Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit module #52

Open
KadDarem opened this issue Feb 24, 2025 · 0 comments
Open

Emit module #52

KadDarem opened this issue Feb 24, 2025 · 0 comments
Labels
request Request a feature

Comments

@KadDarem
Copy link
Contributor

Create a module to optimiser the emit functions
TriggerEvent
TriggerClientEvent
TriggerServerEvent

Example:

function jo.emit.triggerClient(name, source, ...)
    local payload <const> = msgpack.pack_args(...)
    local payloadLen <const> = #payload
    if type(source) == 'table' and table.type(source) == 'array' then
        for i = 1, #source do
            local _source <const> = source[i]
            TriggerClientEventInternal(name, _source, payload, payloadLen)
        end
        return
    end

    TriggerClientEventInternal(name, source, payload, payloadLen)
end
@KadDarem KadDarem added the request Request a feature label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Request a feature
Projects
None yet
Development

No branches or pull requests

1 participant