Implement knife round feature and skip veto option for BO1 matches #342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the requested knife round feature for Best of 1 (BO1) matches and adds the ability to skip voting phases for direct match setup, addressing the core functionality requested in the issue.
Features Added
Knife Round Implementation
knife_round(boolean, default: false) enables knife rounds before match startKnifeRoundandWaitingForKnifeRoundDecisionstates with proper transitions!stayor!switchsides after knife roundknife_startandknife_wonevents for external systemsSetupKnifeRound()method with proper CS2 console commandsSkip Veto Feature
skip_veto(boolean, default: false) bypasses map and team voting phasesEnhanced Console Commands
The existing
!stayand!switchcommands now have dual functionality:Configuration Examples
Basic knife round setup:
{ "knife_round": true, "maplist": ["de_dust2"], "num_maps": 1 }Quick match without voting:
{ "skip_veto": true, "maplist": ["de_dust2"], "team1": { "players": {...} }, "team2": { "players": {...} } }Combined knife round + no voting:
{ "knife_round": true, "skip_veto": true, "maplist": ["de_dust2"] }Technical Implementation
State Machine Flow
API Integration
KnifeRoundStartedParamsandKnifeRoundWonParamsclassesIApiProviderwith knife round event methodsBackward Compatibility
Testing
Documentation
Fixes #340.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
127.0.0.11If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.