mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Server: add script function 'GetServerID()'
Allows one to get the current session uuid (will be used for LiveAPI's Init event for session identification).
This commit is contained in:
parent
6a99c1bd5c
commit
c3f66e748f
@ -247,6 +247,15 @@ namespace VScriptCode
|
||||
SCRIPT_CHECK_AND_RETURN(v, SQ_OK);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: gets the current server id
|
||||
//-----------------------------------------------------------------------------
|
||||
SQRESULT GetServerID(HSQUIRRELVM v)
|
||||
{
|
||||
sq_pushstring(v, g_LogSessionUUID.c_str(), (SQInteger)g_LogSessionUUID.length());
|
||||
SCRIPT_CHECK_AND_RETURN(v, SQ_OK);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: checks whether the server is active
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -300,6 +309,8 @@ void Script_RegisterCoreServerFunctions(CSquirrelVM* s)
|
||||
DEFINE_SERVER_SCRIPTFUNC_NAMED(s, DestroyServer, "Shuts the local server down", "void", "");
|
||||
|
||||
DEFINE_SERVER_SCRIPTFUNC_NAMED(s, SetAutoReloadState, "Set whether we can auto-reload the server", "void", "bool");
|
||||
|
||||
DEFINE_SERVER_SCRIPTFUNC_NAMED(s, GetServerID, "Gets the current server ID", "string", "");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
@ -20,6 +20,8 @@ namespace VScriptCode
|
||||
SQRESULT GetNumHumanPlayers(HSQUIRRELVM v);
|
||||
SQRESULT GetNumFakeClients(HSQUIRRELVM v);
|
||||
|
||||
SQRESULT GetServerID(HSQUIRRELVM v);
|
||||
|
||||
SQRESULT IsServerActive(HSQUIRRELVM v);
|
||||
SQRESULT IsDedicated(HSQUIRRELVM v);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user