优化协议代理代码生成

This commit is contained in:
flswld
2023-01-30 21:30:04 +08:00
parent c753dc53cd
commit 5a175722d7
9 changed files with 71 additions and 66 deletions

View File

@@ -301,17 +301,15 @@ func (f *FightRoutine) getAllPlayer(entityMap map[uint32]*Entity) []uint32 {
}
var ClientCmdProtoMap *client_proto.ClientCmdProtoMap
var ClientCmdProtoMapRefValue reflect.Value
func initClientCmdProtoMap() {
if config.CONF.Hk4e.ClientProtoProxyEnable {
ClientCmdProtoMap = client_proto.NewClientCmdProtoMap()
ClientCmdProtoMapRefValue = reflect.ValueOf(ClientCmdProtoMap)
}
}
func GetClientProtoObjByName(protoObjName string) pb.Message {
fn := ClientCmdProtoMapRefValue.MethodByName("GetClientProtoObjByName")
fn := ClientCmdProtoMap.RefValue.MethodByName("GetClientProtoObjByName")
ret := fn.Call([]reflect.Value{reflect.ValueOf(protoObjName)})
obj := ret[0].Interface()
if obj == nil {