Team Fortress 2 Source Code as on 22/4/2020
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.

87 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef HLTVCLIENTSTATE_H
  7. #define HLTVCLIENTSTATE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "baseclientstate.h"
  12. class CClientFrame;
  13. class CHLTVServer;
  14. extern ConVar tv_name;
  15. class CHLTVClientState : public CBaseClientState
  16. {
  17. friend class CHLTVServer;
  18. public:
  19. CHLTVClientState();
  20. virtual ~CHLTVClientState();
  21. public:
  22. const char *GetCDKeyHash() { return "HLTVHLTVHLTVHLTVHLTVHLTVHLTVHLTV"; }; // haha
  23. bool SetSignonState ( int state, int count );
  24. void SendClientInfo( void );
  25. void PacketEnd( void );
  26. void Clear( void );
  27. void RunFrame ( void );
  28. void InstallStringTableCallback( char const *tableName );
  29. virtual bool HookClientStringTable( char const *tableName );
  30. virtual const char *GetClientName() { return tv_name.GetString(); }
  31. void ConnectionCrashed( const char * reason );
  32. void ConnectionClosing( const char * reason );
  33. int GetConnectionRetryNumber() const;
  34. void ReadEnterPVS( CEntityReadInfo &u );
  35. void ReadLeavePVS( CEntityReadInfo &u );
  36. void ReadDeltaEnt( CEntityReadInfo &u );
  37. void ReadPreserveEnt( CEntityReadInfo &u );
  38. void ReadDeletions( CEntityReadInfo &u );
  39. void CopyNewEntity( CEntityReadInfo &u, int iClass, int iSerialNum );
  40. public: // IServerMessageHandlers
  41. PROCESS_NET_MESSAGE( StringCmd );
  42. PROCESS_NET_MESSAGE( SetConVar );
  43. PROCESS_SVC_MESSAGE( ServerInfo );
  44. PROCESS_SVC_MESSAGE( ClassInfo );
  45. PROCESS_SVC_MESSAGE( VoiceInit );
  46. PROCESS_SVC_MESSAGE( VoiceData );
  47. PROCESS_SVC_MESSAGE( Sounds );
  48. PROCESS_SVC_MESSAGE( FixAngle );
  49. PROCESS_SVC_MESSAGE( CrosshairAngle );
  50. PROCESS_SVC_MESSAGE( BSPDecal );
  51. PROCESS_SVC_MESSAGE( GameEvent );
  52. PROCESS_SVC_MESSAGE( UserMessage );
  53. PROCESS_SVC_MESSAGE( EntityMessage );
  54. PROCESS_SVC_MESSAGE( SetView );
  55. PROCESS_SVC_MESSAGE( PacketEntities );
  56. PROCESS_SVC_MESSAGE( TempEntities );
  57. PROCESS_SVC_MESSAGE( Prefetch );
  58. PROCESS_SVC_MESSAGE( GameEventList );
  59. PROCESS_SVC_MESSAGE( Menu );
  60. public:
  61. void SendPacket();
  62. void UpdateStats();
  63. CClientFrame *m_pNewClientFrame; // not NULL if we just got a packet with a new entity frame
  64. CClientFrame *m_pCurrentClientFrame; // NULL or pointer to last entity frame
  65. bool m_bSaveMemory; //compress data as much as possible to keep whole demos in memory
  66. float m_fNextSendUpdateTime;
  67. CHLTVServer *m_pHLTV; // HLTV server this client state belongs too.
  68. };
  69. #endif // HLTVCLIENTSTATE_H