For the complete documentation index, see llms.txt. This page is also available as Markdown.

DUI Message Protocol

Reference the implemented browser readiness, state, clock, weather, map, and bodycam DUI messages.

This page documents the internal boundary between the Lua client and the bundled browser. It is useful to maintainers but is not a promise that third-party browser replacements will remain compatible across versions.

The DUI URL is fixed:

https://cfx-nui-sonoran-stationdisplay/web/index.html?dui=1&displayId=<id>

Display configuration cannot provide a browser or stream URL.

Browser to Lua

duiReady

After initialization:

{"displayId": "ssd-12345678-abcdef"}

Lua accepts it only for an existing renderer, marks the DUI ready, and forces the current state, game time, and weather. A renderer that does not become ready within the internal 10-second timeout is destroyed and retried after the internal delay.

bodycamFeedStatus

The bodycam viewer can report:

{"displayId": "ssd-...", "unitId": "unit-id", "status": "unavailable"}

The client acknowledges the callback and increments its diagnostic load-failure counter for unavailable. It does not trust the callback to change server runtime state.

bodycamSubscriptions

The visible bodycam DUI sends its mounted display ID and up to four visible unit IDs. The server validates permission, range, routing bucket, current page, service filter, active state, and unit ownership. A 4-second heartbeat keeps the subscription alive; it expires after 8 seconds.

Lua to browser

DISPLAY_STATE_UPDATE

This is the primary state message:

Lua sends a changed state after readiness, cache/display/bodycam changes, explicit refresh, and runtime page changes. It also checks rotation progress at most once per second. Identical encoded state is suppressed unless forced; the browser animates progress between messages.

Important unit fields include ID, callsign, name, status/status code, service, agency, subdivision, location/postal, coordinates, assigned call, panic, update time, and stale state.

Important call fields include ID, kind, title/code, priority/status, address/postal, description, assigned IDs/callsigns, optional emergency caller, coordinates, timestamps, and classified service.

A bodycam feed includes joined server-known unit metadata plus active/mode, activation/update values, and state sequence. It contains no peer, URL, credential, or image payload.

BODYCAM_FRAME

The server sends a subscribed viewer's client a validated JPEG with a rate-controlled latent event. Lua forwards it only to subscribed bodycam DUIs:

The browser converts it to a Blob object URL and revokes the previous URL. Frame contents are not included in state snapshots or diagnostics.

BODYCAM_STATUS

Small status messages report CAPTURE_FAILED or OFFLINE without image data. The browser retains a prior frame briefly for delayed/failure presentation and removes it at the stale timeout.

GAME_TIME_UPDATE

The client sends only when the formatted GTA/FiveM time changes, or when forced after readiness.

WEATHER_UPDATE

Weather values describe the GTA world and an estimated temperature.

MAP_PAN

It is accepted only for an available local renderer currently on Live Map. The Lua side clamps the step to 0.05 through 0.5. Reset is represented by the allowed reset direction used by the browser handler.

BODYCAM_NAVIGATE

It is accepted only for an available local renderer currently on Bodycams and changes that DUI's bodycam feed page.

Versioning

There is no explicit protocol-version field. Update Lua and all web/ files together. Do not replace only web/app.js or copy browser files between resource releases.

The web source also contains dormant administration markup/handlers. The current Lua resource does not open that NUI or register its administrative callbacks; the supported customer interface is WarMenu.

Last updated

Was this helpful?