60 lines
2.8 KiB
Go
60 lines
2.8 KiB
Go
package routers
|
|
|
|
import (
|
|
"context"
|
|
"sync"
|
|
)
|
|
|
|
var _ = sync.Mutex{}
|
|
var _ = context.Background
|
|
|
|
//
|
|
// 家具摆放探针(T1-22 排障用)—— 在玩家脚下周围摆一圈**指定 pathId 的真家具**。
|
|
// 为什么要有它:网格流(68956797 / 68969593)到底有没有在客户端实例化东西,光看日志说不清;
|
|
// 而 SpawnGadgetAsync 这条**显式摆放**通道是已经验证过的(健身房器材 / PropRestock 都走它,
|
|
// 麦当劳座椅实测摆出来过)。所以拿它当基准:
|
|
// · 摆出来的椅子看得到 ⇒ 显式摆放通,家具缺失纯粹是**缺坐标**(PropRestock 只覆盖 55/5116 格);
|
|
// · 连摆在脚边都看不到 ⇒ 摆放通道本身有问题,先修通道,别再往坐标表里填数。
|
|
// ⛑️ 全部参数走配置 + 热重载,改 pathId / 数量不用重新编译;想再摆一次就把 gen +1。
|
|
//
|
|
func GameRouter_DebugPlace_DebugPlaceStateOf(ctx context.Context, session *GameSession) any {
|
|
// Router implementation for GameRouter_DebugPlace_DebugPlaceStateOf
|
|
var zero any; return zero
|
|
}
|
|
|
|
//
|
|
// 每 tick 调一次;gen 没变就直接返回,所以不会刷屏。
|
|
//
|
|
func GameRouter_DebugPlace_TickDebugPlaceAsync(ctx context.Context, session *GameSession, state any, px float32, pz float32) any {
|
|
// Router implementation for GameRouter_DebugPlace_TickDebugPlaceAsync
|
|
var zero any; return zero
|
|
}
|
|
|
|
//
|
|
// 把本探针摆出去的那批 gadget 撤掉:`SyncGadgetRemoveList`(68199571, `List<ulong> ids` + int reason)。
|
|
// ⛑ 只撤 owner.PlacedUids 记下来的这批 —— 不能用 RemoveGadgetsAsync(state) 全清,
|
|
// 那份 state.SpawnedGadgets 里还混着 PropRestock / GymEquipment 摆的全场物件,会一起被端掉。
|
|
// ⛑ 硬规则 238:移除是批量包,日志一行汇总,不逐条打。
|
|
//
|
|
func GameRouter_DebugPlace_ClearDebugPlacedAsync(ctx context.Context, session *GameSession, state any, owner any, ids []any) any {
|
|
// Router implementation for GameRouter_DebugPlace_ClearDebugPlacedAsync
|
|
var zero any; return zero
|
|
}
|
|
|
|
type DebugPlaceSessionState struct {
|
|
SyncRoot any `json:"syncRoot"`
|
|
// 上一次摆放用的 gen。gen 变了才重新摆 —— 这就是「热重载再试一次」的开关。
|
|
LastGen int32 `json:"lastGen"`
|
|
// 合成 uid 的自增源,高位起跳避免撞上客户端烘焙出来的真实 id。
|
|
Seq int64 `json:"seq"`
|
|
//
|
|
// 当前场上由本探针摆出去的 uid。两个用途:
|
|
// ① `gen` 变化时先把上一轮撤掉再摆新的(否则旧的不消失,越摆越多);
|
|
// ② `enabled=false` 时整体撤掉 —— 这就是「清场」开关,不用重连。
|
|
// ⛑ 不能走 `RemoveGadgetsAsync(null)`:那会把 `state.SpawnedGadgets` 里
|
|
// PropRestock / GymEquipment 摆的全场物件一起清掉。
|
|
//
|
|
PlacedUids []uint64 `json:"placedUids"`
|
|
}
|
|
|