2021-12-25 22:36:38 +01:00
|
|
|
//=============================================================================//
|
|
|
|
//
|
|
|
|
// Purpose: Interface the engine exposes to the game DLL
|
|
|
|
//
|
|
|
|
//=============================================================================//
|
|
|
|
|
|
|
|
#include "core/stdafx.h"
|
2022-04-02 12:27:35 +02:00
|
|
|
#include "client/vengineclient_impl.h"
|
2022-08-15 22:29:16 +02:00
|
|
|
#include "engine/client/clientstate.h"
|
2022-05-06 00:34:46 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
// Purpose: define if commands from the server should be restricted or not.
|
|
|
|
// Input : bRestricted -
|
|
|
|
// Output :
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
void CEngineClient::SetRestrictServerCommands(bool bRestricted)
|
|
|
|
{
|
2022-08-15 22:29:16 +02:00
|
|
|
g_pClientState->m_bRestrictServerCommands = bRestricted;
|
2022-05-06 00:34:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
// Purpose: get value for if commands are restricted from servers.
|
|
|
|
// Input :
|
|
|
|
// Output : bool
|
|
|
|
//---------------------------------------------------------------------------------
|
2022-05-07 12:28:58 +02:00
|
|
|
bool CEngineClient::GetRestrictServerCommands() const
|
2022-05-06 00:34:46 +02:00
|
|
|
{
|
2022-08-15 22:29:16 +02:00
|
|
|
return g_pClientState->m_bRestrictServerCommands;
|
2022-05-06 00:34:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
// Purpose: define if commands on the client should be restricted or not.
|
|
|
|
// Input : bRestricted -
|
|
|
|
// Output :
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
void CEngineClient::SetRestrictClientCommands(bool bRestricted)
|
|
|
|
{
|
2022-08-15 22:29:16 +02:00
|
|
|
g_pClientState->m_bRestrictClientCommands = bRestricted;
|
2022-05-06 00:34:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
// Purpose: get value for if commands are restricted for clients.
|
|
|
|
// Input :
|
|
|
|
// Output : bool
|
|
|
|
//---------------------------------------------------------------------------------
|
2022-05-07 12:28:58 +02:00
|
|
|
bool CEngineClient::GetRestrictClientCommands() const
|
2022-05-06 00:34:46 +02:00
|
|
|
{
|
2022-08-15 22:29:16 +02:00
|
|
|
return g_pClientState->m_bRestrictClientCommands;
|
2022-05-06 00:34:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------
|
|
|
|
// Purpose: get local player
|
|
|
|
// Input :
|
2022-07-24 14:05:38 +02:00
|
|
|
// Output : int
|
2022-05-06 00:34:46 +02:00
|
|
|
//---------------------------------------------------------------------------------
|
2022-07-24 14:05:38 +02:00
|
|
|
int CEngineClient::GetLocalPlayer()
|
2022-05-06 00:34:46 +02:00
|
|
|
{
|
2022-07-24 14:05:38 +02:00
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
|
|
|
const int index = 35;
|
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
|
|
|
const int index = 36;
|
|
|
|
#endif
|
|
|
|
return CallVFunc<int>(index, this);
|
2022-05-06 00:34:46 +02:00
|
|
|
}
|