Files
Ananta-ps/internal/config/runtime_config_editor.go

29 lines
1.0 KiB
Go
Raw Permalink 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 config
import (
"encoding/json"
"sync"
)
var _ = json.RawMessage{}
var _ = sync.Mutex{}
//
// GM 面板「实时调参」用的运行时配置编辑器。
// 为什么需要它:以前改任何一个 private-server.json 里的数值都要
// ① 手编两份 json(源码目录 + bin 运行时副本)② 重启服务端。
// 现在面板直接改**被加载的那一份** json 并热重载 PrivateServerConfigStore,
// 改完立刻生效(每 tick 读配置的子系统,如车流 / 市民 / 人群)。
// ⛑️ 不是所有配置都能热生效:端口、路径、登录期下发的东西是**启动时读一次**的,
// 改了要重启。UI 里对这两组做了提示。
//
type RuntimeConfigEditor struct {
// 启动时读一次、改完必须重启的顶层分组。
RestartRequiredGroups []string `json:"restartRequiredGroups"`
ReadOptions any `json:"readOptions"`
WriteOptions any `json:"writeOptions"`
// 需要重启才生效的顶层分组名。
RestartGroups []string `json:"restartGroups"`
}