-
Notifications
You must be signed in to change notification settings - Fork 174
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
Fix problems with knife swap/stay command timing #888
Conversation
Also, I have tested this as well as I can with just myself and a bot, so I know it works, but I would appreciate it if someone else would give it a test. |
I observed that doing knife cvar restore when the knife round reaches its win-panel is the cause of some of these problems. It will potentially restore I'm running with all of these changes on top of 0.11 for my game service at the moment, and I'll leave it there for a couple of days to observe if things work. See 67c30d1 |
…causes odd race conditions when called at the wrong time Reduce info message interval from 29 to 20 but restart it on each round start to avoid double-printing messages Default mp_round_restart_delay 3 in knife config Deduplicate knife decision prompt text Remove MVP reason hack; it was buggy and could print for someone from wrong team Restore knife cvars when knife round has ended, not on round win panel Adjust knife round winner callout due to changes Properly reset knife round var Move cvar save logic to start-knife callback to prevent exec clashes Move knife timer to round end instead of win panel Do not allow less than 10 seconds on knife timer as that does not really make any sense.
192097a
to
6b01f68
Compare
I have extensively tested this in real games and manual testing and everything seems to be working correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; this is a good catch. I'm not surprised such a race condition was possible.
…causes odd race conditions when called at the wrong time (splewis#888) Reduce info message interval from 29 to 20 but restart it on each round start to avoid double-printing messages Default mp_round_restart_delay 3 in knife config Deduplicate knife decision prompt text Remove MVP reason hack; it was buggy and could print for someone from wrong team Restore knife cvars when knife round has ended, not on round win panel Adjust knife round winner callout due to changes Properly reset knife round var Move cvar save logic to start-knife callback to prevent exec clashes Move knife timer to round end instead of win panel Do not allow less than 10 seconds on knife timer as that does not really make any sense.
It seems there are still some rare problems with
!stay
and!swap
being called at the exact wrong time causing the game to misbehave and sometimes skip the live countdown entirely.This PR disables the ability to choose a side until the knife-round has completely ended, removing the race-condition window that would cause this bug.
It also reduces info message interval from 29 to 20, but instead restarts the timer on each round start to avoid double-printing messages, such as the "Team X won the knife round, waiting for them to type swap/stay", which is also triggered when the knife round ends.
Added
mp_round_restart_delay 3
to the default knife config as you now can't do swap/stay until the round ends, so 5 seconds is a bit much.Deduplicate logic for the knife-decision chat message
Remove round-end-fun-fact override hack; it was buggy.
I would like to merge this to 0.10 and release as 0.10.4 (with #887), as this is potentially game-breaking and 0.11 is still not ready.