diff --git a/comm/gameconfig.go b/comm/gameconfig.go index c593f99b6..3fa0e52ea 100644 --- a/comm/gameconfig.go +++ b/comm/gameconfig.go @@ -18,6 +18,7 @@ type GameConfig struct { Gateways []string //网关服务["127.0.0.1:7895"] GatewayPorts []int //网关通信端口 Workers []string //工作服 + BattleAddr string //战斗服地址 } //区服db配置 diff --git a/services/cmd/main.go b/services/cmd/main.go index cc347f900..d1c4ceefd 100644 --- a/services/cmd/main.go +++ b/services/cmd/main.go @@ -306,6 +306,12 @@ func convertServiceSttings(config *comm.GameConfig, id int, stype string, ip str sseting.Id = fmt.Sprintf("%s_%s%d", config.AreaId, comm.Service_Worker, id) sseting.Type = comm.Service_Worker sseting.Sys["rpcx"]["RpcxStartType"] = 2 + if config.BattleAddr != "" { + sseting.Modules["battle"]["OpenCheck"] = true + sseting.Modules["battle"]["BattleServerAddr"] = config.BattleAddr + } else { + sseting.Modules["battle"]["OpenCheck"] = false + } break case comm.Service_Mainte: //维护服务 sseting.Id = fmt.Sprintf("%s_%s", config.AreaId, comm.Service_Mainte)