/* ==================================================================== * ÆÄ ÀÏ : rudpprocess.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : °ûöÁß * ÀÛ ¼º ÀÏ : 09/08/31 * ÁÖÀÇ»çÇ× : * =================================================================== */ #ifndef __RUDP_PROCESS_H__ #define __RUDP_PROCESS_H__ //#ifndef WINVER //#define WINVER 0x0500 //#endif // //#ifndef _WIN32_WINNT //#define _WIN32_WINNT 0x0500 //#endif #pragma once #include "iocprudp.h" #include "packetpool.h" #include "serverProtocol.h" #include "logprotocol.h" #include "servermanager.h" class cRudpProcess : public IocpRudp { private: PacketPool* mPacketPool; SOCKADDR_IN mGame; u_short mGameSeq; IoContextBuffer* mGameBuffer; SOCKADDR_IN mLog; u_short mLogSeq; IoContextBuffer* mLogBuffer; public: // Log °ü·Ã ¸Þ¼Òµå. void GetRegisterDate ( TIMESTAMP_STRUCT* ts ); bool PostServerEvent ( LPCTSTR format, ... ); bool PostServerEvent ( char* message ); bool PostMemberEvent ( char type, char category, long memberIdx, char* message ); bool PostConcurrentEvent ( long serverIdx, long minimum, long maximum, char* message ); public: // Game °ü·Ã ¸Þ¼Òµå. bool PostChSync ( ); bool PostChList ( ServerTable* root ); bool PostChStatus ( long cid, BYTE status ); private: // ¼­¹ö °ü·Ã ¸Þ¼Òµå - º¸Á¶. bool BatchComplete ( MSGBUF* msgBuf, int msgLen ); private: // ¼­¹ö °ü·Ã ¸Þ¼Òµå - ÁÖ. bool RecvComplete ( ULONG_PTR completionKey, PerIoContext* perIoContext, DWORD bytesTransferred ); bool SendComplete ( ULONG_PTR completionKey, PerIoContext* perIoContext, DWORD bytesTransferred ); public: // Ŭ·¡½º »ý¼º ¹× °ø¿ë ¸Þ¼Òµå. cRudpProcess(void); bool Initialize ( char* recv="", char* send="", unsigned short port=14700, unsigned short numWorkerThreads=2 ); void Shutdown ( DWORD maxWait=INFINITE ); bool ReSendExec ( u_long addr, u_short port, u_long seq ); bool SendReliable ( u_long addr, u_short port, u_long seq ); char* GetPacket ( void** handle, char tos, SOCKADDR_IN addr, u_short& seq ); bool SendPacket ( void* handle, unsigned long length=0 ); DWORD BackendThread ( ); public: // Ŭ·¡½º ÆÄ±« ¸Þ¼Òµå. virtual ~cRudpProcess(void); }; #endif // __RUDP_PROCESS_H__