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.

69 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef MAPSLIST_H
  8. #define MAPSLIST_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "server.h"
  13. #include "netadr.h"
  14. #include "maps.h"
  15. #include "rcon.h"
  16. #include "utlvector.h"
  17. #include "Iresponse.h"
  18. class CSocket;
  19. class IResponse;
  20. class CMapsList: public IResponse
  21. {
  22. public:
  23. CMapsList(IResponse *target,serveritem_t &server, const char *rconPassword,const char *mod);
  24. ~CMapsList();
  25. // send an rcon command to a server
  26. void SendQuery();
  27. void Refresh();
  28. bool IsRefreshing();
  29. serveritem_t &GetServer();
  30. void RunFrame();
  31. void UpdateServer();
  32. CUtlVector<Maps_t> *GetMapsList();
  33. bool NewMapsList();
  34. void ServerResponded();
  35. // called when a server response has timed out
  36. void ServerFailedToRespond();
  37. void SetPassword(const char *newPass);
  38. private:
  39. serveritem_t m_Server;
  40. CUtlVector<Maps_t> m_MapsList;
  41. IResponse *m_pResponseTarget;
  42. CRcon *m_pRcon;
  43. char m_sMod[64];
  44. bool m_bIsRefreshing;
  45. bool m_bNewMapsList;
  46. bool m_bRconFailed;
  47. char m_szRconPassword[100];
  48. };
  49. #endif // MAPSLIST_H