feat(config): 添加服务器调试模式配置和塔配置重构

- 在ServerList结构体中添加IsDebug字段用于调试模式标识
- 修改GetServerInfoList函数增加isdebug参数支持
- 移除硬编码的rpcaddr本地地址配置
- 重构塔配置模型,将tower_500和tower_600合并到tower_110
This commit is contained in:
2026-01-08 23:57:22 +08:00
parent 4d0464c76b
commit 971abd29ab
26 changed files with 221 additions and 291 deletions

View File

@@ -6,19 +6,17 @@ import (
"blazing/logic/service/user"
"blazing/modules/base/service"
"golang.org/x/sync/singleflight"
"github.com/panjf2000/gnet/v2"
)
var sg singleflight.Group
// var sg singleflight.Group
var ServerList []rpc.ServerInfo
// var ServerList []rpc.ServerInfo
func fetchData() (any, error) {
ServerList = rpc.GetServerInfoList() //todo 待修改增加缓存
return ServerList, nil
}
// func fetchData() (any, error) {
// ServerList = rpc.GetServerInfoList() //todo 待修改增加缓存
// return ServerList, nil
// }
// GetServerOnline 处理命令: 105
func (h Controller) GetServerOnline(data *user.SidInfo, c gnet.Conn) (result *rpc.CommendSvrInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
@@ -27,10 +25,10 @@ func (h Controller) GetServerOnline(data *user.SidInfo, c gnet.Conn) (result *rp
if service.NewBaseSysUserService().GetPerson(data.Head.UserID).Debug == 1 {
result.IsVip = 1
}
v, _, _ := sg.Do("GetServerInfoList", fetchData)
result.ServerList = v.([]rpc.ServerInfo) //todo 待修改增加缓存
//v, _, _ := sg.Do("GetServerInfoList", fetchData)
//result.ServerList = v.([]rpc.ServerInfo) //todo 待修改增加缓存
result.ServerList = rpc.GetServerInfoList()
return
//return //TODO 这里待实现改成接口调用Ret方法