summaryrefslogtreecommitdiff
path: root/tracker/common/IGameList.h
blob: 8b7a008b803ba53fba067e83e949864d02e5c45b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================

#ifndef IGAMELIST_H
#define IGAMELIST_H
#ifdef _WIN32
#pragma once
#endif

struct serveritem_t;
#include "FindSteamServers.h"

#define EMPTY_SERVER_NAME "0.0.0.0:0"

//-----------------------------------------------------------------------------
// Purpose: Interface to accessing a game list
//-----------------------------------------------------------------------------
class IGameList
{
public:

	enum InterfaceItem_e
	{
		FILTERS,
		GETNEWLIST,
		ADDSERVER,
		ADDCURRENTSERVER,
	};

	// returns true if the game list supports the specified ui elements
	virtual bool SupportsItem(InterfaceItem_e item) = 0;

	// starts the servers refreshing
	virtual void StartRefresh() = 0;

	// gets a new server list
	virtual void GetNewServerList() = 0;

	// stops current refresh/GetNewServerList()
	virtual void StopRefresh() = 0;

	// returns true if the list is currently refreshing servers
	virtual bool IsRefreshing() = 0;

	// gets information about specified server
	virtual serveritem_t &GetServer(unsigned int serverID) = 0;

	// adds a new server to list
	virtual void AddNewServer(serveritem_t &server) = 0;

	// marks that server list has been fully received
	virtual void ListReceived(bool moreAvailable, const char *lastUniqueIP, ESteamServerType serverType) = 0;

	// called when Connect button is pressed
	virtual void OnBeginConnect() = 0;

	// reapplies filters
	virtual void ApplyFilters() = 0;

	// invalid server index
	virtual int GetInvalidServerListID() = 0;
};


#endif // IGAMELIST_H