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.
70 lines
2.1 KiB
70 lines
2.1 KiB
5 years ago
|
//========= 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"
|
||
2 years ago
|
#include <time.h>
|
||
5 years ago
|
|
||
|
//-----------------------------------------------------------------------------
|
||
|
// 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;
|
||
2 years ago
|
time_t m_blackListTimestamp;
|
||
5 years ago
|
};
|
||
|
|
||
|
|
||
|
#endif // BLACKLISTEDSERVERS_H
|