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

Panic in ApiClient.tick when deserializing match_data message if op_code doesn't exist #8

Open
wlinna opened this issue May 18, 2021 · 0 comments

Comments

@wlinna
Copy link

wlinna commented May 18, 2021

OR maybe the title should be: op_code isn't serialized when set to zero.

I'm sending message like this:
client.socket_send(op_code, &msg::SpawnWiz { x: 0.0, y: 0.0 });

If op_code is 0, the message gets serialized to this:

{
    "match_data": {
        "match_id": "032b1d6c-b0c0-418b-bad5-8d85ecd92cdf.",
        "presence": {
            "user_id": "0a84ef9e-63fb-4f16-b33b-3d5772db4e60",
            "session_id": "3b5d3fcf-b7a0-11eb-945c-7106fdcb5b46",
            "username": "u1621318437"
        },
        "data": "AAAAAAAAAAA="
    }
}

The lack of op_code causes a panic in ApiClient.tick. If I change op_code to 1, the panic doesn't happen.

I'm using nakama-rs from GitHub and the latest nakama image from DockerHub. My version of nanoserde is 0.1.25.

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

No branches or pull requests

1 participant