I'm having trouble allowing players to rejoin a game without closing out the game window entirely.
What I'd like to happen: in a two-player game (like pong), if Player A leaves by clicking a back button or closing the game window, the game stops. Player B is informed that Player A disconnected, and then Player B is sent back to the login layout after disconnecting from the current room. Player B can then go back to the game layout through the login layout, becoming the host for a new game. Player C joins, and the two play as normal.
This works well if Player A is the host and closes the game window: Player B can then basically make a new room as the host and play Player C.
However, if Player A is the peer and leaves, the host can not create a new room. They get stuck on the "Joined Room" step. However, a Player C can join and create a new room just fine, and they'll be the new host of that room.
Attached is an example of what's happening with just a slightly-modified pong example file: dropbox.com/s/icaz3edmv56hrun/pong%20reconnect%20example.c3p
To reproduce, open two preview windows, allow both "players" to connect and begin the game, and then close the peer window. The host will see that the peer has disconnected and then get sent back to the login layout after disconnecting from the signalling server. After trying to start a new game, the host will get stuck.
Any ideas as to how to solve this? In theory I would want to have a system like for a chess game or something: you connect with an opponent, play until one of you wins, and then you both get kicked back to the login page to play again against different opponents. Any help is appreciated! Thanks!