feat(middleware): 添加WebSocket服务端处理器

添加了WebSocket服务端处理器,支持WebSocket连接的升级和处理,
包括授权验证功能的实现

fix(fight): 修复NPC战斗逻辑中的问题

移除了NPC回合结束时的调试输出,优化了NPC技能选择逻辑,
确保只选择可使用的技能,并添加了NPC动作执行
This commit is contained in:
2026-01-07 02:30:21 +08:00
parent f5eb445aa0
commit 3c5b9a4ce8
7 changed files with 183 additions and 49 deletions

View File

@@ -13,7 +13,7 @@ type ServerList struct {
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"`
IsOpen uint8 `gorm:"default:0;not null;comment:'是否开启'" json:"is_open"`
//登录地址
LoginAddr string `gorm:"type:string;comment:'登录地址'" json:"login_addr"`
//账号