192 lines
9.3 KiB
Go
192 lines
9.3 KiB
Go
package routers
|
||
|
||
import (
|
||
"context"
|
||
"sync"
|
||
)
|
||
|
||
var _ = sync.Mutex{}
|
||
var _ = context.Background
|
||
|
||
//
|
||
// 开放世界通缉系统(Wanted)——「警车版」。
|
||
// 2026-09-23 自捐赠端 PrivateServer修改_miyuki_fix 的 GameRouter.Wanted.cs 移植。
|
||
// ★ 与捐赠端的关键差异(都是刻意的):
|
||
// 1. **只做警车,不做步行警员**。捐赠端的步行警员靠它自己的 crowd agent 管线
|
||
// (CrowdAgent / PushLogicAgentHandoff / PushCrowdTaskCommand /
|
||
// CrowdAdvanceEstimate),本方没有那套类型,且它那份日志早于它自己的最后一次改动
|
||
// ⇒ 步行警员那半根本没被实机验证过。警车由**客户端自己的车辆 AI** 驱动
|
||
// (NavConfigId=1002 / ChaseDirectlySpeed=26),服务端只负责"派"和"撤"。
|
||
// 2. 因此**自动逃脱/被捕的判据换了**。捐赠端用"最近警员距离"(它自己算的位置),
|
||
// 警车版拿不到警车位置(客户端 AI 不外报),改成两个服务端真信号:
|
||
// · 通缉持续超过 WantedPursuitTimeoutSeconds4229938 ⇒ 自动逃脱;
|
||
// · 玩家倒地(state.PlayerDowned)⇒ 自动被捕。
|
||
// 3. 没有 resetAfterArrest / RestartCurrentWorld(本方没有那个方法),
|
||
// 被捕就是清场 + 罚款。
|
||
// 4. 不碰 CrimeGameplay(商店抢劫/偷车任务链),那半依赖本方完全没有的
|
||
// GmTasks 任务状态物件。
|
||
// ⛑️ 完全绕开官方犯罪通道:不接 SyncAgentCrimeAdd(68831313)、
|
||
// ReportPoliceCrimeEvent(67146776)、GmAddCrimeValue(69946581)。犯罪值是服务端自己加的,
|
||
// 代价是"只有服务端认可的行为会涨值",好处是不会被官方那些未摸清的帧时序炸客户端。
|
||
// 回滚:把 wanted.enabled 置 false(或直接删本文件 + 摘掉三处挂钩)。
|
||
//
|
||
func GameRouter_Wanted_WantedCrimeSettings(ctx context.Context, ) any {
|
||
// Router implementation for GameRouter_Wanted_WantedCrimeSettings
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_SetWantedCrimeSettings(ctx context.Context, options any) any {
|
||
// Router implementation for GameRouter_Wanted_SetWantedCrimeSettings
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_WantedReport(ctx context.Context, session any) any {
|
||
// Router implementation for GameRouter_Wanted_WantedReport
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_WantedActionAsync(ctx context.Context, session any, options any, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_WantedActionAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
// ── 犯罪值状态机 ────────────────────────────────────────────────────────────────────
|
||
func GameRouter_Wanted_SetWantedValueAsync(ctx context.Context, session *GameSession, state any, requestedValue uint32, reason string, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_SetWantedValueAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_AddWantedCrimeAsync(ctx context.Context, session *GameSession, state any, points uint32, reason string, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_AddWantedCrimeAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
//
|
||
// 犯罪事件入口。由三处挂钩调用:npc-hit / npc-kill(玩家打路人、敌人)、
|
||
// vehicle-hit / vehicle-destroy(玩家砸车)。targetId=0 直接忽略。
|
||
//
|
||
func GameRouter_Wanted_RegisterWantedCrimeIncidentAsync(ctx context.Context, session *GameSession, incident string, targetId uint64, attackerId uint64, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_RegisterWantedCrimeIncidentAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_SetWantedLevelAsync(ctx context.Context, session *GameSession, state any, level uint32, reason string, token context.Context, explicitValue any) any {
|
||
// Router implementation for GameRouter_Wanted_SetWantedLevelAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
// ── 出警 ───────────────────────────────────────────────────────────────────────────
|
||
func GameRouter_Wanted_SpawnWantedPoliceAsync(ctx context.Context, session *GameSession, state any, level uint32, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_SpawnWantedPoliceAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
// ── 追捕循环(警车版:只判「超时逃脱」与「倒地被捕」)─────────────────────────────
|
||
func GameRouter_Wanted_StartWantedPursuitLoop(ctx context.Context, session *GameSession, state any) any {
|
||
// Router implementation for GameRouter_Wanted_StartWantedPursuitLoop
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_RunWantedPursuitLoopAsync(ctx context.Context, session *GameSession, state any, generation int32, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_RunWantedPursuitLoopAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
// ── 结算 ───────────────────────────────────────────────────────────────────────────
|
||
func GameRouter_Wanted_BeginWantedEscapeAsync(ctx context.Context, session *GameSession, state any, requestedSeconds int32, requestedReward any, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_BeginWantedEscapeAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_CompleteWantedEscapeAfterDelayAsync(ctx context.Context, session *GameSession, generation int32, seconds int32) any {
|
||
// Router implementation for GameRouter_Wanted_CompleteWantedEscapeAfterDelayAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_CompleteWantedEscapeAsync(ctx context.Context, session *GameSession, state any, expectedGeneration any, requestedReward any, reason string, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_CompleteWantedEscapeAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_CompleteWantedArrestAsync(ctx context.Context, session *GameSession, state any, requestedPenalty any, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_CompleteWantedArrestAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_ClearWantedAsync(ctx context.Context, session *GameSession, state any, reason string, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_ClearWantedAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_ClearWantedDispatchAsync(ctx context.Context, session *GameSession, state any, reason string, token context.Context) any {
|
||
// Router implementation for GameRouter_Wanted_ClearWantedDispatchAsync
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_CancelWantedEscapeLocked(ctx context.Context, state any) any {
|
||
// Router implementation for GameRouter_Wanted_CancelWantedEscapeLocked
|
||
var zero any; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_WantedLevelForValue4229938(ctx context.Context, value uint32) uint32 {
|
||
// Router implementation for GameRouter_Wanted_WantedLevelForValue4229938
|
||
return 0
|
||
}
|
||
|
||
func GameRouter_Wanted_MinimumWantedValue4229938(ctx context.Context, level uint32) uint32 {
|
||
// Router implementation for GameRouter_Wanted_MinimumWantedValue4229938
|
||
return 0
|
||
}
|
||
|
||
// 警车刷在玩家背后 30~54 m(背后 = 玩家朝向的反方向),横向错开 ±7 m。
|
||
func GameRouter_Wanted_WantedPoliceSpawnPosition(ctx context.Context, target Vec3, facing float32, ordinal int32) Vec3 {
|
||
// Router implementation for GameRouter_Wanted_WantedPoliceSpawnPosition
|
||
var zero Vec3; return zero
|
||
}
|
||
|
||
func GameRouter_Wanted_NormalizeWantedFacing(ctx context.Context, value float32) float32 {
|
||
// Router implementation for GameRouter_Wanted_NormalizeWantedFacing
|
||
return 0
|
||
}
|
||
|
||
type WantedCrimeSettings4229938 struct {
|
||
Enabled bool `json:"enabled"`
|
||
NpcHitPoints uint32 `json:"npcHitPoints"`
|
||
NpcKillPoints uint32 `json:"npcKillPoints"`
|
||
VehicleHitPoints uint32 `json:"vehicleHitPoints"`
|
||
VehicleDestroyPoints uint32 `json:"vehicleDestroyPoints"`
|
||
AutoEscapeEnabled bool `json:"autoEscapeEnabled"`
|
||
ArrestOnPlayerDown bool `json:"arrestOnPlayerDown"`
|
||
PursuitTimeoutSeconds int32 `json:"pursuitTimeoutSeconds"`
|
||
VehiclesPerLevel int32 `json:"vehiclesPerLevel"`
|
||
RewardPerLevel float64 `json:"rewardPerLevel"`
|
||
PenaltyPerLevel float64 `json:"penaltyPerLevel"`
|
||
}
|
||
|
||
type WantedPursuitRuntime struct {
|
||
Cancellation *context.CancelFunc `json:"cancellation"`
|
||
Loop *any `json:"loop"`
|
||
Generation int32 `json:"generation"`
|
||
}
|
||
|
||
type WantedActionOptions struct {
|
||
Action string `json:"action"`
|
||
Level uint32 `json:"level"`
|
||
CrimeValue uint32 `json:"crimeValue"`
|
||
Points uint32 `json:"points"`
|
||
Seconds int32 `json:"seconds"`
|
||
Amount *float64 `json:"amount"`
|
||
Enabled *bool `json:"enabled"`
|
||
NpcHitPoints uint32 `json:"npcHitPoints"`
|
||
NpcKillPoints uint32 `json:"npcKillPoints"`
|
||
VehicleHitPoints uint32 `json:"vehicleHitPoints"`
|
||
VehicleDestroyPoints uint32 `json:"vehicleDestroyPoints"`
|
||
AutoEscapeEnabled *bool `json:"autoEscapeEnabled"`
|
||
ArrestOnPlayerDown *bool `json:"arrestOnPlayerDown"`
|
||
PursuitTimeoutSeconds int32 `json:"pursuitTimeoutSeconds"`
|
||
VehiclesPerLevel int32 `json:"vehiclesPerLevel"`
|
||
RewardPerLevel float64 `json:"rewardPerLevel"`
|
||
PenaltyPerLevel float64 `json:"penaltyPerLevel"`
|
||
}
|
||
|