Server will crash if primeshop is clicked in epilogue client

Issue #11 resolved
Former user created an issue

in gracia epilogue, the server will crash after clicking primeshop, if disableing

        //case 0x78: opcodeExRemapped = 0x65; break;
        //case 0x79: opcodeExRemapped = 0x66; break;
        //case 0x7A: opcodeExRemapped = 0x67; break;
        //case 0x7B: opcodeExRemapped = 0x68; break;

inside of CUserSocket::InGamePacketExHandlerWrapper

i disabled it, as it was mapping the packet back to its old handler, causeing it to also trigger Mail packets ( i started working on a mail system ) , the crash then comes in CUserSocket::CallPacketExHandler, i can only assume because it is trying to call 0x78 packethandlers then

i fixed it with a quick and dirty fix by useing

        case 0x0E: return GraciaEpilogue::RequestExEnchantSkillInfo(this, packet, opcode);
        case 0x33: return GraciaEpilogue::RequestExEnchantSkillUntrain(this, packet, opcode);
        case 0x46: return GraciaEpilogue::RequestExEnchantSkillInfoDetail(this, packet, opcode);
        case 0x65: return CMailSystem::RequestPostItemList(this, packet, opcode);
        case 0x66: return CMailSystem::RequestSendMail(this, packet, opcode);
        case 0x67: return CMailSystem::RequestShowPostList(this, packet, opcode);
        case 0x68: return CMailSystem::RequestDeleteReceivedPost(this, packet, opcode);
        case 0x69: return CMailSystem::RequestReadReceivedPost(this, packet, opcode);
        case 0x6A: return CMailSystem::RequestMailClaimItems(this, packet, opcode);
        case 0x6B: return CMailSystem::RequestReturnReceivedPost(this, packet, opcode);
        case 0x6C: return CMailSystem::RequestShowSentPostList(this, packet, opcode);
        case 0x6D: return CMailSystem::RequestDeleteSentPost(this, packet, opcode);
        case 0x6E: return CMailSystem::RequestReadSentPost(this, packet, opcode);
        case 0x6F: return CMailSystem::RequestCancelSentPost(this, packet, opcode);




            //fix opcodes for some changed packets between GF and ct2.4
        case 0x78: return CUserSocket::exHandlers[0x65](this, packet, opcode);
        case 0x79: return CUserSocket::exHandlers[0x66](this, packet, opcode);
        case 0x7A: return CUserSocket::exHandlers[0x67](this, packet, opcode);
        case 0x7B: return CUserSocket::exHandlers[0x68](this, packet, opcode);

inside of CUserSocket::CallPacketExHandler

Comments (4)

  1. Emca

    I wanted to keep all existing internal opcodes intact so the idea was using higher opcodeEx for new packets, for example if I want to add epilogue packet 0x68:

    CUserSocket::InGamePacketExHandlerWrapper:

        case 0x68: opcodeExRemapped = 0x69; break;
    

    and then handle "new" packet 0x69 in CUserSocket::CallPacketExHandler

    Please, do it this way so opcodes inside of CUserSocket::CallPacketExHandler won't be dependent on chronicle.

    I assume you have an account on maxcheaters, can you please send me PM there?

  2. Emca

    Mail system already implemented, in case anyone needs to add another packet, just follow the way it's done for mail system :) Closing this as resolved :)

  3. Log in to comment