Add more support for SDA

This commit is contained in:
JustArchi
2016-03-07 15:53:46 +01:00
parent 09abe77495
commit cfbd880995

View File

@@ -186,7 +186,7 @@ namespace ArchiSteamFarm {
File.Delete(botPath + ".maFile");
Logging.LogGenericInfo("Success!", botName);
} catch (Exception e) {
Logging.LogGenericException(e);
Logging.LogGenericException(e, botName);
}
}
@@ -1168,6 +1168,19 @@ namespace ArchiSteamFarm {
Program.GlobalDatabase.CellID = callback.CellID;
}
// Support and convert SDA files
ulong steamID = callback.ClientSteamID;
if (BotDatabase.SteamGuardAccount == null && File.Exists(steamID + ".maFile")) {
Logging.LogGenericInfo("Converting SDA .maFile into ASF format...", BotName);
try {
BotDatabase.SteamGuardAccount = JsonConvert.DeserializeObject<SteamGuardAccount>(File.ReadAllText(steamID + ".maFile"));
File.Delete(steamID + ".maFile");
Logging.LogGenericInfo("Success!", BotName);
} catch (Exception e) {
Logging.LogGenericException(e, BotName);
}
}
if (BotConfig.UseAsfAsMobileAuthenticator && TwoFactorAuth == null && BotDatabase.SteamGuardAccount == null) {
LinkMobileAuthenticator();
}