优化代码

This commit is contained in:
flswld
2023-02-18 22:09:59 +08:00
parent 21fb9d400f
commit e580baeb46
37 changed files with 198 additions and 118 deletions

View File

@@ -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)