Skip to content

Commit

Permalink
Reset votes to restore when writing new backup
Browse files Browse the repository at this point in the history
Add message about resetting
  • Loading branch information
nickdnk committed Aug 23, 2022
1 parent f3327c9 commit f942162
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion documentation/docs/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ end with a full stop as this is added automatically.
| `TacticalPauseMidSentence` | _Team A_ (_CT_) __tactical pause__ (_1_/_2_). | HintText |
| `TimeRemainingBeforeAnyoneCanUnpausePrefix` | _Team A_ (_CT_) technical pause (_1_/_2_). __Time remaining before anyone can unpause__: _2:30_ | HintText |
| `StopCommandNotEnabled` | The stop command is not enabled. | Chat |
| `StopCommandVotingReset` | The request by _Team A_ to stop the game was canceled as a new round started. | Chat |
| `PauseTimeRemainingPrefix` | _Team A_ (_CT_) tactical pause. __Remaining pause time__: _2:15_ | HintText |
| `PausedForBackup` | The game was restored from a backup. Both teams must unpause to continue. | HintText |
| `AwaitingUnpause` | _Team A_ (_CT_) tactical pause. __Awaiting unpause__. | HintText |
Expand Down Expand Up @@ -132,7 +133,7 @@ end with a full stop as this is added automatically.
| `AdminForceEndWithWinnerInfoMessage` | An admin force-ended the match, setting _Team 1_ as the winner. | Chat |
| `AdminForcePauseInfoMessage` | An admin force-paused the match. | Chat |
| `AdminForceUnPauseInfoMessage` | An admin unpaused the match. | Chat |
| `TeamWantsToReloadLastRoundInfoMessage` | _Team A_ wants to stop and reload last round. _Team B_ must confirm with _!stop_. | Chat |
| `TeamWantsToReloadLastRoundInfoMessage` | _Team A_ wants to restore the game to the beginning of the current round. _Team B_ must confirm with _!stop_. | Chat |
| `TeamWinningSeriesInfoMessage` | _Team A_ is winning the series _2_-_1_. | Chat |
| `SeriesTiedInfoMessage` | The series is tied at _1_-_1_. | Chat |
| `NextSeriesMapInfoMessage` | The next map in the series is _de_nuke_ and it will start in _1:30_. | Chat |
Expand Down
10 changes: 10 additions & 0 deletions scripting/get5.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,16 @@ public void WriteBackup() {
LogDebug("Writing backup to %s", path);
WriteBackStructure(path);
g_LastGet5BackupCvar.SetString(path);

// Reset this when writing a new backup, as voting has no reference to which round the teams wanted to restore to, so
// votes to restore during one round should not carry over into the next round, as it would just restore that round
// instead.
LOOP_TEAMS(t) {
if (g_TeamGivenStopCommand[t]) {
Get5_MessageToAll("%t", "StopCommandVotingReset", g_FormattedTeamNames[t]);
}
g_TeamGivenStopCommand[t] = false;
}
}

public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) {
Expand Down
6 changes: 5 additions & 1 deletion translations/da/get5.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
}
"TeamWantsToReloadLastRoundInfoMessage"
{
"da" "{1} vil stoppe og genindlæse sidste runde. Afventer {3} fra {2}."
"da" "{1} vil stoppe og genindlæse til starten af denne runde. Afventer {3} fra {2}."
}
"TeamWinningSeriesInfoMessage"
{
Expand Down Expand Up @@ -252,6 +252,10 @@
{
"da" "Stop-kommandoen er ikke aktiveret."
}
"StopCommandVotingReset"
{
"da" "Anmodningen fra {1} om at stoppe spillet blev annulleret, da en ny runde startede."
}
"BackupLoadedInfoMessage"
{
"da" "Backup {1} indlæst."
Expand Down
7 changes: 6 additions & 1 deletion translations/get5.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
"TeamWantsToReloadLastRoundInfoMessage"
{
"#format" "{1:s},{2:s},{3:s}"
"en" "{1} wants to stop and reload last round. {2} must confirm with {3}."
"en" "{1} wants to restore the game to the beginning of the current round. {2} must confirm with {3}."
}
"TeamWinningSeriesInfoMessage"
{
Expand Down Expand Up @@ -301,6 +301,11 @@
{
"en" "The stop command is not enabled."
}
"StopCommandVotingReset"
{
"#format" "{1:s}"
"en" "The request by {1} to stop the game was canceled as a new round started."
}
"BackupLoadedInfoMessage"
{
"#format" "{1:s}"
Expand Down

0 comments on commit f942162

Please sign in to comment.