2 Commits

Author SHA1 Message Date
qornwh1
c27e8464b4 fix : 채널 버그 수정 2026-03-05 16:34:52 +09:00
qornwh1
d4c5a70a39 fix : 채널 버그 수정 2026-03-05 16:34:33 +09:00
2 changed files with 16 additions and 2 deletions

View File

@@ -47,8 +47,11 @@ public class ChannelManager
public bool RemoveUser(long userId)
{
// 채널 있으면
int channelId = connectUsers[userId];
// 채널에 없는 유저면 스킵
if (!connectUsers.TryGetValue(userId, out int channelId))
{
return false;
}
// 날린다.
if (channelId >= 0)

View File

@@ -299,6 +299,17 @@ public class GameServer : ServerBase
IntoChannelPacket packet = Serializer.Deserialize<IntoChannelPacket>(new ReadOnlyMemory<byte>(payload));
ChannelManager cm = ChannelManager.Instance;
Channel.Channel channel = cm.GetChannel(packet.ChannelId);
// 최대 인원 체크
if (channel.UserCount >= channel.UserCountMax)
{
Log.Warning("[GameServer] INTO_CHANNEL 채널 인원 초과 HashKey={Key} ChannelId={ChannelId} UserCount={Count}/{Max}",
hashKey, packet.ChannelId, channel.UserCount, channel.UserCountMax);
byte[] full = PacketSerializer.Serialize<IntoChannelPacket>((ushort)PacketCode.INTO_CHANNEL, new IntoChannelPacket { ChannelId = -1 });
SendTo(peer, full);
return;
}
// TODO: 실제 서비스에서는 DB/세션에서 플레이어 정보 로드 필요
Player newPlayer = new Player