Skip to content

Commit

Permalink
Added support for sv_game_mode_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
lenosisnickerboa committed May 7, 2022
1 parent dd61adb commit 6db16dc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
45 changes: 24 additions & 21 deletions src/csgosl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -574,27 +574,30 @@ ValidateMapGroupsMapper
## Run config
# Can deal with at most one space in name, see RunGameModeTypeChanged
variable gameModeMapper [dict create \
"Classic Casual" [dict create type 0 mode 0 skirmish 0] \
"Classic Competitive" [dict create type 0 mode 1 skirmish 0] \
"Wingman" [dict create type 0 mode 2 skirmish 0] \
"Weapon Expert" [dict create type 0 mode 3 skirmish 0] \
"Armsrace" [dict create type 1 mode 0 skirmish 0] \
"Demolition" [dict create type 1 mode 1 skirmish 0] \
"Deathmatch" [dict create type 1 mode 2 skirmish 0] \
"Training" [dict create type 2 mode 0 skirmish 0] \
"Custom" [dict create type 3 mode 0 skirmish 0] \
"Cooperative" [dict create type 4 mode 0 skirmish 0] \
"Cooperative Guardian" [dict create type 4 mode 0 skirmish 0] \
"Cooperative Strike" [dict create type 4 mode 1 skirmish 0] \
"Danger Zone" [dict create type 6 mode 0 skirmish 0] \
"Skirmish-Stab-Stab-Zap" [dict create type 5 mode 0 skirmish 1] \
"Skirmish-Free-For-All" [dict create type 5 mode 0 skirmish 2] \
"Skirmish-Flying-Scoutsman" [dict create type 5 mode 0 skirmish 3] \
"Skirmish-Trigger-Discipline" [dict create type 5 mode 0 skirmish 4] \
"Skirmish-Boom!-Headshot!" [dict create type 5 mode 0 skirmish 6] \
"Skirmish-Hunter-Gatherers" [dict create type 5 mode 0 skirmish 7] \
"Skirmish-Heavy-Assault-Suit" [dict create type 5 mode 0 skirmish 8] \
"Skirmish-Retakes" [dict create type 5 mode 0 skirmish 12]]
"Classic Casual" [dict create type 0 mode 0 flags 0 skirmish 0] \
"Classic Competitive" [dict create type 0 mode 1 flags 0 skirmish 0] \
"Classic Competitive Short" [dict create type 0 mode 1 flags 32 skirmish 0] \
"Wingman" [dict create type 0 mode 2 flags 0 skirmish 0] \
"Weapon Expert" [dict create type 0 mode 3 flags 0 skirmish 0] \
"Armsrace" [dict create type 1 mode 0 flags 0 skirmish 0] \
"Demolition" [dict create type 1 mode 1 flags 0 skirmish 0] \
"Deathmatch" [dict create type 1 mode 2 flags 0 skirmish 0] \
"Deathmatch Team vs Team" [dict create type 1 mode 2 flags 4 skirmish 0] \
"Deathmatch Free For All" [dict create type 1 mode 2 flags 32 skirmish 0] \
"Training" [dict create type 2 mode 0 flags 0 skirmish 0] \
"Custom" [dict create type 3 mode 0 flags 0 skirmish 0] \
"Cooperative" [dict create type 4 mode 0 flags 0 skirmish 0] \
"Cooperative Guardian" [dict create type 4 mode 0 flags 0 skirmish 0] \
"Cooperative Strike" [dict create type 4 mode 1 flags 0 skirmish 0] \
"Danger Zone" [dict create type 6 mode 0 flags 0 skirmish 0] \
"Skirmish-Stab-Stab-Zap" [dict create type 5 mode 0 flags 0 skirmish 1] \
"Skirmish-Free-For-All" [dict create type 5 mode 0 flags 0 skirmish 2] \
"Skirmish-Flying-Scoutsman" [dict create type 5 mode 0 flags 0 skirmish 3] \
"Skirmish-Trigger-Discipline" [dict create type 5 mode 0 flags 0 skirmish 4] \
"Skirmish-Boom!-Headshot!" [dict create type 5 mode 0 flags 0 skirmish 6] \
"Skirmish-Hunter-Gatherers" [dict create type 5 mode 0 flags 0 skirmish 7] \
"Skirmish-Heavy-Assault-Suit" [dict create type 5 mode 0 flags 0 skirmish 8] \
"Skirmish-Retakes" [dict create type 5 mode 0 flags 0 skirmish 12]]

variable botSkillMapper [dict create \
"Easy" 0 \
Expand Down
4 changes: 2 additions & 2 deletions src/page_run.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ variable runLayout [CreateLayout \
] \
]

proc RunGameModeTypeChanged { value1 {value2 ""}} {
set value [string trim "$value1 $value2"]
proc RunGameModeTypeChanged { value1 {value2 ""} {value3 ""} {value4 ""} {value5 ""} {value6 ""} {value7 ""} {value8 ""} {value9 ""}} {
set value [string trim "$value1 $value2 $value3 $value4 $value5 $value6 $value7 $value8 $value9"]
UpdateRunPage
return "$value"
}
Expand Down
5 changes: 3 additions & 2 deletions src/server_support.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ proc GetStartServerCommand {} {
set gameModeType [dict get $gameModeMapper "$gameModeTypeString"]
set gameType [dict get $gameModeType type]
set gameMode [dict get $gameModeType mode]
set gameModeFlags [dict get $gameModeType flags]
set skirmish [dict get $gameModeType skirmish]

set players [GetConfigValue $runConfig players]
Expand Down Expand Up @@ -226,7 +227,7 @@ proc GetStartServerCommand {} {
if { $currentOs == "windows" } {
return "\"[file nativename $serverFolder/$srcdsName]\" \
-game csgo $consoleCommand $rconCommand \
+game_type $gameType +game_mode $gameMode +sv_skirmish_id $skirmish \
+game_type $gameType +game_mode $gameMode +sv_game_mode_flags $gameModeFlags +sv_skirmish_id $skirmish \
$mapGroupOption \
$mapOption \
$steamAccountOption $apiAuthKeyOption \
Expand All @@ -241,7 +242,7 @@ proc GetStartServerCommand {} {
} else {
return "\"$serverFolder/$srcdsName\" \
-game csgo $consoleCommand $rconCommand \
+game_type $gameType +game_mode $gameMode +sv_skirmish_id $skirmish \
+game_type $gameType +game_mode $gameMode +sv_game_mode_flags $gameModeFlags +sv_skirmish_id $skirmish \
$mapGroupOption \
$mapOption \
$steamAccountOption $apiAuthKeyOption \
Expand Down
2 changes: 1 addition & 1 deletion src/version.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# The next line is executed by /bin/sh, but not tcl \
exec wish "$0" ${1+"$@"}

set version "2.11"
set version "2.12"

0 comments on commit 6db16dc

Please sign in to comment.