mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* All libraries have been isolated from each other, and build into separate artifacts. * Project has been restructured to support isolating libraries. * CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example). * Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp). TODO: * Add a batch file to autogenerate all projects. * Add support for dedicated server. * Add support for client dll. Bugs: * Game crashes on the title screen after the UI script compiler has finished (root cause unknown). * Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
64 lines
2.3 KiB
C++
64 lines
2.3 KiB
C++
//=============================================================================//
|
|
//
|
|
// Purpose: Interface the engine exposes to the game DLL
|
|
//
|
|
//=============================================================================//
|
|
|
|
#include "core/stdafx.h"
|
|
#include "clientstate.h"
|
|
#include "vengineclient_impl.h"
|
|
|
|
//---------------------------------------------------------------------------------
|
|
// Purpose: define if commands from the server should be restricted or not.
|
|
// Input : bRestricted -
|
|
// Output :
|
|
//---------------------------------------------------------------------------------
|
|
void CEngineClient::SetRestrictServerCommands(bool bRestricted)
|
|
{
|
|
g_pClientState->m_bRestrictServerCommands = bRestricted;
|
|
}
|
|
|
|
//---------------------------------------------------------------------------------
|
|
// Purpose: get value for if commands are restricted from servers.
|
|
// Input :
|
|
// Output : bool
|
|
//---------------------------------------------------------------------------------
|
|
bool CEngineClient::GetRestrictServerCommands() const
|
|
{
|
|
return g_pClientState->m_bRestrictServerCommands;
|
|
}
|
|
|
|
//---------------------------------------------------------------------------------
|
|
// Purpose: define if commands on the client should be restricted or not.
|
|
// Input : bRestricted -
|
|
// Output :
|
|
//---------------------------------------------------------------------------------
|
|
void CEngineClient::SetRestrictClientCommands(bool bRestricted)
|
|
{
|
|
g_pClientState->m_bRestrictClientCommands = bRestricted;
|
|
}
|
|
|
|
//---------------------------------------------------------------------------------
|
|
// Purpose: get value for if commands are restricted for clients.
|
|
// Input :
|
|
// Output : bool
|
|
//---------------------------------------------------------------------------------
|
|
bool CEngineClient::GetRestrictClientCommands() const
|
|
{
|
|
return g_pClientState->m_bRestrictClientCommands;
|
|
}
|
|
|
|
//---------------------------------------------------------------------------------
|
|
// Purpose: get local player
|
|
// Input :
|
|
// Output : int
|
|
//---------------------------------------------------------------------------------
|
|
int CEngineClient::GetLocalPlayer()
|
|
{
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
|
const static int index = 35;
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
|
const static int index = 36;
|
|
#endif
|
|
return CallVFunc<int>(index, this);
|
|
} |