Giter VIP home page Giter VIP logo

protobuf-net-v2-for-ilruntime's Introduction

数据

人生

  • 编程
  • 数学
  • 动漫

protobuf-net-v2-for-ilruntime's People

Contributors

jasonxudeveloper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

protobuf-net-v2-for-ilruntime's Issues

Protobuf.Serializer.Deserialize时类型string 的长度限制问题。

当字符串大小为小于128时候
QQ截图20231125172556
QQ截图20231125172545
此时是正常的解析并输出。然而当字符串大于127以后则无法解析和输出。
QQ截图20231125172645
QQ截图20231125172655

但实际上数据是可以看到的。只是无法解析而出。
image

查了一下官网的描述:
image

所以不太明白这里的限制到底是怎么发生的。希望能获得杰哥的帮助~!

热更工程中的数据类包含非热更工程中的类时,反序列化报错

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
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.