Here is my cristmas gift, i wanted to make a more important one, but i was lacking of time so my research was stooped many times
Code:// ------------------------------ // Decompiled by Deathway // Date : 2007-03-09 // ------------------------------ #ifndef SPROTOCOL_H #define SPROTOCOL_H #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "protocol.h" // EventControl //----------------------------- #define DRAGON_EVENT 0 #define XMAS_EVENT 1 #define FIRECRACKER_EVENT 2 #define HEARTOFLOVE_EVENT 3 #define MEDAL_EVENT 4 // OptionControl //----------------------------- #define OPTION_RELOAD 0 #define MONSTER_RELOAD 1 #define SHOP_RELOAD 2 #define ALLOPTION_RELOAD 3 #define EVENTINFO_RELOAD 4 #define ETCINFO_RELOAD 5 #define OPTION_CONTROL 6 /* * * * * * * * * * * * * * * * * * * * * * Mu JoinServer Login * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x00 */ struct SDHP_SERVERINFO { struct PBMSG_HEAD h; unsigned char Type; unsigned short Port; char ServerName[50]; unsigned short ServerCode; }; /* * * * * * * * * * * * * * * * * * * * * * Packet User Close by Id * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x05 */ struct SDHP_USERCLOSE_ID { PBMSG_HEAD h; char szId[10]; char szName[10]; unsigned short Level; unsigned char DbClass; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Id Pass Result * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x01 */ struct SDHP_IDPASSRESULT { PBMSG_HEAD h; unsigned char result; short Number; char Id[10]; int UserNumber; int DBNumber; char JoominNumber[13]; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x02 */ struct SDHP_JOINFAIL { PBMSG_HEAD h; short Number; char Id[11]; int UserNumber; int DBNumber; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x04 */ struct SDHP_COMMAND_BLOCK { PBMSG_HEAD h; short Number; char Id[11]; int UserNumber; int DBNumber; unsigned char BlockCode; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Bill Search Result * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x06 */ struct SDHP_BILLSEARCH_RESULT { PBMSG_HEAD h; char Id[10]; short Number; unsigned char cCertifyType; unsigned char PayCode; char EndsDays[12]; int EndTime; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Bill Kill User * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x07, 0x09 */ struct SDHP_BILLKILLUSER { struct PBMSG_HEAD h; char Id[10]; short Number; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x08 */ struct SDHP_OTHERJOINMSG { struct PBMSG_HEAD h; char AccountID[10]; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x20 */ struct SDHP_EXITMSG { PBMSG_HEAD h; unsigned char ExitCode[3]; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x30 */ struct SDHP_EVENTSTART { PBMSG_HEAD h; unsigned char Event; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x40 */ struct SDHP_EVENTCONTROL { PBMSG_HEAD h; unsigned char Event; unsigned char Stat; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x41 */ struct SDHP_OPTIONCONTROL { PBMSG_HEAD h; unsigned char Option; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x30 */ struct SDHP_LOVEHEARTEVENT { PBMSG_HEAD h; char Account[10]; char Name[10]; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x61 */ struct SDHP_LOVEHEARTEVENT_RESULT { PBMSG_HEAD h; unsigned char Result; char Name[10]; int Number; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x31 */ struct SDHP_LOVEHEARTCREATE { PBMSG_HEAD h; unsigned char x; unsigned char y; unsigned char MapNumber; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x62 */ struct SDHP_NOTICE { PBMSG_HEAD h; char Notice[61]; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x63 */ struct SDHP_USER_NOTICE { PBMSG_HEAD h; char szId[10]; char Notice[61]; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x7A */ struct PMSG_REQ_MAPSVRMOVE { PBMSG_HEAD h; int iIndex; char szAccountID[11]; char szCharName[11]; unsigned short wCurMapSvrCode; unsigned short wDstMapSvrCode; unsigned short wMapNumber; unsigned char btX; unsigned char btY; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x7A */ struct PMSG_ANS_MAPSVRMOVE { PBMSG_HEAD h; int iIndex; char szAccountID[11]; char szCharName[11]; unsigned short wCurMapSvrCode; unsigned short wDstMapSvrCode; unsigned short wMapNumber; unsigned char btX; unsigned char btY; int iResult; int iJoinAuthCode1; int iJoinAuthCode2; int iJoinAuthCode3; int iJoinAuthCode4; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x7B ?????????????????????????? #error */ struct PMSG_REQ_MAPSVRAUTH { PBMSG_HEAD h; int iIndex; char szAccountID[11]; char szCharName[11]; unsigned short wDstMapSvrCode; int iJoinAuthCode1; int iJoinAuthCode2; int iJoinAuthCode3; int iJoinAuthCode4; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Other Join Message * Direction : JoinServer -> GameServer * Code : 0xC1 * HeadCode : 0x7A ?????????????????????????????? #error */ struct PMSG_ANS_MAPSVRAUTH { PBMSG_HEAD h; int iIndex; char szAccountID[11]; char szCharName[11]; unsigned short wPrevMapSvrCode; unsigned short wMapNumber; unsigned char btX; unsigned char btY; int iResult; int iUserNumber; int iDBNumber; char cJoominNumber[13]; unsigned char btBlockCode; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x7C */ struct PMSG_NOTIFY_MAXUSER { PBMSG_HEAD h; int iSvrCode; int iMaxUserCount; int iCurUserCount; }; /* * * * * * * * * * * * * * * * * * * * * * Packet Join Fail * Direction : GameServer -> JoinServer * Code : 0xC1 * HeadCode : 0x60 */ struct PMSG_JG_MEMO_SEND { PWMSG_HEAD h; char Name[10]; char TargetName[10]; char Subject[32]; short MemoSize; char Memo[1000]; }; void SProtocolCore(BYTE protoNum, unsigned char* aRecv, DWORD aLen); void GJServerLogin(); void JGServerLoginResult( SDHP_RESULT * lpMsg); void GJPUserClose(char* szAccountID); void JGPAccountRequest(SDHP_IDPASSRESULT * lpMsg); void GJPAccountFail(short number, char* Id, int DBNumber, int UserNumber); void GJPAccountBlock(short number, char * Id, int DBNumber, int UserNumber, int BlockCode); void GJPBillCeckRecv(SDHP_BILLSEARCH_RESULT * lpMsg); void GJPUserKillRecv(SDHP_BILLKILLUSER * lpMsg); void JGOtherJoin(SDHP_OTHERJOINMSG * lpMsg); void GJPUserDisconnectRecv( SDHP_BILLKILLUSER * lpMsg); void GJPUserDisconnectRecv( SDHP_BILLKILLUSER * lpMsg); void JGPExitCodeRecv( SDHP_EXITMSG * lpMsg ); void JGPEventStart( SDHP_EVENTSTART * lpMsg ); void JGPEventControl( SDHP_EVENTCONTROL * lpMsg ); void JGPOptionControl( SDHP_OPTIONCONTROL * lpMsg ); void LoveHeartEventSend(int aIndex, LPSTR AcountId, LPSTR Name); void LoveHeartEventRecv( SDHP_LOVEHEARTEVENT_RESULT * lpMsg ); void LoveHeartCreateSend(); void AllNoticeRecv( SDHP_NOTICE * lpMsg); void UserNoticeRecv( SDHP_USER_NOTICE * lpMsg); void GJReqMapSvrMove(int iIndex, WORD wDesMapSvrCode, WORD wMapNumber, BYTE btX, BYTE btY); void JGAnsMapSvrMove(PMSG_ANS_MAPSVRMOVE * lpMsg); void GJReqMapSvrAuth(int iIndex, LPSTR lpszAccountID, LPSTR lpszCharName, int iJA1, int iJA2, int iJA3, int iJA4); void JGAnsMapSvrAuth(PMSG_ANS_MAPSVRAUTH * lpMsg); void GJNotifyMaxUserCount(); void JGPSendMail(PMSG_JG_MEMO_SEND * lpMsg); #endif
Code:// By Deathway void SProtocolCore(BYTE protoNum, unsigned char* aRecv, DWORD aLen) { #ifdef TRACE_PROTOCOL LogAddHeadHex("JOIN_SERVER", aRecv, aLen); #endif switch ( protoNum ) { case 0x00: JGServerLoginResult((SDHP_RESULT *)aRecv); break; case 0x01: JGPAccountRequest((SDHP_IDPASSRESULT *)aRecv); break; case 0x06: GJPBillCeckRecv((SDHP_BILLSEARCH_RESULT *)aRecv); break; case 0x07: GJPUserKillRecv((SDHP_BILLKILLUSER *)aRecv); break; case 0x08: JGOtherJoin((SDHP_OTHERJOINMSG *)aRecv); break; case 0x09: GJPUserDisconnectRecv((SDHP_BILLKILLUSER *)aRecv); break; case 0x20: JGPExitCodeRecv((SDHP_EXITMSG *)aRecv); break; case 0x30: JGPEventStart((SDHP_EVENTSTART *)aRecv); break; case 0x40: JGPEventControl((SDHP_EVENTCONTROL *)aRecv); break; case 0x41: JGPOptionControl((SDHP_OPTIONCONTROL *)aRecv); break; case 0x60: JGPSendMail((PMSG_JG_MEMO_SEND *)aRecv); break; case 0x61: LoveHeartEventRecv((SDHP_LOVEHEARTEVENT_RESULT *)aRecv); break; case 0x62: AllNoticeRecv((SDHP_NOTICE *)aRecv); break; case 0x63: UserNoticeRecv((SDHP_USER_NOTICE *)aRecv); break; case 0x7A: JGAnsMapSvrMove((PMSG_ANS_MAPSVRMOVE *)aRecv); break; case 0x7B: JGAnsMapSvrAuth((PMSG_ANS_MAPSVRAUTH *)aRecv); break; } } void GJServerLogin() { SDHP_SERVERINFO pInfo; pInfo.h.c = 0xC1; pInfo.h.size = sizeof(SDHP_SERVERINFO); pInfo.h.headcode = 0x00; pInfo.Port = GameServerPort; pInfo.Type = 1; strcpy(pInfo.ServerName , szServerName); pInfo.ServerCode = gGameServerCode; wsJServerCli.DataSend((char*)&pInfo, pInfo.h.size); } void JGServerLoginResult( SDHP_RESULT * lpMsg) { if ( lpMsg->Result == false ) { LogAdd(lMsg.Get(MSGGET(1, 210))); return; } JoinServerConnected=TRUE; gServerReady++; SendMessage(ghWnd, 0x405, 0, 0); }



Reply With Quote![Protocol Documentation [GS->JS] [JS->GS]](http://ragezone.com/hyper728.png)


