Ejemplo n.º 1
0
 public override void Deserialize(JHSNetworkReader reader)
 {
     RESPONSE = reader.ReadByte();
     if (RESPONSE == SUCCESS)
     {
         PlayerNick     = Encoding.UTF8.GetString(reader.ReadBytesAndSize());
         LeaguePosition = reader.ReadByte();
         Gold           = reader.ReadPackedUInt32();
         Silver         = reader.ReadPackedUInt32();
         LoginTocken    = reader.ReadPackedUInt32();
         GameCount      = reader.ReadByte();
         LEVEL          = reader.ReadPackedUInt32();
         EXP            = reader.ReadPackedUInt32();
         League         = (LeagueType)reader.ReadByte();
         SEASON         = reader.ReadByte();
         LEGUE_STATUS   = (LeagueStatus)reader.ReadByte();
         Priviledge     = reader.ReadByte();
         int lenght = reader.ReadByte();
         characters = new ServerCharacter[lenght];
         for (int i = 0; i < lenght; i++)
         {
             characters[i] = new ServerCharacter()
             {
                 PlayerId  = reader.ReadPackedUInt32(),
                 ModelId   = reader.ReadPackedUInt32(),
                 IsChanged = reader.ReadBoolean(),
             };
             if (characters[i].IsChanged)
             {
                 characters[i].SkinColorId   = reader.ReadByte();
                 characters[i].HairColorId   = reader.ReadByte();
                 characters[i].EyeColorId    = reader.ReadByte();
                 characters[i].ShirtColorId  = reader.ReadByte();
                 characters[i].PantsColorId  = reader.ReadByte();
                 characters[i].BootsColorId  = reader.ReadByte();
                 characters[i].GlovesColorId = reader.ReadByte();
             }
         }
         int alenght = reader.ReadByte();
         actives = new uint[alenght];
         for (int i = 0; i < alenght; i++)
         {
             actives[i] = reader.ReadPackedUInt32();
         }
         IsPushLevelUp = reader.ReadBoolean();
     }
 }
Ejemplo n.º 2
0
 public override void Deserialize(JHSNetworkReader reader)
 {
     STATUS = reader.ReadByte();
     if (STATUS == 0)
     {
         Gold      = reader.ReadPackedUInt32();
         Silver    = reader.ReadPackedUInt32();
         character = new ServerCharacter()
         {
             PlayerId      = reader.ReadPackedUInt32(),
             ModelId       = reader.ReadPackedUInt32(),
             SkinColorId   = reader.ReadByte(),
             HairColorId   = reader.ReadByte(),
             EyeColorId    = reader.ReadByte(),
             ShirtColorId  = reader.ReadByte(),
             PantsColorId  = reader.ReadByte(),
             BootsColorId  = reader.ReadByte(),
             GlovesColorId = reader.ReadByte()
         };
     }
 }