大量优化

This commit is contained in:
flswld
2023-01-05 01:29:00 +08:00
parent f991480192
commit 27f16d9063
226 changed files with 2651 additions and 2484 deletions

View File

@@ -304,10 +304,16 @@ func initClientCmdProtoMap() {
func GetClientProtoObjByName(protoObjName string) pb.Message {
if !config.CONF.Hk4e.ClientProtoProxyEnable {
return &proto.NullMsg{}
logger.Error("client proto proxy func not enable")
return nil
}
clientProtoObj := ClientCmdProtoMapRefValue.MethodByName(
"GetClientProtoObjByName",
).Call([]reflect.Value{reflect.ValueOf(protoObjName)})[0].Interface().(pb.Message)
fn := ClientCmdProtoMapRefValue.MethodByName("GetClientProtoObjByName")
ret := fn.Call([]reflect.Value{reflect.ValueOf(protoObjName)})
obj := ret[0].Interface()
if obj == nil {
logger.Error("try to get a not exist proto obj, protoObjName: %v", protoObjName)
return nil
}
clientProtoObj := obj.(pb.Message)
return clientProtoObj
}