diff --git a/r5dev/game/server/vscript_server.cpp b/r5dev/game/server/vscript_server.cpp index 9120f395..0ca711d9 100644 --- a/r5dev/game/server/vscript_server.cpp +++ b/r5dev/game/server/vscript_server.cpp @@ -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", ""); } //--------------------------------------------------------------------------------- diff --git a/r5dev/game/server/vscript_server.h b/r5dev/game/server/vscript_server.h index 4bc7a82f..8d811524 100644 --- a/r5dev/game/server/vscript_server.h +++ b/r5dev/game/server/vscript_server.h @@ -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); }