```
refactor(logic): 重构服务器启动逻辑与任务状态管理 - 移除了 `gcmd` 包在 controller 中的直接使用,改为通过参数传递端口和服务器类型 - 统一使用 `GetTask` 和 `SetTask` 方法替代直接访问 `TaskList` 数组,提升代码可维护性 - 修改了战斗逻辑中部分调试打印语句,并优化战斗循环结束日志输出 - 调整了新手玩家初始化流程,默认完成新手任务4 - 更新了数据库模型字段及结构定义,如增加 `max_ts` 字段、扩展 `TaskList` 长度等 - 改进了宠物添加逻辑,采用 SQL 方式确保捕捉时间唯一递增 - 清理了无用或注释掉的旧代码块
This commit is contained in:
@@ -2,7 +2,6 @@ package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
|
||||
"blazing/cool"
|
||||
|
||||
@@ -26,14 +25,15 @@ var (
|
||||
go cool.ListenFunc(ctx)
|
||||
}
|
||||
//go robot()
|
||||
go reg()
|
||||
s := g.Server()
|
||||
s.Use(Limiter, ghttp.MiddlewareHandlerResponse)
|
||||
s.EnableAdmin()
|
||||
s.SetServerAgent(cool.Config.Name)
|
||||
s.BindHookHandler("/*", ghttp.HookBeforeServe, beforeServeHook)
|
||||
runtime.SetMutexProfileFraction(1) // (非必需)开启对锁调用的跟踪
|
||||
runtime.SetBlockProfileRate(1) // (非必需)开启对阻塞操作的跟踪
|
||||
s.EnablePProf()
|
||||
// runtime.SetMutexProfileFraction(1) // (非必需)开启对锁调用的跟踪
|
||||
// runtime.SetBlockProfileRate(1) // (非必需)开启对阻塞操作的跟踪
|
||||
// s.EnablePProf()
|
||||
// 如果存在 data/cool-admin-vue/dist 目录,则设置为主目录
|
||||
if gfile.IsDir("public") {
|
||||
s.SetServerRoot("public")
|
||||
|
||||
Reference in New Issue
Block a user