Exemplo n.º 1
0
        public override void Deserialize(IDataReader reader)
        {
            base.Deserialize(reader);
            worldX = reader.ReadShort();
            if (worldX < -255 || worldX > 255)
            {
                throw new Exception("Forbidden value on worldX = " + worldX + ", it doesn't respect the following condition : worldX < -255 || worldX > 255");
            }
            worldY = reader.ReadShort();
            if (worldY < -255 || worldY > 255)
            {
                throw new Exception("Forbidden value on worldY = " + worldY + ", it doesn't respect the following condition : worldY < -255 || worldY > 255");
            }
            mapId     = reader.ReadInt();
            subAreaId = reader.ReadVarShort();
            if (subAreaId < 0)
            {
                throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
            }
            var limit       = reader.ReadUShort();
            var companions_ = new Types.PartyCompanionBaseInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                companions_[i] = new Types.PartyCompanionBaseInformations();
                companions_[i].Deserialize(reader);
            }
            companions = companions_;
        }
Exemplo n.º 2
0
        public virtual void Deserialize(IDataReader reader)
        {
            guestId = reader.ReadVarLong();
            if (guestId < 0 || guestId > 9007199254740990)
            {
                throw new Exception("Forbidden value on guestId = " + guestId + ", it doesn't respect the following condition : guestId < 0 || guestId > 9007199254740990");
            }
            hostId = reader.ReadVarLong();
            if (hostId < 0 || hostId > 9007199254740990)
            {
                throw new Exception("Forbidden value on hostId = " + hostId + ", it doesn't respect the following condition : hostId < 0 || hostId > 9007199254740990");
            }
            name      = reader.ReadUTF();
            guestLook = new Types.EntityLook();
            guestLook.Deserialize(reader);
            breed  = reader.ReadSByte();
            sex    = reader.ReadBoolean();
            status = Types.ProtocolTypeManager.GetInstance <Types.PlayerStatus>(reader.ReadShort());
            status.Deserialize(reader);
            var limit       = reader.ReadUShort();
            var companions_ = new Types.PartyCompanionBaseInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                companions_[i] = new Types.PartyCompanionBaseInformations();
                companions_[i].Deserialize(reader);
            }
            companions = companions_;
        }
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     worldX = reader.ReadShort();
     if (worldX < -255 || worldX > 255)
         throw new Exception("Forbidden value on worldX = " + worldX + ", it doesn't respect the following condition : worldX < -255 || worldX > 255");
     worldY = reader.ReadShort();
     if (worldY < -255 || worldY > 255)
         throw new Exception("Forbidden value on worldY = " + worldY + ", it doesn't respect the following condition : worldY < -255 || worldY > 255");
     mapId = reader.ReadInt();
     subAreaId = reader.ReadVarShort();
     if (subAreaId < 0)
         throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
     var limit = reader.ReadUShort();
     companions = new Types.PartyCompanionBaseInformations[limit];
     for (int i = 0; i < limit; i++)
     {
          companions[i] = new Types.PartyCompanionBaseInformations();
          companions[i].Deserialize(reader);
     }
 }
 public virtual void Deserialize(BigEndianReader reader)
 {
     guestId = reader.ReadInt();
     if (guestId < 0)
         throw new Exception("Forbidden value on guestId = " + guestId + ", it doesn't respect the following condition : guestId < 0");
     hostId = reader.ReadInt();
     if (hostId < 0)
         throw new Exception("Forbidden value on hostId = " + hostId + ", it doesn't respect the following condition : hostId < 0");
     name = reader.ReadUTF();
     guestLook = new Types.EntityLook();
     guestLook.Deserialize(reader);
     breed = reader.ReadSByte();
     sex = reader.ReadBoolean();
     status = Types.ProtocolTypeManager.GetInstance<Types.PlayerStatus>(reader.ReadShort());
     status.Deserialize(reader);
     var limit = reader.ReadUShort();
     companions = new Types.PartyCompanionBaseInformations[limit];
     for (int i = 0; i < limit; i++)
     {
          companions[i] = new Types.PartyCompanionBaseInformations();
          companions[i].Deserialize(reader);
     }
 }