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.

77 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef BANPANEL_H
  8. #define BANPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <KeyValues.h>
  13. #include <vgui_controls/Frame.h>
  14. #include <vgui_controls/PHandle.h>
  15. #include <vgui_controls/ListPanel.h>
  16. #include <vgui_controls/PropertyPage.h>
  17. #include "utlvector.h"
  18. #include "BanContextMenu.h"
  19. #include "RemoteServer.h"
  20. //-----------------------------------------------------------------------------
  21. // Purpose: Dialog for displaying information about a game server
  22. //-----------------------------------------------------------------------------
  23. class CBanPanel : public vgui::PropertyPage, public IServerDataResponse
  24. {
  25. DECLARE_CLASS_SIMPLE( CBanPanel, vgui::PropertyPage );
  26. public:
  27. CBanPanel(vgui::Panel *parent, const char *name);
  28. ~CBanPanel();
  29. virtual void OnResetData();
  30. protected:
  31. // property page handlers
  32. virtual void OnPageShow();
  33. virtual void OnThink();
  34. // server response on user data
  35. virtual void OnServerDataResponse(const char *value, const char *response);
  36. virtual void OnKeyCodeTyped(vgui::KeyCode code);
  37. private:
  38. MESSAGE_FUNC( AddBan, "addban" );
  39. MESSAGE_FUNC( RemoveBan, "removeban" );
  40. MESSAGE_FUNC( ChangeBan, "changeban" );
  41. MESSAGE_FUNC_CHARPTR( RemoveBanByID, "removebanbyid", id );
  42. MESSAGE_FUNC_CHARPTR_CHARPTR( ChangeBanTimeByID, "AddBanValue", id, time );
  43. MESSAGE_FUNC_PARAMS( OnCvarChangeValue, "CvarChangeValue", kv );
  44. // returns true if the id string is an IP address, false if it's a WON or STEAM ID
  45. bool IsIPAddress(const char *id);
  46. // msg handlers
  47. MESSAGE_FUNC_INT( OnOpenContextMenu, "OpenContextMenu", itemID );
  48. void OnEffectPlayer(KeyValues *data);
  49. MESSAGE_FUNC( OnItemSelected, "ItemSelected" );
  50. MESSAGE_FUNC( ImportBanList, "importban" );
  51. MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
  52. vgui::ListPanel *m_pBanListPanel;
  53. vgui::Button *m_pAddButton;
  54. vgui::Button *m_pRemoveButton;
  55. vgui::Button *m_pChangeButton;
  56. vgui::Button *m_pImportButton;
  57. CBanContextMenu *m_pBanContextMenu;
  58. float m_flUpdateTime;
  59. bool m_bPageViewed;
  60. };
  61. #endif // BANPANEL_H