コード例 #1
0
ファイル: DbConverter.cs プロジェクト: Pircs/Yi
        public static async Task Convert()
        {
            try
            {
                if (!Directory.Exists("RAW"))
                {
                    Output.WriteLine("RAW not found! Restoring!");
                    //await Content.Content.RestoreAsync();
                    Output.WriteLine("RAW Restored!");
                }
                if (!Directory.Exists("Database"))
                {
                    Directory.CreateDirectory("Database");
                }

                Output.WriteLine("Rebuilding");
                UniqueIdGenerator.Load();
                MapManager.Load(@"RAW\ini\GameMap.dat", Environment.CurrentDirectory + "\\RAW\\");
                Item.ItemFactory.LoadDb();
                await Task.WhenAll(MonsterDb.Load(), PortalDb.Load(), MagicTypeConverter.Load(), ItemBonusConverter.Load(), StatpointConverter.Load(), LevelExpConverter.Load());

                NpcDb.Load();
                await Db.SaveAsJsonAsync(SaveType.All);
            }
            catch (Exception e)
            {
                Output.WriteLine(e);
                Output.WriteLine("N***a, I couldn't load the Db, nor convert your old db. What the f**k are you doing?");
            }
        }
コード例 #2
0
        public static async Task <bool> Load()
        {
            try
            {
                UniqueIdGenerator.Load();
                LoadItems();
                SquigglyDb.LoadMaps();
                SquigglyDb.LoadMobs();
                SquigglyDb.LoadSpawns();
                SquigglyDb.LoadNpcs();
                SquigglyDb.LoadLevelExp();
                SquigglyDb.LoadPortals();
                SquigglyDb.LoadItemBonus();
                SquigglyDb.Spawn();

                await Task.WhenAll(LoadStatpoints(), LoadSkills(), LoadAccounts(),
                                   LoadFloorItems(), LoadStoragePool(), LoadBoothPool());


                StorageSystem.SetUpStorageSpaces();
                BoothSystem.SetUpBooths();
                FloorItemSystem.SetUpFloorItemSystem();

                Output.WriteLine("|------------ Player Data ------------");
                Output.WriteLine("|");
                Output.WriteLine("|---> Accounts:     " + SelectorSystem.Players.Count);
                Output.WriteLine("|---> Storages:     " + StorageSystem.StoragePool.Count);
                Output.WriteLine("|---> Booths:       " + BoothSystem.BoothPool.Count);
                Output.WriteLine("|");
                Output.WriteLine("|------------ Common Data ------------");
                Output.WriteLine("|");
                Output.WriteLine("|---> Bots:         " + GameWorld.CountBots());
                Output.WriteLine("|---> Monsters:     " + GameWorld.CountMonsters());
                Output.WriteLine("|---> Npcs:         " + GameWorld.CountNpcs());
                Output.WriteLine("|---> DynamicNpcs:  " + GameWorld.CountDynNpcs());
                Output.WriteLine("|---> Maps:         " + GameWorld.Maps.Count);
                Output.WriteLine("|---> FloorItems:   " + FloorItemSystem.FloorItems.Count);
                Output.WriteLine("|---> Items:        " + Collections.Items.Count);
                Output.WriteLine("|---> ItemBonus:    " + Collections.ItemBonus.Count);
                Output.WriteLine("|---> LevelExp:     " + Collections.LevelExps.Count);
                Output.WriteLine("|---> StatPoints:   " + Collections.Statpoints.Count);
                Output.WriteLine("|---> Skills:       " + Collections.Skills.Count);
                Output.WriteLine("|---> Portals:      " + Collections.Portals.Count);
                Output.WriteLine("|---> Mob Drops:    " + MobDropSystem.Drops.Count);
                await SetUpScriptingEngine();

                Output.WriteLine("|-------------------------------------");
                Output.WriteLine("");
                GCSettings.LatencyMode = GCLatencyMode.SustainedLowLatency;
                YiCore.CompactLoh();
                return(true);
            }
            catch (Exception ex)
            {
                Output.WriteLine(ex);
                return(false);
            }
        }