Remove scriptfunc stubs

Not really ideal, needs a different solution.
This commit is contained in:
Kawe Mazidjatari 2023-07-19 17:17:38 +02:00
parent ee1fdca7a9
commit 193abdc18a
5 changed files with 0 additions and 52 deletions

View File

@ -218,9 +218,6 @@ void Systems_Init()
ServerScriptRegister_Callback = Script_RegisterServerFunctions;
CoreServerScriptRegister_Callback = Script_RegisterCoreServerFunctions;
AdminPanelScriptRegister_Callback = Script_RegisterAdminPanelFunctions;
#else
CoreServerScriptRegister_Callback = Script_RegisterCoreServerStubs;
AdminPanelScriptRegister_Callback = Script_RegisterAdminPanelStubs;
#endif// !CLIENT_DLL
#ifndef SERVER_DLL

View File

@ -415,34 +415,3 @@ void Script_RegisterCoreClientFunctions(CSquirrelVM* s)
{
DEFINE_CLIENT_SCRIPTFUNC_NAMED(s, IsClientDLL, "Returns whether this build is client only", "bool", "");
}
//---------------------------------------------------------------------------------
// Purpose: core server script stubs (stubbed to prevent script compile errors!!!)
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterCoreServerStubs(CSquirrelVM* s)
{
DEFINE_SCRIPTFUNC_STUBBED(s, IsServerActive, "bool", "");
DEFINE_SCRIPTFUNC_STUBBED(s, IsDedicated, "bool", "");
DEFINE_SCRIPTFUNC_STUBBED(s, CreateServer, "void", "string, string, string, string, int");
DEFINE_SCRIPTFUNC_STUBBED(s, DestroyServer, "void", "");
}
//---------------------------------------------------------------------------------
// Purpose: admin panel script stubs (stubbed to prevent script compile errors!!!)
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterAdminPanelStubs(CSquirrelVM* s)
{
DEFINE_SCRIPTFUNC_STUBBED(s, GetNumHumanPlayers, "int", "");
DEFINE_SCRIPTFUNC_STUBBED(s, GetNumFakeClients, "int", "");
DEFINE_SCRIPTFUNC_STUBBED(s, KickPlayerByName, "void", "string");
DEFINE_SCRIPTFUNC_STUBBED(s, KickPlayerById, "void", "string");
DEFINE_SCRIPTFUNC_STUBBED(s, BanPlayerByName, "void", "string");
DEFINE_SCRIPTFUNC_STUBBED(s, BanPlayerById, "void", "string");
DEFINE_SCRIPTFUNC_STUBBED(s, UnbanPlayer, "void", "string");
}

View File

@ -32,9 +32,6 @@ void Script_RegisterClientFunctions(CSquirrelVM* s);
void Script_RegisterUIFunctions(CSquirrelVM* s);
void Script_RegisterCoreClientFunctions(CSquirrelVM* s);
void Script_RegisterCoreServerStubs(CSquirrelVM* s);
void Script_RegisterAdminPanelStubs(CSquirrelVM* s);
#define DEFINE_CLIENT_SCRIPTFUNC_NAMED(s, functionName, helpString, \
returnType, parameters) \
s->RegisterFunction(#functionName, MKSTRING(Script_##functionName), \

View File

@ -26,15 +26,6 @@ namespace VScriptCode
{
namespace Shared
{
//-----------------------------------------------------------------------------
// Purpose: generic stub for unsupported functions
//-----------------------------------------------------------------------------
SQRESULT StubUnsupported(HSQUIRRELVM v)
{
v_SQVM_RaiseError(v, "This function is not supported on this build\n");
return SQ_ERROR;
}
//-----------------------------------------------------------------------------
// Purpose: expose SDK version to the VScript API
//-----------------------------------------------------------------------------

View File

@ -16,7 +16,6 @@ namespace VScriptCode
{
namespace Shared
{
SQRESULT StubUnsupported(HSQUIRRELVM v);
SQRESULT GetSDKVersion(HSQUIRRELVM v);
SQRESULT GetAvailableMaps(HSQUIRRELVM v);
SQRESULT GetAvailablePlaylists(HSQUIRRELVM v);
@ -25,11 +24,6 @@ namespace VScriptCode
void Script_RegisterCommonAbstractions(CSquirrelVM* s);
#define DEFINE_SCRIPTFUNC_STUBBED(s, functionName, returnType, parameters) \
s->RegisterFunction(#functionName, MKSTRING(Script_##functionName), \
"Stub function; not supported on this build.", #returnType, parameters, \
&VScriptCode::Shared::StubUnsupported); \
#define DEFINE_SHARED_SCRIPTFUNC_NAMED(s, functionName, helpString, \
returnType, parameters) \
s->RegisterFunction(#functionName, MKSTRING(Script_##functionName), \