Server Callbacks

Allows for callbacks initiated from the client used to return information to a client from the server.

RegisterServerCallback(name, func)

Registers a callback on the server-side ready to be called from a client.

  • name* (string) - uniquely identifying name of the callback

  • func* (function (source, callback, ...) ) - function to call when the callback is called. All optional arguments sent from the client will be the optional arguments of this function.

* = required arguments

Example (paired with the client-side example):

FOM.RegisterServerCallback('test', function(source, cb, s1, s2)
    print(s1 .. ' ' .. s2)
    cb('hello', 1)
end)

See Server Callbacks on the client-side for triggering a callback.

Reference: utils/sv_callback.lua

Last updated