Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player-data-struct: move 'game' variable to inside the PlayerData struct #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hex-agon
Copy link
Contributor

@hex-agon hex-agon commented Jun 22, 2023

Move the Game variable from the PlayerMainData to the PlayerData struct. This is due that the PlayerData struct is also present when replying to the User Info Request packet in the following packet: https://packets.pangdox.com/packets/gameservice/server/0157.html

If we omit the Game from the struct and open the My Info tab we can observe alignment issues:
image

By moving the variable we can see the correct alignment:
image

Note: i did not test this with the pangbox server but with my own, though i do not expect any issues with the change 👀

@jchv
Copy link
Contributor

jchv commented Jun 22, 2023

Interesting: It indeed looks like that construct is not 0x0044 specific. What I'd like to figure out is whether maybe it's still meant to be part of the response or part of the player data (logically speaking.) Also, I wonder if setting this to something other than -1 in 0x0044 will trigger PangYa to try to resume a disconnected game or something interesting like that.

@hex-agon
Copy link
Contributor Author

hex-agon commented Jun 22, 2023

I've tried setting the value to some random value and did not see any attempts by the client to join a room or something out of the ordinary while logging in.

A sample packet log with the Game value set to 12:

TRACE [nioEventLoopGroup-6-3] [net.GameProtocolDecoder] - Incoming packetId=0x2
TRACE [nioEventLoopGroup-6-3] [net.GameProtocolDecoder] - Incoming packetId=0x4
TRACE [nioEventLoopGroup-6-3] [net.GameProtocolDecoder] - Incoming packetId=0x16e
TRACE [nioEventLoopGroup-6-3] [net.GameProtocolDecoder] - Incoming packetId=0x16f

Maybe the original server is serializing the whole struct instead of just partially?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants