Skip to content

Commit

Permalink
Server closed message (#421)
Browse files Browse the repository at this point in the history
* Should fix #251

* Fixes #418

* Update Server.cs

* Disconnect players with a "Server closed" message when closing the server
  • Loading branch information
TheVeryStarlk authored Feb 7, 2024
1 parent 6efa497 commit e17d4e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Obsidian/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ await player.SendSoundAsync(SoundEffectBuilder.Create(SoundId.EntitySheepAmbient
// Just stop looping.
}

foreach (var client in _clients)
{
client.SendPacket(new DisconnectPacket(ChatMessage.Simple("Server closed"), client.State));
}

_logger.LogInformation("The game loop has been stopped");
await WorldManager.FlushLoadedWorldsAsync();
}
Expand Down

0 comments on commit e17d4e0

Please sign in to comment.