diff --git a/Obsidian/Services/PacketBroadcaster.cs b/Obsidian/Services/PacketBroadcaster.cs index 7fe35cc0..dd35faff 100644 --- a/Obsidian/Services/PacketBroadcaster.cs +++ b/Obsidian/Services/PacketBroadcaster.cs @@ -71,7 +71,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) await player.client.QueuePacketAsync(queuedPacket.Packet); } } - catch (Exception e) + catch (Exception e) when (e is not OperationCanceledException) { await this.environment.OnServerCrashAsync(this.logger, e); } @@ -96,7 +96,6 @@ public interface IPacketBroadcaster /// The list of entity ids to exlude from the broadcast. public void Broadcast(IClientboundPacket packet, params int[] excludedIds); - /// /// Sends the packets directly to connected clients without processing in a queue. /// diff --git a/Obsidian/WorldData/WorldManager.cs b/Obsidian/WorldData/WorldManager.cs index 58150ed3..0cc80e00 100644 --- a/Obsidian/WorldData/WorldManager.cs +++ b/Obsidian/WorldData/WorldManager.cs @@ -57,7 +57,7 @@ protected async override Task ExecuteAsync(CancellationToken stoppingToken) await Task.WhenAll(this.worlds.Values.Cast().Select(x => x.ManageChunksAsync())); } } - catch (Exception ex) + catch (Exception ex) when (ex is not OperationCanceledException) { await this.serverEnvironment.OnServerCrashAsync(this.logger, ex); }