```
feat(fight): 优化擂台战斗逻辑与状态管理 - 修改了擂台主人设置逻辑,引入 `Set` 方法统一处理玩家信息更新 - 增加对擂主是否可战斗的判断,防止无效挑战 - 调整连胜计算和广播机制,确保数据一致性 - 修复擂台挑战失败时的状态回滚问题 - 引入错误码替代硬编码返回值,提高代码可读性与维护性 - 统一访问擂台玩家的方式,移除冗余字段
This commit is contained in:
@@ -94,11 +94,11 @@ type DefaultEndData struct {
|
||||
type EnumBattleOverReason int
|
||||
|
||||
var BattleOverReason = enum.New[struct {
|
||||
PlayerOffline EnumBattleOverReason `enum:"1"` //掉线
|
||||
PlayerOVerTime EnumBattleOverReason `enum:"2"` //超时
|
||||
PlayerCaptureSuccess EnumBattleOverReason `enum:"3"` //捕捉成功
|
||||
DefaultEnd EnumBattleOverReason `enum:"4"` //默认结束
|
||||
PlayerEscape EnumBattleOverReason `enum:"5"` //逃跑
|
||||
PlayerOffline EnumBattleOverReason `enum:"1"` //掉线
|
||||
PlayerOVerTime EnumBattleOverReason `enum:"2"` //超时
|
||||
NOTwind EnumBattleOverReason `enum:"3"` //打成平手
|
||||
DefaultEnd EnumBattleOverReason `enum:"4"` //默认结束
|
||||
PlayerEscape EnumBattleOverReason `enum:"5"` //逃跑
|
||||
}]()
|
||||
|
||||
// 战斗模式
|
||||
|
||||
Reference in New Issue
Block a user