Remove old converter, closes #153

Decided to remove it faster
This commit is contained in:
JustArchi
2016-03-26 22:23:35 +01:00
parent c163e5e2f3
commit 761d73eb90
4 changed files with 5 additions and 193 deletions

View File

@@ -113,51 +113,12 @@ namespace ArchiSteamFarm {
string botPath = Path.Combine(Program.ConfigDirectory, botName);
// CONVERSION START
if (File.Exists(botPath + ".xml")) {
BotConfig = BotConfig.LoadOldFormat(botPath + ".xml");
if (BotConfig == null) {
return;
}
if (BotConfig.Convert(botPath + ".json")) {
try {
File.Delete(botPath + ".xml");
} catch (Exception e) {
Logging.LogGenericException(e, botName);
return;
}
}
}
// CONVERSION END
BotConfig = BotConfig.Load(botPath + ".json");
if (BotConfig == null) {
Logging.LogGenericError("Your bot config is invalid, refusing to start this bot instance!", botName);
return;
}
// CONVERSION START
if (File.Exists(botPath + ".key")) {
BotDatabase = BotDatabase.Load(botPath + ".db");
try {
BotDatabase.LoginKey = File.ReadAllText(botPath + ".key");
File.Delete(botPath + ".key");
} catch (Exception e) {
Logging.LogGenericException(e, BotName);
}
}
if (File.Exists(botPath + ".auth")) {
BotDatabase = BotDatabase.Load(botPath + ".db");
try {
BotDatabase.SteamGuardAccount = JsonConvert.DeserializeObject<SteamGuardAccount>(File.ReadAllText(botPath + ".auth"));
File.Delete(botPath + ".auth");
} catch (Exception e) {
Logging.LogGenericException(e, BotName);
}
}
// CONVERSION END
if (!BotConfig.Enabled) {
return;
}