mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-17 04:32:27 +08:00
优化代码
This commit is contained in:
@@ -46,7 +46,8 @@ type Hk4e struct {
|
||||
Version string `toml:"version"` // 支持的客户端协议版本号 三位数字 多个以逗号分隔 如300,310,320
|
||||
GateTcpMqAddr string `toml:"gate_tcp_mq_addr"` // 访问网关tcp直连消息队列的地址 填网关的内网地址
|
||||
GateTcpMqPort int32 `toml:"gate_tcp_mq_port"`
|
||||
LoginSdkUrl string `toml:"login_sdk_url"` // 网关登录验证token的sdk服务器地址 目前填dispatch的内网地址
|
||||
LoginSdkUrl string `toml:"login_sdk_url"` // 网关登录验证token的sdk服务器地址 目前填dispatch的内网地址
|
||||
LoadSceneLuaConfig bool `toml:"load_scene_lua_config"` // 是否加载场景详情LUA配置数据
|
||||
}
|
||||
|
||||
// MQ 消息队列
|
||||
@@ -59,6 +60,10 @@ func InitConfig(filePath string) {
|
||||
CONF.loadConfigFile(filePath)
|
||||
}
|
||||
|
||||
func GetConfig() *Config {
|
||||
return CONF
|
||||
}
|
||||
|
||||
// 加载配置文件
|
||||
func (c *Config) loadConfigFile(filePath string) {
|
||||
_, err := toml.DecodeFile(filePath, &c)
|
||||
|
||||
Reference in New Issue
Block a user