refactor(blazing): 重构任务系统并优化相关功能

- 重构了任务系统的数据结构和执行逻辑
- 优化了地图加载和怪物刷新机制
- 改进了宠物系统的基础架构
- 调整了玩家信息和背包的处理方式
- 统一了数据访问层的接口和实现
This commit is contained in:
2025-08-30 21:59:52 +08:00
parent 2ed5c2db27
commit 75e428f62e
23 changed files with 326 additions and 230 deletions

View File

@@ -21,14 +21,17 @@ func (h *Controller) MapEnter(data *maps.InInfo, c *socket.Player) (result *maps
data.Broadcast(c.Info.MapID, *result) //同步广播
// 如果是无怪地图,直接返回
if c.StopChan != nil {
close(c.StopChan)
c.StopChan = nil
}
// 创建新的停止通道
c.StopChan = make(chan struct{})
// 启动刷怪协程
go func(stopChan chan struct{}, currentMap int) {
time.After(5 * time.Second)
<-time.After(5 * time.Second)
// 首次刷新
if !c.IsFighting && c.Info.MapID != 0 {
data.SpawnMonsters(c, true)