Exemplo n.º 1
0
        public void Read(CryptoDataBuffer reader)
        {
            reader.ReadBlockStart(BLOCK);

            int version = reader.ReadCryptoIntUnchecked();

            //if (version != VERSION)
            //    throw new FormatException("ERR_UNSUPPORTED_VERSION");

            Level          = reader.ReadCryptoIntUnchecked();
            Experience     = reader.ReadCryptoIntUnchecked();
            ModifierPoints = reader.ReadCryptoIntUnchecked();
            SkillPoints    = reader.ReadCryptoIntUnchecked();
            DevotionPoints = reader.ReadCryptoIntUnchecked();
            TotalDevotion  = reader.ReadCryptoIntUnchecked();

            TotalStrength     = reader.ReadCryptoFloatUnchecked();
            TotalAgility      = reader.ReadCryptoFloatUnchecked();
            TotalIntelligence = reader.ReadCryptoFloatUnchecked();
            Health            = reader.ReadCryptoFloatUnchecked();
            Energy            = reader.ReadCryptoFloatUnchecked();

            // end marker
            reader.ReadBlockEnd();
        }
Exemplo n.º 2
0
        public void ReadSummary(byte[] data)
        {
            reader = new CryptoDataBuffer(data);
            int val = 0;

            reader.ReadCryptoKey();

            if (!reader.ReadCryptoInt(out val))
            {
                throw new FormatException("ERR_UNSUPPORTED_VERSION");
            }

            if (val != 0x58434447)
            {
                throw new FormatException("ERR_UNSUPPORTED_VERSION");
            }

            reader.ReadCryptoInt(out val);
            //if (val != 1)
            //   throw new FormatException("ERR_UNSUPPORTED_VERSION");

            ReadHeader();

            reader.ReadCryptoInt(out val, false);
            //if (val != 0)
            //    throw new FormatException("ERR_UNSUPPORTED_VERSION");

            int version;

            reader.ReadCryptoInt(out version);
            //if ((version != 6) && (version != 7)) {
            //   throw new FormatException("ERR_UNSUPPORTED_VERSION");
            //}

            reader.ReadAndDiscardUID();
            ReadCharacterInfo();
            Bio.Read(reader);
            this.Print();

            //Inventory.Read(reader);
        }