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.

62 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef SERVERINFOPANEL_H
  8. #define SERVERINFOPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "VarListPropertyPage.h"
  13. #include "tier1/utlbuffer.h"
  14. #include "tier1/utlvector.h"
  15. #include "tier1/utlsymbol.h"
  16. //-----------------------------------------------------------------------------
  17. // Purpose: Dialog for displaying information about a game server
  18. //-----------------------------------------------------------------------------
  19. class CServerInfoPanel : public CVarListPropertyPage
  20. {
  21. public:
  22. CServerInfoPanel(vgui::Panel *parent, const char *name);
  23. ~CServerInfoPanel();
  24. // gets the current hostname
  25. const char *GetHostname();
  26. // Called when page is loaded. Data should be reloaded from document into controls.
  27. virtual void OnResetData();
  28. protected:
  29. // vgui overrides
  30. virtual void OnThink();
  31. // special editing of map cycle list
  32. virtual void OnEditVariable(KeyValues *rule);
  33. // handles responses from the server
  34. virtual void OnServerDataResponse(const char *value, const char *response);
  35. private:
  36. void UpdateMapCycleValue();
  37. float m_flUpdateTime;
  38. int m_iPlayerCount, m_iMaxPlayers;
  39. float m_flLastUptimeReceiveTime;
  40. long m_iLastUptimeReceived;
  41. long m_iLastUptimeDisplayed;
  42. bool m_bMapListRetrieved;
  43. // used to store some strings for mapcycle
  44. CUtlVector<CUtlSymbol> m_AvailableMaps;
  45. CUtlVector<CUtlSymbol> m_MapCycle;
  46. void ParseIntoMapList(const char *maplist, CUtlVector<CUtlSymbol> &mapArray);
  47. typedef CVarListPropertyPage BaseClass;
  48. };
  49. #endif // SERVERINFOPANEL_H