```
feat(config): 重构配置结构并添加服务器列表支持 - 重命名PortBL字段为GameOnlineID,改进命名语义 - 添加ServerList结构体用于管理服务器配置 - 移除七牛云配置相关字段 - 更新ID生成器使用GameOnlineID参数 fix(server): 调整服务器启动参数和VIP逻辑 - 将启动参数从-port改为-id,统一参数命名 - 更新服务器启动逻辑,基于GameOnlineID获取服务器信息 - 为VIP服务器启用调试模式 - 优化端口可用性检查逻辑 refactor(model): 统一模型基类结构 - 将各模型中的*cool.Model嵌入改为Base基类 - 移除soul.go
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"sort"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/qiniu/go-sdk/v7/auth/qbox"
|
||||
"github.com/qiniu/go-sdk/v7/storage"
|
||||
"golang.org/x/crypto/ssh"
|
||||
@@ -43,8 +44,19 @@ func (s *ServerService) GetPort() []model.ServerList {
|
||||
return item
|
||||
|
||||
}
|
||||
func (s *ServerService) GetServer() []model.ServerList {
|
||||
var item []model.ServerList
|
||||
cool.DBM(s.Model).
|
||||
Cache(gdb.CacheOption{
|
||||
// Duration: time.Hour,
|
||||
|
||||
func (s *ServerService) GetFileList() []File {
|
||||
Force: false,
|
||||
}).Scan(&item)
|
||||
|
||||
return item
|
||||
|
||||
}
|
||||
func (s *ServerService) GetFileList() File {
|
||||
var files []File
|
||||
prefix := "logic"
|
||||
delimiter := "" // 用于分隔目录
|
||||
@@ -52,7 +64,7 @@ func (s *ServerService) GetFileList() []File {
|
||||
for {
|
||||
entries, _, nextMarker, hasNext, err := s.manager.ListFiles(s.bucket, prefix, delimiter, marker, 100)
|
||||
if err != nil {
|
||||
return nil
|
||||
return File{}
|
||||
}
|
||||
// 添加文件到结果列表
|
||||
for _, entry := range entries {
|
||||
@@ -77,7 +89,7 @@ func (s *ServerService) GetFileList() []File {
|
||||
return files[i].Time > files[j].Time
|
||||
})
|
||||
|
||||
return files
|
||||
return files[0]
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user