about summary refs log tree commit diff
path: root/src/engine/masterserver.h
blob: d13ea6b4ca81f0ec29706512b8ef2d4d5f185f10 (plain)
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
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com.                */
#ifndef ENGINE_MASTERSERVER_H
#define ENGINE_MASTERSERVER_H

#include "kernel.h"

class IMasterServer : public IInterface
{
	MACRO_INTERFACE("masterserver", 0)
public:

	enum
	{
		MAX_MASTERSERVERS=4
	};

	virtual void Init(class CEngine *pEngine) = 0;
	virtual void SetDefault() = 0;
	virtual int Load() = 0;
	virtual int Save() = 0;

	virtual int RefreshAddresses() = 0;
	virtual void Update() = 0;
	virtual int IsRefreshing() = 0;
	virtual void DumpServers() = 0;
	virtual NETADDR GetAddr(int Index) = 0;
	virtual const char *GetName(int Index) = 0;
};

class IEngineMasterServer : public IMasterServer
{
	MACRO_INTERFACE("enginemasterserver", 0)
public:
};

extern IEngineMasterServer *CreateEngineMasterServer();

#endif