Skip to content

Commit

Permalink
Fix monitoring plugin (#3191)
Browse files Browse the repository at this point in the history
* Misc.

* Fix ASF crash

* Remove warning about automatic update of custom plugins if there is only official plugins enabled

* Fix previous mistake

* Revert "Fix ASF crash"

This reverts commit 42209e9.
  • Loading branch information
Abrynos authored Apr 21, 2024
1 parent d013366 commit e2a5ec3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private void InitializeMeter() {
$"{MetricNamePrefix}_bot_farming_time_remaining_{Units.Minutes}", static () => {
IEnumerable<Bot> bots = Bot.Bots?.Values ?? [];

return bots.Select(static bot => new Measurement<double>(bot.CardsFarmer.TimeRemaining.TotalMinutes, new KeyValuePair<string, object?>(TagNames.BotName, bot.BotName), new KeyValuePair<string, object?>(TagNames.SteamID, bot.SteamID)));
return bots.Where(static bot => bot.IsConnectedAndLoggedOn).Select(static bot => new Measurement<double>(bot.CardsFarmer.TimeRemaining.TotalMinutes, new KeyValuePair<string, object?>(TagNames.BotName, bot.BotName), new KeyValuePair<string, object?>(TagNames.SteamID, bot.SteamID)));
},
Units.Minutes,
"Approximate number of minutes remaining until each bot has finished farming all cards"
Expand Down
4 changes: 3 additions & 1 deletion ArchiSteamFarm/Plugins/PluginsCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ internal static async Task<bool> InitPlugins() {
}

if (activePluginUpdates.Count > 0) {
ASF.ArchiLogger.LogGenericWarning(Strings.CustomPluginUpdatesEnabled);
if (activePluginUpdates.Any(static plugin => plugin is not OfficialPlugin)) {
ASF.ArchiLogger.LogGenericWarning(Strings.CustomPluginUpdatesEnabled);
}

ActivePluginUpdates = activePluginUpdates.ToFrozenSet();
}
Expand Down

0 comments on commit e2a5ec3

Please sign in to comment.