chore(vscode): 更新调试配置并删除无用的 API 代码
- 在 .vscode/launch.json 中添加了新的 Go 调试配置项 - 删除了 blazing/common/api 目录下未使用的 Kick.pb.go 和 Quit.pb.go 文件
This commit is contained in:
50
common/socket/errorcode/error.go
Normal file
50
common/socket/errorcode/error.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package errorcode
|
||||
|
||||
import "github.com/tnnmigga/enum"
|
||||
|
||||
// ErrorCode 错误码枚举类型
|
||||
type ErrorCode uint32
|
||||
|
||||
// ErrorMap 错误码到错误信息的映射
|
||||
//var ErrorMap = make(map[ErrorCode]ErrorInfo)
|
||||
|
||||
// ErrorCodes 错误码注册表
|
||||
var ErrorCodes = enum.New[struct {
|
||||
// 系统错误码
|
||||
ErrLoginFailed ErrorCode `enum:"10001"` // 登录失败
|
||||
ErrAlreadyLoggedIn ErrorCode `enum:"10004"` // 已在别处登录
|
||||
ErrIllegalLanguage ErrorCode `enum:"10005"` // 使用非法语言
|
||||
ErrUserOffline ErrorCode `enum:"10006"` // 用户离线
|
||||
ErrSystemBusy ErrorCode `enum:"10003"` // 系统繁忙
|
||||
ErrInvalidPassword ErrorCode `enum:"10002"` // 密码错误
|
||||
ErrXinDouLimit ErrorCode `enum:"103106"` // XIN豆上限
|
||||
ErrNoFollowedPet ErrorCode `enum:"19001"` // 无跟随精灵
|
||||
ErrWrongElementType ErrorCode `enum:"19002"` // 元素类型错误
|
||||
ErrPositionOccupied ErrorCode `enum:"10101"` // 位置已被占用
|
||||
ErrXinPlanSleeping ErrorCode `enum:"10009"` // XIN计划休眠
|
||||
ErrNoEnergy ErrorCode `enum:"10010"` // 能量不足
|
||||
|
||||
// 战斗相关错误码
|
||||
ErrFightCanceled ErrorCode `enum:"11001"` // 战斗取消
|
||||
ErrFightFinished ErrorCode `enum:"11002"` // 战斗已结束
|
||||
ErrAlreadyActed ErrorCode `enum:"11012"` // 本回合已操作
|
||||
ErrCannotCancelFight ErrorCode `enum:"11005"` // 不能取消对战
|
||||
ErrNoEnergyForFight ErrorCode `enum:"11013"` // 精灵无体力
|
||||
ErrDifferentScene ErrorCode `enum:"11008"` // 不在同一场景
|
||||
ErrNoBossInScene ErrorCode `enum:"11009"` // 场景中无Boss
|
||||
ErrNoQualifiedPet ErrorCode `enum:"11030"` // 无符合条件的精灵
|
||||
ErrExceedFightHours ErrorCode `enum:"11010"` // 在线时间过长
|
||||
|
||||
// 精灵相关错误码
|
||||
ErrNoRequiredPets ErrorCode `enum:"13001"` // 缺少必要精灵
|
||||
ErrAlreadyExchanged ErrorCode `enum:"13002"` // 已兑换过精灵
|
||||
ErrCannotEvolve ErrorCode `enum:"13009"` // 精灵不能进化
|
||||
ErrLevelTooLow ErrorCode `enum:"13007"` // 等级不足
|
||||
ErrCannotDisplayPet ErrorCode `enum:"13017"` // 不能展示精灵
|
||||
ErrAlreadyEaten ErrorCode `enum:"17018"` // 今天已被吃掉
|
||||
ErrItemInUse ErrorCode `enum:"13023"` // 道具正在使用
|
||||
ErrPetNotExist ErrorCode `enum:"103011"` // 精灵不存在
|
||||
ErrCannotRevive ErrorCode `enum:"13033"` // 不能还原元神
|
||||
|
||||
// 其他错误码...
|
||||
}]()
|
||||
Reference in New Issue
Block a user