From 85c3276207c7c0c83f3915cfac7b9fb701459300 Mon Sep 17 00:00:00 2001 From: qornwh1 Date: Thu, 5 Mar 2026 17:04:50 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EC=84=B8=EC=85=98=20=EB=81=8A?= =?UTF-8?q?=EA=B8=B8=EB=95=8C=20=EA=B0=99=EC=9D=80=20=EC=B1=84=EB=84=90?= =?UTF-8?q?=EC=97=90=20=EB=82=98=EA=B0=80=EB=8A=94=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=EB=B3=B4=EB=83=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MMOTestServer/MMOserver/Game/GameServer.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MMOTestServer/MMOserver/Game/GameServer.cs b/MMOTestServer/MMOserver/Game/GameServer.cs index fa31520..cf637c1 100644 --- a/MMOTestServer/MMOserver/Game/GameServer.cs +++ b/MMOTestServer/MMOserver/Game/GameServer.cs @@ -147,10 +147,22 @@ public class GameServer : ServerBase protected override void OnSessionDisconnected(NetPeer peer, long hashKey, DisconnectInfo info) { ChannelManager cm = ChannelManager.Instance; + + // 제거 전에 채널/플레이어 정보 저장 (브로드캐스트에 필요) + int channelId = cm.HasUser(hashKey); + Player? player = channelId >= 0 ? cm.GetChannel(channelId).GetPlayer(hashKey) : null; + if (cm.RemoveUser(hashKey)) { Log.Information("[GameServer] 세션 해제 HashKey={Key} Reason={Reason}", hashKey, info.Reason); + + // 같은 채널 유저들에게 나갔다고 알림 + if (channelId >= 0 && player != null) + { + SendExitChannelPacket(peer, hashKey, channelId, player); + } } + UuidGeneratorManager.Instance.Release(hashKey); }