fix: merge conflict 해결 — BossRaid 토큰 Dictionary 처리 및 개별 전송
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using LiteNetLib;
|
||||
using MMOserver.Config;
|
||||
using MMOserver.Utils;
|
||||
|
||||
namespace MMOserver.Game.Channel;
|
||||
@@ -8,16 +9,12 @@ public class ChannelManager : Singleton<ChannelManager>
|
||||
// 채널 관리
|
||||
private Dictionary<int, Channel> channels = new Dictionary<int, Channel>();
|
||||
|
||||
// 보스 레이드 채널
|
||||
private readonly int bossChannelStart = 10000;
|
||||
private readonly int bossChannelSize = 10;
|
||||
|
||||
// 채널별 유저 관리 (유저 key, 채널 val)
|
||||
private Dictionary<int, int> connectUsers = new Dictionary<int, int>();
|
||||
|
||||
public ChannelManager()
|
||||
{
|
||||
Initializer();
|
||||
Initializer(AppConfig.Server.ChannelCount);
|
||||
}
|
||||
|
||||
public void Initializer(int channelSize = 1)
|
||||
@@ -26,13 +23,6 @@ public class ChannelManager : Singleton<ChannelManager>
|
||||
{
|
||||
channels.Add(i, new Channel(i));
|
||||
}
|
||||
|
||||
// 보스 채널 생성
|
||||
for (int i = 1; i <= bossChannelSize; i++)
|
||||
{
|
||||
int bossChannel = i + bossChannelStart;
|
||||
channels.Add(bossChannel, new Channel(bossChannel));
|
||||
}
|
||||
}
|
||||
|
||||
public Channel GetChannel(int channelId)
|
||||
|
||||
@@ -122,7 +122,7 @@ public class GameServer : ServerBase
|
||||
{
|
||||
// 신규 연결: 웹서버에 JWT 검증 요청
|
||||
string? username = await RestApi.Instance.VerifyTokenAsync(token);
|
||||
if (username == null)
|
||||
if (username == null || username.Trim().Length <= 0)
|
||||
{
|
||||
Log.Warning("[Server] 토큰 검증 실패 - 연결 거부 PeerId={Id}", peer.Id);
|
||||
userUuidGenerator.Release(hashKey);
|
||||
@@ -1114,7 +1114,11 @@ public class GameServer : ServerBase
|
||||
List<string> userNames = new List<string>();
|
||||
foreach (int memberId in party.PartyMemberIds)
|
||||
{
|
||||
userNames.Add(channel.GetPlayer(memberId).Nickname);
|
||||
Player? memberPlayer = channel.GetPlayer(memberId);
|
||||
if (memberPlayer != null)
|
||||
{
|
||||
userNames.Add(memberPlayer.Nickname);
|
||||
}
|
||||
}
|
||||
|
||||
BossRaidResult? result = await RestApi.Instance.BossRaidAccesssAsync(userNames, 1);
|
||||
|
||||
Reference in New Issue
Block a user