NETWORK
Networking functions for client-server communication.
Availability: Client & Server
Methods
NETWORK.broadcast
server
Broadcast a network message to all connected players (server-only)
Signature: bool action(str, obj)
Parameters:
| Name | Type | Description |
|---|---|---|
id | str | Message identifier for the network event |
data | obj | Data payload to send (max 2000 characters) |
Returns: bool - Whether the broadcast was successful
bool result = GAME.NETWORK.broadcast(0, {});
NETWORK.send
client server
Send a network message to a specific player or to the server
Signature: bool action(str, obj, str)
Parameters:
| Name | Type | Description |
|---|---|---|
id | str | Message identifier for the network event |
data | obj | Data payload to send (max 2000 characters) |
playerID | str | Target player ID (required on server, optional on client) |
Returns: bool - Whether the send was successful
bool result = GAME.NETWORK.send(0, {}, "value");