Skip to content

[Log] Attribute each packet dump to its session instead of "SOCKET: 0" - #473

Merged
billy1arm merged 1 commit into
mangoszero:masterfrom
H0zen:fix/packet-dump-session-id
Aug 6, 2026
Merged

[Log] Attribute each packet dump to its session instead of "SOCKET: 0"#473
billy1arm merged 1 commit into
mangoszero:masterfrom
H0zen:fix/packet-dump-session-id

Conversation

@H0zen

@H0zen H0zen commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

WorldGateway::TracePacket passed a hardcoded 0 for the socket field, so every packet of every client was logged under the same id. With two clients connected the dump is one interleaved stream that cannot be taken apart, which defeats the purpose: the question a packet dump is usually asked is what ONE observer was handed, and when.

Thread the connection's SessionId through IWorldGateway::TracePacket and print it as SESSION. The field is 0 only for the pre-auth handshake, which has no session yet.

ClientConnection keeps an atomic copy of the id for tracing. SendPacket traces while holding m_sendOrderLock, and reading m_session there would take m_sessionLock under it, inverting the order HandleAuthSession uses.


This change is Reviewable

WorldGateway::TracePacket passed a hardcoded 0 for the socket field, so every
packet of every client was logged under the same id. With two clients connected
the dump is one interleaved stream that cannot be taken apart, which defeats the
purpose: the question a packet dump is usually asked is what ONE observer was
handed, and when.

Thread the connection's SessionId through IWorldGateway::TracePacket and print it
as SESSION. The field is 0 only for the pre-auth handshake, which has no session
yet.

ClientConnection keeps an atomic copy of the id for tracing. SendPacket traces
while holding m_sendOrderLock, and reading m_session there would take
m_sessionLock under it, inverting the order HandleAuthSession uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@AppVeyorBot

Copy link
Copy Markdown

@billy1arm
billy1arm merged commit 5f5bbc8 into mangoszero:master Aug 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants