game_shared/gamerules.h
143144145146147148149150151
// Functions to verify the single/multiplayer status of a game
virtual bool IsMultiplayer( void ) = 0;// is this a multiplayer game? (either coop or deathmatch)
virtual const unsigned char *GetEncryptionKey() { return NULL; }
#ifdef CLIENT_DLL
#else
143144145146147148149150151152153154155156157158159160
// Functions to verify the single/multiplayer status of a game
virtual bool IsMultiplayer( void ) = 0;// is this a multiplayer game? (either coop or deathmatch)
virtual const unsigned char *GetEncryptionKey() { return (const unsigned char *)"saxEWr5v"; }
#ifdef CLIENT_DLL
// --> Mirv: Clientside rules
// These aren't pure virtual functions so that they don't
// break all the other derived gamerule classes
virtual int PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget ) { AssertMsg(0, "This should not be called!"); return 0; }
virtual bool FCanTakeDamage( CBaseEntity *pVictim, CBaseEntity *pAttacker ) { AssertMsg(0, "This should not be called!"); return TRUE; }
// <-- Mirv
#else
202203204205206207208
virtual bool IsTeamplay( void ) { return FALSE; };// is this deathmatch game being played with team rules?
virtual bool IsCoOp( void ) = 0;// is this a coop game?
virtual const char *GetGameDescription( void ) { return "Half-Life 2"; } // this is the game name that gets seen in the server browser
// Client connection/disconnection
virtual bool ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen ) = 0;// a client just connected to the server (player hasn't spawned yet)
virtual void InitHUD( CBasePlayer *pl ) = 0; // the client dll is ready for updating
211212213214215216217218
virtual bool IsTeamplay( void ) { return FALSE; };// is this deathmatch game being played with team rules?
virtual bool IsCoOp( void ) = 0;// is this a coop game?
virtual const char *GetGameDescription( void ) { return "Half-Life 2"; } // this is the game name that gets seen in the server browser
virtual void SetGameDescription( const char *szGameDescription ) { return; } // this is the game name that gets seen in the server browser
// Client connection/disconnection
virtual bool ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen ) = 0;// a client just connected to the server (player hasn't spawned yet)
virtual void InitHUD( CBasePlayer *pl ) = 0; // the client dll is ready for updating
210211212213214215216
// Client damage rules
virtual float FlPlayerFallDamage( CBasePlayer *pPlayer ) = 0;// this client just hit the ground after a fall. How much damage?
virtual bool FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker ) {return TRUE;};// can this player take damage from this attacker?
virtual bool ShouldAutoAim( CBasePlayer *pPlayer, edict_t *target ) { return TRUE; }
virtual float GetAutoAimScale( CBasePlayer *pPlayer ) { return 1.0f; }
virtual bool ShouldUseRobustRadiusDamage(CBaseEntity *pEntity) { return false; }
220221222223224225226
// Client damage rules
virtual float FlPlayerFallDamage( CBasePlayer *pPlayer ) = 0;// this client just hit the ground after a fall. How much damage?
virtual bool FCanTakeDamage( CBaseEntity *pVictim, CBaseEntity *pAttacker ) {return TRUE;};// can this player take damage from this attacker?
virtual bool ShouldAutoAim( CBasePlayer *pPlayer, edict_t *target ) { return TRUE; }
virtual float GetAutoAimScale( CBasePlayer *pPlayer ) { return 1.0f; }
virtual bool ShouldUseRobustRadiusDamage(CBaseEntity *pEntity) { return false; }
227228229230231232
virtual bool FPlayerCanRespawn( CBasePlayer *pPlayer ) = 0;// is this player allowed to respawn now?
virtual float FlPlayerSpawnTime( CBasePlayer *pPlayer ) = 0;// When in the future will this player be able to spawn?
virtual CBaseEntity *GetPlayerSpawnSpot( CBasePlayer *pPlayer );// Place this player on their spawnspot and face them the proper direction.
virtual bool IsSpawnPointValid( CBaseEntity *pSpot, CBasePlayer *pPlayer );
virtual bool AllowAutoTargetCrosshair( void ) { return TRUE; };
237238239240241242243
virtual bool FPlayerCanRespawn( CBasePlayer *pPlayer ) = 0;// is this player allowed to respawn now?
virtual float FlPlayerSpawnTime( CBasePlayer *pPlayer ) = 0;// When in the future will this player be able to spawn?
virtual CBaseEntity *GetPlayerSpawnSpot( CBasePlayer *pPlayer );// Place this player on their spawnspot and face them the proper direction.
virtual Vector GetPlayerSpawnSpotOffset( const CBasePlayer *pPlayer, const Vector vecOrigin, const Vector vecPlayerBoundsMins, const Vector vecPlayerBoundsMaxs );// for moving the spawn spot around the original spawn spot if other players are inside it
virtual bool IsSpawnPointValid( CBaseEntity *pSpot, CBasePlayer *pPlayer );
virtual bool AllowAutoTargetCrosshair( void ) { return TRUE; };