Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/FiveStack.Commands/Timeout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public partial class FiveStackPlugin
]
public void OnPause(CCSPlayerController? player, CommandInfo? command)
{
MatchManager? match = _matchService.GetCurrentMatch();
if (match != null && match.gameEnded)
{
return;
}

_timeoutSystem.RequestPause(player);
}

Expand All @@ -32,6 +38,12 @@ public void OnResume(CCSPlayerController? player, CommandInfo? command)
]
public void OnTimeout(CCSPlayerController? player, CommandInfo? command)
{
MatchManager? match = _matchService.GetCurrentMatch();
if (match != null && match.gameEnded)
{
return;
}

_timeoutSystem.CallTacTimeout(player);
}
}
2 changes: 2 additions & 0 deletions src/FiveStack.Events/GameEnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public HookResult OnGameEnd(EventCsWinPanelMatch @event, GameEventInfo info)
return HookResult.Continue;
}

match.gameEnded = true;

PublishRoundInformation();

MatchData? matchData = match.GetMatchData();
Expand Down
3 changes: 3 additions & 0 deletions src/FiveStack.Services/MatchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MatchManager
private MatchData? _matchData;
private eMapStatus _currentMapStatus = eMapStatus.Unknown;
private Timer? _resumeMessageTimer;
public bool gameEnded = false;

private readonly MatchEvents _matchEvents;
private readonly GameServer _gameServer;
Expand Down Expand Up @@ -964,6 +965,8 @@ public void Reset()

_currentMapStatus = eMapStatus.Unknown;

gameEnded = false;

readySystem.Reset();
captainSystem.Reset();
knifeSystem.Reset();
Expand Down
Loading