-
Notifications
You must be signed in to change notification settings - Fork 0
Networking.Hook
OliverF edited this page Jun 12, 2014
·
1 revision
Sets up a callback to be executed when a message is received from the remote client.
nil RSAS.Networking.Hook(string id, function callback)
- nil
- string
id
Identification string of the message to be received. - function
callback
The function to be called upon reception of a message with the specified identification string. The function is supplied a single argument: a table containing the received message
Client:
local data = {}
data.animal = "cat"
data.tail = true
data.legs = 7
--create a sub-table
local catIdentity = {}
catIdentity.name = "Tom"
catIdentity.type = "tabby"
--add sub-table to data table
data.identity = catIdentity
RSAS.Networking.SendTable("demo_newanimal", data)Server:
RSAS.Networking.Hook("demo_newanimal", function(data)
RSAS.Print(data)
end)