From 27562e52ef97cd246fcdeccc6a677118ed5241e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Sat, 14 Jun 2025 21:10:00 +0200 Subject: [PATCH] Respect LastAnnouncement fully in public listing I don't recall why we needed that ShouldSendHeartBeats condition here before, it causes the routine to run always if the bot is currently not listed, which is unwanted e.g. if the server tells user to go away, or due to any other reason. --- .../RemoteCommunication.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs index efa27d510..890225dc7 100644 --- a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs +++ b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs @@ -60,7 +60,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { private const byte MinHeartBeatTTL = 10; // Minimum amount of minutes we must wait before sending next HeartBeat private const byte MinimumPasswordResetCooldownDays = 5; // As imposed by Steam limits private const byte MinimumSteamGuardEnabledDays = 15; // As imposed by Steam limits - private const byte MinPersonaStateTTL = 5; // Minimum amount of minutes we must wait before requesting persona state update + private const byte MinPersonaStateTTL = MinAnnouncementTTL; // Minimum amount of minutes we must wait before requesting persona state update private static readonly FrozenSet AcceptedMatchableTypes = [ EAssetType.Emoticon, @@ -187,7 +187,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { return; } - if ((DateTime.UtcNow < LastAnnouncement.AddMinutes(ShouldSendAnnouncementEarlier ? MinAnnouncementTTL : MaxAnnouncementTTL)) && ShouldSendHeartBeats) { + if (DateTime.UtcNow < LastAnnouncement.AddMinutes(ShouldSendAnnouncementEarlier ? MinAnnouncementTTL : MaxAnnouncementTTL)) { return; } @@ -199,7 +199,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { await RequestsSemaphore.WaitAsync().ConfigureAwait(false); try { - if ((DateTime.UtcNow < LastAnnouncement.AddMinutes(ShouldSendAnnouncementEarlier ? MinAnnouncementTTL : MaxAnnouncementTTL)) && ShouldSendHeartBeats) { + if (DateTime.UtcNow < LastAnnouncement.AddMinutes(ShouldSendAnnouncementEarlier ? MinAnnouncementTTL : MaxAnnouncementTTL)) { return; }