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

complete_auth() uses old id on reconnect if rpc is called in last connection. #86692

Closed
Braxtogoo opened this issue Jan 1, 2024 · 1 comment

Comments

@Braxtogoo
Copy link

Braxtogoo commented Jan 1, 2024

Tested versions

  • Reproducible in: v4.2.1.stable.official [b09f793]

System information

Godot v4.2.1.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.3742) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)

Issue description

While attempting to add a password system to my game using the auth API provided by SceneMultiplayer I encountered an issue in which if a client leaves after calling an RPC and reconnects the server will use their previous id in complete_auth(id) despite being given their new id. This happens when calling it directly and using call_deferred(). I've made sure id is not declared anywhere outside the functions and logging suggests that it should be receiving the new id.

(Blue numbers are what I assume the order of execution to roughly be.)
image

(Note that the logging message and the complete_auth() have the same id variable, suggesting the second connection should have used 2049066911 not the old id 1865169831.)
image

Steps to reproduce

-Create a simple multiplayer game.
-Use auth tools provided by SceneMultiplayer.
-Have a client connect.
-Have client call RPC.
-Have client disconnect.
-Have client attempt reconnect.

Minimal reproduction project (MRP)

-Open project.
-Start 2 instances.
-Select "Host" on one instance to make it the server.
-Select "Join" on the other instance to make it a client, the client will automatically call an RPC.
-Select "Leave" on the client.
-Select "Join" on the client again to see the bug.

Commenting out the RPC call makes the bug go away. Commenting out the auth bindings in _ready() also makes the bug go away. The issue arises when both are done. If host is restarted the client can connect again, but still only once.

Auth_Error.zip

@Braxtogoo
Copy link
Author

Just did a test on v4.3.dev2.official [3524346] after reading about #86257 on the blog. The issue seems to be resolved.

My bad, should have checked pull requests as well as issues, looks like I should also join the discord, excited to use this in the next full release!

@AThousandShips AThousandShips added this to the 4.3 milestone Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants