- 编程
- 数学
- 动漫
jasonxudeveloper / protobuf-net-v2-for-ilruntime Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
傑 15:36:50
可以提个issue
傑 15:36:53
我感觉是你这个被裁减了
傑 15:36:57
也可以做个clr绑定
protobuff 加上下面 注释的代码 ,序列化时报空
注释掉后正常
[global::ProtoBuf.ProtoMember(2)]
// [global::System.ComponentModel.DefaultValue("")]
public string token = "";
obj is null.
Local Variables:
T v0 = null, IOException ex = null, T v2 = null
IL_0012: call System.Object ProtoBuf.Serializer::Deserialize(System.Type,System.IO.Stream)
at ProtobufHelper.ProtoDeSerialize(Byte[] msg) D:\Project\cross-gate-client\Assets\Scripts\HotUpdate\Protobuf\ProtobufHelper.cs:Line 39
at Demo.Test() D:\Project\cross-gate-client\Assets\Scripts\HotUpdate\Protobuf\Demo.cs:Line 32
ProtoBuf.ProtoException: obj is null.
at ProtoBuf.Serializers.TypeSerializer.CreateInstance (ProtoBuf.ProtoReader source, System.Boolean includeLocalCallback) [0x00179] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Serializers\TypeSerializer.cs:331
at ProtoBuf.Serializers.TypeSerializer.Read (System.Object value, ProtoBuf.ProtoReader source) [0x00094] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Serializers\TypeSerializer.cs:209
at ProtoBuf.Meta.RuntimeTypeModel.Deserialize (System.Int32 key, System.Object value, ProtoBuf.ProtoReader source) [0x00082] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Meta\RuntimeTypeModel.cs:839
at ProtoBuf.ProtoReader.ReadTypedObject (System.Object value, System.Int32 key, ProtoBuf.ProtoReader reader, System.Type type) [0x00033] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\ProtoReader.cs:607
at ProtoBuf.ProtoReader.ReadObject (System.Object value, System.Int32 key, ProtoBuf.ProtoReader reader) [0x00001] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\ProtoReader.cs:594
at ProtoBuf.Serializers.SubItemSerializer.ProtoBuf.Serializers.IProtoSerializer.Read (System.Object value, ProtoBuf.ProtoReader source) [0x00001] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Serializers\SubItemSerializer.cs:81
at ProtoBuf.Serializers.TagDecorator.Read (System.Object value, ProtoBuf.ProtoReader source) [0x00049] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Serializers\TagDecorator.cs:80
at ProtoBuf.Serializers.FieldDecorator.Read (System.Object value, ProtoBuf.ProtoReader source) [0x0000b] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Serializers\FieldDecorator.cs:39
at ProtoBuf.Serializers.TypeSerializer.Read (System.Object value, ProtoBuf.ProtoReader source) [0x0010b] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Serializers\TypeSerializer.cs:226
at ProtoBuf.Meta.RuntimeTypeModel.Deserialize (System.Int32 key, System.Object value, ProtoBuf.ProtoReader source) [0x00082] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Meta\RuntimeTypeModel.cs:839
at ProtoBuf.Meta.TypeModel.DeserializeCore (ProtoBuf.ProtoReader reader, System.Type type, System.Object value, System.Boolean noAutoCreate) [0x0001f] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Meta\TypeModel.cs:764
at ProtoBuf.Meta.TypeModel.Deserialize (System.IO.Stream source, System.Object value, System.Type type, ProtoBuf.SerializationContext context) [0x0002a] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Meta\TypeModel.cs:627
at ProtoBuf.Meta.TypeModel.Deserialize (System.IO.Stream source, System.Object value, System.Type type) [0x00001] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Meta\TypeModel.cs:604
at ProtoBuf.Serializer.Deserialize (System.Type type, System.IO.Stream source) [0x00001] in D:\Project\cross-gate-client\Assets\ThirdParty\Protobuf\protobuf-net-v2-for-ILRuntime\protobuf-net\Serializer.cs:94
at ILRuntime.Runtime.Generated.ProtoBuf_Serializer_Binding.Deserialize_1 (ILRuntime.Runtime.Intepreter.ILIntepreter __intp, ILRuntime.Runtime.Stack.StackObject* __esp, System.Collections.Generic.IList`1[T] __mStack, ILRuntime.CLR.Method.CLRMethod __method, System.Boolean isNewObj) [0x0006b] in D:\Project\cross-gate-client\Assets\Scripts\System\ILRuntime\Generated\ProtoBuf_Serializer_Binding.cs:96
at (wrapper delegate-invoke) <Module>.invoke_StackObject*_ILIntepreter_StackObject*_IList`1<object>_CLRMethod_bool(ILRuntime.Runtime.Intepreter.ILIntepreter,ILRuntime.Runtime.Stack.StackObject*,System.Collections.Generic.IList`1<object>,ILRuntime.CLR.Method.CLRMethod,bool)
at ILRuntime.Runtime.Intepreter.ILIntepreter.Execute (ILRuntime.CLR.Method.ILMethod method, ILRuntime.Runtime.Stack.StackObject* esp, System.Boolean& unhandledException) [0x033e4] in D:\Project\cross-gate-client\Packages\[email protected]\Runtime\Intepreter\ILIntepreter.cs:1823
UnityEngine.Debug:LogError (object)
ApplicationManager/<>c:<Start>b__1_0 (System.Exception) (at Assets/Scripts/System/ApplicationManager.cs:51)
UniRx.MainThreadDispatcher:UnsafeSend (System.Action) (at Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadDispatcher.cs:276)
UniRx.Scheduler/IgnoreTimeScaleMainThreadScheduler/<DelayAction>d__2:MoveNext () (at Assets/Plugins/UniRx/Scripts/UnityEngineBridge/MainThreadScheduler.cs:240)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
--热更工程的类
[ProtoBuf.ProtoContract]
public class HotData
{
[ProtoBuf.ProtoMember(1)]
public string msg;
[ProtoBuf.ProtoMember(2)]
public Data data;
}
--非热更工程的类
[ProtoBuf.ProtoContract]
public class Data
{
[ProtoBuf.ProtoMember(1)]
public int id;
[ProtoBuf.ProtoMember(2)]
public string name;
[ProtoBuf.ProtoMember(3)]
public Label label;
[ProtoBuf.ProtoContract]
public enum Label
{
A,
B,
C
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.