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); }