Files
Ananta-ps/pkg/protocol/methods/vehicle_navigation_methods4229938.go
T

60 lines
3.7 KiB
Go
Raw 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.
package methods
//
// Client 4229938 vehicle-navigation (自驾 / 路线规划) payloads — see
// GameRouter.VehicleNav.cs for the handler side.
// ⛑️ 这份请求的字段顺序是按线上抓包反推的,不是照抄捐赠端的 DTO 命名
// (规则 111:donor 契约会被抓包证伪)。证据如下,`logs/unknown-methods.log` 里可复核:
// <code>
// AskVehicleNavigationPathPoints (67317431) bytes=21
// 00000000 EE30BF44 713DCA3F DD94B444 01 00 01 01 00
// └ navReq └ target (u32 + vec3) └ bool×4 + byte profile
// AskVehicleNavigationPathPointsFromPos (67650626) bytes=37 ← 比上面多 start(vec3) + EulerY(f32)
// 00000000 2D94CC44 7A29A8BB 32C1BC44 EE30BF44 713DCA3F DD94B444 01 00 01 01 00 44655B43
// └ navReq └ start └ target └ flags └ EulerY
// AskVehicleNavigationPathLength (67519267) bytes=16 ← 无 navReq,尾部 4B 是 4 个 bool/byte
// </code>
// 实测当天 89 次请求全部是「起点在动、终点固定、每秒一次」⇒ 玩家正开着车跑导航,
// 而我们当时回的是 **空点集 + 长度 0**(DefaultReturnCatalog 的 typed default)。
// ⛑️ 返回形状同样来自客户端:`DefaultReturnCatalog4229938` 里 67317431 / 67650626
// 的 shape 都是 complex(677:ReadUInt32+list7+list7),空值时 9 字节
// FF 00000000 FF 01 FF 01 —— 与捐赠端自己探针打印的期望值逐字节一致。
// 所以重点是:**帧必须是非内联根对象**(前面的 0xFF)+ 两个带 +1 偏置的 Int7 列表。
//
// AskVehicleNavigationPathPoints (67317431) — route from "wherever the car is now".
//
// AskVehicleNavigationPathPointsFromPos (67650626) — same, but the client supplies the start
// position explicitly (plus the car's heading) instead of letting the server guess it. This is
// the variant actually used in play: 89 of today's requests were this one.
//
//
// AskVehicleNavigationPathLength (67519267) — route distance in metres, no geometry.
// Answered with a bare float (shape = "ReadSingle").
//
// AskVehicleStartAutonomousDriving (67600663) — begin self-driving to a target.
// AskVehicleChangeAutonomousDrivingTarget (67057156) — retarget mid-drive.
//
// Client 4229938: IGameSceneToClient.SyncVehicleAutonomousDrivingState (68349264) =
// u64 vehicleEntityId + bool isStart。
// ★★ 这是「车会不会自己开」的唯一开关。取证链(2026-09-27):
// GameSceneToClientImpl.lua:1438 → DriveVehiclesManager.SyncVehicleAutonomousDrivingState
// 把它写进 autoDrivingVehicleDict;UI 的 SetAutoDriving 读的正是这张表,
// 而真正的驾驶 AI 在 C# LX6.Drive.DriveManager(该包 exportOption = LuaAndCSharp,两边都收)。
// ⇒ 服务端不推这个包,车永远不会自动开,哪怕 Start 的回执是 Ok。
// wire 形状照抄同构的 SyncVehicleHackableState(也是 u64 + bool):
// Inline = true ⇒ 裸字段、没有 0xFF 根 marker,与 lua reader 里的连续
// ReadUInt64 / ReadBoolean 逐字节对齐。
//
//
// Client 4229938: IGameSceneToClient.SyncPlayerAutonomousDrivingState (68767968) =
// bool isInOverrideMode + bool isAutoDrivingBlocked + bool isImmersiveModeBlocked。
// 三个开关决定「自动驾驶按钮是否显示 / 是否可点」(InitAutoDriveValidCheck、
// GetAutoDriveInteractable)。不下发时三个值都是 nil —— nil 是 falsy,按钮恰好可用,
// 但显式推全 false 才能让 GM 有办法把它关掉。
//
// AskVehicleCancelAutonomousDrivingTarget (67836393) — clear/forget the nav target.
//
// The answer to both path-points methods (complex 677). Non-inline on purpose: the root 0xFF
// is what the client's reader expects (see the byte notes above).
//