From e41d22db047516ac577b25487d7ce6742057829c Mon Sep 17 00:00:00 2001 From: MCrow Date: Thu, 12 Sep 2024 13:24:48 +0200 Subject: [PATCH] Log airdrop interval logs only when there is at least 1 player on the server --- AirdropManager3/AirdropManager3.csproj | 2 +- .../AirdropManager3Plugin.Interval.cs | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/AirdropManager3/AirdropManager3.csproj b/AirdropManager3/AirdropManager3.csproj index e699136..7f8559e 100644 --- a/AirdropManager3/AirdropManager3.csproj +++ b/AirdropManager3/AirdropManager3.csproj @@ -4,7 +4,7 @@ net48 latest RestoreMonarchy.AirdropManager3 - 3.0.1 + 3.0.2 diff --git a/AirdropManager3/AirdropManager3Plugin.Interval.cs b/AirdropManager3/AirdropManager3Plugin.Interval.cs index 0ebba27..cea57a2 100644 --- a/AirdropManager3/AirdropManager3Plugin.Interval.cs +++ b/AirdropManager3/AirdropManager3Plugin.Interval.cs @@ -34,18 +34,26 @@ private IEnumerator AirdropIntervalCoroutine() Broadcast broadcast = Configuration.Instance.Broadcasts.AirdropInterval; SendBroadcastMessage(broadcast, airdrop, airdropSpawn, null, airdropSpawn.Vector3); - LogInfo($"Airdrop {airdrop.DisplayName()} called in by interval at {airdropSpawn.DisplayName()}."); + if (Provider.clients.Count > 0) + { + LogInfo($"Airdrop {airdrop.DisplayName()} called in by interval at {airdropSpawn.DisplayName()}."); + } } else { - LogInfo($"There isn't any airdrop spawns."); + if (Provider.clients.Count > 0) + { + LogInfo($"There isn't any airdrop spawns."); + } } } else { Broadcast broadcast = Configuration.Instance.Broadcasts.AirdropIntervalMinPlayers; SendBroadcastMessage(broadcast, null, null, null, default); - - LogInfo($"Airdrop interval skipped: less than {minPlayers} players online."); + if (Provider.clients.Count > 0) + { + LogInfo($"Airdrop interval skipped: less than {minPlayers} players online."); + } } }