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.

76 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef REPLAYCLIENT_H
  7. #define REPLAYCLIENT_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "baseclient.h"
  12. class CReplayServer;
  13. class CReplayClient : public CBaseClient
  14. {
  15. typedef CBaseClient BaseClass;
  16. public:
  17. CReplayClient(int slot, CBaseServer *pServer);
  18. virtual ~CReplayClient();
  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 isReplayDemoFile );
  25. void FileRequested(const char *fileName, unsigned int transferID, bool isReplayDemoFile );
  26. void FileDenied(const char *fileName, unsigned int transferID, bool isReplayDemoFile );
  27. void FileSent(const char *fileName, unsigned int transferID, bool isReplayDemoFile );
  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 );
  34. bool SendSignonData( void );
  35. void SetRate( int nRate, bool bForce );
  36. void SetUpdateRate( float fUpdateRate, bool bForce );
  37. void UpdateUserSettings();
  38. public: // IClientMessageHandlers
  39. virtual bool NETMsg_SetConVar( const CNETMsg_SetConVar& msg ) OVERRIDE;
  40. virtual bool CLCMsg_ClientInfo( const CCLCMsg_ClientInfo& msg ) OVERRIDE;
  41. virtual bool CLCMsg_Move( const CCLCMsg_Move& msg ) OVERRIDE;
  42. virtual bool CLCMsg_VoiceData( const CCLCMsg_VoiceData& msg ) OVERRIDE;
  43. virtual bool CLCMsg_ListenEvents( const CCLCMsg_ListenEvents& msg ) OVERRIDE;
  44. virtual bool CLCMsg_RespondCvarValue( const CCLCMsg_RespondCvarValue& msg ) OVERRIDE;
  45. virtual bool CLCMsg_FileCRCCheck( const CCLCMsg_FileCRCCheck& msg ) OVERRIDE;
  46. public:
  47. CClientFrame *GetDeltaFrame( int nTick );
  48. public:
  49. int m_nLastSendTick; // last send tick, don't send ticks twice
  50. double m_fLastSendTime; // last net time we send a packet
  51. char m_szPassword[64]; // client password
  52. double m_flLastChatTime; // last time user send a chat text
  53. bool m_bNoChat; // if true don't send chat message to this client
  54. char m_szChatGroup[64]; // client password
  55. CReplayServer *m_pReplay;
  56. };
  57. #endif // REPLAYCLIENT_H