45 lines
1.6 KiB
Go
45 lines
1.6 KiB
Go
package routers
|
||||
|
|
|
|||
|
|
import (
|
|||
|
|
"context"
|
|||
|
|
"sync"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
var _ = sync.Mutex{}
|
|||
|
|
var _ = context.Background
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
// Build 4229938 private-server surface: world entry, direct character switching,
|
|||
|
|
// combat, traversal/buffs and movement. Everything else falls back to typed-neutral RPC replies.
|
|||
|
|
//
|
|||
|
|
type GameRouter struct {
|
|||
|
|
GateSessions *GateSessionHub `json:"_gateSessions"`
|
|||
|
|
Enabled4229938MethodIds []uint32 `json:"enabled4229938MethodIds"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
const (
|
|||
|
|
GameRouter_WorldStateKey string = "client4229938-world"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
// 客户端挂起(切后台 / 失焦,RequestPlayerStartHangup)期间必须停止一切后台推送。
|
|||
|
|
// 客户端在 Hangup 时不再消费网络消息;服务端若继续全速写,TCP 缓冲会被灌满,
|
|||
|
|
// 客户端回到前台时判定「与服务器的网络连接已断开」⇒ RPC session 归零
|
|||
|
|
// (Player.log: session=0|pid=0|0->0 + RPCNotify invalid socket)⇒
|
|||
|
|
// 进 Reconnect Module ⇒ 12 秒重连超时。
|
|||
|
|
// 实测 2026-09-22 23:58:19 / 23:58:32 / 00:05:19 三次断线都是这个形态,
|
|||
|
|
// 且每次都紧跟在 [Davinci] type=TimeScaleAnomaly 之后 0.5 ms。
|
|||
|
|
// ⛑️ WorldEntryState.IsHangup 在加这道门之前全项目**只有写入、零处读取**
|
|||
|
|
// (挂起只是记了个日志就不管了),这是断线重连的直接原因。
|
|||
|
|
// 所有后台推送循环在 tick 开头调用它:挂起期间只睡不推,恢复后自动继续。
|
|||
|
|
//
|
|||
|
|
func GameRouter_IsBackgroundPushPaused(ctx context.Context, session any) bool {
|
|||
|
|
// Router implementation for GameRouter_IsBackgroundPushPaused
|
|||
|
|
return true
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func GameRouter_Build(ctx context.Context, ) any {
|
|||
|
|
// Router implementation for GameRouter_Build
|
|||
|
|
var zero any; return zero
|
|||
|
|
}
|
|||
|
|
|