From adaa272d0592fafd4087e2cf9d2601018789a4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=82ngelo=20Tadeucci?= Date: Thu, 26 Jun 2025 20:14:04 -0300 Subject: [PATCH] Fix: dungeon migrating --- Maple2.Server.Core/Network/Session.cs | 5 +++++ Maple2.Server.Game/PacketHandlers/DungeonRoomHandler.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Maple2.Server.Core/Network/Session.cs b/Maple2.Server.Core/Network/Session.cs index 53df37c9b..a3fe226a4 100644 --- a/Maple2.Server.Core/Network/Session.cs +++ b/Maple2.Server.Core/Network/Session.cs @@ -211,6 +211,11 @@ private async Task ReadRecvPipe(PipeReader reader) { reader.AdvanceTo(buffer.Start, buffer.End); } while (!disposed && !result.IsCompleted); } catch (Exception ex) { + if (ex is InvalidOperationException invalidOperation && invalidOperation.Message.Contains("reader was completed")) { + // Ignore this exception, it happens when the reader is completed, either by the client closing or by the session being disposed. + // it's not a real error + return; + } if (!disposed) { Logger.Error(ex, "Exception reading recv packet"); } diff --git a/Maple2.Server.Game/PacketHandlers/DungeonRoomHandler.cs b/Maple2.Server.Game/PacketHandlers/DungeonRoomHandler.cs index 055181a33..327993f78 100644 --- a/Maple2.Server.Game/PacketHandlers/DungeonRoomHandler.cs +++ b/Maple2.Server.Game/PacketHandlers/DungeonRoomHandler.cs @@ -1,12 +1,13 @@ using Maple2.Database.Storage; using Maple2.PacketLib.Tools; using Maple2.Server.Core.Constants; +using Maple2.Server.Core.PacketHandlers; using Maple2.Server.Game.PacketHandlers.Field; using Maple2.Server.Game.Session; namespace Maple2.Server.Game.PacketHandlers; -public class DungeonRoomHandler : FieldPacketHandler { +public class DungeonRoomHandler : PacketHandler { public override RecvOp OpCode => RecvOp.RoomDungeon; private enum Command : byte {