#include "Main.h" //Uncomment the line below to receive info on how to fix character creation #define HELPME_FIX_CHARACTER_CREATION //Extracts the glue from the existing replay data void ExtractGlue(unsigned char* pData, int ds, PLAYER_DATA* pLir) { for (int i=0; ids-1){} else { unsigned char *t=pData+i+2; if (memcmp(t, &pLir->pCharCreate->streamGlue, 2)==0) { memcpy(&pLir->pCharCreate->PosGlue, (pData+i+8), 2); } } } } #ifdef HELPME_FIX_CHARACTER_CREATION gCoreLog.LogKnownData("ItemPosGlue", (unsigned char*)&pLir->pCharCreate->PosGlue, 2); #endif return; } //Extracts the glue body part or something from the replay data //NOTE: If this appears as CD CD in a dump check Data2 or A34Data //which file contains this seems to change. void ExtractGlueBp(unsigned char* pData, int ds, PLAYER_DATA* pLir) { for (int i=ds-1; i>=0; i--) { if (memcmp(&ServerOpcode(6), pData+i, 2)==0) { if (i+8>ds-1){} else { unsigned char *t=pData+i+2; if (memcmp(t, &pLir->pCharCreate->streamGlue, 2)==0) { memcpy(&pLir->pCharCreate->bpGlue, (pData+i+8), 2); break; } } } } #ifdef HELPME_FIX_CHARACTER_CREATION gCoreLog.LogKnownData("ItemBPGlue", (unsigned char*)&pLir->pCharCreate->bpGlue, 2); #endif } //Extracts the divider glue from the replay data. void ExtractDivGlue(unsigned char* pData, int ds, PLAYER_DATA* pLir) { for (int i=0; ids-1){} else { unsigned char *t=pData+i+7; short t2=0; if (memcmp(t, &t2, 2)==0) { memcpy(&pLir->pCharCreate->itemDivGlue, (pData+i+2), 2); break; } } } } #ifdef HELPME_FIX_CHARACTER_CREATION gCoreLog.LogKnownData("ItemDivGlue", (unsigned char*)&pLir->pCharCreate->itemDivGlue, 2); #endif } //We have received an intermediary packet that is 2 bytes int HandleOpcode_CHARCREATE_ACKNOWLEDGEMENT(NetMessage* pData, PLAYER_DATA* pLir) { char file[200]; sprintf(file, "Data/Packets/CharacterCreation/"); gPacketManager.DirSwitch(file); NetMessage s; s.networkId=pData->networkId; bool extracted_stream_glue=false; while((s.pData=gPacketManager.GetData("Data2", &s.dataSize, 2920))!=NULL) { if (!extracted_stream_glue) { memcpy(&pLir->pCharCreate->streamGlue, s.pData+2, 2); extracted_stream_glue=true; } gpGameServer->SendData(&s); }//*/ //LogKnownData("Stream Glue", (unsigned char*)&lir->charCreate->streamGlue, 2); short ds=0; unsigned char* pPckData=gPacketManager.GetData("Data2", &ds); ExtractGlue(pPckData, ds, pLir); ExtractDivGlue(pPckData, ds, pLir); pPckData=gPacketManager.GetData("A34Data1", &ds); ExtractGlueBp(pPckData, ds, pLir); gCoreLog.debug("Got intermediary!"); return 2; }