RigsofRods
Soft-body Physics Simulation
script_callbacks.h
Go to the documentation of this file.
1 
2 namespace Server2Script {
3 
12 /*
13 Callbacks
14 ---------
15 
16 The game recognizes the following callbacks.
17 You can register them either by using a global function of the same name
18 or by manually invoking `server.setCallback()`. Note that some callbacks allow
19 multiple handler functions (`setCallback()` adds another) while other can only
20 have a single handler function (`setCallback()` replaces the previous).
21 */
22 
26 void main();
27 
31 void frameStep(float dt_millis);
32 
36 void playerAdded(int uid);
37 
41 void playerDeleted(int uid, int crashed);
42 
46 int streamAdded(int uid, StreamRegister@ reg);
47 
51 int playerChat(int uid, const string &in msg);
52 
56 void gameCmd(int uid, const string &in cmd);
57  //addtogroup Server2Script //addtogroup ScriptSideAPIs
60 
61 } // namespace Server2Script
Server2Script::playerChat
int playerChat(int uid, const string &in msg)
ONLY ONE AT A TIME ~ executed when player sends a chat message; Returns broadcastType which determine...
Server2Script::streamAdded
int streamAdded(int uid, StreamRegister@ reg)
executed when player spawns an actor; Returns broadcastType which determines how the message is treat...
Server2Script::playerDeleted
void playerDeleted(int uid, int crashed)
executed when player leaves.
Server2Script::frameStep
void frameStep(float dt_millis)
executed periodically, the parameter is delta time (time since last execution) in milliseconds.
Server2Script::gameCmd
void gameCmd(int uid, const string &in cmd)
ONLY ONE AT A TIME ~ invoked when a script running on client calls game.sendGameCmd()
Server2Script::main
void main()
Required; Script setup function - invoked once when script is loaded.
Server2Script::playerAdded
void playerAdded(int uid)
executed when player joins.
Server2Script
Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.
Definition: ScriptSideAPIs.h:44