Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Namespaces | Functions
Server-to-script

Description

^AngelScript^ Documents script functions (callbacks) invoked by the server.

You can register them either by using a global function of the same name or by manually invoking `server.setCallback()`. Note that some callbacks allow multiple handler functions (`server.setCallback()` adds another) while other can only have a single handler function (`server.setCallback()` replaces the previous).

Namespaces

namespace  Server2Script
 

Functions

void Server2Script::main ()
 
void Server2Script::frameStep (float dt_millis)
 
void Server2Script::playerAdded (int uid)
 
void Server2Script::playerDeleted (int uid, int crashed)
 
int Server2Script::streamAdded (int uid, StreamRegister@ reg)
 
int Server2Script::playerChat (int uid, const string &in msg)
 
void Server2Script::gameCmd (int uid, const string &in cmd)
 
void Server2Script::curlStatus (Script2Server::CurlStatusType type, int n1, int n2, string displayname, string message)
 

Function Documentation

◆ curlStatus()

void Server2Script::curlStatus ( Script2Server::CurlStatusType  type,
int  n1,
int  n2,
string  displayname,
string  message 
)

Reports status of background CURL request - use `server.curlRequestAsync()` to invoke one.

Parameters
type`CurlStatusType` Determines meaning of n1/n2 params.

◆ frameStep()

void Server2Script::frameStep ( float  dt_millis)

executed periodically, the parameter is delta time (time since last execution) in milliseconds.

◆ gameCmd()

void Server2Script::gameCmd ( int  uid,
const string &in  cmd 
)

ONLY ONE AT A TIME ~ invoked when a script running on client calls `game.sendGameCmd()`.

◆ main()

void Server2Script::main ( )

Required; Script setup function - invoked once when script is loaded.

If not present, the server will report error and abandon the script.

◆ playerAdded()

void Server2Script::playerAdded ( int  uid)

executed when player joins.

◆ playerChat()

int Server2Script::playerChat ( int  uid,
const string &in  msg 
)

ONLY ONE AT A TIME ~ executed when player sends a chat message; Returns `broadcastType` which determines how the message is treated.

◆ playerDeleted()

void Server2Script::playerDeleted ( int  uid,
int  crashed 
)

executed when player leaves.

◆ streamAdded()

int Server2Script::streamAdded ( int  uid,
StreamRegister@  reg 
)

executed when player spawns an actor; Returns `broadcastType` which determines how the message is treated.