Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct MapNumber logic when restoring from backups with draws + add series clinch config parameter + fix OnSeriesResult #821

Merged
merged 8 commits into from
Aug 13, 2022

Conversation

nickdnk
Copy link
Collaborator

@nickdnk nickdnk commented Aug 7, 2022

This should fix #817.

I also adjusted Get5_OnBackupRestore to have the correct map and round number, indicating the match, map and round being restored to.

Tried to reduce use of Get5_GetMapNumber() where it is not needed.

Fixed problems with ties not correctly affecting the next map/series end logic.

I put the fix for #822 in here as well.

Added a g_SeriesCanClinch option that allows you to disable clinch-logic in a series, similarly to mp_match_can_clinch, but for maps.

I've moved a lot of code around, fixing the delay on OnSeriesResult and probably fixing a lot of weird issues with GOTV recordings. mp_match_restart_delay is now corrected if it is not long enough, but not shortened if longer. This allows admins to set a longer, fixed pause length between maps regardless of the length of the GOTV delay. Essentially this now includes #825, but I had to put that on top of this due to the way map scores are now handled. This also gets rid of g_ForceWinnerSignal and g_ForcedWinner.

Everything here is tested and it all works as far as I can tell.

scripting/get5/backups.sp Outdated Show resolved Hide resolved
@nickdnk nickdnk requested a review from PhlexPlexico August 7, 2022 20:47
@nickdnk nickdnk added this to the 0.10 milestone Aug 7, 2022
scripting/get5/matchconfig.sp Outdated Show resolved Hide resolved
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch 3 times, most recently from 2783c75 to d4109ba Compare August 8, 2022 21:54
@nickdnk nickdnk linked an issue Aug 8, 2022 that may be closed by this pull request
@nickdnk nickdnk requested a review from splewis August 9, 2022 17:30
@nickdnk nickdnk changed the title Ensure correct MapNumber logic when restoring from backups with draws Ensure correct MapNumber logic when restoring from backups with draws + add series clinch var Aug 9, 2022
@nickdnk nickdnk linked an issue Aug 9, 2022 that may be closed by this pull request
@nickdnk
Copy link
Collaborator Author

nickdnk commented Aug 9, 2022

Last commit fixes #728

@nickdnk
Copy link
Collaborator Author

nickdnk commented Aug 9, 2022

Tested everything in here and it seems to work as expected. Tested clinch_series and also tested that bo2 still works as expected.

@nickdnk nickdnk force-pushed the fix_backups_with_draws branch from 4cf2222 to 225b2a6 Compare August 10, 2022 00:14
@nickdnk nickdnk changed the title Ensure correct MapNumber logic when restoring from backups with draws + add series clinch var Ensure correct MapNumber logic when restoring from backups with draws + add series clinch config parameter Aug 10, 2022
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch from 225b2a6 to 5d7244d Compare August 10, 2022 23:49
@nickdnk
Copy link
Collaborator Author

nickdnk commented Aug 10, 2022

Now also fixes #213

@nickdnk nickdnk linked an issue Aug 10, 2022 that may be closed by this pull request
@nickdnk nickdnk changed the title Ensure correct MapNumber logic when restoring from backups with draws + add series clinch config parameter Ensure correct MapNumber logic when restoring from backups with draws + add series clinch config parameter + fix on_series_result Aug 10, 2022
@nickdnk nickdnk changed the title Ensure correct MapNumber logic when restoring from backups with draws + add series clinch config parameter + fix on_series_result Ensure correct MapNumber logic when restoring from backups with draws + add series clinch config parameter + fix OnSeriesResult Aug 10, 2022
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch from b046f02 to 9c8d3ca Compare August 11, 2022 23:25
@nickdnk
Copy link
Collaborator Author

nickdnk commented Aug 12, 2022

Fixes #190 now also.

@nickdnk nickdnk linked an issue Aug 12, 2022 that may be closed by this pull request
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch 2 times, most recently from adacb56 to 10819c6 Compare August 12, 2022 19:08
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch 2 times, most recently from 8f892d8 to 88d162d Compare August 12, 2022 21:43
@nickdnk
Copy link
Collaborator Author

nickdnk commented Aug 12, 2022

I changed the translation logic to always inject the color around variables if applicable. This means we don't have to make sure different languages use the same colors. I also cleaned up some of the translations a bit, where I could.

Player names are now colored based on the side they are on, so for instance when PlayerName has requested a tactical pause. is printed, PlayerName will now be either yellow or blue, depending on the side the player is on.

Commands in translations (.ie. type !unpause to continue) are now always colored green and have been changed to be injected variables as well.

…draws

Read round number from valve backup on restore event
Use g_MapNumber in more places and reduce use of Get5_GetMapNumber where not needed
Properly calculate series results when ties are included
Remove bo2 tie message (it was used when not bo2)
Remove call to WriteBackup on match end
Remove unused translation from docs
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch 2 times, most recently from 0718f2c to 66743d7 Compare August 13, 2022 18:53
Cleaned up EndSeries call
Fixed match restart delay to GOTV delay
Remove unnecessary g_ForceWinnerSignal and g_ForcedWinner vars
Remove duplicate call to Stats_SeriesEnd when forfeiting
Ensure Get5_OnDemoFinished is detached from global vars and on a delay for file flush
Adjust translation to include time-to-map-change
Ensure SetMatchRestartDelay is called after cvars are set, using timers
Use datapacks for all backup timer chains, ensuring nothing messes with the parameters
Update translations doc + danish
Fix mp_match_restart_delay problems related to restoring cvars
Cleaned up duplicate code used to start recording, moved all code to recording.sp
prevent invalid handle if RestoreCvars is called twice
Always reset g_DemoFileName on map start
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch 2 times, most recently from 68784d9 to ff2e6e8 Compare August 13, 2022 19:09
nickdnk and others added 3 commits August 13, 2022 21:21
Don't wait for gotv when restoring cvars when force-ending a match
ensure endmatch unpauses the game
Add gold color; color player names based on their current side
Fixed some translations
consistently color team names
Fixed correct callout and graphics for winning team when knife-round ends
Get rid of Timer_PostKnife
Always reset g_HasKnifeRoundStarted when loading configs or maps
@nickdnk nickdnk force-pushed the fix_backups_with_draws branch from ff2e6e8 to d9b4a16 Compare August 13, 2022 19:21
Copy link
Owner

@splewis splewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just a few tiny nits that I'd like to see tweaked, feel free to merge it.

@nickdnk nickdnk merged commit 25f4e2c into development Aug 13, 2022
@nickdnk nickdnk mentioned this pull request Aug 13, 2022
@nickdnk nickdnk deleted the fix_backups_with_draws branch August 14, 2022 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants