ddnet/src/engine/server/register.h
GreYFoX cc63cf2553 Merge branch 'master' of git://github.com/oy/teeworlds
Conflicts:
	src/engine/external/pnglite/pnglite.c
	src/engine/external/pnglite/pnglite.h
	src/engine/shared/config_variables.h
	src/game/client/components/menus_browser.cpp
	src/game/server/entities/character.cpp
	src/game/server/entities/laser.cpp
	src/game/server/gamecontext.cpp
	src/game/server/player.cpp
	src/game/version.h
2011-05-09 18:36:13 +02:00

54 lines
1.3 KiB
C++

/* (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_SERVER_REGISTER_H
#define ENGINE_SERVER_REGISTER_H
#include <engine/masterserver.h>
class CRegister
{
enum
{
REGISTERSTATE_START=0,
REGISTERSTATE_UPDATE_ADDRS,
REGISTERSTATE_QUERY_COUNT,
REGISTERSTATE_HEARTBEAT,
REGISTERSTATE_REGISTERED,
REGISTERSTATE_ERROR
};
struct CMasterserverInfo
{
NETADDR m_Addr;
int m_Count;
int m_Valid;
int64 m_LastSend;
};
class CNetServer *m_pNetServer;
class IEngineMasterServer *m_pMasterServer;
class IConsole *m_pConsole;
int m_RegisterState;
int64 m_RegisterStateStart;
int m_RegisterFirst;
int m_RegisterCount;
CMasterserverInfo m_aMasterserverInfo[IMasterServer::MAX_MASTERSERVERS];
int m_RegisterRegisteredServer;
void RegisterNewState(int State);
void RegisterSendFwcheckresponse(NETADDR *pAddr);
void RegisterSendHeartbeat(NETADDR Addr);
void RegisterSendCountRequest(NETADDR Addr);
void RegisterGotCount(struct CNetChunk *pChunk);
public:
CRegister();
void Init(class CNetServer *pNetServer, class IEngineMasterServer *pMasterServer, class IConsole *pConsole);
void RegisterUpdate(int Nettype);
int RegisterProcessPacket(struct CNetChunk *pPacket);
};
#endif