Giter Site home page Giter Site logo

Comments (2)

JasonXuDeveloper avatar JasonXuDeveloper commented on June 9, 2024

嗯 似乎是解析ILWrapperType的地方有问题,没解析到RealType,明天处理

from nino.

TZSG avatar TZSG commented on June 9, 2024

List 内容为值类型测试OK了,但是为class时有问题。

[Serializable]
    [NinoSerialize]
    public partial class PlayerLoginState2
    {
        [NinoMember(0)] public List<DeviceInfo> TestService;

        public PlayerLoginState2()
        {
            TestService = new List<DeviceInfo>();
        }
    }


[Serializable]
    [NinoSerialize]
    public partial class DeviceInfo
    {
        [NinoMember(0)] public int Type;
        [NinoMember(1)] public string UID;

        public DeviceInfo()
        {
            Type = (int)SystemInfo.deviceType;
            UID = SystemInfo.deviceUniqueIdentifier;
        }
    }



PlayerLoginState2 playerLoginState22 = new PlayerLoginState2();
playerLoginState22.TestService.Add(new DeviceInfo());
string test1 = Convert.ToBase64String(Nino.Serialization.Serializer.Serialize(playerLoginState22));
Log.Print("test1 Serialize OK >" + test1);
var test2 = Nino.Serialization.Deserializer.Deserialize<PlayerLoginState2>(Convert.FromBase64String(test1));
Log.Print("test1 Deserialize OK");

报错

[JEngine] test1 Serialize OK >42bkZuZWMTOzNDCxNDHTtTQ2NtQ1dXa21HU0N3TSNXIyMzFwMTU0czQwBAA=
InvalidOperationException: The type ILRuntime.Runtime.Intepreter.ILTypeInstance does not have NinoSerialize attribute or custom importer/exporter
==========ILRuntime StackTrace==========
IL_0382: call !0 System.Runtime.CompilerServices.TaskAwaiter`1<System.Boolean>::GetResult()
HotUpdateScripts.Lcgames.LoadingPanel/<AccountLogin>d__17.MoveNext() (at HotUpdateScripts/Lcgames/UI/Panel/Base/LoadingPanel.cs:16707566)
--- End of stack trace from previous location ---
IL_0091: call !!0 Nino.Serialization.Deserializer::Deserialize<HotUpdateScripts.Lcgames.PlayerLoginState2>(System.Byte[],System.Text.Encoding,Nino.Serialization.CompressOption)

from nino.

Related Issues (20)

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.