Пример #1
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 12)
            {
                throw new Exception();
            }

            if (file.ReadInt() != 1) // version
            {
                throw new Exception();
            }

            names = new List <string>();
            UInt32 n = file.ReadInt();

            for (var i = 0; i < n; i++)
            {
                var name = GDString.Read(file);
                names.Add(name);
            }

            file.ReadBlockEnd(b);
        }
Пример #2
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 10)
            {
                throw new Exception();
            }

            if (file.ReadInt() != 2) // version
            {
                throw new Exception();
            }

            for (var i = 0; i < 3; i++)
            {
                tokens[i] = new List <string>();
                UInt32 n = file.ReadInt();

                for (var j = 0; j < n; j++)
                {
                    var token = GDString.Read(file);
                    tokens[i].Add(token);
                }
            }

            file.ReadBlockEnd(b);
        }
Пример #3
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 4)
            {
                throw new Exception();
            }

            var version = file.ReadInt();

            if (version == 6) // version
            {
                stashPages = GDArray <StashPage> .Read(file);
            }
            else if (version == 5)
            {
                stashPages = new List <StashPage>();
                var width  = file.ReadInt();
                var height = file.ReadInt();
                var items  = GDArray <StashItem> .Read(file);

                stashPages.Add(new StashPage()
                {
                    width = width, height = height, items = items
                });
            }
            else
            {
                throw new Exception("Invalid stash version.");
            }

            file.ReadBlockEnd(b);
        }
Пример #4
0
 public override void Read(GDFileReader file)
 {
     for (var i = 0; i < 16; i++)
     {
         id[i] = file.ReadByte();
     }
 }
Пример #5
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 5)
            {
                throw new Exception();
            }

            if (file.ReadInt() != 1) // version
            {
                throw new Exception();
            }

            for (var i = 0; i < 3; i++)
            {
                uids[i] = GDArray <Uid> .Read(file);
            }

            for (var i = 0; i < 3; i++)
            {
                spawn[i] = new Uid();
                spawn[i].Read(file);
            }

            file.ReadBlockEnd(b);
        }
Пример #6
0
 public override void Read(GDFileReader file)
 {
     name               = GDString.Read(file);
     autoCastSkill      = GDString.Read(file);
     autoCastController = GDString.Read(file);
     itemSlot           = file.ReadInt();
     itemName           = GDString.Read(file);
 }
Пример #7
0
 public override void Read(GDFileReader file)
 {
     modified      = file.ReadByte();
     unlocked      = file.ReadByte();
     value         = file.ReadFloat();
     positiveBoost = file.ReadFloat();
     negativeBoost = file.ReadFloat();
 }
Пример #8
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 3)
            {
                throw new Exception();
            }

            if (file.ReadInt() != 4) // version
            {
                throw new Exception();
            }

            if ((flag = file.ReadByte()) != 0)
            {
                UInt32 n = file.ReadInt();
                focused  = file.ReadInt();
                selected = file.ReadInt();

                for (UInt32 i = 0; i < n; i++)
                {
                    var invSack = new InventorySack();
                    invSack.Read(file);
                    Sacks.Add(invSack);
                }

                useAlternate = file.ReadByte();

                for (var i = 0; i < 12; i++)
                {
                    Equipment[i] = new InventoryEquipment();
                    Equipment[i].Read(file);
                }

                alternate1 = file.ReadByte();

                for (var i = 0; i < 2; i++)
                {
                    Weapon1[i] = new InventoryEquipment();
                    Weapon1[i].Read(file);
                }

                alternate2 = file.ReadByte();

                for (var i = 0; i < 2; i++)
                {
                    Weapon2[i] = new InventoryEquipment();
                    Weapon2[i].Read(file);
                }
            }

            file.ReadBlockEnd(b);
        }
Пример #9
0
        public void Read(Stream f)
        {
            var file = new GDFileReader(f);

            file.BeginRead();

            uint temp = file.ReadInt();

            if (temp != 0x58434447)
            {
                throw new Exception();
            }

            Header.Read(file);

            if (file.NextInt() != 0) //Checksum(?)
            {
                throw new Exception();
            }

            var fileVersion = file.ReadInt();

            if (fileVersion < 6 || fileVersion > 8) // version (6, 7 and 8 - only 8 supported here)
            {
                throw new Exception("Invalid file version: " + fileVersion);
            }

            Id.Read(file);

            Info.Read(file);
            Bio.Read(file);
            Inventory.Read(file);
            Stash.Read(file);
            respawns.Read(file);
            teleports.Read(file);
            markers.Read(file);
            shrines.Read(file);
            skills.Read(file);
            notes.Read(file);
            factions.Read(file);
            ui.Read(file);
            tutorials.Read(file);
            stats.Read(file);

            if (fileVersion >= 7)
            {
                tokens.Read(file);
            }


            file.EndRead();
        }
Пример #10
0
 public override void Read(GDFileReader file)
 {
     name               = GDString.Read(file);
     level              = file.ReadInt();
     enabled            = file.ReadByte();
     devotionLevel      = file.ReadInt();
     experience         = file.ReadInt();
     active             = file.ReadInt();
     unknown1           = file.ReadByte();
     unknown2           = file.ReadByte();
     autoCastSkill      = GDString.Read(file);
     autoCastController = GDString.Read(file);
 }
Пример #11
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 1)
            {
                throw new Exception();
            }

            var version = file.ReadInt();

            if (version < 3 || version > 5) // version
            {
                throw new Exception("Invalid character info version");
            }

            isInMainQuest      = file.ReadByte();
            hasBeenInGame      = file.ReadByte();
            difficulty         = file.ReadByte();
            greatestDifficulty = file.ReadByte();
            money = file.ReadInt();
            if (version >= 4)
            {
                greatestSurvivalDifficulty = file.ReadByte();
                currentTribute             = file.ReadInt();
            }

            compassState = file.ReadByte();

            if (version >= 2 && version <= 4)
            {
                lootMode = file.ReadInt();
            }

            skillWindowShowHelp    = file.ReadByte();
            alternateConfig        = file.ReadByte();
            alternateConfigEnabled = file.ReadByte();
            texture = GDString.Read(file);
            if (version >= 5)
            {
                uint size = file.ReadInt(true);

                var lootFilters = new byte[size];
                for (int i = 0; i < lootFilters.Length; i++)
                {
                    lootFilters[i] = file.ReadByte();
                }
            }

            file.ReadBlockEnd(b);
        }
Пример #12
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 0)
            {
                throw new Exception();
            }

            tempBool = file.ReadByte();
            Items    = GDArray <InventoryItem> .Read(file);

            file.ReadBlockEnd(b);
        }
Пример #13
0
        public static List <T> Read(GDFileReader file)
        {
            List <T> entries = new List <T>();
            UInt32   n       = file.ReadInt();

            for (var i = 0; i < n; i++)
            {
                var entry = new T();
                entry.Read(file);
                entries.Add(entry);
            }

            return(entries);
        }
Пример #14
0
        public static string Read(GDFileReader file)
        {
            UInt32 len = file.ReadInt();

            string ret = "";

            for (var i = 0; i < len; i++)
            {
                var b1 = file.ReadByte();

                ret += (char)b1;
            }

            return(ret);
        }
Пример #15
0
        public override void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 0)
            {
                throw new Exception();
            }

            width  = file.ReadInt();
            height = file.ReadInt();
            items  = GDArray <StashItem> .Read(file);

            file.ReadBlockEnd(b);
        }
Пример #16
0
        public static string Read(GDFileReader file)
        {
            UInt32 len = file.ReadInt();

            string ret = "";

            for (var i = 0; i < len; i++)
            {
                var b1 = file.ReadByte();
                var b2 = file.ReadByte();//Todo: use the second byte

                ret += (char)b1;
            }

            return(ret);
        }
Пример #17
0
 public override void Read(GDFileReader file)
 {
     baseName      = GDString.Read(file);
     prefixName    = GDString.Read(file);
     suffixName    = GDString.Read(file);
     modifierName  = GDString.Read(file);
     transmuteName = GDString.Read(file);
     seed          = file.ReadInt();
     relicName     = GDString.Read(file);
     relicBonus    = GDString.Read(file);
     relicSeed     = file.ReadInt();
     augmentName   = GDString.Read(file);
     unknown       = file.ReadInt();
     augmentSeed   = file.ReadInt();
     var1          = file.ReadInt();
     stackCount    = file.ReadInt();
 }
Пример #18
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 14)
            {
                throw new Exception();
            }

            var version = file.ReadInt();

            if (version != 5 && version != 4) // version
            {
                throw new Exception("Invalid save file version.");
            }

            unknown1 = file.ReadByte();
            unknown2 = file.ReadInt();
            unknown3 = file.ReadByte();

            for (var i = 0; i < 5; i++)
            {
                unknown4[i] = GDString.Read(file);
                unknown5[i] = GDString.Read(file);
                unknown6[i] = file.ReadByte();
            }

            int numberOfSlots = 46;

            if (version == 4)
            {
                numberOfSlots = 36;
            }
            slots = new HotSlot[numberOfSlots];

            for (var i = 0; i < numberOfSlots; i++)
            {
                slots[i] = new HotSlot();
                slots[i].Read(file);
            }

            cameraDistance = file.ReadFloat();

            file.ReadBlockEnd(b);
        }
Пример #19
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 13)
            {
                throw new Exception();
            }

            if (file.ReadInt() != 5) // version
            {
                throw new Exception();
            }

            faction  = file.ReadInt();
            factions = GDArray <FactionData> .Read(file);

            file.ReadBlockEnd(b);
        }
Пример #20
0
        public override void Read(GDFileReader file)
        {
            type = file.ReadInt();

            if (type == 0)
            {
                skill         = GDString.Read(file);
                isItemSkill   = file.ReadByte();
                item          = GDString.Read(file);
                equipLocation = file.ReadInt();
            }
            else if (type == 4)
            {
                item       = GDString.Read(file);
                bitmapUp   = GDString.Read(file);
                bitmapDown = GDString.Read(file);
                label      = GDWString.Read(file);
            }
        }
Пример #21
0
        public void Read(GDFileReader file)
        {
            var headerVersion = file.ReadInt();

            if (headerVersion != 1 && headerVersion != 2) // Header version. Must be 2.
            {
                throw new Exception("Invalid header version.");
            }

            Name     = GDWString.Read(file);
            Sex      = file.ReadByte();
            Tag      = GDString.Read(file);
            Level    = file.ReadInt();
            Hardcore = file.ReadByte();
            if (headerVersion == 2)
            {
                file.ReadByte(); //expansion status
            }
        }
Пример #22
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 8)
            {
                throw new Exception();
            }

            if (file.ReadInt() != 5) // version
            {
                throw new Exception();
            }

            skills = GDArray <Skill> .Read(file);

            masteriesAllowed              = file.ReadInt();
            skillReclamationPointsUsed    = file.ReadInt();
            devotionReclamationPointsUsed = file.ReadInt();
            itemSkills = GDArray <ItemSkill> .Read(file);

            file.ReadBlockEnd(b);
        }
Пример #23
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 15)
            {
                throw new Exception();
            }

            if (file.ReadInt() != 1) // version
            {
                throw new Exception();
            }


            UInt32 n = file.ReadInt();

            for (var i = 0; i < n; i++)
            {
                pages.Add(file.ReadInt());
            }

            file.ReadBlockEnd(b);
        }
Пример #24
0
 public override void Read(GDFileReader file)
 {
     base.Read(file);
     x = file.ReadFloat();
     y = file.ReadFloat();
 }
Пример #25
0
 public abstract void Read(GDFileReader file);
Пример #26
0
        public void Read(GDFileReader file)
        {
            Block b = new Block();

            if (file.ReadBlockStart(b) != 16)
            {
                throw new Exception();
            }

            var version = file.ReadInt();

            if (version < 7 || version > 11) // version
            {
                throw new Exception();
            }

            playTime                = file.ReadInt();
            deaths                  = file.ReadInt();
            kills                   = file.ReadInt();
            experienceFromKills     = file.ReadInt();
            healthPotionsUsed       = file.ReadInt();
            manaPotionsUsed         = file.ReadInt();
            maxLevel                = file.ReadInt();
            hitsReceived            = file.ReadInt();
            hitsInflicted           = file.ReadInt();
            criticalHitsInflicted   = file.ReadInt();
            criticalHitsReceived    = file.ReadInt();
            greatestDamageInflicted = file.ReadFloat();

            for (var i = 0; i < 3; i++)
            {
                greatestMonsterKilledName[i]        = GDString.Read(file);
                greatestMonsterKilledLevel[i]       = file.ReadInt();
                greatestMonsterKilledLifeAndMana[i] = file.ReadInt();
                lastMonsterHit[i]   = GDString.Read(file);
                lastMonsterHitBy[i] = GDString.Read(file);
            }

            championKills             = file.ReadInt();
            lastHit                   = file.ReadFloat();
            lastHitBy                 = file.ReadFloat();
            greatestDamageReceived    = file.ReadFloat();
            heroKills                 = file.ReadInt();
            itemsCrafted              = file.ReadInt();
            relicsCrafted             = file.ReadInt();
            transcendentRelicsCrafted = file.ReadInt();
            mythicalRelicsCrafted     = file.ReadInt();
            shrinesRestored           = file.ReadInt();
            oneShotChestsOpened       = file.ReadInt();
            loreNotesCollected        = file.ReadInt();

            for (var i = 0; i < 3; i++)
            {
                bossKills[i] = file.ReadInt();
            }

            if (version >= 9)
            {
                survivalWaveTier      = file.ReadInt();
                greatestSurvivalScore = file.ReadInt();
                cooldownRemaining     = file.ReadInt();
                cooldownTotal         = file.ReadInt();
            }

            if (version >= 11)
            {
                var skillTrackingMapCount = file.ReadInt();

                for (int i = 0; i < skillTrackingMapCount; i++)
                {
                    var s = GDString.Read(file);
                    var n = file.ReadInt();
                }

                var endlessSouls   = file.ReadInt();
                var endlessEssence = file.ReadInt();
                var difficultySkip = file.ReadByte();
            }

            uniqueItemsFound     = file.ReadInt();
            randomizedItemsFound = file.ReadInt();

            file.ReadBlockEnd(b);
        }
Пример #27
0
        public override void Read(GDFileReader file)
        {
            base.Read(file);

            attached = file.ReadByte();
        }