diff --git a/admin/apps/game/domain/server.go b/admin/apps/game/domain/server.go index d2144ef..a20dc12 100644 --- a/admin/apps/game/domain/server.go +++ b/admin/apps/game/domain/server.go @@ -9,6 +9,7 @@ import ( "bytes" "fmt" "sort" + "strconv" "strings" "text/template" "time" @@ -32,6 +33,7 @@ type CdnServerNoticeInfo struct { NoticeList []*CdnNoticeInfo } +// todo 根据项目获取不同的cdn推送内容 func genCdnServerListContent(projectEt *entity.Project, serverList, noticeList []*entity.CommonResource) (string, error) { info := &CdnServerNoticeInfo{} hook, _ := projects.GetProjectResourceHook(projectEt, consts.ResourcesName_Server).(projects.IServerInfoHook) @@ -71,7 +73,8 @@ func genCdnServerListContent(projectEt *entity.Project, serverList, noticeList [ serverInfo.Properties[5].Value = fmt.Sprintf("%v", getCdnServerStatus(serverDbInfo)) serverInfo.Properties[6].Key = "area" - serverInfo.Properties[6].Value = "1区" + serverId, _ := strconv.Atoi(serverDbInfo.ServerConfID) + serverInfo.Properties[6].Value = getCdnServerArea(serverId) serverInfo.Properties[7].Key = "type" serverInfo.Properties[7].Value = "1" @@ -109,6 +112,11 @@ func genCdnServerListContent(projectEt *entity.Project, serverList, noticeList [ return bytesBuffer.String(), nil } +func getCdnServerArea(serverId int) string { + // 神魔大陆每4个服对应一个区,从20001开始 + return fmt.Sprintf("%v区", (serverId-20001)/4+1) +} + func getCdnServerStatus(server *model.Server) int { if server.IsServerDown { return consts.CdnServerStatus_Maintain diff --git a/admin/cmd/all_in_one/admin b/admin/cmd/all_in_one/admin index 2d0dedb..4850369 100755 Binary files a/admin/cmd/all_in_one/admin and b/admin/cmd/all_in_one/admin differ diff --git a/admin/uniugm.db b/admin/uniugm.db index b68e650..1ef5b37 100644 Binary files a/admin/uniugm.db and b/admin/uniugm.db differ