diff --git a/MMOTestServer/MMOserver/Api/BossRaidResult.cs b/MMOTestServer/MMOserver/Api/BossRaidResult.cs index 4a9c629..fb03ea4 100644 --- a/MMOTestServer/MMOserver/Api/BossRaidResult.cs +++ b/MMOTestServer/MMOserver/Api/BossRaidResult.cs @@ -4,10 +4,39 @@ namespace MMOserver.Api; // API 응답(BossRaidAccessResponse)을 직접 노출하지 않고 이걸로 매핑해서 반환 public sealed class BossRaidResult { - public int RoomId { get; init; } - public string SessionName { get; init; } = string.Empty; - public int BossId { get; init; } - public List Players { get; init; } = new(); - public string Status { get; init; } = string.Empty; - public string? Tokens { get; init; } + public int RoomId + { + get; + init; + } + + public string SessionName + { + get; + init; + } = string.Empty; + + public int BossId + { + get; + init; + } + + public List Players + { + get; + init; + } = new(); + + public string Status + { + get; + init; + } = string.Empty; + + public Dictionary Tokens + { + get; + init; + } = new(); } diff --git a/MMOTestServer/MMOserver/Api/RestApi.cs b/MMOTestServer/MMOserver/Api/RestApi.cs index 7c418ec..c3cefbe 100644 --- a/MMOTestServer/MMOserver/Api/RestApi.cs +++ b/MMOTestServer/MMOserver/Api/RestApi.cs @@ -79,7 +79,7 @@ public class RestApi : Singleton { try { - HttpResponseMessage response = await httpClient.PostAsJsonAsync(url, new { usernames = userNames, bossId }); + HttpResponseMessage response = await httpClient.PostAsJsonAsync(url, new { usernames = userNames, bossId = bossId }); // 401: API 키 인증 실패 if (response.StatusCode == HttpStatusCode.Unauthorized) @@ -166,10 +166,10 @@ public class RestApi : Singleton } [JsonPropertyName("tokens")] - public string? Tokens + public Dictionary Tokens { get; set; - } + } = new(); } } diff --git a/MMOTestServer/MMOserver/Game/GameServer.cs b/MMOTestServer/MMOserver/Game/GameServer.cs index 4318702..f14ddac 100644 --- a/MMOTestServer/MMOserver/Game/GameServer.cs +++ b/MMOTestServer/MMOserver/Game/GameServer.cs @@ -1144,10 +1144,16 @@ public class GameServer : ServerBase SendTo(memberPeer, PacketSerializer.Serialize((ushort)PacketCode.CHANGE_MAP, response)); // 모두에게 레이드로 이동 (할당된 실제 레이드 맵 ID 전달) - SendTo(peer, - PacketSerializer.Serialize((ushort)PacketCode.INTO_BOSS_RAID, - new IntoBossRaidPacket - { RaidId = assignedRaidMapId, IsSuccess = true, Session = result.SessionName, Token = result.Tokens })); + if (result.Tokens.ContainsKey(memberPlayer.Nickname.Trim())) + { + SendTo(peer, + PacketSerializer.Serialize((ushort)PacketCode.INTO_BOSS_RAID, + new IntoBossRaidPacket + { + RaidId = assignedRaidMapId, IsSuccess = true, Session = result.SessionName, + Token = result.Tokens[memberPlayer.Nickname.Trim()] + })); + } } Log.Debug("[GameServer] INTO_BOSS_RAID HashKey={Key} PartyId={PartyId} AssignedRaidMapId={RaidId}", hashKey, party.PartyId,