From 97a371001bfc3fefa28d72bddaed125d3ea771a7 Mon Sep 17 00:00:00 2001 From: CAtlas0784 Date: Wed, 16 Sep 2026 02:19:44 +0700 Subject: [PATCH] feat(debug-panel): [Item 8 & Item 3] add outfit toggle UI endpoint and update enemy camp selection --- Ananta.Server/Ananta.App/DebugApiServer.cs | 15 ++++++++++++ .../Ananta.App/DebugPanel/index.html | 23 +++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Ananta.Server/Ananta.App/DebugApiServer.cs b/Ananta.Server/Ananta.App/DebugApiServer.cs index a0f2132..c28bc86 100644 --- a/Ananta.Server/Ananta.App/DebugApiServer.cs +++ b/Ananta.Server/Ananta.App/DebugApiServer.cs @@ -124,6 +124,8 @@ internal sealed class DebugApiServer(PrivateServerConfig config, GameSessionHub await WriteJsonAsync(ctx, await UnstuckBlackScreenAsync(token), token); else if (method == "POST" && path == "/api/player/rollback-10s") await WriteJsonAsync(ctx, await RollbackPositionAsync(token), token); + else if (method == "POST" && path == "/api/player/toggle-clothes") + await WriteJsonAsync(ctx, await ToggleClothesAsync(token), token); else if (method == "POST" && path == "/api/enemy/spawn") await WriteJsonAsync(ctx, await SpawnEnemyAsync(await ReadBodyAsync(ctx.Request, token), token), token); else if (method == "POST" && path == "/api/cutscene/play") @@ -1032,6 +1034,19 @@ internal sealed class DebugApiServer(PrivateServerConfig config, GameSessionHub return new { ok = true, timeline }; } + private async Task ToggleClothesAsync(CancellationToken token) + { + var session = hub.Current; + if (session is null) + return new { ok = false, error = "no live game session (is the client in the world?)" }; + + var cmd = "CMD:TOGGLE_CLOTHES"; + await session.NotifyAsync(MethodId.SyncNotice, UxSerializer.Serialize(cmd), token); + + session.Log.Info("[DEBUG-API] toggle clothes dispatched"); + return new { ok = true }; + } + private static async Task ReadBodyAsync(HttpListenerRequest request, CancellationToken token) { if (!request.HasEntityBody) diff --git a/Ananta.Server/Ananta.App/DebugPanel/index.html b/Ananta.Server/Ananta.App/DebugPanel/index.html index 8ece527..a593a40 100644 --- a/Ananta.Server/Ananta.App/DebugPanel/index.html +++ b/Ananta.Server/Ananta.App/DebugPanel/index.html @@ -117,6 +117,14 @@ +
+

👗 Outfit / Appearance (āļŠāļĨāļąāļšāļŠāļļāļ” / āļ‹āđˆāļ­āļ™āđ€āļŠāļ·āđ‰āļ­āļœāđ‰āļē)

+
+ +
+
āļŠāļĨāļąāļšāļāļēāļĢāđāļŠāļ”āļ‡āļœāļĨāđ€āļŠāļ·āđ‰āļ­āļœāđ‰āļē (SkinnedMeshRenderer) āļ‚āļ­āļ‡āļ•āļąāļ§āļĨāļ°āļ„āļĢāļ—āļĩāđˆāļāļģāļĨāļąāļ‡āđ€āļĨāđˆāļ™āļ­āļĒāļđāđˆ āđ‚āļ”āļĒāļĒāļąāļ‡āļ„āļ‡āđāļŠāļ”āļ‡āđ‚āļĄāđ€āļ”āļĨāļšāļ­āļ”āļĩāđ‰āđ€āļ”āļīāļĄāđ„āļ§āđ‰
+
+

Emergency Unstuck & Black Screen Recovery

@@ -146,9 +154,9 @@
Camp: Count: @@ -412,6 +420,11 @@ async function rollback10s() { refresh(); } +async function toggleClothes() { + const r = await api('/api/player/toggle-clothes', { method: 'POST' }); + log('toggle clothes: ' + JSON.stringify(r)); +} + function onEnemyPresetChange() { const sel = document.getElementById('enemypreset').value; if (sel !== 'custom') { @@ -421,8 +434,8 @@ function onEnemyPresetChange() { async function spawnEnemy() { const body = { - enemyId: parseInt(document.getElementById('enemyId').value || '100101', 10), - camp: parseInt(document.getElementById('enemyCamp').value || '2', 10), + enemyId: parseInt(document.getElementById('enemyId').value || '40900579', 10), + camp: parseInt(document.getElementById('enemyCamp').value || '0', 10), count: parseInt(document.getElementById('enemyCount').value || '1', 10) }; const r = await api('/api/enemy/spawn', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) });