36using namespace AngelScript;
63 this->
kick(buid, msg);
90 if (!c)
return "none";
176 std::thread(std::move(pktask), context).detach();
189 return (
int) time(NULL);
193 if (refTypeId & asTYPEID_SCRIPTOBJECT && (refTypeId & asTYPEID_OBJHANDLE)) {
195 }
else if (refTypeId == asTYPEID_VOID) {
197 }
else if (refTypeId & asTYPEID_SCRIPTOBJECT) {
201 "server.deleteCallback should be called with a handle of the object! (that is: put an @ sign in front of the object)");
206 mse->
setException(
"The object for the callback has to be a script-class or null!");
211 if (refTypeId & asTYPEID_SCRIPTOBJECT && (refTypeId & asTYPEID_OBJHANDLE)) {
213 }
else if (refTypeId == asTYPEID_VOID) {
215 }
else if (refTypeId & asTYPEID_SCRIPTOBJECT) {
219 "server.setCallback should be called with a handle of the object! (that is: put an @ sign in front of the object)");
224 mse->
setException(
"The object for the callback has to be a script-class or null!");
237 return std::string(ANGELSCRIPT_VERSION_STRING);
263 return (
int) (from + (to - from) * ((
float) rand() / (float) RAND_MAX));
void putNetMessage(int user_id, MessageType type, const char *text)
void playerDeleted(int uid, int crash=0)
void setException(const std::string &message)
Sets an exception that aborts the currently running script and shows the exception in the log file.
void addCallbackScript(const std::string &type, const std::string &func, AngelScript::asIScriptObject *obj)
This method checks and converts the parameters and then adds a script callback.
void deleteCallbackScript(const std::string &type, const std::string &_func, AngelScript::asIScriptObject *obj)
This method checks and converts the parameters and then deletes a script callback.
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_protocolVersion()
std::string getUserIPAddress(int uid)
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)
void setUserName(int uid, const std::string &username)
std::string getUserVersion(int uid)
std::string get_voipServ()
void setUserColourNum(int uid, int num)
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()
ServerScript(ServerScriptEngine *se, ServerScriptSequencer *sequencer)
void sendGameCommand(int uid, std::string cmd)
ServerScriptClient * getClient(int uid)
void serverSay(std::string msg, int uid=-1, int type=0)
void QueueClientForDisconnect(int client_id)
void Log(ServerLogLevel level, const char *format,...)
std::string SanitizeUtf8String(std::string const &str_in)
void ServerScriptCurlRequestThreadFunc(CurlTaskContext context)
@ AUTH_MOD
moderator status
@ AUTH_NONE
no authentication
@ AUTH_RANKED
ranked status
@ AUTH_ADMIN
admin on the server
#define RORNET_MAX_USERNAME_LEN
bytes.
std::string ctc_displayname
ServerScriptEngine * ctc_script_engine
RoRnet::UserInfo user
user information
int32_t authstatus
auth status set by server: AUTH_*
char username[RORNET_MAX_USERNAME_LEN]
the nickname of the user (UTF-8)
int32_t colournum
colour set by server
char usertoken[40]
user token
char clientversion[25]
a version number of the client. For example 1 for RoR 0.35