83 lines
4.0 KiB
Go
83 lines
4.0 KiB
Go
package routers
|
||
|
||
import (
|
||
"context"
|
||
"sync"
|
||
)
|
||
|
||
var _ = sync.Mutex{}
|
||
var _ = context.Background
|
||
|
||
//
|
||
// 移动命令的回执观测 —— AskReportLogicAgentCommandSuccess2(67057559)、
|
||
// AskReportLogicAgentCommandFail(67193144)、AskReportLogicAgentCommandData2(67780469)、
|
||
// AskAgentPoiActionDone(67016793)。
|
||
// 移植自捐赠端 DremkaPS(2026-09-24)。他们这几条端点的价值写得很直白:
|
||
// SyncLogicAgentCommand 对服务端是 fire-and-forget —— 客户端装了这条命令、还是拿到就丢了,
|
||
// 在出站日志里长得一模一样。这几条是客户端的回答,有了它们,「行人还是不走」才能细分成
|
||
// 「客户端收了 12 条一条没跑」还是「每一条进来就被拒了」—— 两种完全不同的故障,
|
||
// 修法也完全相反。这正是服务端侧 stall 看门狗(规则 45)缺的那只眼睛。
|
||
// ⛑⛑ 三条本服的取舍:
|
||
// 1. 只观测,不改判定。回执计数先落进 AmbientPed,但不参与
|
||
// StepFailCount 的回收判据 —— 那套判据是实测调过的,先把数据看清楚再动。
|
||
// 日志里同时打出 stepFail=,两者的相关性肉眼就能对上。
|
||
// 2. 只认我们自己的人。捐赠端提醒过:ambient crowd 和客户端自己的场景行人也走这几条
|
||
// notify,所以这里按 agentId 在 AmbientState.Peds 里查,查不到就直接返回。
|
||
// 3. POI 不重放。捐赠端的 AskAgentPoiActionDone 会把同一个 POI 再放回去,
|
||
// 但本服根本不下发任何 POI action(Handlers / RpcTypes 里没有 POI 载荷),重放无从谈起;
|
||
// 而他们自己也写了客户端「350 ms 内上报 31 条」,没有闸门的重放就是一场包风暴。
|
||
// 这里只记观测日志。
|
||
//
|
||
func GameRouter_AgentCommandAck_AgentCommandSuccess(ctx context.Context, conn any, msg any) any {
|
||
// Router implementation for GameRouter_AgentCommandAck_AgentCommandSuccess
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_AgentCommandAck_AgentCommandFail(ctx context.Context, conn any, msg any) any {
|
||
// Router implementation for GameRouter_AgentCommandAck_AgentCommandFail
|
||
var zero any; return zero
|
||
}
|
||
|
||
//
|
||
// AskReportLogicAgentCommandData2 是 per-agent 的状态 / 层报告。只记条数与关键字段:
|
||
// 它回答的是「客户端到底有没有在跑这台状态机」,不需要逐条解析 Data。
|
||
//
|
||
func GameRouter_AgentCommandAck_AgentCommandReport(ctx context.Context, conn any, msg any) any {
|
||
// Router implementation for GameRouter_AgentCommandAck_AgentCommandReport
|
||
var zero any; return zero
|
||
}
|
||
|
||
//
|
||
// AskAgentPoiActionDone:观测 only(理由见文件头第 3 条)。
|
||
//
|
||
func GameRouter_AgentCommandAck_AgentPoiActionDone(ctx context.Context, conn any, msg any) any {
|
||
// Router implementation for GameRouter_AgentCommandAck_AgentPoiActionDone
|
||
var zero any; return zero
|
||
}
|
||
|
||
// ------------------------------------------------------------------ helpers
|
||
//
|
||
// 按实测偏移读回执里的 (agentId, commandId)。agentId 固定 8 字节 LE,commandId 紧跟其后 4 字节 LE。
|
||
// 长度不够就返回 false —— 宁可记一条 undecodable,也不要读半个字段当真值。
|
||
//
|
||
func GameRouter_AgentCommandAck_TryReadCommandAck(ctx context.Context, body []byte, agentOffset int32, agentId uint64, commandId int32) bool {
|
||
// Router implementation for GameRouter_AgentCommandAck_TryReadCommandAck
|
||
return true
|
||
}
|
||
|
||
func GameRouter_AgentCommandAck_FindAmbientPed(ctx context.Context, session *GameSession, agentId uint64) any {
|
||
// Router implementation for GameRouter_AgentCommandAck_FindAmbientPed
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_AgentCommandAck_LogAck(ctx context.Context, conn any, kind string, agentId uint64, commandId int32, acks int32, fails int32, count int32, ped any) any {
|
||
// Router implementation for GameRouter_AgentCommandAck_LogAck
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_AgentCommandAck_NoteUndecodable(ctx context.Context, conn any, kind string, bytes int32) any {
|
||
// Router implementation for GameRouter_AgentCommandAck_NoteUndecodable
|
||
var zero any; return zero
|
||
}
|
||
|