2010-11-20 10:37:14 +00:00
|
|
|
/* (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. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef GAME_SERVER_EVENTHANDLER_H
|
|
|
|
#define GAME_SERVER_EVENTHANDLER_H
|
|
|
|
|
2013-12-31 05:13:57 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
typedef __int32 int32_t;
|
|
|
|
typedef unsigned __int32 uint32_t;
|
|
|
|
typedef __int64 int64_t;
|
|
|
|
typedef unsigned __int64 uint64_t;
|
|
|
|
#else
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
|
|
|
class CEventHandler
|
|
|
|
{
|
|
|
|
static const int MAX_EVENTS = 128;
|
|
|
|
static const int MAX_DATASIZE = 128*64;
|
|
|
|
|
2011-04-13 18:37:12 +00:00
|
|
|
int m_aTypes[MAX_EVENTS]; // TODO: remove some of these arrays
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_aOffsets[MAX_EVENTS];
|
|
|
|
int m_aSizes[MAX_EVENTS];
|
2013-12-31 05:13:57 +00:00
|
|
|
int64_t m_aClientMasks[MAX_EVENTS];
|
2010-05-29 07:25:38 +00:00
|
|
|
char m_aData[MAX_DATASIZE];
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CGameContext *m_pGameServer;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int m_CurrentOffset;
|
|
|
|
int m_NumEvents;
|
|
|
|
public:
|
|
|
|
CGameContext *GameServer() const { return m_pGameServer; }
|
|
|
|
void SetGameServer(CGameContext *pGameServer);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
CEventHandler();
|
2013-12-31 05:13:57 +00:00
|
|
|
void *Create(int Type, int Size, int64_t Mask = -1LL);
|
2010-05-29 07:25:38 +00:00
|
|
|
void Clear();
|
|
|
|
void Snap(int SnappingClient);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|