Beispiel #1
0
        public static void Initialize()
        {
            using (Database.TemporarySchema(Database.SchemaMCDB))
            {
                IsInitialized = false;

                Styles?.Skins.Clear();
                Styles?.MaleHairs.Clear();
                Styles?.MaleFaces.Clear();
                Styles?.FemaleHairs.Clear();
                Styles?.FemaleFaces.Clear();

                Items?.Clear();

                Skills?.Clear();

                Mobs?.Clear();

                Maps?.Clear();

                Quests?.Clear();

                Database.Test();

                Stopwatch sw = new Stopwatch();

                sw.Start();

                Log.Inform("Loading data...");

                Styles       = new AvailableStyles();
                Items        = new CachedItems();
                Skills       = new CachedSkills();
                Mobs         = new CachedMobs();
                Reactors     = new CachedReactors();
                Quests       = new CachedQuests();
                CreationData = new CreationData();
                Maps         = new CachedMaps();

                CommandFactory.Initialize();

                sw.Stop();

                Log.SkipLine();
                Log.Success("Maple data loaded in {0}ms.", sw.ElapsedMilliseconds);
                Log.SkipLine();

                IsInitialized = true;
            }
        }
Beispiel #2
0
        public static void Initialize()
        {
            using (Database.TemporarySchema(Database.SchemaMCDB))
            {
                DataProvider.IsInitialized = false;

                if (DataProvider.Styles != null)
                {
                    DataProvider.Styles.Skins.Clear();
                    DataProvider.Styles.MaleHairs.Clear();
                    DataProvider.Styles.MaleFaces.Clear();
                    DataProvider.Styles.FemaleHairs.Clear();
                    DataProvider.Styles.FemaleFaces.Clear();
                }

                if (DataProvider.Items != null)
                {
                    DataProvider.Items.Clear();
                }

                if (DataProvider.Skills != null)
                {
                    DataProvider.Skills.Clear();
                }

                if (DataProvider.Mobs != null)
                {
                    DataProvider.Mobs.Clear();
                }

                if (DataProvider.Maps != null)
                {
                    DataProvider.Maps.Clear();
                }

                if (DataProvider.Quests != null)
                {
                    DataProvider.Quests.Clear();
                }

                Database.Test();

                Stopwatch sw = new Stopwatch();

                sw.Start();

                Log.Inform("Loading data...");

                DataProvider.Styles       = new AvailableStyles();
                DataProvider.Items        = new CachedItems();
                DataProvider.Skills       = new CachedSkills();
                DataProvider.Mobs         = new CachedMobs();
                DataProvider.Reactors     = new CachedReactors();
                DataProvider.Quests       = new CachedQuests();
                DataProvider.CreationData = new CreationData();
                DataProvider.Maps         = new CachedMaps();

                CommandFactory.Initialize();

                sw.Stop();

                Log.Success("Maple data loaded in {0}ms.", sw.ElapsedMilliseconds);

                DataProvider.IsInitialized = true;
            }
        }