Beispiel #1
0
        public void ReadSummary(byte[] data)
        {
            reader = new GDCryptoDataBuffer(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);

            Inventory.Read(reader);
        }
Beispiel #2
0
        private void ReadCharacterInfo()
        {
            bool isInMainQuest;
            bool hasBeenInGame;
            byte difficulty;
            byte greatestCampaignDifficulty;
            uint money;
            byte greatestCrucibleDifficulty;
            int  tributes;

            reader.ReadBlockStart(Constants.BLOCK);



            int version = reader.ReadCryptoIntUnchecked();

            if ((version != Constants.VERSION_3) && (version != Constants.VERSION_4))
            {
                throw new FormatException("ERR_UNSUPPORTED_VERSION");
            }


            reader.ReadCryptoBool(out isInMainQuest);
            reader.ReadCryptoBool(out hasBeenInGame);
            reader.ReadCryptoByte(out difficulty);
            reader.ReadCryptoByte(out greatestCampaignDifficulty);

            reader.ReadCryptoUInt(out money);

            if (version == Constants.VERSION_4)
            {
                reader.ReadCryptoByte(out greatestCrucibleDifficulty);
                reader.ReadCryptoInt(out tributes);
            }

            byte   compassState           = reader.ReadCryptoByteUnchecked();
            int    lootMode               = reader.ReadCryptoIntUnchecked();
            byte   skillWindowHelp        = reader.ReadCryptoByteUnchecked();
            byte   alternateConfig        = reader.ReadCryptoByteUnchecked();
            byte   alternateConfigEnabled = reader.ReadCryptoByteUnchecked();
            string texture = reader.ReadCryptoStringUnchecked();

            reader.ReadBlockEnd();
        }