fix(socket): 玩家断开连接时增加保存锁,避免重复保存
在玩家断开连接时,使用 sync.Once 确保只保存一次玩家数据, 防止因并发或多次触发导致的数据异常。 feat(fight): 增加战斗资格判断与邀请取消功能 - 新增 Player.CanFight() 方法用于统一判断是否可以参与战斗 - 在多个战斗相关接口中加入 CanFight 检查 - 添加“取消战斗邀请”指令及处理逻辑(cmd: 2402) - 修复部分错误码不准确的问题,提升提示一致性 refactor(login): 优化登录流程并增强健壮性 - 提前校验 session 合法性 - 增强获取玩家信息后的空指针检查 - 调整挖矿数据重置方式为 defer 执行 - 优化日志输出内容,便于调试追踪 docs(model): 更新部门、菜单等模型字段命名规范 将 orderNum 字段改为 ordernum,保持数据库列名风格一致, 同时更新了 base_sys_role 中 userId 为 userid。 perf(rate-limit): 提高登录接口的限流 Burst 容量 调整限流器配置,将请求 burst 容量从 2 提升至 5, 以应对短时间高频访问场景,改善用户体验。 chore(build): 忽略新增编译产物和临时文件 在 .gitignore 中添加 logic/logic2、login/login 等新生成文件路径, 避免误提交二进制文件到版本控制。
This commit is contained in:
@@ -9,7 +9,7 @@ type BaseSysDepartment struct {
|
||||
*cool.Model
|
||||
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 部门名称
|
||||
ParentID uint `gorm:"column:parentId;type:bigint" json:"parentId"` // 上级部门ID
|
||||
OrderNum int32 `gorm:"column:orderNum;type:int;not null" json:"orderNum"` // 排序
|
||||
ordernum int32 `gorm:"column:ordernum;type:int;not null" json:"ordernum"` // 排序
|
||||
}
|
||||
|
||||
// TableName BaseSysDepartment's table name
|
||||
|
||||
@@ -13,7 +13,7 @@ type BaseSysMenu struct {
|
||||
Perms *string `gorm:"column:perms;type:text" json:"perms"` // 权限标识
|
||||
Type int32 `gorm:"column:type;not null" json:"type"` // 类型 0:目录 1:菜单 2:按钮
|
||||
Icon *string `gorm:"column:icon;type:varchar(255)" json:"icon"` // 图标
|
||||
OrderNum int32 `gorm:"column:orderNum;type:int;not null;default:0" json:"orderNum"` // 排序
|
||||
ordernum int32 `gorm:"column:ordernum;type:int;not null;default:0" json:"ordernum"` // 排序
|
||||
ViewPath *string `gorm:"column:viewPath;type:varchar(255)" json:"viewPath"` // 视图地址
|
||||
KeepAlive bool `gorm:"column:keepAlive;not null;default:1" json:"keepAlive"` // 路由缓存
|
||||
IsShow bool `gorm:"column:isShow;not null;default:1" json:"isShow"` // 是否显示
|
||||
|
||||
@@ -7,7 +7,7 @@ const TableNameBaseSysRole = "base_sys_role"
|
||||
// BaseSysRole mapped from table <base_sys_role>
|
||||
type BaseSysRole struct {
|
||||
*cool.Model
|
||||
UserID string `gorm:"column:userId;type:varchar(255);not null" json:"userId"` // 用户ID
|
||||
UserID string `gorm:"column:userid;type:varchar(255);not null" json:"userid"` // 用户ID
|
||||
Name string `gorm:"column:name;type:varchar(255);not null;index:IDX_469d49a5998170e9550cf113da,priority:1" json:"name"` // 名称
|
||||
Label *string `gorm:"column:label;type:varchar(50);index:IDX_f3f24fbbccf00192b076e549a7,priority:1" json:"label"` // 角色标签
|
||||
Remark *string `gorm:"column:remark;type:varchar(255)" json:"remark"` // 备注
|
||||
|
||||
Reference in New Issue
Block a user