RigsofRods  2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
server_callbacks.h
Go to the documentation of this file.
1 
2  // =================================================== //
3  // THIS IS NOT A C++ HEADER! Only a dummy for Doxygen. //
4  // =================================================== //
5 
6 namespace Server2Script {
7 
16 /*
17 Callbacks
18 ---------
19 
20 The game recognizes the following callbacks.
21 You can register them either by using a global function of the same name
22 or by manually invoking `server.setCallback()`. Note that some callbacks allow
23 multiple handler functions (`setCallback()` adds another) while other can only
24 have a single handler function (`setCallback()` replaces the previous).
25 */
26 
30 void main();
31 
35 void frameStep(float dt_millis);
36 
40 void playerAdded(int uid);
41 
45 void playerDeleted(int uid, int crashed);
46 
50 int streamAdded(int uid, StreamRegister@ reg);
51 
55 int playerChat(int uid, const string &in msg);
56 
60 void gameCmd(int uid, const string &in cmd);
61 
66 void curlStatus(curlStatusType type, int n1, int n2, string displayname, string message);
67  //addtogroup Server2Script //addtogroup ScriptSideAPIs
70 
71 } // 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::curlStatus
void curlStatus(curlStatusType type, int n1, int n2, string displayname, string message)
Reports status of background CURL request - use `game.curlRequestAsync()` to invoke one.
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:46