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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void OnApiResetRound(CCSPlayerController? player, CommandInfo command)
return;
}

_gameBackupRounds.RestoreRound(round);
_gameBackupRounds.RestoreRound(round, command.ArgByIndex(2) == "force");
}

[ConsoleCommand("css_reset", "Restores to a previous round")]
Expand Down
11 changes: 4 additions & 7 deletions apps/counterstrikesharp/src/FiveStack.Commands/Vote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ public void OnResetAnswer(CCSPlayerController? player, CommandInfo command)
return;
}

if (_gameBackupRounds.IsResettingRound())
{
_gameBackupRounds.restoreRoundVote?.CastVote(
player,
command.GetCommandString == "css_y"
);
}
_gameBackupRounds.restoreRoundVote?.CastVote(
player,
command.GetCommandString == "css_y"
);

if (_surrenderSystem.IsSurrendering())
{
Expand Down
14 changes: 10 additions & 4 deletions apps/counterstrikesharp/src/FiveStack.Events/RoundEnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public HookResult OnRoundOfficiallyEnded(EventRoundOfficiallyEnded @event, GameE
match.UpdateMapStatus(eMapStatus.Overtime);
}

if (_gameBackupRounds.IsResettingRound())
if (_gameBackupRounds.BlocksPlay())
{
_logger.LogInformation("OnRoundOfficiallyEnded skipping capture: restoring round");
_logger.LogInformation("OnRoundOfficiallyEnded skipping capture: round restore pending or in progress");
return HookResult.Continue;
}

Expand All @@ -55,10 +55,10 @@ public HookResult OnRoundOfficiallyEnded(EventRoundOfficiallyEnded @event, GameE
[GameEventHandler]
public HookResult OnRoundEnd(EventRoundEnd @event, GameEventInfo info)
{
if (_gameBackupRounds.IsResettingRound())
if (_gameBackupRounds.BlocksPlay())
{
_logger.LogInformation(
$"OnRoundEnd ignored (restoring round): message={@event.Message}"
$"OnRoundEnd ignored (round restore pending or in progress): message={@event.Message}"
);
return HookResult.Continue;
}
Expand Down Expand Up @@ -182,6 +182,12 @@ private void CaptureRoundResult(MatchManager match, MatchData matchData, MatchMa

public void PublishPendingRound(bool SendBackupRound)
{
if (_gameBackupRounds.BlocksPlay())
{
_matchEvents.ClearPendingRoundResult();
return;
}

MatchEvents.RoundResultSnapshot? snap = _matchEvents.PendingRoundResult;
if (snap == null)
{
Expand Down
6 changes: 4 additions & 2 deletions apps/counterstrikesharp/src/FiveStack.Events/RoundStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info)
return HookResult.Continue;
}

if (_gameBackupRounds.IsResettingRound())
if (_gameBackupRounds.BlocksPlay())
{
_logger.LogInformation("OnRoundStart skipping publish: restoring round");
_logger.LogInformation(
"OnRoundStart skipping publish: round restore pending or in progress"
);
return HookResult.Continue;
}

Expand Down
Loading
Loading