Open PeanutButterRat opened 6 months ago
Hey there! I've still not used the MultiplayerPeer stuff but yeah, it should definitely reset that, I'd think. I'll check it out!
After cross referencing with ENetMultiplayerPeer, it looks like some other state should probably be reset as well such as flushing any incoming packets. https://github.com/godotengine/godot/blob/b7feebefabc2d48b0d4794cd31fc141f1caecc5c/modules/enet/enet_multiplayer_peer.cpp#L294
Yeah, looks like there are a few big differences indeed. Seems like something that should be patched in.
Describe the bug SteamMultiplayerPeer will complain that the user is still in a lobby even after calling close(). This prevents the user from joining another lobby and forces the creation of another SteamMultiplayerPeer object.
To Reproduce Steps to reproduce the behavior:
Expected behavior I expect the multiplayer peer to create a different lobby and connect the user to that one instead.
Screenshots Initial state before joining a lobby. After clicking on "Create" which calls SteamMultiplayerPeer.create_lobby() and updates the lobby ID. After clicking on "Leave" which calls SteamMultiplayerPeer.close() and clears the lobby ID. After clicking on "Create" again. Notice that the lobby ID is still "None". The error that is displayed in the terminal.
Desktop (please complete the following information):
Version of Godot: Godot Engine v4.3.dev.custom_build.d00734053
Version of GodotSteam: GodotSteam Multiplayer Peer 4.8 (Module) (Latest Version)
Additional context I think the fix is very simple, just add a line to reset the lobby_state in the close method back to disconnected.