In the 'Cooldown Announcement' video' around 09:15, there's a change in Player Controller to get the Countdown Time from Gamemode directly if having authority.
Adding that code did break the cooldown countdown on my server player - it just is stuck at the start value and does not change, while on clients, countdown works.
uint32 SecondsLeft = FMath::CeilToInt(TimeLeft);
// no countdown on server player if getting Countdown Time from Gamemode directly
if (HasAuthority()) // on server, get seconds left directly from game mode - avoid being off
{
BlasterGameMode = BlasterGameMode == nullptr ? Cast<ABlasterGameMode>(UGameplayStatics::GetGameMode(this)) : BlasterGameMode;
if (BlasterGameMode)
{
SecondsLeft = FMath::CeilToInt(BlasterGameMode->GetCountdownTime() + LevelStartingTime);
}
}```
The solution is simple: in GameMode Tick(), the Update of CountdownTime when in Cooldown state was simply missing.
```c++
void ABlasterGameMode::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (bDelayedStart && MatchState == MatchState::WaitingToStart)
{
//blabla
}
else if (MatchState == MatchState::InProgress)
{
//blabla
}
// === FIX === need to update CountdownTime when getting directly
else if (MatchState == MatchState::Cooldown)
{
CountdownTime = CooldownTime + WarmupTime + MatchTime - GetWorld()->GetTimeSeconds() + LevelStartingTime;
}
}```
I rechecked both videos, 'Custom Match States' and 'Cooldown Announcement' - but that part is not in there - also not in the github commits for the lectures, so it looks like a little bug in the course. Maybe I'm missing something else, but it would be great if Stephen could have a look at this.