refactor(controller): 重构ParseCmd函数并优化Init方法

- 修改ParseCmd函数参数,移除不必要的泛型参数T
- 为Init函数添加详细注释说明参数含义
- 优化getCmd函数的注释和代码结构
- 重命名ParseCmdTagWithStructField为parseCmdTagWithStructField以符合私有函数命名规范

refactor(pet_info): 统一玩家参数命名从c到player

- 将pet_info.go中所有方法的player参数名从c改为player
- 保持代码逻辑不变,仅统一参数命名规范
- 更新相关
This commit is contained in:
2025-12-25 12:21:15 +08:00
parent 164e70519f
commit d84100a52f
5 changed files with 149 additions and 137 deletions

View File

@@ -22,6 +22,7 @@ import (
_ "net/http/pprof"
)
// PprofWeb 启动pprof性能分析web服务
func PprofWeb() {
runtime.SetMutexProfileFraction(1) // (非必需)开启对锁调用的跟踪
runtime.SetBlockProfileRate(1) // (非必需)开启对阻塞操作的跟踪
@@ -30,6 +31,8 @@ func PprofWeb() {
panic(err)
}
}
// signalHandlerForMain 主进程信号处理函数
func signalHandlerForMain(sig os.Signal) {
fight.Fightpool.ReleaseTimeout(0)
@@ -41,6 +44,7 @@ func signalHandlerForMain(sig os.Signal) {
fmt.Println("MainProcess is shutting down due to signal:", sig.String())
}
// main 程序主入口函数
func main() {
//loadAccounts()
// if cool.IsRedisMode {
@@ -63,6 +67,7 @@ func main() {
gproc.Listen()
}
// loadAccounts 从CSV文件加载账号信息
func loadAccounts() {
t1, _ := os.Getwd()
data, err := os.ReadFile(t1 + "/b.csv")
@@ -80,4 +85,4 @@ func loadAccounts() {
blservice.NewUserService(uint32(t.ID)).Info.Reg(t.Username, 0)
}
//fmt.Printf("加载 %d 个账号\n", len(accounts))
}
}