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.

75 lines
2.0 KiB

  1. //========= Copyright � 1996-2001, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef DIALOGADDSERVER_H
  8. #define DIALOGADDSERVER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. class CAddServerGameList;
  13. class IGameList;
  14. //-----------------------------------------------------------------------------
  15. // Purpose: Dialog which lets the user add a server by IP address
  16. //-----------------------------------------------------------------------------
  17. class CDialogAddServer : public vgui::Frame, public ISteamMatchmakingPingResponse
  18. {
  19. DECLARE_CLASS_SIMPLE( CDialogAddServer, vgui::Frame );
  20. friend class CAddServerGameList;
  21. public:
  22. CDialogAddServer(vgui::Panel *parent, IGameList *gameList);
  23. ~CDialogAddServer();
  24. void ServerResponded( gameserveritem_t &server );
  25. void ServerFailedToRespond();
  26. void ApplySchemeSettings( vgui::IScheme *pScheme );
  27. MESSAGE_FUNC( OnItemSelected, "ItemSelected" );
  28. private:
  29. virtual void OnCommand(const char *command);
  30. void OnOK();
  31. void TestServers();
  32. MESSAGE_FUNC( OnTextChanged, "TextChanged" );
  33. virtual void FinishAddServer( gameserveritem_t &pServer );
  34. virtual bool AllowInvalidIPs( void ) { return false; }
  35. protected:
  36. IGameList *m_pGameList;
  37. vgui::Button *m_pTestServersButton;
  38. vgui::Button *m_pAddServerButton;
  39. vgui::Button *m_pAddSelectedServerButton;
  40. vgui::PropertySheet *m_pTabPanel;
  41. vgui::TextEntry *m_pTextEntry;
  42. vgui::ListPanel *m_pDiscoveredGames;
  43. int m_OriginalHeight;
  44. CUtlVector<gameserveritem_t> m_Servers;
  45. CUtlVector<HServerQuery> m_Queries;
  46. };
  47. class CDialogAddBlacklistedServer : public CDialogAddServer
  48. {
  49. DECLARE_CLASS_SIMPLE( CDialogAddBlacklistedServer, CDialogAddServer );
  50. public:
  51. CDialogAddBlacklistedServer( vgui::Panel *parent, IGameList *gameList) :
  52. CDialogAddServer( parent, gameList )
  53. {
  54. }
  55. virtual void FinishAddServer( gameserveritem_t &pServer );
  56. void ApplySchemeSettings( vgui::IScheme *pScheme );
  57. virtual bool AllowInvalidIPs( void ) { return true; }
  58. };
  59. #endif // DIALOGADDSERVER_H