You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.5 KiB
50 lines
1.5 KiB
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
|
//
|
|
// Purpose: Entity that propagates general data needed by clients for every player.
|
|
//
|
|
// $NoKeywords: $
|
|
//=============================================================================//
|
|
|
|
#ifndef PLAYER_RESOURCE_H
|
|
#define PLAYER_RESOURCE_H
|
|
#ifdef _WIN32
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "shareddefs.h"
|
|
|
|
class CPlayerResource : public CBaseEntity
|
|
{
|
|
DECLARE_CLASS( CPlayerResource, CBaseEntity );
|
|
public:
|
|
DECLARE_SERVERCLASS();
|
|
DECLARE_DATADESC();
|
|
|
|
virtual void Spawn( void );
|
|
virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() | FCAP_DONT_SAVE; }
|
|
virtual void ResourceThink( void );
|
|
virtual void UpdatePlayerData( void );
|
|
virtual int UpdateTransmitState(void);
|
|
int GetPlayerSmoothPing( int iClientIndex );
|
|
|
|
protected:
|
|
// Data for each player that's propagated to all clients
|
|
// Stored in individual arrays so they can be sent down via datatables
|
|
CNetworkArray( int, m_iPing, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_iKills, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_iAssists, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_iDeaths, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_bConnected, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_iTeam, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_iPendingTeam, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_bAlive, MAX_PLAYERS+1 );
|
|
CNetworkArray( int, m_iHealth, MAX_PLAYERS+1 );
|
|
|
|
CNetworkArray( int, m_iCoachingTeam, MAX_PLAYERS + 1);
|
|
|
|
int m_nUpdateCounter;
|
|
};
|
|
|
|
extern CPlayerResource *g_pPlayerResource;
|
|
|
|
#endif // PLAYER_RESOURCE_H
|