summaryrefslogtreecommitdiff
path: root/game/server/tf/tf_player_resource.h
blob: 9080c6a73192e9384c8d382e1fca04de436703ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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