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.

81 lines
2.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef HLTVCLIENT_H
  7. #define HLTVCLIENT_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "baseclient.h"
  12. class CHLTVServer;
  13. class CHLTVClient : public CBaseClient
  14. {
  15. typedef CBaseClient BaseClass;
  16. public:
  17. CHLTVClient(int slot, CBaseServer *pServer);
  18. virtual ~CHLTVClient();
  19. // INetMsgHandler interface
  20. void ConnectionClosing( const char *reason );
  21. void ConnectionCrashed(const char *reason);
  22. void PacketStart(int incoming_sequence, int outgoing_acknowledged);
  23. void PacketEnd( void );
  24. void FileReceived( const char *fileName, unsigned int transferID, bool bIsReplayDemoFile = false );
  25. void FileRequested(const char *fileName, unsigned int transferID, bool bIsReplayDemoFile = false );
  26. void FileDenied(const char *fileName, unsigned int transferID, bool bIsReplayDemoFile = false );
  27. void FileSent(const char *fileName, unsigned int transferID, bool bIsReplayDemoFile = false );
  28. bool ProcessConnectionlessPacket( netpacket_t *packet );
  29. // IClient interface
  30. bool ExecuteStringCommand( const char *s );
  31. void SpawnPlayer( void );
  32. bool ShouldSendMessages( void );
  33. bool SendSnapshot( CClientFrame * pFrame ) OVERRIDE;
  34. bool SendSignonData( void );
  35. void SetRate( int nRate, bool bForce );
  36. void SetUpdateRate( float fUpdaterate, bool bForce ); // override;
  37. void UpdateUserSettings();
  38. public: // IClientMessageHandlers
  39. virtual bool CLCMsg_RespondCvarValue( const CCLCMsg_RespondCvarValue& msg ) OVERRIDE;
  40. virtual bool CLCMsg_FileCRCCheck( const CCLCMsg_FileCRCCheck& msg ) OVERRIDE;
  41. virtual bool NETMsg_SetConVar( const CNETMsg_SetConVar& msg ) OVERRIDE;
  42. virtual bool NETMsg_PlayerAvatarData( const CNETMsg_PlayerAvatarData& msg ) OVERRIDE { return true; }
  43. virtual bool CLCMsg_Move( const CCLCMsg_Move& msg ) OVERRIDE;
  44. virtual bool CLCMsg_ClientInfo( const CCLCMsg_ClientInfo& msg ) OVERRIDE;
  45. virtual bool CLCMsg_VoiceData( const CCLCMsg_VoiceData& msg ) OVERRIDE;
  46. virtual bool CLCMsg_ListenEvents( const CCLCMsg_ListenEvents& msg ) OVERRIDE;
  47. public:
  48. CClientFrame *GetDeltaFrame( int nTick );
  49. protected:
  50. virtual bool ProcessSignonStateMsg(int state, int spawncount) OVERRIDE;
  51. public:
  52. CHLTVServer *m_pHLTV;
  53. int m_nLastSendTick; // last send tick, don't send ticks twice
  54. double m_fLastSendTime; // last net time we send a packet
  55. char m_szPassword[128]; // client password
  56. double m_flLastChatTime; // last time user send a chat text
  57. bool m_bNoChat; // if true don't send chat message to this client
  58. char m_szChatGroup[128]; // client password
  59. };
  60. #endif // HLTVCLIENT_H