Raised This Month: $51 Target: $400
 12% 

Advanced Map Configuration


Post New Thread Reply   
 
Thread Tools Display Modes
Author
cmptrwz
Member
Join Date: Dec 2008
Plugin ID:
661
Plugin Version:
1.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Server Based Map, Map Prefix, and Custom Mode Configurations
    Old 12-07-2008 , 14:08   Advanced Map Configuration
    Reply With Quote #1

    Advanced Map Configuration
    Recently I decided I wanted to run multiple server instances of Left 4 Dead, each with different settings, including map-specific settings. Without having multiple installs. Preferably using -fork.

    That doesn't work well without a really convoluted alias setup, let me tell you.

    This plugin fixes that. On each map load (in OnConfigsExecuted) the plugin runs through a series of configuration files, all stored in cfg/advmap/, based on various things it can see about the server. If any of the files is not there it skips it.

    Assuming you are on a Left 4 Dead server on the l4d_vs_hospital01_apartment map, the full list it will look for by default is over 40 entries long. The basics, however, are the following files in the various folders it is checking:
    default.cfg
    l4d.cfg
    vs.cfg
    hospital01.cfg
    l4d_.cfg
    l4d_vs_.cfg
    l4d_vs_hospital01_.cfg
    l4d_vs_hospital01_apartment.cfg

    AKA, a default configuration file, a configuration file for each prefix on the map filename individually, the complete prefix set in order, and the map name itself. The catch is it looks in the following folders for each of those files by default:
    cfg/advmap/<gamemode?/>
    cfg/advmap/<gamemode?/>/<ip>/
    cfg/advmap/<gamemode?/>/<hostip>/
    cfg/advmap/<gamemode?/>/<hostport>/
    cfg/advmap/<gamemode?/>/<ip>/<hostport>/
    cfg/advmap/<gamemode?/>/<hostip>/<hostport>/

    Where ip, hostip, and port are the cvars ip, hostip, and port.
    gamemode (sm_mapconfig_gamemode) is included when set so you can cut out the ip, hostip, and hostport checks but still have multiple named "modes" of play.

    Configuration:

    sm_mapconfig_enabled - Default 1 - Is the plugin enabled at all? If set to 0 no attempt to run additional configs will be made.
    sm_mapconfig_prefixchar - Default "_" - I doubt this will ever need to be changed, but figured it was better to make it an option.
    sm_mapconfig_prefixdepth - Default 3 - Maximum number of prefixes to extract from the map filename
    sm_mapconfig_prefixmode - Default 3 - Bitmask.
    • 0 - Nothing set, prefix checking is disabled entirely.
    • 1 - Run prefix configs based on entire prefix to point. (with trailing prefixchar)
    • 2 - Run prefix configs based on pieces of prefix. (no trailing prefixchar)
    • 4 - Remove trailing digits from last prefix before adding prefixchar (Only with 1)
    • 8 - Reverse order of prefix configs. (Only with 2)
    • 16 - Run prefix configs ONLY, no map configs. If you set ONLY this (or this and 4 and/or you won't get prefix OR map configs.
    sm_mapconfig_includeport - Default 1 - Do we include the port in the folder tree when checking for map config files?
    • 0 - Never
    • 1 - Run configs that match without first, then with
    • 2 - Only run configs that match with
    sm_mapconfig_includeip - Default 6 - Bitmask. Do we include the ip in the folder tree when checking for map config files?
    • 0 - Never
    • 1 - Only run configs that match with (if not set, run configs that match without first, then with)
    • 2 - Use cvar "ip" - Which, incidently, may or may not be an ip
    • 4 - Use cvar "hostip" - Which appears to always be the decimal (not dotted quad) form of the ip
    sm_mapconfig_gamemode - Default "" - A folder name to check for config files in. If changed in one of the config files the plugin runs it takes effect on the next map load. If changed at any other point it triggers the configuration reload right away, as if the map had just changed.
    sm_mapconfig_version - The version of the plugin.

    Notes:
    I HIGHLY recommend disabling some of the folders unless you need them. You should not, for example, need the ip, hostip, AND hostport options active all the time. I personally plan on running with just the hostport option active, and only so that it can disable the hostport option and activate a gamemode.

    Alternatively, if you want to use the ip, hostip, or hostport options, consider enabling the "require" them options so that the tree will not be checked above them.

    Tricks:
    If the prefix mode includes bits 4 and 1 (such as if you set it to 5) then Left 4 Dead campaigns can be easily targeted, as it will run the following campaign specific configs:
    l4d_airport_.cfg
    l4d_farm_.cfg
    l4d_hospital_.cfg
    l4d_smalltown_.cfg
    l4d_vs_farm_.cfg
    l4d_vs_hospital_.cfg
    Attached Files
    File Type: sp Get Plugin or Get Source (adv_map_config.sp - 2389 views - 10.1 KB)
    cmptrwz is offline
    recon0
    Veteran Member
    Join Date: Sep 2007
    Location: US
    Old 12-11-2008 , 01:46   Re: Advanced Map Configuration
    Reply With Quote #2

    This looks very useful ;)
    __________________
    recon0 is offline
    necrosect
    Senior Member
    Join Date: Jun 2008
    Old 12-29-2008 , 14:15   Re: Advanced Map Configuration
    Reply With Quote #3

    sorry if this is a retarded question... but. I'm a bit confused about how the naming works. I have tf/cfg/advmap as a folder in that i have: cp_.cfg ctf_.cfg arena_.cfg and pl_.cfg I've put echo commands in each of the configs so I can see if they are actually being executed. I've tried a few configurations of the bitmasks of prefix mode but to be honest I'm a bit confused. What settings do I need to get this to work with the file structure I have (depth and mode)? Also - what order does this execute in? %mapname%.cfg then the advmap config? or the other way around?
    necrosect is offline
    cmptrwz
    Member
    Join Date: Dec 2008
    Old 12-29-2008 , 15:48   Re: Advanced Map Configuration
    Reply With Quote #4

    I have only tested on Linux, with the Left 4 Dead dedicated server, although I don't believe I use anything that would not work elsewhere. Are you using Linux or Windows for your dedicated server? I can get either up and running with TF2 to test with, but would prefer to only test the one you are using at the moment to see if I can find issues.

    I am not sure where in the loop the game itself will load the config in, have not tried to use the game's built-in map specific config set with this.
    cmptrwz is offline
    necrosect
    Senior Member
    Join Date: Jun 2008
    Old 01-01-2009 , 15:31   Re: Advanced Map Configuration
    Reply With Quote #5

    linux i'll work out where it loads with echos i think - just put one in every config and see what order they're loaded in . but yeah it's a linux tf2 server. Having a bit of a problem seeing if this is working or not... it seems not to be in some random cases - will do some testing and try to be a bit more specific for you! .

    Last edited by necrosect; 01-01-2009 at 16:10.
    necrosect is offline
    tathannibal
    New Member
    Join Date: Jun 2007
    Old 07-19-2009 , 16:41   Advanced Map Configuration
    Reply With Quote #6

    Hi all.
    Sry i'm no undestand.

    Need to L4D server gamemode change.
    Pls help this readme is not undestand.
    tathannibal is offline
    valamideus
    Member
    Join Date: Jun 2011
    Old 04-27-2012 , 15:24   Re: Advanced Map Configuration
    Reply With Quote #7

    I have two problems. When I put a cvar on a map, when i change the map to another map, cvar continues on the map that changed. And when I switch the map takes too long to load, is in "Server is changing level."
    valamideus is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 20:00.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode