Example #1
0
 public static void OnLoad()
 {
     Persistence.Deserialize(
         FilePath,
         reader =>
     {
         _Version = reader.ReadInt();
     });
 }
Example #2
0
        public static void OnLoad()
        {
            Persistence.Deserialize(
                FilePath,
                reader =>
            {
                _Version = reader.ReadInt();

                if (_Version > 2)
                {
                    _FirstRun        = reader.ReadBool();
                    _SpawnsConverted = reader.ReadBool();
                }
            });
        }
Example #3
0
        public static void OnLoad()
        {
            Persistence.Deserialize(
                FilePath,
                reader =>
            {
                int version = reader.ReadInt();

                LastReset = reader.ReadDateTime();

                int count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    PlayerMobile pm = reader.ReadMobile() as PlayerMobile;
                    Dictionary <SkillName, DateTime> dict = new Dictionary <SkillName, DateTime>();

                    int c = reader.ReadInt();
                    for (int j = 0; j < c; j++)
                    {
                        SkillName sk  = (SkillName)reader.ReadInt();
                        DateTime next = reader.ReadDateTime();

                        dict[sk] = next;
                    }

                    if (pm != null)
                    {
                        ROTTable[pm] = dict;
                    }
                }

                count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    PlayerMobile pm = reader.ReadMobile() as PlayerMobile;
                    int total       = reader.ReadInt();

                    if (pm != null)
                    {
                        StatsTable[pm] = total;
                    }
                }

                CheckTime();
            });
        }
Example #4
0
        public static void Load()
        {
            Persistence.Deserialize(
                _FilePath,
                reader =>
            {
                var version = reader.ReadInt();

                switch (version)
                {
                case 1:
                    {
                        var entries = reader.ReadInt();

                        while (--entries >= 0)
                        {
                            var key = reader.ReadString();

                            var ents = reader.ReadInt();

                            var col = new EntityCollection(ents);

                            IEntity ent;

                            while (--ents >= 0)
                            {
                                ent = World.FindEntity(reader.ReadInt());

                                if (ent != null && !ent.Deleted)
                                {
                                    col.Add(ent);
                                }
                            }

                            _Collections[key] = col;
                        }
                    }
                    break;

                case 0:
                    {
                        var entries = reader.ReadInt();

                        while (--entries >= 0)
                        {
                            var key = reader.ReadString();

                            var items   = reader.ReadStrongItemList();
                            var mobiles = reader.ReadStrongMobileList();

                            var col = new EntityCollection(items.Count + mobiles.Count);

                            col.AddRange(items);
                            col.AddRange(mobiles);

                            _Collections[key] = col;
                        }
                    }
                    break;
                }
            });
        }
Example #5
0
 public static void OnLoad()
 {
     Persistence.Deserialize(FilePath, OnDeserialize);
 }