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.

59 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: defines a RCon class used to send rcon commands to remote servers
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef SERVERINFO_H
  8. #define SERVERINFO_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "server.h"
  13. #include "netadr.h"
  14. class CSocket;
  15. class IResponse;
  16. class CServerInfo
  17. {
  18. public:
  19. CServerInfo(IResponse *target,serveritem_t &server);
  20. ~CServerInfo();
  21. // send an rcon command to a server
  22. void Query();
  23. void Refresh();
  24. bool IsRefreshing();
  25. serveritem_t &GetServer();
  26. void RunFrame();
  27. bool Refreshed();
  28. void UpdateServer(netadr_t *adr, bool proxy, const char *serverName, const char *map,
  29. const char *gamedir, const char *gameDescription, int players,
  30. int maxPlayers, float recvTime, bool password);
  31. int serverID;
  32. int received;
  33. private:
  34. serveritem_t m_Server;
  35. CSocket *m_pQuery; // Game server query socket
  36. IResponse *m_pResponseTarget;
  37. bool m_bIsRefreshing;
  38. float m_fSendTime;
  39. bool m_bRefreshed;
  40. };
  41. #endif // SERVERINFO_H