diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/tf/tf_player_resource.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/tf/tf_player_resource.h')
| -rw-r--r-- | game/server/tf/tf_player_resource.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/game/server/tf/tf_player_resource.h b/game/server/tf/tf_player_resource.h new file mode 100644 index 0000000..9080c6a --- /dev/null +++ b/game/server/tf/tf_player_resource.h @@ -0,0 +1,83 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: TF's custom CPlayerResource +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef TF_PLAYER_RESOURCE_H +#define TF_PLAYER_RESOURCE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tf_player_shared.h" + +class CTFPlayerResource : public CPlayerResource, public CGameEventListener +{ + DECLARE_CLASS( CTFPlayerResource, CPlayerResource ); + +public: + DECLARE_SERVERCLASS(); + + CTFPlayerResource(); + + virtual void FireGameEvent( IGameEvent *event ); + + virtual void UpdatePlayerData( void ); + virtual void Spawn( void ); + virtual void Init( int iIndex ) OVERRIDE; + + int GetTotalScore( int iIndex ); + + void SetPartyLeaderIndex( int iTeam, int iIndex ); + int GetPartyLeaderIndex( int iTeam ); + void SetEventTeamStatus( int iValue ) { m_iEventTeamStatus = iValue; } + uint32 GetEventTeamStatus( void ) { return m_iEventTeamStatus; } + + void SetPlayerClassWhenKilled( int iIndex, int iClass ); + +protected: + virtual void UpdateConnectedPlayer( int iIndex, CBasePlayer *pPlayer ) OVERRIDE; + virtual void UpdateDisconnectedPlayer( int iIndex ) OVERRIDE; + + CNetworkArray( int, m_iTotalScore, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iPlayerClass, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iMaxHealth, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iMaxBuffedHealth, MAX_PLAYERS+1 ); + CNetworkArray( bool, m_bArenaSpectator, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iActiveDominations, MAX_PLAYERS+1 ); + + // These variables are only networked in tournament mode + CNetworkArray( float,m_flNextRespawnTime, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iChargeLevel, MAX_PLAYERS+1 ); + + CNetworkArray( int, m_iDamage, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iDamageAssist, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iDamageBoss, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iHealing, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iHealingAssist, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iDamageBlocked, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iCurrencyCollected, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iBonusPoints, MAX_PLAYERS+1 ); + CNetworkArray( int, m_iPlayerLevel, MAX_PLAYERS+1 ); + // Pseudo multidimensional array [MAX_PLAYERS + 1][CTFPlayerShared::kTFStreak_COUNT] + CNetworkArray( int, m_iStreaks, ( ( MAX_PLAYERS + 1 ) * CTFPlayerShared::kTFStreak_COUNT ) ); + CNetworkArray( int, m_iUpgradeRefundCredits, MAX_PLAYERS + 1 ); + CNetworkArray( int, m_iBuybackCredits, MAX_PLAYERS + 1 ); + + CNetworkVar( int, m_iPartyLeaderRedTeamIndex ); + CNetworkVar( int, m_iPartyLeaderBlueTeamIndex ); + CNetworkVar( int, m_iEventTeamStatus ); + + CNetworkArray( int, m_iPlayerClassWhenKilled, MAX_PLAYERS+1 ); + CNetworkArray( MM_PlayerConnectionState_t, m_iConnectionState, MAX_PLAYERS + 1 ); + + float m_flNextDamageAndHealingSend; + + CUtlVector< uint32 > m_vecRedPlayers; + CUtlVector< uint32 > m_vecBluePlayers; + CUtlVector< int > m_vecFreeSlots; +}; + +#endif // TF_PLAYER_RESOURCE_H |