[]嵌套类型的protobuf报错
message LoginResult {
required int32 result = 1;
optional string authToken = 2;
repeated ServerInfo serverList = 3;
optional int32 platformErrorCode = 4;
optional string par1 = 5;
optional string par2 = 6;
optional string recommendedUId = 7;
}
message ServerInfo {
required int32 id = 1;
required string name = 2;
required string address = 3;
required int32 status = 4;
optional string serverUId = 5;
optional int32 controlStatus = 6;
optional string closeMessage = 7;
}
这种嵌套类型的proto decode的时候报错
Uncaught TypeError: this.clazz is not a constructor
at Message.ProtoBuf.Reflect.MessagePrototype.decode (protobuf.js?tick=17185:3213)
at Element.ProtoBuf.Reflect.ElementPrototype.decode (protobuf.js?tick=17185:2201)
at Field.ProtoBuf.Reflect.FieldPrototype.decode (protobuf.js?tick=17185:3743)
at Message.ProtoBuf.Reflect.MessagePrototype.decode (protobuf.js?tick=17185:3249)
at Function.ProtoBuf.Reflect.MessagePrototype.build.Message.decode (protobuf.js?tick=17185:2949)
at ProtobufConverter.gtea.net.ProtobufConverter.__proto__.decode (gtea.js?tick=17185:1120)
at XMLHttpRequest.BaseUI.extend.getServerData.request.onreadystatechange (login.js:467)
required int32 result = 1;
optional string authToken = 2;
repeated ServerInfo serverList = 3;
optional int32 platformErrorCode = 4;
optional string par1 = 5;
optional string par2 = 6;
optional string recommendedUId = 7;
}
message ServerInfo {
required int32 id = 1;
required string name = 2;
required string address = 3;
required int32 status = 4;
optional string serverUId = 5;
optional int32 controlStatus = 6;
optional string closeMessage = 7;
}
这种嵌套类型的proto decode的时候报错
Uncaught TypeError: this.clazz is not a constructor
at Message.ProtoBuf.Reflect.MessagePrototype.decode (protobuf.js?tick=17185:3213)
at Element.ProtoBuf.Reflect.ElementPrototype.decode (protobuf.js?tick=17185:2201)
at Field.ProtoBuf.Reflect.FieldPrototype.decode (protobuf.js?tick=17185:3743)
at Message.ProtoBuf.Reflect.MessagePrototype.decode (protobuf.js?tick=17185:3249)
at Function.ProtoBuf.Reflect.MessagePrototype.build.Message.decode (protobuf.js?tick=17185:2949)
at ProtobufConverter.gtea.net.ProtobufConverter.__proto__.decode (gtea.js?tick=17185:1120)
at XMLHttpRequest.BaseUI.extend.getServerData.request.onreadystatechange (login.js:467)
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
jiye
赞同来自:
http://ask.layabox.com/question/2249
cuixueying
赞同来自: