Raised This Month: $40 Target: $400
 10% 

Maplister


Post New Thread Reply   
 
Thread Tools Display Modes
Author
theY4Kman
Join Date: Jun 2007
Location: Yak
Plugin ID:
25
Plugin Version:
1.6.8
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Lists the maps in the mod/maps/ directory to players and writes them to files
    Old 06-12-2007 , 19:50   Maplister
    Reply With Quote #1

    After downloading countless maps and updating the maplist the same amount, I wondered why it wasn't an automated process. Well, instead of complaining, I went ahead and made this plugin.

    What it does is fill maplist.txt with every map (.bsp file) in your maps/ directory whenever you execute "sm_writemaplist" from the console of an admin. Also, if you execute "sm_maplist" from any console, it will reply with the maplist from maps/. Using the cvar sm_auto_maplist, you can let it generate a new maplist whenever the map changes.

    ConCommands:
    • sm_maplist [filter]
      • Prints a map list satisfying the optionally specified filter to the user that executed the command.
    • sm_writemaplist <output file> [filter]
      • Outputs a map list satisfying the optionally specified filter to the file specified. This requires the generic admin flag ('b').

    ConVars:
    • sm_maplister_version
      • The version of the maplister plugin
    • sm_auto_maplist
      • (0|1) Will automatically generate a new maplist when the map changes or the server starts.
    Installation:
    • With .smx
      • Use the "Get Plugin" link to download the .smx. Place it in the addons/sourcemod/plugins directory
    Changelog:
    • Version 1.0
      • Initial release
    • Version 1.1
      • Can use writemaplist from the user console. It will check that the user is an admin. It turns out that GetUserAdmin() wasn't working for me because it didn't work on Windows Listen servers. They fixed it in 938+, so I updated the code and tested it.
    • Version 1.2
      • Updated to plugin standards
        • Added version cvar
        • Renamed all commands to the sm_ prefix
        • Commented and formatted code
      • Added natives (Available in the .zip or .rar packages)
        • WriteNewMaplist
        • ListMapsToClient
    • Version 1.3
      • Restyled code
      • Allowed filenames to be used in sm_writemaplist:
        • sm_writemaplist <filename>
      • Map lists are now sorted alphabetically A-Z
    • Version 1.4
      • Map exclusion file (configs/maplister_excludes.cfg) allows you to specify maps that should be excluded when listing maps (to players and files).
        • Put one map name on each line in sourcemod/configs/maplister_excludes.cfg
        • Exclude the ending ".bsp"
    • Version 1.5
      • Map name filters allow you to print only the maps that start with the specified string. For example, `sm_maplist cs` will list only the maps that began with the letters "cs": cs_assault, cs_compound, cs_crackhouse, etc.
      • Fixed the maps exclusion file. The problem was that I would loop through all the lines in the file for the first map name, and I never reset the file pointer. It would be stuck at the bottom the whole time.
    • Version 1.6
      • Added support for L4D add-on maps.
    • Version 1.6.8 (by Malachi -- he's awesome)
      • All configuration resides in configs/maplister.cfg (first line denotes the filename Maplister outputs to when writing to file)
      • SteamPipe support

    If you have any comments or suggestions, please tell me!
    Attached Files
    File Type: sp Get Plugin or Get Source (maplister.sp - 1688 views - 9.1 KB)
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.

    Last edited by asherkin; 08-02-2013 at 07:51. Reason: Hotfix: 1.6.1 (fixes non-bsp files showing up in listing)
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    sessus
    Senior Member
    Join Date: May 2006
    Old 06-12-2007 , 23:31   Re: [PLUGIN] Maplister
    Reply With Quote #2

    this a great.

    could you maybe add a cvar so that the maplist is not updated every map-change to reduce server load?
    sessus is offline
    theY4Kman
    Join Date: Jun 2007
    Location: Yak
    Old 06-12-2007 , 23:54   Re: [PLUGIN] Maplister
    Reply With Quote #3

    It's there
    sm_auto_maplist 0
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    kill0r
    Junior Member
    Join Date: Jun 2007
    Old 06-13-2007 , 03:34   Re: [PLUGIN] Maplister
    Reply With Quote #4

    Sorry for that stupid question, but why maplist.txt and not mapcycle.txt? maplist.txt is afaik mani-only? see server-convar "mapcyclefile".
    kill0r is offline
    sessus
    Senior Member
    Join Date: May 2006
    Old 06-13-2007 , 04:15   Re: [PLUGIN] Maplister
    Reply With Quote #5

    Quote:
    Originally Posted by theY4Kman View Post
    It's there
    sm_auto_maplist 0
    Yeah, that automatically creates the list when the server restarts or changes the map. I was requesting a cvar that disables the generation of a new maplist upon map-change and only generates the list when the server is restarted.

    @kill0r: maplist.txt is likely to be used by the coming map management of SM, which you don't necessarity want to be identical to mapcycle.txt. I think you can actually speficy within your server.cfg which of those is used a the mapcycle source (unless im confusing this with mani ).
    sessus is offline
    kill0r
    Junior Member
    Join Date: Jun 2007
    Old 06-13-2007 , 16:20   Re: [PLUGIN] Maplister
    Reply With Quote #6

    Thx sessus, but where is the new map management discussed? If it's not final yet, I would like to suggest something:
    1. SM should read the mapcyclefile once (onload) and store the list in memory.
    2. SM should provide some functions (e.g. GetMaplist(), ClearMaplist(), ..)

    3. OnMapStart() A plugin could then move the currentmap to the bottom of the list (if it was in the list). (MaplistMoveToBottom(currentmap))
    Or do some randomstuff whatever...
    4. OnMapEnd() SM automaticaly loads the map on top of the list.

    -> It's easier to use, you have more control, no need to read and write the .txt.
    -> Better management for say nextmap, maplister, mapshaker, setnextmap, setnextnextmap,...
    -> Easier to combine or to replace with a mysql/DB list <- no need to change anything for the plugins.
    -> We could have favoured maps twice or even more often in the list.

    Last edited by kill0r; 06-13-2007 at 16:22.
    kill0r is offline
    theY4Kman
    Join Date: Jun 2007
    Location: Yak
    Old 06-15-2007 , 09:10   Re: [PLUGIN] Maplister
    Reply With Quote #7

    I updated it to version 1.1. It seems that GetUserAdmin() wasn't working only because of my version of SourceMod (rev 937). With 938+, it worked with Listen servers, so I tested it and it worked
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    krod
    Member
    Join Date: Oct 2006
    Old 06-15-2007 , 09:35   Re: [PLUGIN] Maplister
    Reply With Quote #8

    This is sooo helpful, thanks!
    krod is offline
    theY4Kman
    Join Date: Jun 2007
    Location: Yak
    Old 06-15-2007 , 13:24   Re: [PLUGIN] Maplister
    Reply With Quote #9

    My pleasure, mate
    __________________
    http://y4kstudios.com
    Is that loud enough? Oh, while I have you, check out Viper.
    theY4Kman is offline
    Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
    supermj
    Senior Member
    Join Date: May 2004
    Location: Georgia
    Old 06-16-2007 , 00:10   Re: [PLUGIN] Maplister
    Reply With Quote #10

    Thanks!!! Had a request for this and just added it right on!!!
    __________________
    supermj 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 17:53.


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