Counter Strike : Global Offensive Source Code
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

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Entity that propagates general data needed by clients for every player.
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PLAYER_RESOURCE_H
  8. #define PLAYER_RESOURCE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "shareddefs.h"
  13. class CPlayerResource : public CBaseEntity
  14. {
  15. DECLARE_CLASS( CPlayerResource, CBaseEntity );
  16. public:
  17. DECLARE_SERVERCLASS();
  18. DECLARE_DATADESC();
  19. virtual void Spawn( void );
  20. virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() | FCAP_DONT_SAVE; }
  21. virtual void ResourceThink( void );
  22. virtual void UpdatePlayerData( void );
  23. virtual int UpdateTransmitState(void);
  24. int GetPlayerSmoothPing( int iClientIndex );
  25. protected:
  26. // Data for each player that's propagated to all clients
  27. // Stored in individual arrays so they can be sent down via datatables
  28. CNetworkArray( int, m_iPing, MAX_PLAYERS+1 );
  29. CNetworkArray( int, m_iKills, MAX_PLAYERS+1 );
  30. CNetworkArray( int, m_iAssists, MAX_PLAYERS+1 );
  31. CNetworkArray( int, m_iDeaths, MAX_PLAYERS+1 );
  32. CNetworkArray( int, m_bConnected, MAX_PLAYERS+1 );
  33. CNetworkArray( int, m_iTeam, MAX_PLAYERS+1 );
  34. CNetworkArray( int, m_iPendingTeam, MAX_PLAYERS+1 );
  35. CNetworkArray( int, m_bAlive, MAX_PLAYERS+1 );
  36. CNetworkArray( int, m_iHealth, MAX_PLAYERS+1 );
  37. CNetworkArray( int, m_iCoachingTeam, MAX_PLAYERS + 1);
  38. int m_nUpdateCounter;
  39. };
  40. extern CPlayerResource *g_pPlayerResource;
  41. #endif // PLAYER_RESOURCE_H