JasonXuDeveloper/Nino

反序列化Int类型错误

iamnewaplayer opened this issue · 3 comments

[NinoMember(9)] public int LoginAppID = -1;
反序列化代码生成
reader.DecompressAndReadNumber<System.Int32>(ref value.LoginAppID);
值是错误的
用反射正常

[NinoSerialize]
public partial class GamePatcher
{

    [NinoMember(1)] public DateTime StaticValidityDateTime = DateTime.MinValue;
    [NinoMember(2)] public int CCC= -1;
    [NinoMember(3)] public string Key = "";
}

public void test()
{
       GamePatcher gp = new GamePatcher();
      gp.CCC=10;
      gp.Key="ajoaiewrnvo";

        var a = Nino.Serialization.Serializer.Serialize<GamePatcher>(gp);
        var b = Nino.Serialization.Deserializer.Deserialize<GamePatcher>(a);
//不生成代码正常
//序列化代码为老版本代码
//生成反序列化代码后 b.CCC的值不正确  
}

测试了,不是nino的问题,是你自己的问题,你自己检查一下是不是之前生成的数据和新生成的数据不一样了