Пример #1
0
        public async Task ExportItems()
        {
            // Overrides current recipes in file
            var tagsString = RecipeUtil.GetCraftableTagItems();

            if (tagsString == null || tagsString.Length == 0)
            {
                return;
            }

            await DataExporter.WriteToFile("tags", "/", tagsString);

            Logger.Debug($"Item tags exported at {DateTime.Now.ToShortTimeString()}");
        }
Пример #2
0
        public async Task ExportRecipes()
        {
            // Overrides current recipes in file
            var recipesString = RecipeUtil.GetRecipesString();

            if (recipesString == null || recipesString.Length == 0)
            {
                return;
            }

            await DataExporter.WriteToFile("recipes", "/", recipesString);

            Logger.Debug($"Recipes exported at {DateTime.Now.ToShortTimeString()}");
        }
Пример #3
0
        public async Task ExportLiveCraftingTablesData()
        {
            if (Config.Data.SaveCraftingTablesData)
            {
                // Overrides current crafting tables data in file
                Logger.Debug("Exporting crafting tables data");
                var craftingTablesString = RecipeUtil.GetCraftingTablesString();
                if (craftingTablesString == null || craftingTablesString.Length == 0)
                {
                    return;
                }

                await DataExporter.WriteToFile("craftingTables", "/", craftingTablesString);

                Logger.Debug($"Finished exporting crafting tables data");
            }
        }
Пример #4
0
        private async Task ExportLiveStoreData(bool byCommand = false)
        {
            if (Config.Data.SaveStoreData)
            {
                // Overrides current store data in file
                Logger.Debug("Exporting store data");
                var storesString = TradeUtil.GetStoresString();
                if (storesString == null || storesString.Length == 0)
                {
                    return;
                }

                await DataExporter.WriteToFile("stores", "/", storesString[0]);

                Logger.Debug($"Store data exported at {DateTime.Now.ToShortTimeString()}");

                if (!byCommand && Config.Data.SaveHistoricalStoreData)
                {
                    Logger.Debug("Saving stores data to history file");
                    await DataExporter.AddToFile("storesHistoric", "/", storesString[1]);
                }
                Logger.Debug("Finished UpdateStoreData");
            }
        }