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.

74 lines
2.1 KiB

  1. //========= Copyright 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. public:
  16. CHLTVClient(int slot, CBaseServer *pServer);
  17. virtual ~CHLTVClient();
  18. // INetMsgHandler interface
  19. void ConnectionClosing( const char *reason );
  20. void ConnectionCrashed(const char *reason);
  21. void PacketStart(int incoming_sequence, int outgoing_acknowledged);
  22. void PacketEnd( void );
  23. void FileReceived( const char *fileName, unsigned int transferID );
  24. void FileRequested(const char *fileName, unsigned int transferID );
  25. void FileDenied(const char *fileName, unsigned int transferID );
  26. void FileSent(const char *fileName, unsigned int transferID );
  27. bool ProcessConnectionlessPacket( netpacket_t *packet );
  28. // IClient interface
  29. bool ExecuteStringCommand( const char *s );
  30. void SpawnPlayer( void );
  31. bool ShouldSendMessages( void );
  32. void SendSnapshot( CClientFrame * pFrame );
  33. bool SendSignonData( void );
  34. void SetRate( int nRate, bool bForce );
  35. void SetUpdateRate(int udpaterate, bool bForce);
  36. void UpdateUserSettings();
  37. public: // IClientMessageHandlers
  38. PROCESS_NET_MESSAGE( SetConVar );
  39. PROCESS_CLC_MESSAGE( ClientInfo );
  40. PROCESS_CLC_MESSAGE( Move );
  41. PROCESS_CLC_MESSAGE( VoiceData );
  42. PROCESS_CLC_MESSAGE( ListenEvents );
  43. PROCESS_CLC_MESSAGE( RespondCvarValue );
  44. PROCESS_CLC_MESSAGE( FileCRCCheck );
  45. PROCESS_CLC_MESSAGE( FileMD5Check ) { return true; }
  46. PROCESS_CLC_MESSAGE( SaveReplay );
  47. public:
  48. CClientFrame *GetDeltaFrame( int nTick );
  49. public:
  50. int m_nLastSendTick; // last send tick, don't send ticks twice
  51. double m_fLastSendTime; // last net time we send a packet
  52. char m_szPassword[64]; // client password
  53. double m_flLastChatTime; // last time user send a chat text
  54. bool m_bNoChat; // if true don't send chat message to this client
  55. char m_szChatGroup[64]; // client password
  56. CHLTVServer *m_pHLTV;
  57. };
  58. #endif // HLTVCLIENT_H