Preemptively update IVEngineServer and IServerTools so we can dynamically use new functions

when interface versions get updated in binaries.
This commit is contained in:
Nicholas Hastings 2014-10-30 19:06:51 -04:00
parent 367ad02ba2
commit b3aa910ad2
2 changed files with 101 additions and 31 deletions

View File

@ -57,6 +57,9 @@ class CStandardSendProxies;
class IAchievementMgr; class IAchievementMgr;
class CGamestatsData; class CGamestatsData;
class CSteamID; class CSteamID;
class IReplayFactory;
class IReplaySystem;
class IServer;
typedef struct player_info_s player_info_t; typedef struct player_info_s player_info_t;
@ -71,8 +74,13 @@ typedef struct player_info_s player_info_t;
#endif #endif
#define INTERFACEVERSION_VENGINESERVER "VEngineServer021" #define INTERFACEVERSION_VENGINESERVER "VEngineServer021"
#define INTERFACEVERSION_VENGINESERVER_INT 21
struct bbox_t; struct bbox_t
{
Vector mins;
Vector maxs;
};
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: Interface the engine exposes to the game DLL // Purpose: Interface the engine exposes to the game DLL
@ -390,21 +398,27 @@ public:
// keyvalues are deleted inside the function // keyvalues are deleted inside the function
virtual void ClientCommandKeyValues( edict_t *pEdict, KeyValues *pCommand ) = 0; virtual void ClientCommandKeyValues( edict_t *pEdict, KeyValues *pCommand ) = 0;
virtual const CSteamID *GetClientSteamIDByPlayerIndex( int index ) = 0; // Returns the SteamID of the specified player. It'll be NULL if the player hasn't authenticated yet.
virtual const CSteamID *GetClientSteamIDByPlayerIndex( int entnum ) = 0;
// Gets a list of all clusters' bounds. Returns total number of clusters.
virtual int GetClusterCount() = 0; virtual int GetClusterCount() = 0;
virtual int GetAllClusterBounds( bbox_t *pBoxes, int maxboxes ) = 0; virtual int GetAllClusterBounds( bbox_t *pBBoxList, int maxBBox ) = 0;
virtual edict_t *CreateFakeClientEx( const char *netname, bool bUnknown ) = 0;
virtual int GetServerVersion() const = 0;
virtual void *GetReplay() = 0;
};
abstract_class IServerGCLobby // Create a bot with the given name. Returns NULL if fake client can't be created
{ virtual edict_t *CreateFakeClientEx( const char *netname, bool bReportFakeClient = true ) = 0;
public:
virtual bool HasLobby() const = 0; // Server version from the steam.inf, this will be compared to the GC version
virtual bool SteamIDAllowedToConnect( const CSteamID &steamId ) const = 0; virtual int GetServerVersion() const = 0;
virtual void UpdateServerDetails( void ) = 0;
virtual bool ShouldHibernate() = 0; // Only in VEngineServer022 and later
// Get sv.GetTime()
virtual float GetServerTime() const = 0;
// Exposed for server plugin authors
virtual IServer *GetIServer() = 0;
virtual IReplaySystem *GetReplay() = 0;
}; };
#define INTERFACEVERSION_SERVERGAMEDLL_VERSION_4 "ServerGameDLL004" #define INTERFACEVERSION_SERVERGAMEDLL_VERSION_4 "ServerGameDLL004"
@ -413,6 +427,9 @@ public:
#define INTERFACEVERSION_SERVERGAMEDLL_VERSION_7 "ServerGameDLL007" #define INTERFACEVERSION_SERVERGAMEDLL_VERSION_7 "ServerGameDLL007"
#define INTERFACEVERSION_SERVERGAMEDLL_VERSION_8 "ServerGameDLL008" #define INTERFACEVERSION_SERVERGAMEDLL_VERSION_8 "ServerGameDLL008"
#define INTERFACEVERSION_SERVERGAMEDLL "ServerGameDLL009" #define INTERFACEVERSION_SERVERGAMEDLL "ServerGameDLL009"
#define INTERFACEVERSION_SERVERGAMEDLL_INT 9
class IServerGCLobby;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: These are the interfaces that the game .dll exposes to the engine // Purpose: These are the interfaces that the game .dll exposes to the engine
@ -427,7 +444,8 @@ public:
CreateInterfaceFn fileSystemFactory, CreateInterfaceFn fileSystemFactory,
CGlobalVars *pGlobals) = 0; CGlobalVars *pGlobals) = 0;
virtual bool ReplayInit( CreateInterfaceFn replayFactory ) = 0; // Setup replay interfaces on the server
virtual bool ReplayInit( CreateInterfaceFn fnReplayFactory ) = 0;
// This is called when a new game is started. (restart, map) // This is called when a new game is started. (restart, map)
virtual bool GameInit( void ) = 0; virtual bool GameInit( void ) = 0;
@ -522,16 +540,25 @@ public:
// Called after the steam API has been activated post-level startup // Called after the steam API has been activated post-level startup
virtual void GameServerSteamAPIActivated( void ) = 0; virtual void GameServerSteamAPIActivated( void ) = 0;
// Called after the steam API has been shutdown post-level startup
virtual void GameServerSteamAPIShutdown( void ) = 0; virtual void GameServerSteamAPIShutdown( void ) = 0;
virtual void SetServerHibernation( bool bHibernating ) = 0; virtual void SetServerHibernation( bool bHibernating ) = 0;
// interface to the new GC based lobby system
virtual IServerGCLobby *GetServerGCLobby() = 0; virtual IServerGCLobby *GetServerGCLobby() = 0;
// Return override string to show in the server browser
// "map" column, or NULL to just use the default value
// (the map name)
virtual const char *GetServerBrowserMapOverride() = 0; virtual const char *GetServerBrowserMapOverride() = 0;
// Get gamedata string to send to the master serer updater.
virtual const char *GetServerBrowserGameData() = 0; virtual const char *GetServerBrowserGameData() = 0;
}; };
typedef IServerGameDLL IServerGameDLL008;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Just an interface version name for the random number interface // Just an interface version name for the random number interface
// See vstdlib/random.h for the interface definition // See vstdlib/random.h for the interface definition
@ -569,6 +596,7 @@ public:
virtual void CheckTransmit( CCheckTransmitInfo *pInfo, const unsigned short *pEdictIndices, int nEdicts ) = 0; virtual void CheckTransmit( CCheckTransmitInfo *pInfo, const unsigned short *pEdictIndices, int nEdicts ) = 0;
}; };
#define INTERFACEVERSION_SERVERGAMECLIENTS_VERSION_3 "ServerGameClients003"
#define INTERFACEVERSION_SERVERGAMECLIENTS "ServerGameClients004" #define INTERFACEVERSION_SERVERGAMECLIENTS "ServerGameClients004"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -611,7 +639,7 @@ public:
int dropped_packets, bool ignore, bool paused ) = 0; int dropped_packets, bool ignore, bool paused ) = 0;
// Let the game .dll do stuff after messages have been sent to all of the clients once the server frame is complete // Let the game .dll do stuff after messages have been sent to all of the clients once the server frame is complete
virtual void PostClientMessagesSent( void ) = 0; virtual void PostClientMessagesSent_DEPRECIATED( void ) = 0;
// For players, looks up the CPlayerState structure corresponding to the player // For players, looks up the CPlayerState structure corresponding to the player
virtual CPlayerState *GetPlayerState( edict_t *player ) = 0; virtual CPlayerState *GetPlayerState( edict_t *player ) = 0;
@ -632,9 +660,13 @@ public:
// The client has submitted a keyvalues command // The client has submitted a keyvalues command
virtual void ClientCommandKeyValues( edict_t *pEntity, KeyValues *pKeyValues ) = 0; virtual void ClientCommandKeyValues( edict_t *pEntity, KeyValues *pKeyValues ) = 0;
virtual void ClientSpawned( edict_t *pEntity ) = 0; // Hook for player spawning
virtual void ClientSpawned( edict_t *pPlayer ) = 0;
}; };
typedef IServerGameClients IServerGameClients003;
#define INTERFACEVERSION_UPLOADGAMESTATS "ServerUploadGameStats001" #define INTERFACEVERSION_UPLOADGAMESTATS "ServerUploadGameStats001"
abstract_class IUploadGameStats abstract_class IUploadGameStats
@ -704,4 +736,16 @@ public:
virtual void GetTaggedConVarList( KeyValues *pCvarTagList ) = 0; virtual void GetTaggedConVarList( KeyValues *pCvarTagList ) = 0;
}; };
//-----------------------------------------------------------------------------
// Purpose: Provide hooks for the GC based lobby system
//-----------------------------------------------------------------------------
abstract_class IServerGCLobby
{
public:
virtual bool HasLobby() const = 0;
virtual bool SteamIDAllowedToConnect( const CSteamID &steamId ) const = 0;
virtual void UpdateServerDetails(void) = 0;
virtual bool ShouldHibernate() = 0;
};
#endif // EIFACE_H #endif // EIFACE_H

View File

@ -32,6 +32,9 @@ class CBaseAnimating;
class CTakeDamageInfo; class CTakeDamageInfo;
class ITempEntsSystem; class ITempEntsSystem;
class IEntityFactoryDictionary; class IEntityFactoryDictionary;
class CBaseTempEntity;
class CGlobalEntityList;
class IEntityFindFilter;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -217,6 +220,29 @@ public:
virtual void RadiusDamage( const CTakeDamageInfo &info, const Vector &vecSrc, float flRadius, int iClassIgnore, CBaseEntity *pEntityIgnore ) = 0; virtual void RadiusDamage( const CTakeDamageInfo &info, const Vector &vecSrc, float flRadius, int iClassIgnore, CBaseEntity *pEntityIgnore ) = 0;
virtual ITempEntsSystem *GetTempEntsSystem( void ) = 0; virtual ITempEntsSystem *GetTempEntsSystem( void ) = 0;
// Only in VSERVERTOOLS003 and later
virtual CBaseTempEntity *GetTempEntList( void ) = 0;
virtual CGlobalEntityList *GetEntityList( void ) = 0;
virtual bool IsEntityPtr( void *pTest ) = 0;
virtual CBaseEntity *FindEntityByClassname( CBaseEntity *pStartEntity, const char *szName ) = 0;
virtual CBaseEntity *FindEntityByName( CBaseEntity *pStartEntity, const char *szName, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL, IEntityFindFilter *pFilter = NULL ) = 0;
virtual CBaseEntity *FindEntityInSphere( CBaseEntity *pStartEntity, const Vector &vecCenter, float flRadius ) = 0;
virtual CBaseEntity *FindEntityByTarget( CBaseEntity *pStartEntity, const char *szName ) = 0;
virtual CBaseEntity *FindEntityByModel( CBaseEntity *pStartEntity, const char *szModelName ) = 0;
virtual CBaseEntity *FindEntityByNameNearest( const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
virtual CBaseEntity *FindEntityByNameWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
virtual CBaseEntity *FindEntityByClassnameNearest( const char *szName, const Vector &vecSrc, float flRadius ) = 0;
virtual CBaseEntity *FindEntityByClassnameWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecSrc, float flRadius ) = 0;
virtual CBaseEntity *FindEntityByClassnameWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecMins, const Vector &vecMaxs ) = 0;
virtual CBaseEntity *FindEntityGeneric( CBaseEntity *pStartEntity, const char *szName, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
virtual CBaseEntity *FindEntityGenericWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
virtual CBaseEntity *FindEntityGenericNearest( const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
virtual CBaseEntity *FindEntityNearestFacing( const Vector &origin, const Vector &facing, float threshold ) = 0;
virtual CBaseEntity *FindEntityClassNearestFacing( const Vector &origin, const Vector &facing, float threshold, char *classname ) = 0;
virtual CBaseEntity *FindEntityProcedural( const char *szName, CBaseEntity *pSearchingEntity = NULL, CBaseEntity *pActivator = NULL, CBaseEntity *pCaller = NULL ) = 0;
}; };
typedef IServerTools IServerTools001; typedef IServerTools IServerTools001;