Fix broken bot databases

This commit is contained in:
JustArchi
2016-03-26 22:12:55 +01:00
parent f195563ba5
commit 8fd41cc587
2 changed files with 11 additions and 2 deletions

View File

@@ -133,7 +133,7 @@ namespace ArchiSteamFarm {
BotConfig = BotConfig.Load(botPath + ".json");
if (BotConfig == null) {
Logging.LogGenericError("Your config for this bot instance is invalid, it won't run!", botName);
Logging.LogGenericError("Your bot config is invalid, refusing to start this bot instance!", botName);
return;
}
@@ -162,6 +162,12 @@ namespace ArchiSteamFarm {
return;
}
BotDatabase = BotDatabase.Load(botPath + ".db");
if (BotDatabase == null) {
Logging.LogGenericError("Bot database could not be loaded, refusing to start this bot instance!", botName);
return;
}
bool alreadyExists;
lock (Bots) {
alreadyExists = Bots.ContainsKey(botName);
@@ -174,7 +180,6 @@ namespace ArchiSteamFarm {
return;
}
BotDatabase = BotDatabase.Load(botPath + ".db");
SentryFile = botPath + ".bin";
if (BotDatabase.SteamGuardAccount == null) {

View File

@@ -78,6 +78,10 @@ namespace ArchiSteamFarm {
return null;
}
if (botDatabase == null) {
return null;
}
botDatabase.FilePath = filePath;
return botDatabase;
}