net
Read-only usermsg hooks delivered to on_net_message(msg); game handlers still run.
Functions
net.hook_message
net.hook_message(name) -> boolean| Name | Type | Description |
|---|---|---|
| name | string | Usermsg name, like "DeathMsg". |
Routes this message to on_net_message; scripts share hooks.
Returns false if no such message
- Case-sensitive; raises on 32+ character names or past 256 hooks.
- on_net_message gets other scripts' hooks too, so check msg:name().
net.unhook_message
net.unhook_message(name)| Name | Type | Description |
|---|---|---|
| name | string | Name passed to hook_message. |
Stops this script listening to the message.
Does nothing if never hooked.