/* ==================================================================== * ÆÄ ÀÏ : 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 "serverProtocol.h" #include "logprotocol.h" #include "packetpool.h" class cRudpProcess : public IocpRudp { private: PacketPool* mPacketPool; SOCKADDR_IN mLogin; u_long mLoginSeq; IoContextBuffer* mLoginBuffer; SOCKADDR_IN mGame; u_long mGameSeq; IoContextBuffer* mGameBuffer; SOCKADDR_IN mLog; u_long mLogSeq; IoContextBuffer* mLogBuffer; public: // LOG °ü·Ã ¸Þ¼Òµå. bool PostServerEvent ( LPCTSTR format, ... ); bool PostServerEvent ( char* message ); bool PostMemberEvent ( char type, char category, long memberIdx, char* message ); bool PostCharacterEvent ( char category, long memberIdx, long serverIdx, long characterIdx, char _level, long _exp, char _skillLevel, long _skillExp, long _skillPoint, char* message ); bool PostMoneyEvent ( long serverIdx, long characterIdx, long before, long after, char* message ); bool PostDepositEvent ( long serverIdx, long characterIdx, long before, long after, char* message ); bool PostInventoryEvent ( long serverIdx, char category, long inventoryIdx, long characterIdx, long itemDefineIndex, short number, short count, BYTE enhanced, BYTE seal, char* message ); bool PostQuestEvent ( long serverIdx, char category, long characterIdx, long questIdx, char* message ); bool PostGuildEvent ( long serverIdx, long characterIdx, long guildIdx, char guildPosition, char* message ); bool PostDropItemEvent ( long serverIdx, long channelNum, sDropItem* pDropItem, unsigned long count ); bool PostSkillEvent ( long serverIdx, long characterIdx, bool isReset, long skillIdx, char skillStep ); public: // Login °ü·Ã ¸Þ¼Òµå. bool PostChStatus ( long cid, BYTE status ); public: // Game °ü·Ã ¸Þ¼Òµå. bool PostServerNotice ( long cid, wchar_t* message, u_int length ); bool PostChatShout ( long cid, unsigned short numOfMap, long characterIdx, wchar_t* name, wchar_t* message, u_int length ); bool PostPVPStatus ( long cid, BYTE status, unsigned char pvpType ); bool PostPVPNotice ( long cid, unsigned char leftMinute, unsigned char pvpType ); bool PostPVPPlayerList ( long cid, char* msg, int len ); bool PostThemeStatus ( long cid, BYTE status ); bool PostThemeInvite ( long cid, short themeIdx, short roomIdx, long requestor, long characterIdx, char* msg, int len ); bool PostThemeInviteRes ( long cid, long requestor, wchar_t* name, char errorCode ); bool PostGuildSync ( long cid, char* msg, int len ); bool PostGuildConnectSync ( long cid ); bool PostMonsterSync ( long cid, char* msg, int len ); bool PostChatSync ( long cid, char* msg, int len ); bool PostPostReceived ( long cid, long characterIdx ); 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_long& seq ); bool SendPacket ( void* handle, unsigned long length=0 ); void GetRegisterDate ( TIMESTAMP_STRUCT* ts ); DWORD BackendThread ( ); public: // Ŭ·¡½º ÆÄ±« ¸Þ¼Òµå. virtual ~cRudpProcess(void); }; #endif // __RUDP_PROCESS_H__