Emit Server
A module to optimize your trigger events server <> client.
Configuration Variables (Convars)
Convar | Side | Type | Default | Description |
---|---|---|---|---|
jo_libs:emit:bps | Server | Integer | 20000 | Default bit/s for latent events |
JO Functions
jo.emit.triggerClient()
A function to trigger a client(s)
Syntax
lua
jo.emit.triggerClient(eventName, source, ...)
Parameters
eventName
: string
The event name
source
: string|table
The player ID or list of players ID
...
: any
Other arguments
Example
lua
local source = 5
local data = "MyData"
jo.emit.triggerServer('YourEventName', source, data)
--OR--
local sources = { 3, 4, 5, 13 } --list of players
local data = "MyData"
jo.emit.triggerServer('YourEventName', sources, data)
jo.emit.triggerClient.latent()
A function to trigger a client(s) with a limited bandwith
Syntax
lua
jo.emit.triggerClient.latent(eventName, source, ...)
Parameters
eventName
: string
The event name
source
: string|table
The player ID or list of players ID
...
: any
Other arguments
Example
lua
local source = 5
local data = {}
for i = 1, 100000 do
data[i] = i
end
jo.emit.triggerServer.latent('YourEventName', source, data)
--OR--
local sources = { 3, 4, 5, 13 } --list of players
local data = {}
for i = 1, 100000 do
data[i] = i
end
jo.emit.triggerServer.latent('YourEventName', sources, data)
jo.emit.updateBps()
A function to update the bit/s of emit module
Syntax
lua
jo.emit.updateBps(bps)
Parameters
bps
: integer
bit/s
Example
lua
jo.emit.updateBps(3000)