```
feat(build): 更新构建脚本添加资源打包和proto编译 更新build.bat脚本,添加proto文件编译和资源打包功能,调整资源打包顺序。 BREAKING CHANGE: 构建流程发生变化,需要重新生成proto文件和打包资源。 --- refactor(xmlres): 使用gres替换gfile读取资源文件 将xmlres模块中文件读取方式从gfile.GetBytes改为gres.GetContent, 使
This commit is contained in:
@@ -2,13 +2,11 @@ package rpc
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/base/service"
|
||||
"blazing/modules/config/model"
|
||||
|
||||
"context"
|
||||
|
||||
"github.com/butoften/array"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
func GetServerInfoList() []ServerInfo {
|
||||
@@ -18,17 +16,17 @@ func GetServerInfoList() []ServerInfo {
|
||||
cool.DBM(dictInfoModel1).Scan(&ret)
|
||||
//fmt.Println(t)
|
||||
var ret1 []ServerInfo
|
||||
ip, _ := service.NewBaseSysParamService().DataByKey(context.Background(), "server_ip")
|
||||
testip, _ := service.NewBaseSysParamService().DataByKey(context.Background(), "test_ip")
|
||||
// ip, _ := service.NewBaseSysParamService().DataByKey(context.Background(), "server_ip")
|
||||
// testip, _ := service.NewBaseSysParamService().DataByKey(context.Background(), "test_ip")
|
||||
|
||||
for _, v := range ret {
|
||||
tt := newServerInfo()
|
||||
tt.OnlineID = uint32(v.OnlineID)
|
||||
|
||||
tt.IP = ip
|
||||
if tt.OnlineID == 2 {
|
||||
tt.IP = v.IP
|
||||
if v.IsVip != 0 {
|
||||
tt.UserCnt = 300
|
||||
tt.IP = testip
|
||||
|
||||
}
|
||||
tt.Port = v.Port
|
||||
|
||||
@@ -50,9 +48,9 @@ func GetServerInfoList() []ServerInfo {
|
||||
array.Sort(&ret1, func(a ServerInfo, b ServerInfo) bool {
|
||||
return a.OnlineID < b.OnlineID
|
||||
})
|
||||
ret1 = lo.UniqBy(ret1, func(s ServerInfo) int {
|
||||
return int(s.Port)
|
||||
})
|
||||
// ret1 = lo.UniqBy(ret1, func(s ServerInfo) int {
|
||||
// return int(s.Port)
|
||||
// })
|
||||
//fmt.Printf("升序 Sort: %v\n", ret1)
|
||||
return ret1
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ func (h *ServerHandler) RegisterLogic(ctx context.Context, id, port uint16) erro
|
||||
if !ok {
|
||||
return fmt.Errorf("no reverse client")
|
||||
}
|
||||
t, _ := blservice.NewLoginServiceService().GetServerID(id)
|
||||
aa, ok := cool.GetClient(t)
|
||||
t := blservice.NewLoginServiceService().GetServerID(id)
|
||||
aa, ok := cool.GetClient(t.Port)
|
||||
if ok && aa != nil { //如果已经存在且这个端口已经被存过
|
||||
aa.QuitSelf(0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user