Skip to content

Commit

Permalink
Improve match start menu + add get5_creatematch cli (#988)
Browse files Browse the repository at this point in the history
Adjust tests and match config load feedback
Reorder functions in matchconfig.sp
Add tests for loading scrim configs
Add backup browser support to the new menu
Remove redundant scrim functions
Allow force-ready for backup restore
Add option to select winner on force-end
Fix winner team name empty on early force-end
Add 5 series delay before kick when ending series due to timeout
Validate team "id" property in JSON
Refactor get5_creatematch to work as CLI
Use json_get_last_error for better error feedback
Refactor JSON file loading
Add Wingman maps to map formatter
Use StrContains to format map names to support workshop maps
Introduce "random" option to side_type
Fix indents in template files
Remove old Command_CreateMatch code
Fix ArrayList memory leaks
Sort printed map list alphabetically
Fix random side type
Support sorting maps with formatted names in map menu
Fix workshop maps not being formatted
Add Canals and Aztec to map formatter
Update sm-json to v5 dev
  • Loading branch information
nickdnk committed Mar 25, 2023
1 parent 48aba89 commit c33f920
Show file tree
Hide file tree
Showing 25 changed files with 3,410 additions and 786 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Publish MKDocs to GH Pages
on:
pull_request:
branches:
- "development"
push:
branches:
- "master"
- "development"
- "adjust_docs"
jobs:
build:
name: Deploy docs
Expand All @@ -23,6 +25,9 @@ jobs:
if [ ${{ github.ref }} == 'refs/heads/master' ]
then
mike deploy latest --push
else
elif [ ${{ github.ref }} == 'refs/heads/development' ]
then
mike deploy dev --push
else
mike deploy PR-${{ github.head_ref || github.ref_name }} --push
fi
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ details.
7. The map is now always reloaded when a match configuration is loaded *if* a game was previously played on the same map
with no map reload in between. This is in effort to clear the game state and prevent bugs such as [the warmup
countdown timer stopping at 0.01](https://github.com/splewis/get5/issues/976).
8. The [`get5_creatematch`](https://splewis.github.io/get5/dev/commands/#get5_creatematch) command has been replaced by
a CLI-like command which lets you configure almost any type of match with a single command.
9. [`num_maps`](https://splewis.github.io/get5/dev/match_schema/#schema) in the match schema now defaults to `1` instead
of `3`.
10. [`get5_scrim`](https://splewis.github.io/get5/dev/commands/#get5_scrim) and the accompanying `scrim_template.cfg`
file is now considered legacy, and you should instead
use [`get5_creatematch --scrim --team1 home_team`](https://splewis.github.io/get5/dev/commands/#get5_creatematch)
and add your home team to the new teams file to achieve the same result.

### New Features / Changes 🎉

Expand All @@ -196,6 +204,15 @@ details.
6. You can now provide an `id` parameter to your team objects in match configurations, which is echoed back in the
forwards and JSON events.
7. Fixed missing HTTP event on `Get5_OnTeamReadyStatusChanged` and associated memory leak.
8. [`side_type`](https://splewis.github.io/get5/dev/match_schema/#schema) now accepts `random` as a parameter.
9. Workshop maps are now correctly formatted in the map veto system, assuming they contain a know map.
I.e. `workshop/82722474/de_nuke_2` would format to `Nuke`, since it contains `de_nuke`. Previously, a complete match
was required. The default Wingman maps now also format correctly (`de_lake` => `Lake` etc.).
10. The [`!get5`](https://splewis.github.io/get5/dev/commands/#get5) menu has been significantly upgraded and now
supports creating almost any type of match, similarly to the new `get5_creatematch` command, but using in-game menus
only. It now also lets you browse recent backups and set a winner if force-ending a match.
11. Any match configuration file can now take `scrim: true` in order to load in scrim mode, and `team2` will then not be
required.

# 0.13.1

Expand Down
4 changes: 4 additions & 0 deletions cfg/get5/cvars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"default": {
}
}
33 changes: 33 additions & 0 deletions cfg/get5/maps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"default": [
"de_ancient",
"de_anubis",
"de_inferno",
"de_mirage",
"de_nuke",
"de_overpass",
"de_vertigo"
],
"extended": [
"de_ancient",
"de_anubis",
"de_dust2",
"de_inferno",
"de_mirage",
"de_nuke",
"de_overpass",
"de_train",
"de_vertigo"
],
"wingman": [
"de_boyard",
"de_chalice",
"de_cbble",
"de_inferno",
"de_overpass",
"de_shortdust",
"de_shortnuke",
"de_train",
"de_vertigo"
]
}
1 change: 1 addition & 0 deletions cfg/get5/teams.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
144 changes: 63 additions & 81 deletions configs/get5/example_match.cfg
Original file line number Diff line number Diff line change
@@ -1,86 +1,68 @@
"Match"
{
"matchid" "example_match"
"num_maps" "3" // Must be an odd number or 2. 1->Bo1, 2->Bo2, 3->Bo3, etc.
"matchid" "example_match"
"num_maps" "3"
"spectators" // players allowed in spectator (e.g., admins) should go here
{
"players"
{
"76561197996426755" ""
}
}
"skip_veto" "0" // If set to 1, the maps will be preset using the first maps in the maplist below.
"veto_first" "team1" // Set to "random", "team1" or "team2" to select who starts the veto. Any other values will default to team1 starting.
"side_type" "standard" // Either "standard", "always_knife", or "never_knife"
"maplist"
{
"de_ancient" ""
"de_inferno" ""
"de_mirage" ""
"de_nuke" ""
"de_overpass" ""
"de_anubis" ""
"de_vertigo" ""
}
"players_per_team" "5"
"coaches_per_team" "2"
"min_players_to_ready" "1" // Minimum # of players a team must have to ready

"spectators" // players allowed in spectator (e.g., admins) should go here
{
"players"
{
"STEAM_1:1:....." ""
"STEAM_1:1:....." ""
"STEAM_1:1:....." ""
}
}
"team1"
{
"name" "EnvyUs" // You should always set a team name, otherwise some chat messages will not make sense. If there is no true team name, use "Team1" at least.
"tag" "EnvyUs" // Short tags replace the "clan tag" on the scoreboard. They are optional.
"flag" "FR"
"logo" "nv"
"players"
{
// Any of the 3 formats (steam2, steam3, steam64 profile) are acceptable.
// Note: the "players" section may be skipped if you set get5_check_auths to 0,
// but that is not recommended. You can also set player names that will be forced here.
// If you don't want to force player names, just use an empty quote "".
"STEAM_0:1:52245092" "splewis"
"[U:1:104490185]" ""
"76561198064755913" ""
}
}
"skip_veto" "0" // If set to 1, the maps will be preset using the first maps in the maplist below.

"veto_first" "team1" // Set to "random", "team1" or "team2" to select who starts the veto. Any other values will default to team1 starting.

"side_type" "standard" // Either "standard", "always_knife", or "never_knife"

"maplist"
{
"de_dust2" ""
"de_inferno" ""
"de_mirage" ""
"de_nuke" ""
"de_overpass" ""
"de_train" ""
"de_vertigo" ""
}

"players_per_team" "5"
"coaches_per_team" "2"
"min_players_to_ready" "1" // Minimum # of players a team must have to ready
"min_spectators_to_ready" "0" // How many spectators must be ready to begin.

// These values wrap mp_teamprediction_pct and mp_teamprediction_txt.
// You can exclude these if you don't want those cvars set.
"favored_percentage_team1" "65"
"favored_percentage_text" "HLTV Bets"
"team1"
{
"name" "EnvyUs" // You should always set a team name, otherwise some chat messages will not make sense. If there is no true team name, use "Team1" at least.
"tag" "EnvyUs" // Short tags replace the "clan tag" on the scoreboard. They are optional.
"flag" "FR"
"logo" "nv"
"players"
{
// Any of the 3 formats (steam2, steam3, steam64 profile) are acceptable.
// Note: the "players" section may be skipped if you set get5_check_auths to 0,
// but that is not recommended. You can also set player names that will be forced here.
// If you don't want to force player names, just use an empty quote "".
"STEAM_0:1:52245092" "splewis"
"[U:1:104490185]" ""
"76561198064755913" ""
"STEAM_1:1:....." ""
"STEAM_1:1:....." ""
}
}

"team2"
{
"name" "Fnatic"
"tag" "fnatic"
"flag" "SE"
"logo" "fntc"
"players"
{
"STEAM_1:1:46796472" ""
"STEAM_1:0:78189799" ""
"STEAM_1:0:142982" ""
"STEAM_1:1:....." ""
"STEAM_1:1:....." ""
}
}

// These will be executed on each map start or config load.
// You should not use this as a replacement for the cfg/get5/live.cfg config.
"cvars"
{
"hostname" "Match server #1"
"sm_practicemode_can_be_started" "0" // Disallow enabling practice mode when a match is loaded.
}
"team2"
{
"name" "Fnatic"
"tag" "fnatic"
"flag" "SE"
"logo" "fntc"
"players"
{
"STEAM_1:1:46796472" ""
"STEAM_1:0:78189799" ""
"STEAM_1:0:142982" ""
}
}
// These will be executed on each map start or config load.
// You should not use this as a replacement for the cfg/get5/live.cfg config, but you can use it to change
// individual parameters, such as friendly fire. These parameters are applied *after* the live config and will
// override it.
"cvars"
{
"sm_practicemode_can_be_started" "0" // Disallow enabling practice mode when a match is loaded.
}
}
113 changes: 46 additions & 67 deletions configs/get5/example_match.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,48 @@
{
"matchid": "example_match",
"num_maps": 3,
"players_per_team": 5,
"coaches_per_team": 2,
"min_players_to_ready": 1,
"min_spectators_to_ready": 0,
"skip_veto": false,
"veto_first": "team1",
"side_type": "standard",

"spectators": {
"players":
[
"STEAM_1:1:.....",
"STEAM_1:1:.....",
"STEAM_1:1:....."
]
},

"maplist":
[
"de_dust2",
"de_inferno",
"de_mirage",
"de_nuke",
"de_overpass",
"de_train",
"de_vertigo"
],

"favored_percentage_team1": 65,
"favored_percentage_text": "HLTV Bets",

"team1": {
"name": "EnvyUs",
"tag": "EnvyUs",
"flag": "FR",
"logo": "nv",
"players":
{
"STEAM_0:1:52245092" : "splewis",
"STEAM_1:1:....." : "",
"STEAM_1:1:....." : "",
"STEAM_1:1:....." : "",
"STEAM_1:1:....." : ""
}
},

"team2": {
"name": "Fnatic",
"tag": "Fnatic",
"flag": "SE",
"logo": "fntc",
"players":
[
"STEAM_1:1:46796472",
"STEAM_1:0:78189799",
"STEAM_1:0:142982",
"STEAM_1:1:.....",
"STEAM_1:1:....."
]
},

"cvars": {
"hostname": "Match server #1",
"sm_practicemode_can_be_started": "0"
}
"matchid": "example_match",
"num_maps": 3,
"players_per_team": 5,
"coaches_per_team": 2,
"min_players_to_ready": 1,
"skip_veto": false,
"veto_first": "team1",
"side_type": "standard",
"spectators": {
"players": [
"76561197996426755"
]
},
"maplist": [
"de_ancient",
"de_inferno",
"de_mirage",
"de_nuke",
"de_overpass",
"de_anubis",
"de_vertigo"
],
"team1": {
"name": "EnvyUs",
"tag": "EnvyUs",
"flag": "FR",
"logo": "nv",
"players": {
"STEAM_0:1:52245092": "splewis",
"76561198064755913": ""
}
},
"team2": {
"name": "Fnatic",
"tag": "Fnatic",
"flag": "SE",
"logo": "fntc",
"players": [
"STEAM_1:1:46796472",
"STEAM_1:0:78189799",
"STEAM_1:0:142982"
]
},
"cvars": {
"sm_practicemode_can_be_started": "0"
}
}

0 comments on commit c33f920

Please sign in to comment.