Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
RoR::ServerScript Class Reference

Description

Definition at line 37 of file ServerScript.h.

Public Member Functions

 ServerScript (ServerScriptEngine *se, ServerScriptSequencer *sequencer)
 
 ~ServerScript ()
 
void log (std::string &msg)
 
void say (std::string &msg, int uid=-1, int type=0)
 
void kick (int kuid, std::string &msg)
 
void ban (int kuid, std::string &msg)
 
bool unban (int kuid)
 
int playerChat (int uid, char *str)
 
std::string getServerTerrain ()
 
int sendGameCommand (int uid, std::string cmd)
 
std::string getUserName (int uid)
 
void setUserName (int uid, const std::string &username)
 
std::string getUserAuth (int uid)
 
int getUserAuthRaw (int uid)
 
void setUserAuthRaw (int uid, int authmode)
 
int getUserColourNum (int uid)
 
void setUserColourNum (int uid, int num)
 
std::string getUserToken (int uid)
 
std::string getUserVersion (int uid)
 
std::string getUserIPAddress (int uid)
 
int getUserPosition (int uid, Ogre::Vector3 &v)
 
int getNumClients ()
 
int getStartTime ()
 
int getTime ()
 
std::string get_version ()
 
std::string get_asVersion ()
 
std::string get_protocolVersion ()
 
void setCallback (const std::string &type, const std::string &func, void *obj, int refTypeId)
 
void deleteCallback (const std::string &type, const std::string &func, void *obj, int refTypeId)
 
void throwException (const std::string &message)
 
unsigned int get_maxClients ()
 
std::string get_serverName ()
 
std::string get_IPAddr ()
 
unsigned int get_listenPort ()
 
int get_serverMode ()
 
std::string get_owner ()
 
std::string get_website ()
 
std::string get_ircServ ()
 
std::string get_voipServ ()
 
int rangeRandomInt (int from, int to)
 
void broadcastUserInfo (int uid)
 
void curlRequestAsync (std::string url, std::string displayname)
 

Protected Attributes

ServerScriptEngine * mse
 
ServerScriptSequencer * seq
 

Constructor & Destructor Documentation

◆ ServerScript()

ServerScript::ServerScript ( ServerScriptEngine *  se,
ServerScriptSequencer *  sequencer 
)

Definition at line 39 of file ServerScript.cpp.

◆ ~ServerScript()

ServerScript::~ServerScript ( )

Definition at line 42 of file ServerScript.cpp.

Member Function Documentation

◆ ban()

void ServerScript::ban ( int  kuid,
std::string &  msg 
)

Definition at line 61 of file ServerScript.cpp.

◆ broadcastUserInfo()

void ServerScript::broadcastUserInfo ( int  uid)

Definition at line 266 of file ServerScript.cpp.

◆ curlRequestAsync()

void ServerScript::curlRequestAsync ( std::string  url,
std::string  displayname 
)

Launches a background task, use curlStatus callback to monitor progress and receive result.

Parameters
displaynameThe "correlation ID" - the label passed to the callback to identify the transfer.
Remarks
Callback signature: curlStatus(curlStatusType, int n1, int n2, string displayname, string message)
  • CURL_STATUS_PROGRESS: n1 = bytes downloaded, n2 = total bytes, message = empty
  • CURL_STATUS_SUCCESS: n1 = CURL return code, n2 = HTTP result code, message = payload as string
  • CURL_STATUS_FAILURE: n1 = CURL return code, n2 = HTTP result code, message = CURL error string

Definition at line 168 of file ServerScript.cpp.

◆ deleteCallback()

void ServerScript::deleteCallback ( const std::string &  type,
const std::string &  func,
void *  obj,
int  refTypeId 
)

Definition at line 192 of file ServerScript.cpp.

◆ get_asVersion()

std::string ServerScript::get_asVersion ( )

Definition at line 236 of file ServerScript.cpp.

◆ get_IPAddr()

std::string ServerScript::get_IPAddr ( )

Definition at line 248 of file ServerScript.cpp.

◆ get_ircServ()

std::string ServerScript::get_ircServ ( )

Definition at line 258 of file ServerScript.cpp.

◆ get_listenPort()

unsigned int ServerScript::get_listenPort ( )

Definition at line 250 of file ServerScript.cpp.

◆ get_maxClients()

unsigned int ServerScript::get_maxClients ( )

Definition at line 244 of file ServerScript.cpp.

◆ get_owner()

std::string ServerScript::get_owner ( )

Definition at line 254 of file ServerScript.cpp.

◆ get_protocolVersion()

std::string ServerScript::get_protocolVersion ( )

Definition at line 240 of file ServerScript.cpp.

◆ get_serverMode()

int ServerScript::get_serverMode ( )

Definition at line 252 of file ServerScript.cpp.

◆ get_serverName()

std::string ServerScript::get_serverName ( )

Definition at line 246 of file ServerScript.cpp.

◆ get_version()

std::string ServerScript::get_version ( )

Definition at line 232 of file ServerScript.cpp.

◆ get_voipServ()

std::string ServerScript::get_voipServ ( )

Definition at line 260 of file ServerScript.cpp.

◆ get_website()

std::string ServerScript::get_website ( )

Definition at line 256 of file ServerScript.cpp.

◆ getNumClients()

int ServerScript::getNumClients ( )

Definition at line 180 of file ServerScript.cpp.

◆ getServerTerrain()

std::string ServerScript::getServerTerrain ( )

Definition at line 159 of file ServerScript.cpp.

◆ getStartTime()

int ServerScript::getStartTime ( )

Definition at line 184 of file ServerScript.cpp.

◆ getTime()

int ServerScript::getTime ( )

Definition at line 188 of file ServerScript.cpp.

◆ getUserAuth()

std::string ServerScript::getUserAuth ( int  uid)

Definition at line 87 of file ServerScript.cpp.

◆ getUserAuthRaw()

int ServerScript::getUserAuthRaw ( int  uid)

Definition at line 99 of file ServerScript.cpp.

◆ getUserColourNum()

int ServerScript::getUserColourNum ( int  uid)

Definition at line 116 of file ServerScript.cpp.

◆ getUserIPAddress()

std::string ServerScript::getUserIPAddress ( int  uid)

Definition at line 149 of file ServerScript.cpp.

◆ getUserName()

std::string ServerScript::getUserName ( int  uid)

Definition at line 71 of file ServerScript.cpp.

◆ getUserPosition()

int RoR::ServerScript::getUserPosition ( int  uid,
Ogre::Vector3 &  v 
)

◆ getUserToken()

std::string ServerScript::getUserToken ( int  uid)

Definition at line 133 of file ServerScript.cpp.

◆ getUserVersion()

std::string ServerScript::getUserVersion ( int  uid)

Definition at line 140 of file ServerScript.cpp.

◆ kick()

void ServerScript::kick ( int  kuid,
std::string &  msg 
)

Definition at line 55 of file ServerScript.cpp.

◆ log()

void ServerScript::log ( std::string &  msg)

Definition at line 45 of file ServerScript.cpp.

◆ playerChat()

int RoR::ServerScript::playerChat ( int  uid,
char *  str 
)

◆ rangeRandomInt()

int ServerScript::rangeRandomInt ( int  from,
int  to 
)

Definition at line 262 of file ServerScript.cpp.

◆ say()

void ServerScript::say ( std::string &  msg,
int  uid = -1,
int  type = 0 
)

Definition at line 49 of file ServerScript.cpp.

◆ sendGameCommand()

int ServerScript::sendGameCommand ( int  uid,
std::string  cmd 
)

Definition at line 163 of file ServerScript.cpp.

◆ setCallback()

void ServerScript::setCallback ( const std::string &  type,
const std::string &  func,
void *  obj,
int  refTypeId 
)

Definition at line 210 of file ServerScript.cpp.

◆ setUserAuthRaw()

void ServerScript::setUserAuthRaw ( int  uid,
int  authmode 
)

Definition at line 108 of file ServerScript.cpp.

◆ setUserColourNum()

void ServerScript::setUserColourNum ( int  uid,
int  num 
)

Definition at line 125 of file ServerScript.cpp.

◆ setUserName()

void ServerScript::setUserName ( int  uid,
const std::string &  username 
)

Definition at line 79 of file ServerScript.cpp.

◆ throwException()

void ServerScript::throwException ( const std::string &  message)

Definition at line 228 of file ServerScript.cpp.

◆ unban()

bool ServerScript::unban ( int  kuid)

Definition at line 67 of file ServerScript.cpp.

Field Documentation

◆ mse

ServerScriptEngine* RoR::ServerScript::mse
protected

local script engine pointer, used as proxy mostly

Definition at line 39 of file ServerScript.h.

◆ seq

ServerScriptSequencer* RoR::ServerScript::seq
protected

Definition at line 40 of file ServerScript.h.


The documentation for this class was generated from the following files: