henpemaz / Rain-Meadow

Rain World multiplayer engine and custom game mode
121 stars 16 forks source link

Graceful kick when lobby owner quits the game/lobby #111

Open Chrometurtle opened 7 months ago

Chrometurtle commented 7 months ago

When the lobby owner leaves the lobby or exits the game. gracefully kick the other players

6fears7 commented 6 months ago

We have logic for OnPlayerDisconnet to pass ownership of the world to another player and enable the game to continue instead of kicking players:

        public void OnPlayerDisconnect(OnlinePlayer player)
        {
            if (this is Lobby lobby && owner == player) // lobby owner has left
            {
                RainMeadow.Debug($"Lobby owner {player} left!!!");
                NewOwner(MatchmakingManager.instance.GetLobbyOwner());
            }

However, we should add implementation here when a player leaves to strip their character from the world similar to how they are removed in the Region Gates logic so they're not "ghosting".

We will also want a real disconnect from the game so that #78 should be resolved.

Chrometurtle commented 6 months ago

related to #92 as well