feat(config): 重构配置结构并添加服务器列表支持 - 重命名PortBL字段为GameOnlineID,改进命名语义 - 添加ServerList结构体用于管理服务器配置 - 移除七牛云配置相关字段 - 更新ID生成器使用GameOnlineID参数 fix(server): 调整服务器启动参数和VIP逻辑 - 将启动参数从-port改为-id,统一参数命名 - 更新服务器启动逻辑,基于GameOnlineID获取服务器信息 - 为VIP服务器启用调试模式 - 优化端口可用性检查逻辑 refactor(model): 统一模型基类结构 - 将各模型中的*cool.Model嵌入改为Base基类 - 移除soul.go
52 lines
1.0 KiB
Go
52 lines
1.0 KiB
Go
package model
|
||
|
||
import (
|
||
"blazing/cool"
|
||
)
|
||
|
||
const TableNamePlayerBagItem = "player_bag_item"
|
||
|
||
// PlayerBagItem mapped from table <player_bag_item>
|
||
type Item struct {
|
||
Base
|
||
PlayerID uint64 `gorm:"not null;index:idx_player_bag_item_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||
// 物品Id,
|
||
ItemId uint32 `json:"item_id"`
|
||
|
||
// 物品数量,
|
||
ItemCnt uint32 `json:"item_cnt"`
|
||
}
|
||
|
||
type SingleItemInfo struct {
|
||
// 物品Id,
|
||
ItemId uint32 `json:"itemId"`
|
||
// 物品数量,
|
||
ItemCnt uint32 `json:"itemCnt"`
|
||
// 固定值360000,
|
||
LeftTime uint32 `json:"leftTime"`
|
||
// 固定值0,
|
||
ItemLevel uint32 `json:"itemLevel"`
|
||
}
|
||
|
||
// TableName PlayerBagItem's table name
|
||
func (*Item) TableName() string {
|
||
return TableNamePlayerBagItem
|
||
}
|
||
|
||
// GroupName PlayerBagItem's table group
|
||
func (*Item) GroupName() string {
|
||
return "default"
|
||
}
|
||
|
||
// NewPlayerBagItem create a new PlayerBagItem
|
||
func NewPlayerBag() *Item {
|
||
return &Item{
|
||
Base: *NewBase(),
|
||
}
|
||
}
|
||
|
||
// init 创建表
|
||
func init() {
|
||
cool.CreateTable(&Item{})
|
||
}
|