RigsofRods
Soft-body Physics Simulation
Namespaces | Functions
Server-to-script

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

+ Collaboration diagram for Server-to-script:

Namespaces

 Server2Script
 Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.
 

Functions

void Server2Script::main ()
 Required; Script setup function - invoked once when script is loaded. More...
 
void Server2Script::frameStep (float dt_millis)
 executed periodically, the parameter is delta time (time since last execution) in milliseconds. More...
 
void Server2Script::playerAdded (int uid)
 executed when player joins. More...
 
void Server2Script::playerDeleted (int uid, int crashed)
 executed when player leaves. More...
 
int Server2Script::streamAdded (int uid, StreamRegister@ reg)
 executed when player spawns an actor; Returns broadcastType which determines how the message is treated. More...
 
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. More...
 
void Server2Script::gameCmd (int uid, const string &in cmd)
 ONLY ONE AT A TIME ~ invoked when a script running on client calls game.sendGameCmd() More...
 

Detailed Description

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

Function Documentation

◆ 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.