feat(guild): controller scaffolding + /guild/info baseline

- 5 common DTOs under Models/Dtos/Common/Guild/ (GuildDetailDto,
  GuildUserBaseDto, GuildMemberInfoDto, ChatUserDto, ChatMessageDto)
- 28 per-endpoint request/response DTOs under Models/Dtos/Guild/ and
  Models/Dtos/GuildChat/ with full [MessagePackObject]/[Key]/
  [JsonPropertyName] attribute mirrors on every property
- GuildController (22 actions): /guild/info returns prod-shape with
  config-backed max_member_num/max_sub_leader_num/usable_stamp_list;
  21 stubs return empty/default DTOs
- GuildChatController (7 stubs), /guild_chat/messages stub returns
  wait_interval=10 per config
- 29 new routing smoke test cases (100 total, all pass)
- GuildWireShape literal-JSON test for GuildInfoResponse (1/1 pass)
- GameConfigurationJsonbTests updated for 17th GuildConfig section
- Total: 1422 tests pass, 0 errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-27 12:01:27 -04:00
parent a1aa6998b8
commit 99019963ca
50 changed files with 1576 additions and 3 deletions

View File

@@ -0,0 +1,50 @@
using Microsoft.AspNetCore.Mvc;
using SVSim.Database.Services.Guild;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
using SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
namespace SVSim.EmulatedEntrypoint.Controllers;
/// <summary>/guild_chat/* — 7 endpoints. See docs/api-spec/endpoints/post-login/guild_chat-*.md.</summary>
[Route("guild_chat")]
public sealed class GuildChatController : SVSimController
{
private readonly IGuildChatService _chat;
public GuildChatController(IGuildChatService chat) => _chat = chat;
[HttpPost("messages")]
public Task<ActionResult<GuildChatMessagesResponse>> Messages([FromBody] GuildChatMessagesRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildChatMessagesResponse>>(new GuildChatMessagesResponse
{
MaintenanceCardList = new(),
Users = new(),
ChatMessage = new(),
WaitInterval = 10,
});
[HttpPost("post")]
public Task<ActionResult<GuildChatPostResponse>> Post([FromBody] GuildChatPostRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildChatPostResponse>>(new GuildChatPostResponse());
[HttpPost("add_deck")]
public Task<ActionResult<EmptyResponse>> AddDeck([FromBody] GuildChatAddDeckRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<EmptyResponse>>(new EmptyResponse());
[HttpPost("delete_deck")]
public Task<ActionResult<EmptyResponse>> DeleteDeck([FromBody] GuildChatDeleteDeckRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<EmptyResponse>>(new EmptyResponse());
[HttpPost("add_replay")]
public Task<ActionResult<EmptyResponse>> AddReplay([FromBody] GuildChatAddReplayRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<EmptyResponse>>(new EmptyResponse());
[HttpPost("replay_detail")]
public Task<ActionResult<GuildChatReplayDetailResponse>> ReplayDetail([FromBody] GuildChatReplayDetailRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildChatReplayDetailResponse>>(new GuildChatReplayDetailResponse());
[HttpPost("deck_log")]
public Task<ActionResult<GuildChatDeckLogResponse>> DeckLog([FromBody] GuildChatDeckLogRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildChatDeckLogResponse>>(new GuildChatDeckLogResponse());
}

View File

@@ -0,0 +1,129 @@
using Microsoft.AspNetCore.Mvc;
using SVSim.Database.Models.Config;
using SVSim.Database.Services;
using SVSim.Database.Services.Guild;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
using SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
namespace SVSim.EmulatedEntrypoint.Controllers;
/// <summary>/guild/* — 22 endpoints. See docs/api-spec/endpoints/post-login/guild-*.md.</summary>
[Route("guild")]
public sealed class GuildController : SVSimController
{
private readonly IGuildService _guild;
private readonly IGameConfigService _configs;
public GuildController(IGuildService guild, IGameConfigService configs)
{
_guild = guild;
_configs = configs;
}
[HttpPost("info")]
public async Task<ActionResult<GuildInfoResponse>> Info([FromBody] BaseRequest _, CancellationToken ct)
{
if (!TryGetViewerId(out var viewerId)) return Unauthorized();
var cfg = _configs.Get<GuildConfig>();
var view = await _guild.GetMyGuildAsync(viewerId, ct);
var resp = new GuildInfoResponse
{
MaxMemberNum = cfg.MaxMemberNum,
MaxSubLeaderNum = cfg.MaxSubLeaderNum,
UsableStampList = cfg.UsableStampList.ConvertAll(i => i.ToString()),
};
if (view is null)
{
resp.GuildStatus = 0; // NOT_JOINING
}
else
{
resp.GuildStatus = 2; // JOINING — fully populated path lands in Task 7
// Task 7 populates `Guild`, JoinRequestCount, InviteCount.
}
return resp;
}
// ===== 21 remaining stubs — each returns the response DTO with defaults =====
[HttpPost("create")]
public Task<ActionResult<EmptyResponse>> Create([FromBody] GuildCreateRequest req, CancellationToken ct) => Stub();
[HttpPost("breakup")]
public Task<ActionResult<EmptyResponse>> Breakup([FromBody] BaseRequest _, CancellationToken ct) => Stub();
[HttpPost("update")]
public Task<ActionResult<GuildUpdateResponse>> Update([FromBody] GuildUpdateRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildUpdateResponse>>(new GuildUpdateResponse());
[HttpPost("update_description")]
public Task<ActionResult<EmptyResponse>> UpdateDescription([FromBody] GuildUpdateDescriptionRequest req, CancellationToken ct) => Stub();
[HttpPost("update_emblem")]
public Task<ActionResult<GuildUpdateResponse>> UpdateEmblem([FromBody] GuildUpdateEmblemRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildUpdateResponse>>(new GuildUpdateResponse());
[HttpPost("search_guild")]
public Task<ActionResult<GuildSearchGuildResponse>> SearchGuild([FromBody] GuildSearchGuildRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildSearchGuildResponse>>(new GuildSearchGuildResponse { List = new() });
[HttpPost("emblem_list")]
public Task<ActionResult<GuildEmblemListResponse>> EmblemList([FromBody] BaseRequest _, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildEmblemListResponse>>(new GuildEmblemListResponse { EmblemList = new() });
[HttpPost("others_info")]
public Task<ActionResult<GuildOthersInfoResponse>> OthersInfo([FromBody] GuildOthersInfoRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildOthersInfoResponse>>(new GuildOthersInfoResponse());
[HttpPost("friend_list")]
public Task<ActionResult<GuildFriendListResponse>> FriendList([FromBody] BaseRequest _, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildFriendListResponse>>(new GuildFriendListResponse { Friends = new() });
[HttpPost("invite_user_list")]
public Task<ActionResult<GuildInviteUserListResponse>> InviteUserList([FromBody] BaseRequest _, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildInviteUserListResponse>>(new GuildInviteUserListResponse { Users = new() });
[HttpPost("invited_guild_list")]
public Task<ActionResult<GuildInvitedGuildListResponse>> InvitedGuildList([FromBody] GuildInvitedGuildListRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildInvitedGuildListResponse>>(new GuildInvitedGuildListResponse { List = new() });
[HttpPost("invite")]
public Task<ActionResult<EmptyResponse>> Invite([FromBody] GuildInviteRequest req, CancellationToken ct) => Stub();
[HttpPost("cancel_invite")]
public Task<ActionResult<EmptyResponse>> CancelInvite([FromBody] GuildCancelInviteRequest req, CancellationToken ct) => Stub();
[HttpPost("reject_invite")]
public Task<ActionResult<EmptyResponse>> RejectInvite([FromBody] GuildRejectInviteRequest req, CancellationToken ct) => Stub();
[HttpPost("join")]
public Task<ActionResult<GuildJoinResponse>> Join([FromBody] GuildJoinEndpointRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildJoinResponse>>(new GuildJoinResponse { GuildStatus = 0 });
[HttpPost("cancel_join_request")]
public Task<ActionResult<EmptyResponse>> CancelJoinRequest([FromBody] GuildCancelJoinRequestRequest req, CancellationToken ct) => Stub();
[HttpPost("join_request_list")]
public Task<ActionResult<GuildJoinRequestListResponse>> JoinRequestList([FromBody] GuildJoinRequestListRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildJoinRequestListResponse>>(new GuildJoinRequestListResponse { Users = new() });
[HttpPost("join_request_accept")]
public Task<ActionResult<EmptyResponse>> JoinRequestAccept([FromBody] GuildJoinRequestAcceptRequest req, CancellationToken ct) => Stub();
[HttpPost("reject_join_request")]
public Task<ActionResult<EmptyResponse>> RejectJoinRequest([FromBody] GuildRejectJoinRequestRequest req, CancellationToken ct) => Stub();
[HttpPost("leave")]
public Task<ActionResult<EmptyResponse>> Leave([FromBody] BaseRequest _, CancellationToken ct) => Stub();
[HttpPost("remove")]
public Task<ActionResult<EmptyResponse>> Remove([FromBody] GuildRemoveRequest req, CancellationToken ct) => Stub();
[HttpPost("change_role")]
public Task<ActionResult<GuildChangeRoleResponse>> ChangeRole([FromBody] GuildChangeRoleRequest req, CancellationToken ct)
=> Task.FromResult<ActionResult<GuildChangeRoleResponse>>(new GuildChangeRoleResponse { Members = new() });
private static Task<ActionResult<EmptyResponse>> Stub() =>
Task.FromResult<ActionResult<EmptyResponse>>(new EmptyResponse());
}

View File

@@ -0,0 +1,54 @@
using MessagePack;
using System.Text.Json;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// Wire shape for a single chat message in /guild_chat/messages `chat_message[]`
/// and /gathering_chat/messages. Matches guild_chat-messages.md ChatMessage interface.
///
/// deck / replay / room are JsonElement? so arbitrary payloads can pass through in Phase 5
/// without premature typing (TODO task-17: replace with typed DTOs when replay subsystem is documented).
/// </summary>
[MessagePackObject]
public class ChatMessageDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("message_id"), Key("message_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long MessageId { get; set; }
/// <summary>eMessageType: 0=NORMAL 1=STAMP 2=DECK 3=JOIN 4=LEAVE 5=REPLAY etc.</summary>
[JsonPropertyName("message_type"), Key("message_type"), JsonConverter(typeof(StringifiedIntConverter))]
public int MessageType { get; set; }
[JsonPropertyName("create_time"), Key("create_time"), JsonConverter(typeof(StringifiedLongConverter))]
public long CreateTime { get; set; }
/// <summary>Text body for NORMAL, stringified stamp id for STAMP, etc.</summary>
[JsonPropertyName("message"), Key("message")]
public string Message { get; set; } = "";
/// <summary>Present when message_type = DECK (2). Inline DeckLogData payload.</summary>
[JsonPropertyName("deck"), Key("deck")]
public JsonElement? Deck { get; set; }
/// <summary>Present when message_type = REPLAY (5). Inline ReplayInfoItem payload.</summary>
[JsonPropertyName("replay"), Key("replay")]
public JsonElement? Replay { get; set; }
/// <summary>Present when message_type = ROOM_MATCH (10). Inline room-invite payload.</summary>
[JsonPropertyName("room"), Key("room")]
public JsonElement? Room { get; set; }
/// <summary>GATHERING_TOURNAMENT_ROOM extras — only meaningful for /gathering_chat.</summary>
[JsonPropertyName("viewer_id1"), Key("viewer_id1")]
public long? ViewerId1 { get; set; }
/// <summary>GATHERING_TOURNAMENT_ROOM extras — only meaningful for /gathering_chat.</summary>
[JsonPropertyName("viewer_id2"), Key("viewer_id2")]
public long? ViewerId2 { get; set; }
}

View File

@@ -0,0 +1,39 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// Generic UserInfoBase shape for chat contexts — used in /guild_chat/messages `users[]`
/// and shared with /gathering_chat. Matches types.ts.md#user-profile-types ChatUser (UserInfoBase).
/// </summary>
[MessagePackObject]
public class ChatUserDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
/// <summary>Optional — omit when the viewer has no friend relationship with this user.</summary>
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
/// <summary>Optional — omit when no pending friend apply.</summary>
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
}

View File

@@ -0,0 +1,41 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// Mirrors GuildDetailInfo.cs:143-156. Wire ints are emitted as stringified.
/// member_num is included on the wire only when this dto represents a search-result row
/// (the /guild/info "detail" inside `guild` object also includes it).
/// </summary>
[MessagePackObject]
public class GuildDetailDto
{
[JsonPropertyName("guild_id"), Key("guild_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int GuildId { get; set; }
[JsonPropertyName("guild_name"), Key("guild_name")]
public string GuildName { get; set; } = "";
[JsonPropertyName("description"), Key("description")]
public string Description { get; set; } = "";
[JsonPropertyName("guild_emblem_id"), Key("guild_emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long GuildEmblemId { get; set; }
[JsonPropertyName("join_condition"), Key("join_condition"), JsonConverter(typeof(StringifiedIntConverter))]
public int JoinCondition { get; set; }
[JsonPropertyName("activity"), Key("activity"), JsonConverter(typeof(StringifiedIntConverter))]
public int Activity { get; set; }
[JsonPropertyName("member_num"), Key("member_num"), JsonConverter(typeof(StringifiedIntConverter))]
public int MemberNum { get; set; }
[JsonPropertyName("leader_name"), Key("leader_name")]
public string LeaderName { get; set; } = "";
[JsonPropertyName("leader_viewer_id"), Key("leader_viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long LeaderViewerId { get; set; }
}

View File

@@ -0,0 +1,52 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// GuildMember wire shape — extends UserInfoBase (flat-spread) with is_official_mark_displayed + role.
/// Matches GuildMemberInfo.cs:43-50 and types.ts.md#guild-types GuildMember.
/// role: 0 = REGULAR, 1 = LEADER, 2 = SUB_LEADER.
/// </summary>
[MessagePackObject]
public class GuildMemberInfoDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
/// <summary>Optional — omit when the caller has no friend relationship with this member.</summary>
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
/// <summary>Optional — omit when no pending friend apply.</summary>
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
/// <summary>
/// Whether the official-account badge is shown for this member.
/// Client reads this unconditionally from GuildMemberInfo.Parse — always emit it.
/// </summary>
[JsonPropertyName("is_official_mark_displayed"), Key("is_official_mark_displayed"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int IsOfficialMarkDisplayed { get; set; }
/// <summary>0 = REGULAR, 1 = LEADER, 2 = SUB_LEADER. Stringified.</summary>
[JsonPropertyName("role"), Key("role"), JsonConverter(typeof(StringifiedIntConverter))]
public int Role { get; set; }
}

View File

@@ -0,0 +1,40 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
/// <summary>
/// UserInfoBase flat-spread fields as used in guild contexts (GuildMemberInfo.cs, invite lists, etc.).
/// viewer_id / name / emblem_id / country_code / rank / degree_id / is_friend? / is_friend_apply?.
/// Matches types.ts.md#user-profile-types UserInfoBase.
/// </summary>
[MessagePackObject]
public class GuildUserBaseDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
/// <summary>Optional — omit when the caller has no friend relationship with this user.</summary>
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
/// <summary>Optional — omit when the caller has no pending friend apply to this user.</summary>
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/cancel_invite. Leader/sub-leader retracts an outstanding invite.</summary>
[MessagePackObject]
public class GuildCancelInviteRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Invite id from /guild/invite_user_list.</summary>
[JsonPropertyName("invite_id"), Key("invite_id")]
public long InviteId { get; set; }
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Request for POST /guild/cancel_join_request.
/// No fields — server identifies the pending request from the calling user's state.
/// Uses explicit DTO (not BaseRequest) so we can add fields if needed in later tasks.
/// </summary>
[MessagePackObject]
public class GuildCancelJoinRequestRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
}

View File

@@ -0,0 +1,26 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/change_role. Change a member's role (promote/demote/transfer leadership).</summary>
[MessagePackObject]
public class GuildChangeRoleRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>ViewerId of the member whose role is changing.</summary>
[JsonPropertyName("target_viewer_id"), Key("target_viewer_id")]
public long TargetViewerId { get; set; }
/// <summary>New role: 0 = REGULAR, 1 = LEADER, 2 = SUB_LEADER.</summary>
[JsonPropertyName("role_id"), Key("role_id")]
public int RoleId { get; set; }
}

View File

@@ -0,0 +1,16 @@
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/change_role.
/// Returns the full updated member list so the client can redraw without re-fetching /guild/info.
/// </summary>
[MessagePackObject]
public class GuildChangeRoleResponse
{
[JsonPropertyName("members"), Key("members")]
public List<GuildMemberInfoDto> Members { get; set; } = new();
}

View File

@@ -0,0 +1,29 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/create.</summary>
[MessagePackObject]
public class GuildCreateRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
[JsonPropertyName("guild_name"), Key("guild_name")]
public string GuildName { get; set; } = "";
/// <summary>GuildDetailInfo.ActivityType enum (1..16).</summary>
[JsonPropertyName("activity"), Key("activity")]
public int Activity { get; set; }
/// <summary>GuildDetailInfo.JoinConditionType enum (1 FREE, 2 APPROVAL, 3 ONLY_INVITE).</summary>
[JsonPropertyName("join_condition"), Key("join_condition")]
public int JoinCondition { get; set; }
}

View File

@@ -0,0 +1,21 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Response for POST /guild/emblem_list. List of emblem entries the leader can select.</summary>
[MessagePackObject]
public class GuildEmblemListResponse
{
[JsonPropertyName("guild_emblem_list"), Key("guild_emblem_list")]
public List<GuildEmblemEntry> EmblemList { get; set; } = new();
}
/// <summary>One emblem entry. emblem_id is long per spec.</summary>
[MessagePackObject]
public class GuildEmblemEntry
{
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
}

View File

@@ -0,0 +1,53 @@
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/friend_list.
/// NOTE: per guild-friend_list.md, `data` is an array at the root — BUT we return this
/// as a wrapper for now; the controller returns the List directly.
/// TODO(task-14): verify array-root shape via capture; may need a custom response wrapper.
/// </summary>
[MessagePackObject]
public class GuildFriendListResponse
{
// Placeholder — see controller; actual wire shape is array-at-root per spec.
// The controller returns List<GuildInviteCandidateDto> directly for now.
[JsonPropertyName("friends"), Key("friends")]
public List<GuildInviteCandidateDto> Friends { get; set; } = new();
}
/// <summary>InviteCandidate — UserInfoBase + is_join_guild flag.</summary>
[MessagePackObject]
public class GuildInviteCandidateDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(SVSim.EmulatedEntrypoint.Models.Dtos.Common.StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(SVSim.EmulatedEntrypoint.Models.Dtos.Common.StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(SVSim.EmulatedEntrypoint.Models.Dtos.Common.StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(SVSim.EmulatedEntrypoint.Models.Dtos.Common.StringifiedIntConverter))]
public int DegreeId { get; set; }
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
/// <summary>true => friend is already in a guild and can't be invited.</summary>
[JsonPropertyName("is_join_guild"), Key("is_join_guild")]
public bool IsJoinGuild { get; set; }
}

View File

@@ -0,0 +1,51 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Mirrors GuildInfo.cs:68-86. Always-present: max_member_num, max_sub_leader_num,
/// guild_status, usable_stamp_list. Conditionally present (client `Keys.Contains` -gated):
/// guild (detail + members), join_request_count, invite_count.
/// </summary>
[MessagePackObject]
public class GuildInfoResponse
{
[JsonPropertyName("max_member_num"), Key("max_member_num"), JsonConverter(typeof(StringifiedIntConverter)),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int MaxMemberNum { get; set; }
[JsonPropertyName("max_sub_leader_num"), Key("max_sub_leader_num"), JsonConverter(typeof(StringifiedIntConverter)),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int MaxSubLeaderNum { get; set; }
[JsonPropertyName("guild_status"), Key("guild_status"), JsonConverter(typeof(StringifiedIntConverter)),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int GuildStatus { get; set; }
/// <summary>Stamp ids the viewer can use in chat. Stringified ints (capture: ["100001",...]).</summary>
[JsonPropertyName("usable_stamp_list"), Key("usable_stamp_list"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public List<string> UsableStampList { get; set; } = new();
[JsonPropertyName("guild"), Key("guild")]
public GuildBundle? Guild { get; set; }
[JsonPropertyName("join_request_count"), Key("join_request_count"), JsonConverter(typeof(StringifiedIntConverter))]
public int? JoinRequestCount { get; set; }
[JsonPropertyName("invite_count"), Key("invite_count"), JsonConverter(typeof(StringifiedIntConverter))]
public int? InviteCount { get; set; }
}
[MessagePackObject]
public class GuildBundle
{
[JsonPropertyName("detail"), Key("detail")]
public GuildDetailDto Detail { get; set; } = new();
[JsonPropertyName("members"), Key("members")]
public List<GuildMemberInfoDto> Members { get; set; } = new();
}

View File

@@ -0,0 +1,26 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/invite. Leader/sub-leader sends invite to a user.</summary>
[MessagePackObject]
public class GuildInviteRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>ViewerId of the user to invite.</summary>
[JsonPropertyName("invited_viewer_id"), Key("invited_viewer_id")]
public long InvitedViewerId { get; set; }
/// <summary>Free-text invite message. Client hardcodes "" — always empty on wire.</summary>
[JsonPropertyName("invite_message"), Key("invite_message")]
public string InviteMessage { get; set; } = "";
}

View File

@@ -0,0 +1,56 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Response for POST /guild/invite_user_list.
/// Lists outstanding invites the guild has sent out (leader/sub-leader view).
/// </summary>
[MessagePackObject]
public class GuildInviteUserListResponse
{
[JsonPropertyName("list"), Key("list")]
public List<GuildOutgoingInviteDto> Users { get; set; } = new();
}
/// <summary>
/// OutgoingInvite — UserInfoBase fields flat-spread + invite_id + invite_time.
/// Matches guild-invite_user_list.md OutgoingInvite interface.
/// </summary>
[MessagePackObject]
public class GuildOutgoingInviteDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
/// <summary>Invite id — pass to /guild/cancel_invite to retract.</summary>
[JsonPropertyName("invite_id"), Key("invite_id")]
public long InviteId { get; set; }
/// <summary>Unix seconds when the invite was sent.</summary>
[JsonPropertyName("invite_time"), Key("invite_time")]
public long InviteTime { get; set; }
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/invited_guild_list. Lists pending invites the user has received.</summary>
[MessagePackObject]
public class GuildInvitedGuildListRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Pagination page index. This list is the only one the client actually scrolls.</summary>
[JsonPropertyName("page"), Key("page")]
public int Page { get; set; }
}

View File

@@ -0,0 +1,57 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Response for POST /guild/invited_guild_list.
/// Each entry is GuildDetail fields + invite_id as flat siblings on the wire.
/// Per spec: client constructs GuildDetailInfo + reads invite_id from the SAME object.
/// </summary>
[MessagePackObject]
public class GuildInvitedGuildListResponse
{
[JsonPropertyName("list"), Key("list")]
public List<GuildReceivedInviteDto> List { get; set; } = new();
}
/// <summary>
/// ReceivedInvite — GuildDetail fields flat-spread + invite_id.
/// invite_id and detail fields are siblings, not nested (per guild-invited_guild_list.md).
/// </summary>
[MessagePackObject]
public class GuildReceivedInviteDto
{
[JsonPropertyName("guild_id"), Key("guild_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int GuildId { get; set; }
[JsonPropertyName("guild_name"), Key("guild_name")]
public string GuildName { get; set; } = "";
[JsonPropertyName("description"), Key("description")]
public string Description { get; set; } = "";
[JsonPropertyName("guild_emblem_id"), Key("guild_emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long GuildEmblemId { get; set; }
[JsonPropertyName("join_condition"), Key("join_condition"), JsonConverter(typeof(StringifiedIntConverter))]
public int JoinCondition { get; set; }
[JsonPropertyName("activity"), Key("activity"), JsonConverter(typeof(StringifiedIntConverter))]
public int Activity { get; set; }
[JsonPropertyName("member_num"), Key("member_num"), JsonConverter(typeof(StringifiedIntConverter))]
public int MemberNum { get; set; }
[JsonPropertyName("leader_name"), Key("leader_name")]
public string LeaderName { get; set; } = "";
[JsonPropertyName("leader_viewer_id"), Key("leader_viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long LeaderViewerId { get; set; }
/// <summary>Invite id — pass to /guild/join (from_invite=true) or /guild/reject_invite.</summary>
[JsonPropertyName("invite_id"), Key("invite_id")]
public long InviteId { get; set; }
}

View File

@@ -0,0 +1,30 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Request for POST /guild/join.
/// NOTE: named GuildJoinEndpointRequest (not GuildJoinRequest) to avoid collision with
/// SVSim.Database.Entities.Guild.GuildJoinRequest which is an EF entity.
/// </summary>
[MessagePackObject]
public class GuildJoinEndpointRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
[JsonPropertyName("guild_id"), Key("guild_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int GuildId { get; set; }
/// <summary>true = consuming an open invite (from /guild/invited_guild_list).</summary>
[JsonPropertyName("from_invite"), Key("from_invite")]
public bool FromInvite { get; set; }
}

View File

@@ -0,0 +1,25 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Request for POST /guild/join_request_accept.
/// GuildJoinRequestActionParam shape — single field request_viewer_id.
/// </summary>
[MessagePackObject]
public class GuildJoinRequestAcceptRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>ViewerId of the user whose join request is being accepted.</summary>
[JsonPropertyName("request_viewer_id"), Key("request_viewer_id")]
public long RequestViewerId { get; set; }
}

View File

@@ -0,0 +1,27 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Request for POST /guild/join_request_list.
/// KeysetPagination shape — client always sends page=0, oldest_time=0.
/// </summary>
[MessagePackObject]
public class GuildJoinRequestListRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
[JsonPropertyName("page"), Key("page")]
public int Page { get; set; }
[JsonPropertyName("oldest_time"), Key("oldest_time")]
public long OldestTime { get; set; }
}

View File

@@ -0,0 +1,52 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Response for POST /guild/join_request_list (leader/sub-leader view).</summary>
[MessagePackObject]
public class GuildJoinRequestListResponse
{
[JsonPropertyName("list"), Key("list")]
public List<GuildJoinRequestEntryDto> Users { get; set; } = new();
}
/// <summary>
/// JoinRequest entry — UserInfoBase fields flat-spread + is_official_mark_displayed + request_time.
/// Matches guild-join_request_list.md JoinRequest interface.
/// </summary>
[MessagePackObject]
public class GuildJoinRequestEntryDto
{
[JsonPropertyName("viewer_id"), Key("viewer_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long ViewerId { get; set; }
[JsonPropertyName("name"), Key("name")]
public string Name { get; set; } = "";
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
[JsonPropertyName("country_code"), Key("country_code")]
public string CountryCode { get; set; } = "";
[JsonPropertyName("rank"), Key("rank"), JsonConverter(typeof(StringifiedIntConverter))]
public int Rank { get; set; }
[JsonPropertyName("degree_id"), Key("degree_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int DegreeId { get; set; }
[JsonPropertyName("is_friend"), Key("is_friend")]
public int? IsFriend { get; set; }
[JsonPropertyName("is_friend_apply"), Key("is_friend_apply")]
public int? IsFriendApply { get; set; }
[JsonPropertyName("is_official_mark_displayed"), Key("is_official_mark_displayed")]
public int IsOfficialMarkDisplayed { get; set; }
/// <summary>Unix seconds when the request was submitted. Don't send millisecond timestamps.</summary>
[JsonPropertyName("request_time"), Key("request_time")]
public long RequestTime { get; set; }
}

View File

@@ -0,0 +1,18 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Response for POST /guild/join.
/// Returns the user's new guild_status; client calls /guild/info next when status is JOINING.
/// </summary>
[MessagePackObject]
public class GuildJoinResponse
{
/// <summary>eGUILD_STATUS the user is now in. Stringified.</summary>
[JsonPropertyName("guild_status"), Key("guild_status"), JsonConverter(typeof(StringifiedIntConverter)),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int GuildStatus { get; set; }
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/others_info. Browse another guild's public detail.</summary>
[MessagePackObject]
public class GuildOthersInfoRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
[JsonPropertyName("guild_id"), Key("guild_id"), JsonConverter(typeof(StringifiedIntConverter))]
public int GuildId { get; set; }
}

View File

@@ -0,0 +1,15 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Response for POST /guild/others_info. Only the detail sub-tree — no member list (privacy).
/// Reuses GuildDetailSubTree (same shape as /guild/update response).
/// </summary>
[MessagePackObject]
public class GuildOthersInfoResponse
{
[JsonPropertyName("guild"), Key("guild")]
public GuildDetailSubTree Guild { get; set; } = new();
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/reject_invite. User declines an incoming invite.</summary>
[MessagePackObject]
public class GuildRejectInviteRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Invite id from /guild/invited_guild_list.</summary>
[JsonPropertyName("invite_id"), Key("invite_id")]
public long InviteId { get; set; }
}

View File

@@ -0,0 +1,25 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>
/// Request for POST /guild/reject_join_request.
/// GuildJoinRequestActionParam shape — single field request_viewer_id.
/// </summary>
[MessagePackObject]
public class GuildRejectJoinRequestRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>ViewerId of the user whose join request is being rejected.</summary>
[JsonPropertyName("request_viewer_id"), Key("request_viewer_id")]
public long RequestViewerId { get; set; }
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/remove. Kick a member (leader/sub-leader only).</summary>
[MessagePackObject]
public class GuildRemoveRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>ViewerId of the member to remove. Field is `remove_viewer_id`, not `viewer_id`.</summary>
[JsonPropertyName("remove_viewer_id"), Key("remove_viewer_id")]
public long RemoveViewerId { get; set; }
}

View File

@@ -0,0 +1,34 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/search_guild.</summary>
[MessagePackObject]
public class GuildSearchGuildRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Name query. Empty string = match-all.</summary>
[JsonPropertyName("guild_name"), Key("guild_name")]
public string GuildName { get; set; } = "";
/// <summary>ActivityType filter (1..16). 0 = any.</summary>
[JsonPropertyName("activity"), Key("activity")]
public int Activity { get; set; }
/// <summary>JoinConditionType filter (1..3). 0 = any.</summary>
[JsonPropertyName("join_condition"), Key("join_condition")]
public int JoinCondition { get; set; }
/// <summary>Member-count bucket filter. 0 = any, 1 = small, 2 = medium, 3 = large.</summary>
[JsonPropertyName("member_condition_range"), Key("member_condition_range")]
public int MemberConditionRange { get; set; }
}

View File

@@ -0,0 +1,13 @@
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/search_guild. Flat list of guild details matching the filter.</summary>
[MessagePackObject]
public class GuildSearchGuildResponse
{
[JsonPropertyName("list"), Key("list")]
public List<GuildDetailDto> List { get; set; } = new();
}

View File

@@ -0,0 +1,21 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/update_description. Leader-only.</summary>
[MessagePackObject]
public class GuildUpdateDescriptionRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
[JsonPropertyName("description"), Key("description")]
public string Description { get; set; } = "";
}

View File

@@ -0,0 +1,23 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/update_emblem. Leader-only. emblem_id is long.</summary>
[MessagePackObject]
public class GuildUpdateEmblemRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Emblem id from /guild/emblem_list. long per spec.</summary>
[JsonPropertyName("emblem_id"), Key("emblem_id"), JsonConverter(typeof(StringifiedLongConverter))]
public long EmblemId { get; set; }
}

View File

@@ -0,0 +1,29 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
/// <summary>Request for POST /guild/update. Leader-only.</summary>
[MessagePackObject]
public class GuildUpdateRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
[JsonPropertyName("guild_name"), Key("guild_name")]
public string GuildName { get; set; } = "";
/// <summary>ActivityType enum (1..16).</summary>
[JsonPropertyName("activity"), Key("activity")]
public int Activity { get; set; }
/// <summary>JoinConditionType enum (1..3).</summary>
[JsonPropertyName("join_condition"), Key("join_condition")]
public int JoinCondition { get; set; }
}

View File

@@ -0,0 +1,23 @@
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 and POST /guild/update_emblem.
/// Returns the full updated guild detail sub-tree; client merges without re-fetching members.
/// </summary>
[MessagePackObject]
public class GuildUpdateResponse
{
[JsonPropertyName("guild"), Key("guild")]
public GuildDetailSubTree Guild { get; set; } = new();
}
[MessagePackObject]
public class GuildDetailSubTree
{
[JsonPropertyName("detail"), Key("detail")]
public GuildDetailDto Detail { get; set; } = new();
}

View File

@@ -0,0 +1,26 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Request for POST /guild_chat/add_deck. Shares a deck snapshot to guild chat.</summary>
[MessagePackObject]
public class GuildChatAddDeckRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>API-side Format value of the deck being shared.</summary>
[JsonPropertyName("deck_format"), Key("deck_format")]
public int DeckFormat { get; set; }
/// <summary>Slot number of the deck being shared (within the user's regular deck slots).</summary>
[JsonPropertyName("deck_no"), Key("deck_no")]
public int DeckNo { get; set; }
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Request for POST /guild_chat/add_replay. Shares a battle replay to guild chat.</summary>
[MessagePackObject]
public class GuildChatAddReplayRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Battle id of the replay being shared. long per spec.</summary>
[JsonPropertyName("battle_id"), Key("battle_id")]
public long BattleId { get; set; }
}

View File

@@ -0,0 +1,18 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Request for POST /guild_chat/deck_log. No fields — returns all shared decks by format.</summary>
[MessagePackObject]
public class GuildChatDeckLogRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
}

View File

@@ -0,0 +1,26 @@
using MessagePack;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>
/// Response for POST /guild_chat/deck_log.
/// deck_log keys are stringified API-side Format ints (e.g. "1", "2").
/// TODO(task-17): replace deck_log with typed DTOs when DeckLogData shape is fully specified.
/// Crossover/MyRotation keys must be OMITTED (not empty arrays) when those formats are disabled.
/// </summary>
[MessagePackObject]
public class GuildChatDeckLogResponse
{
[JsonPropertyName("maintenance_card_list"), Key("maintenance_card_list"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public List<int> MaintenanceCardList { get; set; } = new();
/// <summary>
/// Decks shared in chat, bucketed by API-side Format value (stringified int keys).
/// JsonElement pass-through for now — Task 17 will type the inner DeckLogEntry shape.
/// </summary>
[JsonPropertyName("deck_log"), Key("deck_log")]
public JsonElement? DeckLog { get; set; }
}

View File

@@ -0,0 +1,26 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Request for POST /guild_chat/delete_deck. Deletes a previously-shared deck from the chat archive.</summary>
[MessagePackObject]
public class GuildChatDeleteDeckRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>API-side Format of the deck being deleted.</summary>
[JsonPropertyName("deck_format"), Key("deck_format")]
public int DeckFormat { get; set; }
/// <summary>Message id of the chat message that originally shared the deck.</summary>
[JsonPropertyName("message_id"), Key("message_id")]
public long MessageId { get; set; }
}

View File

@@ -0,0 +1,25 @@
using MessagePack;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>
/// Response for POST /guild_chat/delete_deck.
/// Returns refreshed deck_log after deletion.
/// TODO(task-17): replace deck_log with typed DeckLogData DTOs when deck-log shape is fully documented.
/// </summary>
[MessagePackObject]
public class GuildChatDeleteDeckResponse
{
[JsonPropertyName("maintenance_card_list"), Key("maintenance_card_list"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public List<int> MaintenanceCardList { get; set; } = new();
/// <summary>
/// Refreshed deck log keyed by API-side Format int (stringified, e.g. "1", "2").
/// Using JsonElement for now; Task 17 will type this properly.
/// </summary>
[JsonPropertyName("deck_log"), Key("deck_log")]
public JsonElement? DeckLog { get; set; }
}

View File

@@ -0,0 +1,30 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Request for POST /guild_chat/messages. Polling endpoint for guild chat.</summary>
[MessagePackObject]
public class GuildChatMessagesRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Anchor message id. 0 = latest log head.</summary>
[JsonPropertyName("start_message_id"), Key("start_message_id")]
public long StartMessageId { get; set; }
/// <summary>Chat.eRequestDirection: 1=OLD 2=NEW 3=BOTH.</summary>
[JsonPropertyName("direction"), Key("direction")]
public int Direction { get; set; }
/// <summary>Client's current polling interval in seconds.</summary>
[JsonPropertyName("wait_interval"), Key("wait_interval")]
public int WaitInterval { get; set; }
}

View File

@@ -0,0 +1,31 @@
using MessagePack;
using System.Text.Json.Serialization;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common;
using SVSim.EmulatedEntrypoint.Models.Dtos.Common.Guild;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Response for POST /guild_chat/messages.</summary>
[MessagePackObject]
public class GuildChatMessagesResponse
{
/// <summary>Card ids currently disabled for maintenance — client refreshes its global list.</summary>
[JsonPropertyName("maintenance_card_list"), Key("maintenance_card_list"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public List<int> MaintenanceCardList { get; set; } = new();
/// <summary>Users referenced by messages in this batch — deduplicated catalog.</summary>
[JsonPropertyName("users"), Key("users"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public List<ChatUserDto> Users { get; set; } = new();
/// <summary>Messages ordered oldest-to-newest.</summary>
[JsonPropertyName("chat_message"), Key("chat_message"),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public List<ChatMessageDto> ChatMessage { get; set; } = new();
/// <summary>Server-driven polling interval in seconds. Client uses this for the next poll.</summary>
[JsonPropertyName("wait_interval"), Key("wait_interval"), JsonConverter(typeof(StringifiedIntConverter)),
JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int WaitInterval { get; set; }
}

View File

@@ -0,0 +1,26 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Request for POST /guild_chat/post. Posts a text message or stamp to guild chat.</summary>
[MessagePackObject]
public class GuildChatPostRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>eMessageType: 0=NORMAL (text body), 1=STAMP (stringified stamp id).</summary>
[JsonPropertyName("type"), Key("type")]
public int Type { get; set; }
/// <summary>Text body for NORMAL; stringified stamp id for STAMP.</summary>
[JsonPropertyName("message"), Key("message")]
public string Message { get; set; } = "";
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>
/// Response for POST /guild_chat/post.
/// achieved_info and reward_list are optional; only present when posting triggered a mission completion.
/// TODO(task-16): populate achieved_info + reward_list shapes when chat missions are implemented.
/// </summary>
[MessagePackObject]
public class GuildChatPostResponse
{
/// <summary>Optional. Present when posting triggered a mission completion.</summary>
[JsonPropertyName("achieved_info"), Key("achieved_info")]
public JsonElement? AchievedInfo { get; set; }
/// <summary>Optional. Goods deltas from any rewards in achieved_info.</summary>
[JsonPropertyName("reward_list"), Key("reward_list")]
public JsonElement? RewardList { get; set; }
}

View File

@@ -0,0 +1,22 @@
using MessagePack;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>Request for POST /guild_chat/replay_detail. Fetches full replay payload for a shared replay.</summary>
[MessagePackObject]
public class GuildChatReplayDetailRequest
{
[JsonPropertyName("viewer_id"), Key("viewer_id")]
public string ViewerId { get; set; } = "";
[JsonPropertyName("steam_id"), Key("steam_id")]
public ulong SteamId { get; set; }
[JsonPropertyName("steam_session_ticket"), Key("steam_session_ticket")]
public string SteamSessionTicket { get; set; } = "";
/// <summary>Message id of the REPLAY chat message.</summary>
[JsonPropertyName("message_id"), Key("message_id")]
public long MessageId { get; set; }
}

View File

@@ -0,0 +1,19 @@
using MessagePack;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.GuildChat;
/// <summary>
/// Response for POST /guild_chat/replay_detail.
/// Shape is opaque pending replay-subsystem documentation.
/// TODO(task-17): enumerate fields from Wizard/ReplayDetailInfo.cs when replay subsystem is documented.
/// </summary>
[MessagePackObject]
public class GuildChatReplayDetailResponse
{
// Placeholder — replay detail shape is undocumented until we capture a live trace.
// Using JsonElement pass-through for now.
[JsonPropertyName("_todo"), Key("_todo")]
public JsonElement? Placeholder { get; set; }
}

View File

@@ -25,14 +25,15 @@ public class GameConfigurationJsonbTests
var rows = await db.GameConfigs.AsNoTracking().ToListAsync();
var byName = rows.ToDictionary(r => r.SectionName);
// One row per [ConfigSection]-marked POCO (16 sections today: Player, DefaultGrants,
// One row per [ConfigSection]-marked POCO (17 sections today: Player, DefaultGrants,
// DefaultLoadout, Challenge, Rotation, PackRates, MyRotationSchedule, Story, ResourceConfig,
// Freeplay, ArenaTwoPick, Matching, CardMasterConfig, ColosseumSeason, ColosseumRounds, LoginBonus).
// Freeplay, ArenaTwoPick, Matching, CardMasterConfig, ColosseumSeason, ColosseumRounds,
// LoginBonus, Guild).
Assert.That(byName.Keys, Is.EquivalentTo(new[]
{
"Player", "DefaultGrants", "DefaultLoadout", "Challenge", "Rotation", "PackRates",
"MyRotationSchedule", "Story", "ResourceConfig", "Freeplay", "ArenaTwoPick", "Matching",
"CardMasterConfig", "ColosseumSeason", "ColosseumRounds", "LoginBonus",
"CardMasterConfig", "ColosseumSeason", "ColosseumRounds", "LoginBonus", "Guild",
}));
var resources = JsonSerializer.Deserialize<ResourceConfig>(byName["ResourceConfig"].ValueJson)!;

View File

@@ -146,6 +146,38 @@ public class RoutingSmokeTests
[TestCase("/rotation_free_battle/finish")]
[TestCase("/unlimited_free_battle/finish")]
[TestCase("/free_battle/force_finish")]
// Guild endpoints (Task 5)
[TestCase("/guild/info")]
[TestCase("/guild/create")]
[TestCase("/guild/breakup")]
[TestCase("/guild/update")]
[TestCase("/guild/update_description")]
[TestCase("/guild/update_emblem")]
[TestCase("/guild/search_guild")]
[TestCase("/guild/emblem_list")]
[TestCase("/guild/others_info")]
[TestCase("/guild/friend_list")]
[TestCase("/guild/invite_user_list")]
[TestCase("/guild/invited_guild_list")]
[TestCase("/guild/invite")]
[TestCase("/guild/cancel_invite")]
[TestCase("/guild/reject_invite")]
[TestCase("/guild/join")]
[TestCase("/guild/cancel_join_request")]
[TestCase("/guild/join_request_list")]
[TestCase("/guild/join_request_accept")]
[TestCase("/guild/reject_join_request")]
[TestCase("/guild/leave")]
[TestCase("/guild/remove")]
[TestCase("/guild/change_role")]
// GuildChat endpoints (Task 5)
[TestCase("/guild_chat/messages")]
[TestCase("/guild_chat/post")]
[TestCase("/guild_chat/add_deck")]
[TestCase("/guild_chat/delete_deck")]
[TestCase("/guild_chat/add_replay")]
[TestCase("/guild_chat/replay_detail")]
[TestCase("/guild_chat/deck_log")]
public async Task Authenticated_route_resolves(string path)
{
using var factory = new TestFactory();

View File

@@ -0,0 +1,40 @@
using NUnit.Framework;
using System.Text.Json;
using SVSim.EmulatedEntrypoint.Models.Dtos.Guild;
namespace SVSim.UnitTests.Wire;
[TestFixture]
public class GuildWireShape
{
private static readonly JsonSerializerOptions Opts = new()
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
};
[Test]
public void GuildInfo_non_joined_serializes_to_prod_shape()
{
var resp = new GuildInfoResponse
{
MaxMemberNum = 30,
MaxSubLeaderNum = 2,
GuildStatus = 0,
UsableStampList = Enumerable.Range(100001, 20).Select(i => i.ToString()).ToList(),
};
var json = JsonSerializer.Serialize(resp, Opts);
using var doc = JsonDocument.Parse(json);
var root = doc.RootElement;
Assert.That(root.GetProperty("max_member_num").GetString(), Is.EqualTo("30"));
Assert.That(root.GetProperty("max_sub_leader_num").GetString(), Is.EqualTo("2"));
Assert.That(root.GetProperty("guild_status").GetString(), Is.EqualTo("0"));
Assert.That(root.GetProperty("usable_stamp_list").EnumerateArray().Select(e => e.GetString()).First(), Is.EqualTo("100001"));
// The four nullable fields MUST NOT appear when null:
Assert.That(root.TryGetProperty("guild", out _), Is.False);
Assert.That(root.TryGetProperty("join_request_count", out _), Is.False);
Assert.That(root.TryGetProperty("invite_count", out _), Is.False);
}
}