Files

62 lines
3.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Ananta.SDK.Logging;
using Ananta.SDK.Rpc;
using Ananta.Server.Protocol.Client4229938;
namespace Ananta.Server.Handlers.Game;
/// <summary>
/// 飞镖(DartsGame,prefab 上的笼子小游戏;lua <c>LX6/MiniGame/DartsGame/DartsGame.lua</c>)。
///
/// <para>★ 只解决「await 拿不到回执」,<b>治不了 T-pose</b>。</para>
///
/// 角色 T-pose 的根因不在这里:
/// 动画整条链在客户端 —— <c>DartsGame.lua:51</c> 定 <c>timelineName = "Gameplay_Dart"</c>,
/// <c>:1447 Timeline_LoadAndPlay</c>,底层 <c>L50.L50App.L50Game.CutsceneManager</c>
/// (<c>LX6/Manager/Timeline/TimelineManager.lua:37</c>),而这个 LoadAndPlay 是 <b>void</b>
/// ⇒ 失败一个字节的日志都不留。2026-09-24 22:0x 已证资源不缺
/// (Blocks 93G、本局零 AssetBundle/timeline 加载失败、BindRealUnitFeature 0 次),
/// ⇒ 要确认 timeline 到底播没播,只能 frida 实锤(脚本 <c>_frida_dart_probe.py</c>)。
///
/// <para>取证:2026-09-24 22:13:09 ~ 22:14:31 真机一局(handler 生效后首局,dartId=14):</para>
/// <code>
/// INVOKE StartDarts 63777955 bytes=12 hex=0E000000 14000000 03000000
/// dartId=14 challengeId=20 dartMode=3
/// INVOKE TriggerDartTiming 67926798 bytes=1 hex=00 / 01 / 02
/// INVOKE RecordDarts 63225711 bytes=15 hex=14000000 A8000000 00000000 00 FF01
/// challengeId=20 score=168 goal=0 finish=false []
/// </code>
/// ⛑ **`dartMode` 不是常量**:三局实测 20:26局=1 / 21:48局=1 / 22:13局=3,
/// <c>challengeId</c> 恒 20。将来若要做"按模式给不同结算",第三个 u32 就是分支依据,
/// 别照注释里的某一局写死。
///
/// <para>接之前服务端走的是框架兜底
/// <c>! [RPC4229938] unimplemented TriggerDartTiming -> typed-default void 0b</c>,
/// console 看着 <c>e=0 0b</c> 像是过了,但 <b>typed-default 不是语义应答</b>;
/// dump.cs 三条都是非泛型 <c>UXRPCTask</c>(void)⇒ 空包 + err=0 就是客户端要的 OK。
/// 22:13 那局已验:接上后 <c>grep "unimplemented.*Dart" console-latest.log</c> → 空。</para>
///
/// <para>⛑ 为什么只接这三条(硬规则 112):</para>
/// 另外五条 <c>LeaveDart(67039599)</c> / <c>RecordDartEnd(67097646)</c> /
/// <c>RecordDartScore(67483394)</c> / <c>RecordDartId(67567529)</c> /
/// <c>RecordDartPerformEnd(67921918)</c> 在 <c>unknown-methods.log</c> 里是 <b>0 次</b>
/// —— 客户端从没发过,注册它们只是增加维护面。等日志里真出现再照下面抄一行。
///
/// <para>⛑ 回滚:从 GameRouter.cs 的 Enabled4229938MethodIds 里删掉这三条即可
/// (handler 不注册 = 走 typed-neutral 兜底),不用删本文件。</para>
/// </summary>
internal sealed partial class GameRouter
{
[Handler(MethodId.StartDarts)]
[Handler(MethodId.TriggerDartTiming)]
[Handler(MethodId.RecordDarts)]
private Task DartsAccept(Connection conn, UxRpcMessage msg)
{
// body 不长(1~15 字节),直接带 hex 落地:将来要写真契约时这份日志就是免费素材。
var body = msg.Body;
var n = body.Length > 32 ? 32 : body.Length;
var hex = n > 0 ? System.Convert.ToHexString(body.AsSpan(0, n)) : string.Empty;
conn.Log.Info($"[DARTS] accepted {RpcMethodNames.Display(msg.MethodId)} bytes={body.Length} hex={hex}");
return conn.ReturnEmptyOkAsync(msg);
}
}