From 8d06dd90d8303a60e069b4ba7eb14465f4463d2e Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 10 Jan 2016 20:55:00 +0100 Subject: [PATCH] Do not attempt to try sending request to disconnected clients --- ArchiSteamFarm/ArchiHandler.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ArchiSteamFarm/ArchiHandler.cs b/ArchiSteamFarm/ArchiHandler.cs index 24d2ed39f..f5abaaffb 100644 --- a/ArchiSteamFarm/ArchiHandler.cs +++ b/ArchiSteamFarm/ArchiHandler.cs @@ -134,7 +134,7 @@ namespace ArchiSteamFarm { */ internal void AcceptClanInvite(ulong clanID) { - if (clanID == 0) { + if (clanID == 0 || !Client.IsConnected) { return; } @@ -146,7 +146,7 @@ namespace ArchiSteamFarm { } internal void DeclineClanInvite(ulong clanID) { - if (clanID == 0) { + if (clanID == 0 || !Client.IsConnected) { return; } @@ -158,6 +158,10 @@ namespace ArchiSteamFarm { } internal void PlayGames(params uint[] gameIDs) { + if (!Client.IsConnected) { + return; + } + var request = new ClientMsgProtobuf(EMsg.ClientGamesPlayed); foreach (uint gameID in gameIDs) { if (gameID == 0) { @@ -173,6 +177,10 @@ namespace ArchiSteamFarm { } internal void PlayGames(ICollection gameIDs) { + if (!Client.IsConnected) { + return; + } + var request = new ClientMsgProtobuf(EMsg.ClientGamesPlayed); foreach (uint gameID in gameIDs) { if (gameID == 0) { @@ -188,7 +196,7 @@ namespace ArchiSteamFarm { } internal AsyncJob RedeemKey(string key) { - if (string.IsNullOrEmpty(key)) { + if (string.IsNullOrEmpty(key) || !Client.IsConnected) { return null; }