Skip to content

Commit

Permalink
Log airdrop interval logs only when there is at least 1 player on the…
Browse files Browse the repository at this point in the history
… server
  • Loading branch information
RestoreMonarchy committed Sep 12, 2024
1 parent 9c1eab2 commit e41d22d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AirdropManager3/AirdropManager3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net48</TargetFramework>
<LangVersion>latest</LangVersion>
<RootNamespace>RestoreMonarchy.AirdropManager3</RootNamespace>
<Version>3.0.1</Version>
<Version>3.0.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
16 changes: 12 additions & 4 deletions AirdropManager3/AirdropManager3Plugin.Interval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
}

Expand Down

0 comments on commit e41d22d

Please sign in to comment.