diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /serverbrowser/BlacklistedServers.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'serverbrowser/BlacklistedServers.h')
| -rw-r--r-- | serverbrowser/BlacklistedServers.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/serverbrowser/BlacklistedServers.h b/serverbrowser/BlacklistedServers.h new file mode 100644 index 0000000..ce8b9b5 --- /dev/null +++ b/serverbrowser/BlacklistedServers.h @@ -0,0 +1,68 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef BLACKLISTEDSERVERS_H +#define BLACKLISTEDSERVERS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "ServerBrowser/blacklisted_server_manager.h" + +//----------------------------------------------------------------------------- +// Purpose: Blacklisted servers list +//----------------------------------------------------------------------------- +class CBlacklistedServers : public vgui::PropertyPage +{ + DECLARE_CLASS_SIMPLE( CBlacklistedServers, vgui::PropertyPage ); + +public: + CBlacklistedServers(vgui::Panel *parent); + ~CBlacklistedServers(); + + // blacklist list, loads/saves from file + void LoadBlacklistedList(); + void SaveBlacklistedList(); + void AddServer(gameserveritem_t &server); + + virtual void ApplySchemeSettings(vgui::IScheme *pScheme); + + // passed from main server browser window instead of messages + void OnConnectToGame(); + void OnDisconnectFromGame( void ); + + blacklisted_server_t *GetBlacklistedServer( int iServerID ); + bool IsServerBlacklisted(gameserveritem_t &server); + +private: + // context menu message handlers + MESSAGE_FUNC( OnPageShow, "PageShow" ); + MESSAGE_FUNC_INT( OnOpenContextMenu, "OpenContextMenu", itemID ); + MESSAGE_FUNC( OnAddServerByName, "AddServerByName" ); + MESSAGE_FUNC( OnRemoveFromBlacklist, "RemoveFromBlacklist" ); + MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath ); + + void ClearServerList( void ); + void OnAddCurrentServer( void ); + void OnImportBlacklist( void ); + void OnCommand(const char *command); + void UpdateBlacklistUI( blacklisted_server_t *blackServer ); + int GetSelectedServerID( void ); + bool AddServersFromFile( const char *pszFilename, bool bResetTimes ); + +private: + vgui::Button *m_pAddServer; + vgui::Button *m_pAddCurrentServer; + vgui::ListPanel *m_pGameList; + vgui::DHANDLE< vgui::FileOpenDialog > m_hImportDialog; + + CBlacklistedServerManager m_blackList; + long m_blackListTimestamp; +}; + + +#endif // BLACKLISTEDSERVERS_H |