r5sdk/r5dev/game/server/vscript_server.h
Kawe Mazidjatari 5a2dfaf03a Server: add option to respect game state when performing auto reload
Can be toggled with the new cvar 'host_autoReloadRespectGameState', and used in combination with the new server script func 'SetAutoReloadState( bool state )'. This makes sure that even when the timer reaches 'host_autoReloadRate', it would wait with the reload until the game itself is finished (which is when SetAutoReloadState( true ) is being called from scripts).
2024-06-01 11:30:35 +02:00

40 lines
1.2 KiB
C++

#ifndef VSCRIPT_SERVER_H
#define VSCRIPT_SERVER_H
#include "vscript/languages/squirrel_re/vsquirrel.h"
namespace VScriptCode
{
namespace Server
{
SQRESULT CreateServer(HSQUIRRELVM v);
SQRESULT DestroyServer(HSQUIRRELVM v);
SQRESULT SetAutoReloadState(HSQUIRRELVM v);
SQRESULT KickPlayerByName(HSQUIRRELVM v);
SQRESULT KickPlayerById(HSQUIRRELVM v);
SQRESULT BanPlayerByName(HSQUIRRELVM v);
SQRESULT BanPlayerById(HSQUIRRELVM v);
SQRESULT UnbanPlayer(HSQUIRRELVM v);
SQRESULT GetNumHumanPlayers(HSQUIRRELVM v);
SQRESULT GetNumFakeClients(HSQUIRRELVM v);
SQRESULT IsServerActive(HSQUIRRELVM v);
SQRESULT IsDedicated(HSQUIRRELVM v);
}
}
void Script_RegisterServerFunctions(CSquirrelVM* s);
void Script_RegisterCoreServerFunctions(CSquirrelVM* s);
void Script_RegisterAdminPanelFunctions(CSquirrelVM* s);
void Script_RegisterServerEnums(CSquirrelVM* const s);
#define DEFINE_SERVER_SCRIPTFUNC_NAMED(s, functionName, helpString, \
returnType, parameters) \
s->RegisterFunction(#functionName, MKSTRING(Script_##functionName), \
helpString, returnType, parameters, VScriptCode::Server::##functionName); \
#endif // VSCRIPT_SERVER_H