fix(minigame): announce entrance-opened for sub-minute registration windows

SendOpenedNotificationsAsync only looped per full minute, so a <1min entrance
(e.g. a 30s test window) sent no golden 'event opened' notification. Now sends
one up front when TotalMinutes==0. >=1min windows unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Acentech Dev
2026-07-21 12:55:00 +03:00
parent e45ad4f8d7
commit 7312b0e20d

View File

@@ -102,6 +102,14 @@ public abstract class MiniGameStartBasePlugIn<TConfiguration, TGameState> : Peri
return;
}
// Sub-minute entrance windows (e.g. a 30s test window) have (int)TotalMinutes == 0, so the
// per-minute loop below would send nothing and players would get no "event opened" notification.
// Announce once up front in that case (>= 1 minute windows are unaffected).
if ((int)enterDuration.TotalMinutes == 0 && this.Configuration?.EntranceOpenedMessage is { } shortOpenMessage)
{
await state.Context.SendGlobalNotificationAsync(string.Format(shortOpenMessage, 1)).ConfigureAwait(false);
}
for (var remainingMinutes = (int)enterDuration.TotalMinutes; remainingMinutes > 0; remainingMinutes--)
{
if (this.Configuration?.EntranceOpenedMessage is { } openMessage)