This commit is contained in:
1
2026-01-23 14:59:15 +00:00
parent 95055fe955
commit 53be2cb776
8 changed files with 129 additions and 121 deletions

View File

@@ -47,7 +47,7 @@ func ParseCmd[T any](data []byte) T {
func Init(isGame bool) {
// 获取控制器实例的反射值
controllerValue := reflect.ValueOf(Maincontroller)
// 获取控制器类型
controllerType := controllerValue.Type()
@@ -86,11 +86,11 @@ func Init(isGame bool) {
Req: methodValue.Type().In(0).Elem(),
// Res: , // TODO 待实现对不同用户初始化方法以取消全局cmdcache
}
_, exists := cool.CmdCache.LoadOrStore(cmd, cmdInfo)
if exists { // 方法已存在
glog.Error(context.Background(), "命令处理方法已存在,跳过注册", cmd, method.Name)
}
cool.CmdCache[cmd] = cmdInfo
// if exists { // 方法已存在
// glog.Error(context.Background(), "命令处理方法已存在,跳过注册", cmd, method.Name)
// }
}
}
}