Fix QuestProgressExtended packet header overflow (C1 to C2)#789
Conversation
The QuestProgressExtended packet (0xF6, 0x0C) is 272 bytes but was declared with a C1 header. A C1 header stores its length in a single byte, so it cannot represent sizes above 255: the length was written as 272 & 0xFF = 16. Clients therefore framed only 16 bytes, the remaining 256 desynced the packet stream, and the connection dropped when a quest was started or its progress was shown. Switch the header to C2HeaderWithSubCode, matching the identically sized QuestStateExtended packet and every other server packet larger than 255 bytes. The 2-byte C2 length encodes 272 correctly. Field offsets are unchanged; the generated struct definitions are updated to match the packet definition.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a packet stream desync issue caused by an overflow in the QuestProgressExtended packet header. By switching from a single-byte C1 header to a two-byte C2 header, the system can now correctly handle the 272-byte packet size, preventing connection drops during quest updates. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the QuestProgressExtended packet and its reference counterpart to use the C2HeaderWithSubCode (header type 0xC2) instead of C1HeaderWithSubCode (header type 0xC1). This changes the packet length representation from a byte to a ushort, allowing for larger packet sizes. There are no review comments, and I have no additional feedback to provide.
The QuestProgressExtended packet (0xF6, 0x0C) is 272 bytes but was declared with a C1 header. A C1 header stores its length in a single byte, so it cannot represent sizes above 255: the length was written as 272 & 0xFF = 16. Clients therefore framed only 16 bytes, the remaining 256 desynced the packet stream, and the connection dropped when a quest was started or its progress was shown.
Switch the header to C2HeaderWithSubCode, matching the identically sized QuestStateExtended packet and every other server packet larger than 255 bytes. The 2-byte C2 length encodes 272 correctly. Field offsets are unchanged; the generated struct definitions are updated to match the packet definition.
This is the server part for sven-n/MuMain#425
Closes #779