Rigs of Rods 2023.09
Soft-body Physics Simulation
Loading...
Searching...
No Matches
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
6namespace Server2Script {
7
16/*
17Callbacks
18---------
19
20The game recognizes the following callbacks.
21You can register them either by using a global function of the same name
22or by manually invoking `server.setCallback()`. Note that some callbacks allow
23multiple handler functions (`setCallback()` adds another) while other can only
24have a single handler function (`setCallback()` replaces the previous).
25*/
26
30void main();
31
35void frameStep(float dt_millis);
36
40void playerAdded(int uid);
41
45void playerDeleted(int uid, int crashed);
46
50int streamAdded(int uid, StreamRegister@ reg);
51
55int playerChat(int uid, const string &in msg);
56
60void gameCmd(int uid, const string &in cmd);
61
66void curlStatus(curlStatusType type, int n1, int n2, string displayname, string message);
67
//addtogroup Server2Script //addtogroup ScriptSideAPIs
70
71} // namespace Server2Script
int playerChat(int uid, const string &in msg)
ONLY ONE AT A TIME ~ executed when player sends a chat message; Returns broadcastType which determine...
void frameStep(float dt_millis)
executed periodically, the parameter is delta time (time since last execution) in milliseconds.
void playerDeleted(int uid, int crashed)
executed when player leaves.
void gameCmd(int uid, const string &in cmd)
ONLY ONE AT A TIME ~ invoked when a script running on client calls game.sendGameCmd()
void curlStatus(curlStatusType type, int n1, int n2, string displayname, string message)
Reports status of background CURL request - use `game.curlRequestAsync()` to invoke one.
void main()
Required; Script setup function - invoked once when script is loaded.
void playerAdded(int uid)
executed when player joins.
int streamAdded(int uid, StreamRegister@ reg)
executed when player spawns an actor; Returns broadcastType which determines how the message is treat...
Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.