Repository navigation
fix: exc_list items parse one per sub-packet, and req_exc is accepted mid-trade (21.1.3) - #541
Conversation
… mid-trade (21.1.3) A trailing sub-packet list whose fields are space-separated counted one item per token, so `exc_list 21 44 10 53 21 2 87 55` produced six entries: the two real offers followed by four default (Equipment, 0, 0) fillers. The item count is now tokens / fields-per-sub-packet. req_exc confirm and cancel are only ever sent while a trade is open, but the header only allowed InGame, so the scope gate dropped them before any handler ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe ChangesExchange request scope
Exchange list deserialization
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
Summary
ExcListPacket.SubPackets) counted one item per token instead of one per sub-packet.exc_list 21 44 10 53 21 2 87 55(the serializer corpus' own output) deserialized to six entries: two real offers, then four defaultEquipment/0/0fillers. The count is nowtokens / (PropertyAmount + 1), rounded up so a partial trailing item still parses as before. Dotted sub-packet lists and lists with an explicitLengthdon't take this branch.req_excscope:Confirmed/Cancelledare only sent while a trade is open, but the header wasInGameonly, so NosCore's scope gate dropped them before the handler. It is nowInGame | InTrade. While trading, the other request types are already refused by the handler (Requested→ trading with someone else,List→OpenExchangefails, shops return early).Needed by NosCoreIO/NosCore#2427, which currently works around both in the server.
Test plan
dotnet test test/NosCore.Packets.Tests: 131/131exc_listwith two and one offers yields exactly two and one items with the right fieldsreq_excdeclaresInTradereq_exc→InTrade | InGame)🤖 Generated with Claude Code
Summary by CodeRabbit