Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
ServerScript.h
Go to the documentation of this file.
1
2// =============================================================================
3// This file is adopted from rorserver at commit 4a7109ae2d9a081ccfdad8cc696dc54efe49acb3
4// Changes from the original are marked with "//RIGSOFRODS"
5// =============================================================================
6
7/*
8This file is part of "Rigs of Rods Server" (Relay mode)
9
10Copyright 2007 Pierre-Michel Ricordel
11Copyright 2014+ Rigs of Rods Community
12
13"Rigs of Rods Server" is free software: you can redistribute it
14and/or modify it under the terms of the GNU General Public License
15as published by the Free Software Foundation, either version 3
16of the License, or (at your option) any later version.
17
18"Rigs of Rods Server" is distributed in the hope that it will
19be useful, but WITHOUT ANY WARRANTY; without even the implied
20warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21See the GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with Foobar. If not, see <http://www.gnu.org/licenses/>.
25*/
26
27#pragma once
28
29#ifdef USE_ANGELSCRIPT
30
32#include "angelscript.h"
33#include "RoRnet.h"
34
35namespace RoR { // RIGSOFRODS
36
38protected:
41
42public:
44
46
47 void log(std::string &msg);
48
49 void say(std::string &msg, int uid = -1, int type = 0);
50
51 void kick(int kuid, std::string &msg);
52
53 void ban(int kuid, std::string &msg);
54
55 bool unban(int kuid);
56
57 int playerChat(int uid, char *str);
58
59 std::string getServerTerrain();
60
61 int sendGameCommand(int uid, std::string cmd);
62
63 std::string getUserName(int uid);
64
65 void setUserName(int uid, const std::string &username);
66
67 std::string getUserAuth(int uid);
68
69 int getUserAuthRaw(int uid);
70
71 void setUserAuthRaw(int uid, int authmode);
72
73 int getUserColourNum(int uid);
74
75 void setUserColourNum(int uid, int num);
76
77 std::string getUserToken(int uid);
78
79 std::string getUserVersion(int uid);
80
81 std::string getUserIPAddress(int uid);
82
83 int getUserPosition(int uid, Ogre::Vector3 &v);
84
85 int getNumClients();
86
87 int getStartTime();
88
89 int getTime();
90
91 std::string get_version();
92
93 std::string get_asVersion();
94
95 std::string get_protocolVersion();
96
97 void setCallback(const std::string &type, const std::string &func, void *obj, int refTypeId);
98
99 void deleteCallback(const std::string &type, const std::string &func, void *obj, int refTypeId);
100
101 void throwException(const std::string &message);
102
103 unsigned int get_maxClients();
104
105 std::string get_serverName();
106
107 std::string get_IPAddr();
108
109 unsigned int get_listenPort();
110
111 int get_serverMode();
112
113 std::string get_owner();
114
115 std::string get_website();
116
117 std::string get_ircServ();
118
119 std::string get_voipServ();
120
121 int rangeRandomInt(int from, int to);
122
123 void broadcastUserInfo(int uid);
124
133 void curlRequestAsync(std::string url, std::string displayname);
134};
135
136} // namespace RoR
137
138#endif // USE_ANGELSCRIPT
int sendGameCommand(int uid, std::string cmd)
ServerScriptSequencer * seq
std::string getServerTerrain()
unsigned int get_listenPort()
void curlRequestAsync(std::string url, std::string displayname)
Launches a background task, use curlStatus callback to monitor progress and receive result.
std::string getUserName(int uid)
std::string get_owner()
std::string get_protocolVersion()
std::string getUserIPAddress(int uid)
int playerChat(int uid, char *str)
void ban(int kuid, std::string &msg)
std::string get_serverName()
void log(std::string &msg)
void deleteCallback(const std::string &type, const std::string &func, void *obj, int refTypeId)
std::string getUserToken(int uid)
int rangeRandomInt(int from, int to)
void say(std::string &msg, int uid=-1, int type=0)
ServerScriptEngine * mse
local script engine pointer, used as proxy mostly
void setUserAuthRaw(int uid, int authmode)
int getUserPosition(int uid, Ogre::Vector3 &v)
std::string get_IPAddr()
void setUserName(int uid, const std::string &username)
std::string getUserVersion(int uid)
std::string get_voipServ()
void setUserColourNum(int uid, int num)
bool unban(int kuid)
std::string get_asVersion()
unsigned int get_maxClients()
int getUserAuthRaw(int uid)
int getUserColourNum(int uid)
std::string get_ircServ()
void throwException(const std::string &message)
std::string getUserAuth(int uid)
std::string get_version()
void broadcastUserInfo(int uid)
void kick(int kuid, std::string &msg)
void setCallback(const std::string &type, const std::string &func, void *obj, int refTypeId)
std::string get_website()