Skip to content

Commit

Permalink
Fix shutdown exceptions (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVeryStarlk committed Mar 3, 2024
1 parent 5aa2869 commit 6e363ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Obsidian/Services/PacketBroadcaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -96,7 +96,6 @@ public interface IPacketBroadcaster
/// <param name="excludedIds">The list of entity ids to exlude from the broadcast.</param>
public void Broadcast(IClientboundPacket packet, params int[] excludedIds);


/// <summary>
/// Sends the packets directly to connected clients without processing in a queue.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Obsidian/WorldData/WorldManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected async override Task ExecuteAsync(CancellationToken stoppingToken)
await Task.WhenAll(this.worlds.Values.Cast<World>().Select(x => x.ManageChunksAsync()));
}
}
catch (Exception ex)
catch (Exception ex) when (ex is not OperationCanceledException)
{
await this.serverEnvironment.OnServerCrashAsync(this.logger, ex);
}
Expand Down

0 comments on commit 6e363ba

Please sign in to comment.