Allow ignoring playlists for the first map.

If sv_skip_lobby dvar is 1 set the lobby map and gametype to what the first gametype and map in the sv_maprotation dvar is set to, and then launch the game. sv_skip_lobby is enabled by default but setting it to 0 enables default behavior.
This commit is contained in:
JezuzLizard 2023-03-11 14:23:36 -08:00
parent 9cb2f337fa
commit 0e45709565
4 changed files with 30 additions and 7 deletions

View File

@ -34,7 +34,20 @@ Lobby.Process.CreateDedicatedModsLobby = function (f8_arg0, f8_arg1)
Engine.RunPlaylistRules(f8_arg0)
Engine.RunPlaylistSettings(f8_arg0)
Lobby.Timer.HostingLobby({controller = f8_arg0, lobbyType = f8_arg1.lobbyType, mainMode = f8_arg1.mainMode, lobbyTimerType = f8_arg1.lobbyTimerType})
if Engine.DvarInt( nil, "sv_skip_lobby" ) == 1 then
if Engine.DvarInt( nil, "sv_skip_lobby" ) == 1 then
-- Engine.ComError( Enum.errorCode.ERROR_SCRIPT, "Using sv_skip_lobby" )
local map_rotation_string = Engine.DvarString( nil, "sv_maprotation" )
if map_rotation_string ~= "" then
local map_rotation_tokens = split_string( map_rotation_string, " " )
if map_rotation_tokens[ 1 ] == "gametype" then
Engine.Exec(0, "lobby_setgametype " .. map_rotation_tokens[ 2 ] )
-- Engine.ComError( Enum.errorCode.ERROR_SCRIPT, "Set gametype to " .. map_rotation_tokens[ 2 ] .. " based on map rotation" )
if map_rotation_tokens[ 3 ] == "map" then
Engine.Exec(0, "lobby_setmap " .. map_rotation_tokens[ 4 ] )
-- Engine.ComError( Enum.errorCode.ERROR_SCRIPT, "Set map to " .. map_rotation_tokens[ 4 ] .. " based on map rotation" )
end
end
end
Engine.Exec(0, "launchgame")
end
end)
@ -46,4 +59,13 @@ Lobby.Process.CreateDedicatedModsLobby = function (f8_arg0, f8_arg1)
Lobby.Process.AddActions(f8_local6, f8_local7)
Lobby.Process.AddActions(f8_local7, nil)
return {head = f8_local2, interrupt = Lobby.Interrupt.NONE, force = true, cancellable = true}
end
end
function split_string(str, delimiter)
local tokens = {}
local pattern = string.format("([^%s]+)", delimiter)
for token in string.gmatch(str, pattern) do
table.insert(tokens, token)
end
return tokens
end

View File

@ -36,7 +36,8 @@ set sv_pure "0" // verifying cilent files
set sv_floodProtect "1" // Chat Spam Protection
set logfile "1" // Enable loging 1-2? enable. 0 disable. Leave it on if you plan on using B3 or IW4MAdmin.
set g_log "logs/games_mp.log" // Gamelog filename. If you edit this, Make sure you change B3.xml if you have bigbrotherbot. IW4MAdmin auto-detects however.
set sv_lobby_mode "mp" // Sets the lobby type to multiplayer
set sv_lobby_mode "mp" // Sets the lobby type to multiplayer.
set sv_skip_lobby "1" // Makes the server load the map immediately instead of waiting at the lobby. Turn this off if you want to use playlists instead(currently required for custom maps).
//////////////////////////////////////////////////
// BOT CONFIGURATION //
@ -113,5 +114,4 @@ set cg_thirdPerson "0" // third-person mode
// //
//////////////////////////////////////////////////////////
set sv_maprotation "gametype tdm map mp_biodome map mp_spire map mp_sector map mp_apartments map mp_chinatown map mp_veiled map mp_havoc map mp_ethiopia map mp_infection map mp_metro map mp_redwood map mp_stronghold map mp_nuketown_x map mp_shrine map mp_ruins map mp_cryogen map mp_rome map mp_crucible map mp_kung_fu map mp_miniature map mp_western map mp_conduit map mp_rise map mp_arena map mp_city map mp_skyjacked map mp_aerospace map mp_waterpark map mp_banzai map mp_veiled_heyday map mp_redwood_ice"
map_rotate
set sv_maprotation "gametype tdm map mp_biodome map mp_spire map mp_sector map mp_apartments map mp_chinatown map mp_veiled map mp_havoc map mp_ethiopia map mp_infection map mp_metro map mp_redwood map mp_stronghold map mp_nuketown_x map mp_shrine map mp_ruins map mp_cryogen map mp_rome map mp_crucible map mp_kung_fu map mp_miniature map mp_western map mp_conduit map mp_rise map mp_arena map mp_city map mp_skyjacked map mp_aerospace map mp_waterpark map mp_banzai map mp_veiled_heyday map mp_redwood_ice"

View File

@ -37,6 +37,7 @@ set sv_floodProtect "1" // Chat Spam Protection
set logfile "1" // Enable loging 1-2? enable. 0 disable. Leave it on if you plan on using B3 or IW4MAdmin.
set g_log "logs/games_cp.log" // Gamelog filename. If you edit this, Make sure you change B3.xml if you have bigbrotherbot. IW4MAdmin auto-detects however.
set sv_lobby_mode "cp" // Sets the lobby type to camapaign
set sv_skip_lobby "1" // Makes the server load the map immediately instead of waiting at the lobby. Turn this off if you want to use playlists instead(currently required for custom maps).
//////////////////////////////////////////////////
// BASE GAME CONFIGURATION //
@ -73,5 +74,4 @@ set cg_thirdPerson "0" // third-person mod
// //
//////////////////////////////////////////////////////////////
set sv_maprotation "gametype coop map cp_mi_eth_prologue"
map_rotate
set sv_maprotation "gametype coop map cp_mi_eth_prologue"

View File

@ -37,6 +37,7 @@ set sv_floodProtect "1" // Chat Spam Protection
set logfile "1" // Enable loging 1-2? enable. 0 disable. Leave it on if you plan on using B3 or IW4MAdmin.
set g_log "logs/games_zm.log" // Gamelog filename. If you edit this, Make sure you change B3.xml if you have bigbrotherbot. IW4MAdmin auto-detects however.
set sv_lobby_mode "zm" // Sets the lobby type to zombies
set sv_skip_lobby "1" // Makes the server load the map immediately instead of waiting at the lobby. Turn this off if you want to use playlists instead(currently required for custom maps).
//////////////////////////////////////////////////
// BASE GAME CONFIGURATION //