mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
SteamClient.IsConnected hardening
This commit is contained in:
@@ -642,6 +642,10 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
return "This bot instance is not connected!";
|
||||
}
|
||||
|
||||
if (pause) {
|
||||
if (CardsFarmer.ManualMode) {
|
||||
return "Automatic farming is stopped already!";
|
||||
@@ -772,6 +776,10 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
return "This bot instance is not connected!";
|
||||
}
|
||||
|
||||
if (BotConfig.SteamMasterID == 0) {
|
||||
return "Trade couldn't be send because SteamMasterID is not defined!";
|
||||
}
|
||||
@@ -1157,10 +1165,14 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected || !IsMaster(steamID)) {
|
||||
if (!IsMaster(steamID)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
return "This bot instance is not connected!";
|
||||
}
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
foreach (uint gameID in gameIDs) {
|
||||
SteamApps.FreeLicenseCallback callback = await SteamApps.RequestFreeLicense(gameID);
|
||||
@@ -1219,6 +1231,10 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
return "This bot instance is not connected!";
|
||||
}
|
||||
|
||||
Dictionary<uint, string> ownedGames;
|
||||
if (!string.IsNullOrEmpty(BotConfig.SteamApiKey)) {
|
||||
ownedGames = ArchiWebHandler.GetOwnedGames(SteamClient.SteamID);
|
||||
@@ -1288,7 +1304,7 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
string[] responses = await Task.WhenAll(Bots.OrderBy(bot => bot.Key).Select(bot => bot.Value.ResponseOwns(steamID, query))).ConfigureAwait(false);
|
||||
string[] responses = await Task.WhenAll(Bots.Where(bot => bot.Value.SteamClient.IsConnected).OrderBy(bot => bot.Key).Select(bot => bot.Value.ResponseOwns(steamID, query))).ConfigureAwait(false);
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
foreach (string response in responses.Where(response => !string.IsNullOrEmpty(response))) {
|
||||
@@ -1308,6 +1324,10 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!SteamClient.IsConnected) {
|
||||
return "This bot instance is not connected!";
|
||||
}
|
||||
|
||||
if (gameIDs.Contains(0)) {
|
||||
if (!CardsFarmer.ManualMode) {
|
||||
return "Done!";
|
||||
|
||||
Reference in New Issue
Block a user