Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/engine/server/server.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//=============================================================================//
//=============================================================================//
//
// Purpose:
//
Expand Down Expand Up @@ -223,6 +223,9 @@ void CServer::BroadcastMessage(CNetMessage* const msg, const bool onlyActive, co
void CServer::RunFrame(CServer* pServer)
{
CServer__RunFrame(pServer);

for (auto& callback : !PluginSystem()->GetServerFrameCallbacks())
callback.Function()(pServer);
}

bool CServer::SpawnServer(CServer* pServer, const char* pszMapName, const char* pszMapGroupName)
Expand All @@ -249,3 +252,4 @@ void VServer::Detour(const bool bAttach) const
///////////////////////////////////////////////////////////////////////////////
CServer* g_pServer = nullptr;
CClientExtended CServer::sm_ClientsExtended[MAX_PLAYERS];

7 changes: 6 additions & 1 deletion src/game/server/basecombatcharacter.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose: Base combat character with no AI
//
Expand Down Expand Up @@ -50,6 +50,11 @@ class CBaseCombatCharacter : public CBaseAnimatingOverlay
Hull_e GetHullType() const { return m_eHull; }
void SetHullType(Hull_e hullType) { m_eHull = hullType; }

const WeaponInventory& GetWeaponInventory() const { return m_inventory; }
const EHANDLE* GetLatestPrimaryWeapons() const { return m_latestPrimaryWeapons; }
const EHANDLE* GetLatest3pWeapons() const { return m_latest3pWeaponGettingEquipped; }
const EHANDLE* GetSwitchingWeapons() const { return m_weaponGettingSwitchedOut; }

private:
bool m_bPreventWeaponPickup;
char gap_15b1[3];
Expand Down
10 changes: 0 additions & 10 deletions src/game/server/baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ model_t* CBaseEntity::GetModel(void)
return (model_t*)g_pModelInfoServer->GetModel(GetModelIndex());
}

inline string_t CBaseEntity::GetModelName(void) const
{
return m_ModelName;
}

inline int CBaseEntity::GetModelIndex(void) const
{
return m_nModelIndex;
}

const HSCRIPT CBaseEntity::GetScriptInstance()
{
return v_CBaseEntity__GetScriptInstance(this);
Expand Down
10 changes: 8 additions & 2 deletions src/game/server/baseentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ class CBaseEntity : public IServerEntity
const CServerNetworkProperty* NetworkProp() const;

model_t* GetModel(void);
int GetModelIndex(void) const; // Virtual in-engine!
string_t GetModelName(void) const; // Virtual in-engine!
inline int GetModelIndex(void) const { return m_nModelIndex; } // Virtual in-engine!
inline string_t GetModelName(void) const { return m_ModelName; }
const Vector3D& GetViewOffset(void) const { return m_vecViewOffset; }
const Vector3D& GetAbsOrigin(void) const { return m_vecAbsOrigin; }
const Vector3D& GetAbsVelocity(void) const { return m_vecAbsVelocity; }
const Vector3D& GetVecPrevAbsOrigin(void) const { return m_vecPrevAbsOrigin; }

inline edict_t GetEdict(void) const { return NetworkProp()->GetEdict(); }
inline string_t GetEntityName(void) const { return m_iName; }
inline const EHANDLE& GetMoveParentHandle(void) const { return m_hMoveParent; }
inline const EHANDLE& GetMoveChildHandle(void) const { return m_hMoveChild; }
inline const EHANDLE& GetMovePeerHandle(void) const { return m_hMovePeer; }
inline const EHANDLE& GetOwnerEntityHandle(void) const { return m_hOwnerEntity; }

inline int GetFlags(void) const { return m_fFlags; }

Expand Down
2 changes: 2 additions & 0 deletions src/game/server/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ class CPlayer : public CBaseCombatCharacter

char GetLifeState(void) const { return m_lifeState; }
int GetTeamNum(void) const { return m_iTeamNum; }
const EHANDLE& GetThirdPersonEnt() const { return m_hThirdPersonEnt; }
const EHANDLE* GetViewModels() const { return m_hViewModels; }
private:
char m_szNetname[256];
bool m_zoomViewdriftDebounceEnabled;
Expand Down
3 changes: 3 additions & 0 deletions src/pluginsystem/ipluginsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#define INTERFACEVERSION_PLUGINSYSTEM "VPluginSystem002"

class CServer;

struct PluginOperation_s
{
enum class PluginCommand_e : int16_t
Expand All @@ -23,6 +25,7 @@ struct PluginOperation_s
OnRegisterServerScriptFunctions = 5,
OnRegisterClientScriptFunctions = 6,
OnRegisterUIScriptFunctions = 7,
CServer_RunFrame = 8,
};

PluginCommand_e commandId;
Expand Down
10 changes: 10 additions & 0 deletions src/pluginsystem/pluginsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ void CPluginSystem::InstallCallback(PluginOperation_s* const pio)
ADD_PLUGIN_CALLBACK(OnRegisterUIScriptFunctionsFn, GetRegisterUIScriptFuncsCallbacks(), pio->function);
break;
}
case PluginOperation_s::PluginCallback_e::CServer_RunFrame:
{
ADD_PLUGIN_CALLBACK(OnServerFrameFn, GetServerFrameCallbacks(), pio->function);
break;
}
default:
Assert(0); // Unimplemented.
break;
Expand Down Expand Up @@ -307,6 +312,11 @@ void CPluginSystem::RemoveCallback(PluginOperation_s* const pio)
REMOVE_PLUGIN_CALLBACK(OnRegisterUIScriptFunctionsFn, GetRegisterUIScriptFuncsCallbacks(), pio->function);
break;
}
case PluginOperation_s::PluginCallback_e::CServer_RunFrame:
{
REMOVE_PLUGIN_CALLBACK(OnServerFrameFn, GetServerFrameCallbacks(), pio->function);
break;
}
default:
Assert(0); // Unimplemented.
break;
Expand Down
1 change: 1 addition & 0 deletions src/pluginsystem/pluginsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class CPluginSystem : public IPluginSystem
CREATE_PLUGIN_CALLBACK(OnRegisterServerScriptFunctionsFn, void(*)(CSquirrelVM*), GetRegisterServerScriptFuncsCallbacks, registerServerScriptFuncsCallbacks);
CREATE_PLUGIN_CALLBACK(OnRegisterClientScriptFunctionsFn, void(*)(CSquirrelVM*), GetRegisterClientScriptFuncsCallbacks, registerClientScriptFuncsCallbacks);
CREATE_PLUGIN_CALLBACK(OnRegisterUIScriptFunctionsFn, void(*)(CSquirrelVM*), GetRegisterUIScriptFuncsCallbacks, registerUIScriptFuncsCallbacks);
CREATE_PLUGIN_CALLBACK(OnServerFrameFn, void(*)(CServer*), GetServerFrameCallbacks, serverFrameCallbacks);

#undef CREATE_PLUGIN_CALLBACK

Expand Down