#ifndef GW_SERVER_H_ #define GW_SERVER_H_ #define ushort unsigned short #define ulong unsigned long #define uchar unsigned char #ifdef WIN32 #define STDEXT stdext #pragma comment(lib, "../src/hnl/HawkNL.lib") #endif #include "hnl/nl.h" #include "IdGenerator.h" #include #include #define MAX_SOCKETS 30000 #define myBitSet(val, bit) (val=val | bit) #define myBitClr(val, bit) (val=val & (~bit)) #define myBitTest(val, bit) ((val & bit)==bit) struct ENCRYPTION_STATE { unsigned long offset1; unsigned long offset2; unsigned char key[264]; }; struct GwClient { NLsocket mySocket; ushort externalId; std::vector outBuffer; std::vector inBuffer; ENCRYPTION_STATE encryptionState; bool usingEncryption; ulong eByteCounter; void PushIn(void* pBuffer, int bufferSize) { uchar* pBuf=(uchar*)pBuffer; for(int i=0; i mClients; STDEXT::hash_map mOpcodesTable; int (*mpClientConnected)(GwClient* pClient); int (*mpClientDisconnected)(GwClient* pClient); int (*mpPacketProcessing)(uchar* pData, ulong dataSize, GwClient* pClient); }; #endif