public void SaveLogs(IEnumerable <LoggingSystemSettings> accounts, string keyString, string json)
        {
            var filePath = $@"DataBase/OctoDataBase/Logging/{keyString}.json";

            try
            {
                File.WriteAllText(filePath, json);
            }
            catch (Exception e)
            {
                _log.Critical($"Failed To WRITE (SaveLogs) (3 params) : {e.Message}");
            }
        }
        public void SaveServerSettings(IEnumerable <ServerSettings> accounts, string idString, string json)
        {
            var filePath = $@"DataBase/OctoDataBase/ServerAccounts/account-{idString}.json";

            try
            {
                File.WriteAllText(filePath, json);
            }
            catch (Exception e)
            {
                _log.Critical($"Save SERVER AccountSettings (3 params): {e.Message}");
            }
        }
        public void SaveAccountSettings(DiscordAccountClass accounts, string idString, string json)
        {
            var filePath = $@"DataBase/OctoDataBase/UserAccounts/discordAccount-{idString}.json";

            try
            {
                File.WriteAllText(filePath, json);
            }
            catch (Exception e)
            {
                _log.Critical($"Save USER DiscordAccountClass (3 params): {e.Message}");
            }
        }
Exemple #4
0
        public void SaveAccountSettings(IEnumerable <AccountSettings> accounts, string idString, string json)
        {
            var filePath = $@"DataBase/OctoDataBase/UserAccounts/account-{idString}.json";

            if (idString.Contains("BACK_UP"))
            {
                filePath = $@"DataBase/OctoDataBase/UserAccountsBackup/account-{idString}.json";
            }

            try
            {
                File.WriteAllText(filePath, json);
            }
            catch (Exception e)
            {
                _log.Critical($"Save USER AccountSettings (3 params): {e.Message}");
            }
        }
Exemple #5
0
 public void SaveAccountSettings(IEnumerable <SpellSetting> accounts, string filePath)
 {
     try
     {
         var json = JsonConvert.SerializeObject(accounts, Formatting.Indented);
         File.WriteAllText(filePath, json);
     }
     catch (Exception e)
     {
         _log.Critical($"Failed to WRITE (Save Game Spells Account): {e.Message}");
     }
 }
Exemple #6
0
 public Config(LoginFromConsole log)
 {
     try
     {
         JsonConvert.PopulateObject(File.ReadAllText(@"DataBase/OctoDataBase/config.json"), this);
     }
     catch (Exception ex)
     {
         log.Critical(ex);
         Console.ReadKey();
         Environment.Exit(-1);
     }
 }