Files
SVSimServer/SVSim.EmulatedEntrypoint/Models/Dtos/Guild/GuildUpdateResponse.cs
gamer147 09104f4e73 fix(guild): /guild/update response — flat detail under guild (matches GuildUpdateTask.Parse)
GuildUpdateTask.Parse() reads data[guild] as GuildDetailInfo directly; the previous
GuildDetailSubTree wrapper (data[guild][detail]) caused json[guild_id].ToInt() to
crash on the client. Split GuildUpdateResponse (flat) from GuildUpdateEmblemResponse
(nested, correct for GuildEmblemUpdateTask.Parse). Also surfaces guild_name from the
request through UpdateGuildRequest.Name -> service -> repo so the client rename is honoured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 12:54:15 -04:00

35 lines
1001 B
C#

using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Response for POST /guild/update.
/// GuildUpdateTask.Parse() reads data["guild"] directly as GuildDetailInfo — flat, no "detail" wrapper.
/// </summary>
[MessagePackObject]
public class GuildUpdateResponse
{
[JsonPropertyName("guild"), Key("guild")]
public GuildDetailDto Guild { get; set; } = new();
}
/// <summary>
/// Response for POST /guild/update_emblem.
/// GuildEmblemUpdateTask.Parse() reads data["guild"]["detail"] — requires the nested wrapper.
/// </summary>
[MessagePackObject]
public class GuildUpdateEmblemResponse
{
[JsonPropertyName("guild"), Key("guild")]
public GuildDetailSubTree Guild { get; set; } = new();
}
[MessagePackObject]
public class GuildDetailSubTree
{
[JsonPropertyName("detail"), Key("detail")]
public GuildDetailDto Detail { get; set; } = new();
}