Raised This Month: $7 Target: $400
 1% 

Map configs with prefix support 1.3


Post New Thread Reply   
 
Thread Tools Display Modes
Author
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Plugin ID:
344
Plugin Version:
1.2
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows you to have per map config files. Support for map prefix configs (example: dm_.cfg)
    Old 04-05-2008 , 17:37   Map configs with prefix support 1.3
    Reply With Quote #1

    with prefix support


    Plugin on Github: https://github.com/bcserv/mapconfigs - Forks & Pull requests are welcome

    Allows you to have per map config files. Support for map prefix configs (example: dm_.cfg)
    This is a complete rewrite of a map configs plugin I found somewhere.

    You can have prefix configs that allow you to easily execute cvars/commands for a group of maps, without having to create a cfg file for each of them.
    The executing order is alphabetical, that means configs that have the shortest name will be executed first.

    Example:

    Your maps name is js_build_puzzle_nine_v10

    Your config files are js_build_puzzle_nine_v10.cfg, js_build_.cfg and js_.cfg

    The executing order will be:
    1. js_.cfg
    2. js_build_.cfg
    3. js_build_puzzle_nine_v10.cfg
    Config structure

    cfg/sourcemod/map-cfg/

    ConVars

    none

    Todo

    -


    Changelog


    06-05-2015 Version 1.3
    • Fixed handle leak

    26-10-2014 Version 1.2
    • Added support for workshop maps (CS:GO), thanks to tabakhase

    23-8-2009 Version 1.1.1
    • Fixed configs getting executed twice OnPluginStart

    23-8-2009 Version 1.1
    • Added version Convar mc_version
    • Code cleanup
    7-5-2008 Version 1.02
    • The plugin is now using OnAutoConfigsBuffered() instead of OnConfigsExecuted() for more reliable cvar changing.
    7-5-2008 Version 1.01
    • Fixed wrong folder structor in attached rar file.
    5-4-2008 Version 1.0
    • Initial release
    Tested games
    • CS: GO
    • Half Life 2: Deathmatch
    • Counter Strike: Source
    • Team Fortress 2
    • Day of Defeat: Source
    • Should work with any games

    Contributors
    Attached Files
    File Type: zip mapconfigs.zip (8.1 KB, 11454 views)
    __________________
    Why reinvent the wheel ? Download smlib with over 350 useful functions.

    When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
    powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

    Last edited by berni; 05-05-2015 at 18:07.
    berni is offline
    r3dh3adkid
    Senior Member
    Join Date: Apr 2008
    Location: Georgia
    Old 05-06-2008 , 22:00   Re: Map configs with prefix support
    Reply With Quote #2

    Either your post is incorrect or the code is because your code draws the configs from cfg/sourcemod/map-cfg not cfg/map-cfg

    other than that, the plugin has worked so far without a hitch!
    __________________
    r3dh3adkid is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 05-06-2008 , 22:21   Re: Map configs with prefix support
    Reply With Quote #3

    How is that any different from this plugin?
    bl4nk is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 05-07-2008 , 00:14   Re: Map configs with prefix support
    Reply With Quote #4

    It works with all mods.
    __________________

    DontWannaName is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 05-07-2008 , 02:10   Re: Map configs with prefix support
    Reply With Quote #5

    I use the plugin I linked on CSS, DOD:S, and TF2 just fine.
    bl4nk is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 05-07-2008 , 02:40   Re: Map configs with prefix support
    Reply With Quote #6

    Well than the difference is this one was released in April for any mod and the other was made in January for CSS it said.
    __________________

    DontWannaName is offline
    berni
    SourceMod Plugin Approver
    Join Date: May 2007
    Location: Austria
    Old 05-07-2008 , 03:59   Re: Map configs with prefix support
    Reply With Quote #7

    Quote:
    Originally Posted by r3dh3adkid View Post
    Either your post is incorrect or the code is because your code draws the configs from cfg/sourcemod/map-cfg not cfg/map-cfg

    other than that, the plugin has worked so far without a hitch!
    Thanks for reporting this I corrected this.

    Well there are some things that are different.
    • My code isn't so bloated like in the other plugin
    • My plugin allows multiple prefix configs for one map, the config executing order is alphabetical, that means configs with shorter file name are getting executed first.
    • My plugin doesn't read every line from the config and executes in the console, it's using the exec command.
    • My plugin isn't limited to CS:S only ;)
    • you don't need to have a _ in the mapname to use prefix configs, it works with anything.

    Last edited by berni; 05-07-2008 at 07:20.
    berni is offline
    Caught off Guard
    Senior Member
    Join Date: Jan 2008
    Old 05-07-2008 , 04:03   Re: Map configs with prefix support
    Reply With Quote #8

    Quote:
    Originally Posted by berni View Post
    Thanks for reporting this I corrected this.

    Well there are some things that are different.
    • My code isn't so bloated like in the other plugin
    • My plugin allows multiple prefix configs for one map, the config executing order is alphabetical, that means configs with shorter file name are getting executed first.
    • My plugin doesn't read every line from the config and executes in the console, it's using the exec command.
    • My plugin isn't limited to CS:S only ;)
    thanks for the summary i will take a look at it later. even though the other plugin says CS:S only, it works fine in insurgency. however if the code is more efficient it would be worth a look see. will come back with any problems I find!

    cheers
    Caught off Guard is offline
    Caught off Guard
    Senior Member
    Join Date: Jan 2008
    Old 05-10-2008 , 02:13   Re: Map configs with prefix support
    Reply With Quote #9

    appears to work fine in insurgency. thanks.
    Caught off Guard is offline
    BAILOPAN
    Join Date: Jan 2004
    Old 05-20-2008 , 22:16   Re: Map configs with prefix support
    Reply With Quote #10

    Your plugin has a race condition. OnConfigsExecuted() guarantees that all configs have finished executing. But you're issuing an "exec" command inside OnConfigsExecuted(), and the changes won't necessarily be mirrored in plugins which rely on this guarantee (such as reservedslots).

    I've added a forward to the 1.1 branch to help mitigate this problem, you can read about it here. This change will make it into 1.0.2 or so. I won't unapprove this plugin until a stable release has the new feature and this plugin has had time to update after that.

    Note: "fixing" by using OnMapStart() is not a good idea since it occurs before sourcemod.cfg gets executed.
    __________________
    egg

    Last edited by BAILOPAN; 05-20-2008 at 22:19.
    BAILOPAN is offline
    Reply


    Thread Tools
    Display Modes

    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 07:43.


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