OPX//77
opx_infinityCore

Events

Last updated on

The net events the core itself sends and listens to, the host event names in OPX.Host, the core's WebUI page channels, and its private internal events.

The core's own events, outside any module: refusals and command answers going to a player, notes coming back to the server journal, and the WebUI channels every view shares. Use this page for the exact name or payload, e.g. to draw command answers in a custom chat. Module events are on each module's events page; the three prefixes are explained in Events and channels.

The core calls itself runtime on the net channel: opx:net:runtime:<verb>.

Net events

opx:net:runtime:notify

Server → client. A refusal, sent by OPX.Refuse. The client shows locale(code, params) as a toast of kind; an icon outside OPX.Glyphs is dropped, and so is a param that is not a string or a number.

RegisterNetEvent('opx:net:runtime:notify', function(payload) end)
  • payload: table
    • kind: 'error' | 'warning' — from OPX.Result.Kind
    • code: string — always a locale key that exists
    • params?: table<string, string | number> — at most 8, strings cut to 64 bytes
    • operation: string
    • icon?: string

opx:net:runtime:commandAnswer

Server → client. What a command did, sent by OPX.CommandNotice. The client shows message as a toast with id opx.command (a new answer replaces the last one), unless toasted is true.

RegisterNetEvent('opx:net:runtime:commandAnswer', function(raw, kind, message, toasted, icon) end)
  • raw: string
  • kind: string
  • message: string
  • toasted: boolean
  • icon?: string

opx:net:runtime:commandResult

Server → client. A command's read-back (a list or a dump), sent by OPX.CommandResult. The chat module draws it, styled by kind; with no listener nothing is shown.

RegisterNetEvent('opx:net:runtime:commandResult', function(line) end)
  • line: table
    • kind: 'info' | 'error'
    • author: string — SERVER_NAME
    • text: string

opx:net:runtime:note

Client → server. One line for the server journal, sent by OPX.Note. Evidence only: nothing reads it back.

TriggerServerEvent('opx:net:runtime:note', module, text)
  • module: string — 1–32 characters matching ^[a-z0-9][a-z0-9_.-]*$, else dropped
  • text: string — 1–2048 bytes, else dropped; stripped of control characters and cut to 400 characters

The server allows 12 per player per 10 s and 60 per session.

Any client can raise opx:net:runtime:note. Do not act on what it says.

Host events (OPX.Host)

OPX.Host names the platform's own events, so code does not spell them by hand.

KeyEvent nameSide the core uses it on
PLAYER_CONNECTEDonPlayerConnectedserver
PLAYER_DISCONNECTEDonPlayerDisconnectedserver — the core clears notes, cooldowns and any session left behind
PLAYER_READYonPlayerReadyserver — the core warns when the host opened a gate the core was holding (liveness_lost: or timeout:), or when it was never held (no_holds)
CLIENT_RESOURCE_STARTonClientResourceStartclient — client boot
CLIENT_RESOURCE_STOPonClientResourceStopclient — client shutdown
RESOURCE_STARTonResourceStartserver
RESOURCE_STOPonResourceStopserver — stops jobs and modules, releases selection buckets
WORLD_READYopen77:worldReady—
GAMEPLAY_READYopen77:session:gameplayReady— the platform's own gate hold clears only after a client sends it
VEHICLE_REMOVEDonVehicleRemoved—
TUNABLE_CHANGEDonTunableChangedserver — re-raised as opx:in:tune:changed
KEYBINDS_CHANGEDopen77:keybinds:changedclient, no payload — raised after any key mapping is registered, rebound, reset or removed. Every module that shows a key name (admin, animations, clothing, dealership, garages, inventory, prompts, teleports) listens to this one constant to redraw.

The server and client pairs are different names: CLIENT_RESOURCE_START on the server registers a handler nothing raises.

Page channels

The runtime has one WebUI page, id opx. Lua sends and listens on <channel>; the page sees opx:<channel> (The WebUI page).

Page → Lua

ChannelPayloadMeaning
ready—The page has loaded. Nothing is sent to it before this. Lua then writes the locale catalogue with locale:set.
<module>:readyanyA view has mounted. The core wires one for every declared module before any module starts, and holds what arrives (up to 8 payloads) until the module registers its handler.
focus:set{ focus, owner }What the page holds focus for. With focus not true (or no owner), the core empties the Lua focus stack and drops focus; otherwise it drops every owner above owner. Modules may listen as well.
diag{ text }A page-side error or message, written to the client log as [surface opx] page: <text>.
notify:ready—The toast view has mounted. Lua answers with notify:config, notify:down if the player is down, and every toast still up.
notify:gone{ id }A toast finished its countdown. Lua forgets it.

Lua → page

ChannelPayloadMeaning
locale:set{ locale, strings, first, done }The locale catalogue, in parts of 250 keys, one part per frame. first clears the page's copy; done marks the last part.
reply{ ref, ... }The answer to a page request, from OPX.UI.Answer.
notify:config{ position, width }From TOASTS.
notify:show{ id, kind, title, message, icon, durationMs, stinger }Show or replace a toast.
notify:updatethe whole toastA toast changed.
notify:dismiss{ id }Take one toast down.
notify:clear{}Take every toast down.
notify:down{ down }Hide or show the toast stacks.

Internal events

Private to opx_infinity, raised with TriggerEvent on the server. A server TriggerEvent reaches every server resource, so another resource can hear them, but they are not a supported API and may change.

EventArgumentsRaised when
opx:in:gate:heldsourceOPX.Gate.Hold took a hold. No module listens to it in this version.
opx:in:gate:releasedsource, noteOPX.Gate.Release released one. No module listens to it in this version.
opx:in:session:forgottenplayerIdOPX.ForgetSession is dropping a session. The character module unloads on it.
opx:in:tune:changedkeyThe host reported a tunable change. No module listens to it in this version: read tunables with OPX.Tune.Number at the moment of use.

On this page