```
feat(build): 更新构建脚本添加资源打包和proto编译 更新build.bat脚本,添加proto文件编译和资源打包功能,调整资源打包顺序。 BREAKING CHANGE: 构建流程发生变化,需要重新生成proto文件和打包资源。 --- refactor(xmlres): 使用gres替换gfile读取资源文件 将xmlres模块中文件读取方式从gfile.GetBytes改为gres.GetContent, 使
This commit is contained in:
@@ -153,28 +153,28 @@ type PlayerInfo struct {
|
||||
GraduationCount uint32 `struc:"uint32" default:"0" json:"graduation_count"` // 毕业人数
|
||||
}
|
||||
|
||||
MaxPuniLv uint32 `struc:"uint32" default:"0" json:"max_puni_lv"` // 默认0, 虚无 元素 能量 生命 轮回 永恒 圣洁 最高为8
|
||||
PetMaxLevel uint32 `struc:"uint32" json:"pet_max_level"` // 精灵最高等级
|
||||
AllPetNumber uint32 `struc:"uint32" json:"all_pet_number"` // 精灵数量
|
||||
MonKingWin uint32 `struc:"uint32" json:"mon_king_win"` // 精灵王胜场
|
||||
MessWin uint32 `struc:"skip" json:"mess_win"` // 大乱斗胜场
|
||||
CurrentStage uint32 `struc:"uint32" default:"1" json:"current_stage"` // 勇者之塔层数
|
||||
MaxStage uint32 `struc:"uint32" json:"max_stage"` // 试炼之塔最高层
|
||||
CurrentFreshStage uint32 `struc:"uint32" json:"current_fresh_stage"` // 当前试炼层数
|
||||
MaxFreshStage uint32 `struc:"uint32" json:"max_fresh_stage"` // 最高试炼层
|
||||
MaxArenaWins uint32 `struc:"uint32" json:"max_arena_wins"` // 星际擂台连胜
|
||||
TwoTimes uint32 `struc:"uint32" default:"0" json:"two_times"` // 双倍经验加速器剩余使用次数
|
||||
ThreeTimes uint32 `struc:"uint32" default:"0" json:"three_times"` // 三倍经验加速器剩余使用次数
|
||||
AutoFight uint32 `struc:"uint32" default:"0" json:"auto_fight"` // 是否自动战斗
|
||||
AutoFightTime uint32 `struc:"uint32" default:"0" json:"auto_fight_time"` // 自动战斗剩余的场次
|
||||
EnergyTime uint32 `struc:"uint32" default:"0" json:"energy_time"` // 能量吸收仪剩余次数
|
||||
LearnTimes uint32 `struc:"uint32" default:"0" json:"learn_times"` // 学习力吸收仪剩余次数
|
||||
MonBattleMedal uint32 `struc:"uint32" default:"0" json:"mon_battle_medal"` // 默认0
|
||||
RecordCount uint32 `struc:"uint32" default:"0" json:"record_count"` // 默认0
|
||||
ObtainTm uint32 `struc:"uint32" default:"0" json:"obtain_tm"` // 默认0
|
||||
SoulBeadItemID uint32 `struc:"uint32" json:"soul_bead_item_id"` // 当前元神珠id
|
||||
ExpireTm uint32 `struc:"uint32" default:"0" json:"expire_tm"` // 默认0
|
||||
FuseTimes uint32 `struc:"uint32" default:"0" json:"fuse_times"` // 默认0
|
||||
MaxPuniLv uint32 `struc:"uint32" default:"0" json:"max_puni_lv"` // 默认0, 虚无 元素 能量 生命 轮回 永恒 圣洁 最高为8
|
||||
PetMaxLevel uint32 `struc:"uint32" json:"pet_max_level"` // 精灵最高等级
|
||||
AllPetNumber uint32 `struc:"uint32" json:"all_pet_number"` // 精灵数量
|
||||
MonKingWin uint32 `struc:"uint32" json:"mon_king_win"` // 精灵王胜场
|
||||
MessWin uint32 `struc:"skip" json:"mess_win"` // 大乱斗胜场
|
||||
CurrentStage uint32 `struc:"uint32" default:"1" json:"current_stage"` // 勇者之塔层数
|
||||
MaxStage uint32 `struc:"uint32" json:"max_stage"` // 试炼之塔最高层
|
||||
CurrentFreshStage uint32 `struc:"uint32" default:"1" json:"current_fresh_stage"` // 当前试炼层数
|
||||
MaxFreshStage uint32 `struc:"uint32" json:"max_fresh_stage"` // 最高试炼层
|
||||
MaxArenaWins uint32 `struc:"uint32" json:"max_arena_wins"` // 星际擂台连胜
|
||||
TwoTimes uint32 `struc:"uint32" default:"0" json:"two_times"` // 双倍经验加速器剩余使用次数
|
||||
ThreeTimes uint32 `struc:"uint32" default:"0" json:"three_times"` // 三倍经验加速器剩余使用次数
|
||||
AutoFight uint32 `struc:"uint32" default:"0" json:"auto_fight"` // 是否自动战斗
|
||||
AutoFightTime uint32 `struc:"uint32" default:"0" json:"auto_fight_time"` // 自动战斗剩余的场次
|
||||
EnergyTime uint32 `struc:"uint32" default:"0" json:"energy_time"` // 能量吸收仪剩余次数
|
||||
LearnTimes uint32 `struc:"uint32" default:"0" json:"learn_times"` // 学习力吸收仪剩余次数
|
||||
MonBattleMedal uint32 `struc:"uint32" default:"0" json:"mon_battle_medal"` // 默认0
|
||||
RecordCount uint32 `struc:"uint32" default:"0" json:"record_count"` // 默认0
|
||||
ObtainTm uint32 `struc:"uint32" default:"0" json:"obtain_tm"` // 默认0
|
||||
SoulBeadItemID uint32 `struc:"uint32" json:"soul_bead_item_id"` // 当前元神珠id
|
||||
ExpireTm uint32 `struc:"uint32" default:"0" json:"expire_tm"` // 默认0
|
||||
FuseTimes uint32 `struc:"uint32" default:"0" json:"fuse_times"` // 默认0
|
||||
|
||||
NONO struct {
|
||||
//fieldDescription:"1为跟随 0为收回 且如果为收回 那么后续结构不需要发送, 不序列化"
|
||||
|
||||
@@ -83,25 +83,13 @@ func (s *LoginService) SetServerID(OnlineID uint16, Port uint16) error {
|
||||
return nil
|
||||
|
||||
}
|
||||
func (s *LoginService) GetServerID(OnlineID uint16) (uint16, error) {
|
||||
var tttt model.ServerList
|
||||
func (s *LoginService) GetServerID(OnlineID uint16) *model.ServerList {
|
||||
var tttt *model.ServerList
|
||||
err := cool.DBM(s.Model).Where("online_id", OnlineID).Scan(&tttt)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return nil
|
||||
}
|
||||
|
||||
// record, err := m.One()
|
||||
// if err != nil {
|
||||
// return 0, err
|
||||
// }
|
||||
// if record == nil {
|
||||
// //说明是新的服务器
|
||||
|
||||
// return 0, fmt.Errorf("未找到服务器")
|
||||
// }
|
||||
// var tttt model.ServerList
|
||||
// record.Struct(&tttt)
|
||||
|
||||
return tttt.Port, nil
|
||||
return tttt
|
||||
|
||||
}
|
||||
|
||||
22
modules/config/controller/admin/server.go
Normal file
22
modules/config/controller/admin/server.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/config/service"
|
||||
)
|
||||
|
||||
type ServerController struct {
|
||||
*cool.Controller
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
// 注册路由
|
||||
cool.RegisterController(&ServerController{
|
||||
&cool.Controller{
|
||||
Prefix: "/admin/config/server",
|
||||
Api: []string{"Add", "Delete", "Update", "Info", "List", "Page"},
|
||||
Service: service.NewServerService(),
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -25,7 +25,7 @@ type PetBaseConfig struct {
|
||||
|
||||
// ===================== 战斗核心属性(BossMon节点) =====================
|
||||
MonID int32 `gorm:"not null;comment:'BOSS对应的精灵ID'" json:"mon_id"`
|
||||
Nature uint32 `gorm:"not null;default:0;comment:'BOSS属性-性格'" json:"nature"`
|
||||
Nature int32 `gorm:"not null;default:0;comment:'BOSS属性-性格'" json:"nature"`
|
||||
Effect []uint32 `gorm:"type:jsonb;not null;default:'[]';comment:'BOSS特性'" json:"effect"`
|
||||
Lv int32 `gorm:"not null;comment:'BOSS等级(LvHpMatchUser非0时此配置无效)'" json:"lv"`
|
||||
Color string `gorm:"comment:'BOSS颜色'" json:"color"`
|
||||
|
||||
@@ -10,10 +10,17 @@ const TableNameServerList = "server_list"
|
||||
// ServerList mapped from table <server_list>
|
||||
type ServerList struct {
|
||||
*cool.Model
|
||||
OnlineID uint16 `gorm:"column:online_id;comment:'在线ID';uniqueIndex" json:"online_id"`
|
||||
//IP string `gorm:"type:varchar(16);comment:'服务器IP'" json:"ip"`
|
||||
Port uint16 `gorm:"comment:'端口号,通常是小整数'" json:"port"`
|
||||
//IsOpen bool `gorm:"default:true;not null;comment:'服务器是否开启,默认为开启状态'" json:"is_open"`
|
||||
OnlineID uint16 `gorm:"column:online_id;comment:'在线ID';uniqueIndex" json:"online_id"`
|
||||
IP string `gorm:"type:string;comment:'服务器IP'" json:"ip"`
|
||||
Port uint16 `gorm:"comment:'端口号,通常是小整数'" json:"port"`
|
||||
IsOpen bool `gorm:"default:true;not null;comment:'服务器是否开启,默认为开启状态'" json:"is_open"`
|
||||
CanPort []uint32 `gorm:"type:jsonb;comment:'可连接端口'" json:"can_port"`
|
||||
IsVip uint32 `gorm:"default:0;not null;comment:'是否为VIP服务器'" json:"is_vip"`
|
||||
//服务器异色概率设定ServerList
|
||||
ShinyRate uint8 `gorm:"default:0;comment:'异色概率'" json:"shiny_rate"`
|
||||
//服务器天气设定ServerList
|
||||
WeatherRate uint8 `gorm:"default:0;comment:'天气概率'" json:"weather_rate"`
|
||||
Desc string `gorm:"comment:'服务器描述'" json:"desc"`
|
||||
}
|
||||
|
||||
// TableName ServerList's table name
|
||||
|
||||
18
modules/config/service/server.go
Normal file
18
modules/config/service/server.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/config/model"
|
||||
)
|
||||
|
||||
type ServerService struct {
|
||||
*cool.Service
|
||||
}
|
||||
|
||||
func NewServerService() *ServerService {
|
||||
return &ServerService{
|
||||
&cool.Service{
|
||||
Model: model.NewServerList(),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -15,20 +15,38 @@ func NewTaskService() *TaskService {
|
||||
return &TaskService{
|
||||
&cool.Service{
|
||||
Model: model.NewTaskConfig(),
|
||||
PageQueryOp: &cool.QueryOp{
|
||||
FieldEQ: []string{"task_type"},
|
||||
},
|
||||
//UniqueKey: map[string]string{"task_id": "索引不能重复"},
|
||||
},
|
||||
}
|
||||
}
|
||||
func (s *TaskService) Get(id, os uint32) *model.TaskConfig {
|
||||
var item *model.TaskConfig
|
||||
cool.DBM(s.Model).Where("task_id", id).Where("out_state", os).
|
||||
var item []model.TaskConfig
|
||||
cool.DBM(s.Model).Where("task_id", id).
|
||||
Cache(gdb.CacheOption{
|
||||
// Duration: time.Hour,
|
||||
|
||||
Force: false,
|
||||
}).Scan(&item)
|
||||
var res *model.TaskConfig
|
||||
if len(item) == 1 { //只有一个直接默认
|
||||
res = &item[0]
|
||||
}
|
||||
if len(item) > 1 { //
|
||||
|
||||
return item
|
||||
for _, v := range item {
|
||||
if v.OutState == os {
|
||||
res = &item[os]
|
||||
return res
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return res
|
||||
|
||||
}
|
||||
func (s *TaskService) GetDaily() []model.TaskConfig {
|
||||
|
||||
Reference in New Issue
Block a user