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:
@@ -102,6 +102,14 @@ public abstract class MiniGameStartBasePlugIn<TConfiguration, TGameState> : Peri
|
|||||||
return;
|
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--)
|
for (var remainingMinutes = (int)enterDuration.TotalMinutes; remainingMinutes > 0; remainingMinutes--)
|
||||||
{
|
{
|
||||||
if (this.Configuration?.EntranceOpenedMessage is { } openMessage)
|
if (this.Configuration?.EntranceOpenedMessage is { } openMessage)
|
||||||
|
|||||||
Reference in New Issue
Block a user