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

[CS:GO] Workshop Map Loader (v0.13.0, 2014-06-27)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Nefarius
Member
Join Date: Sep 2010
Plugin ID:
4027
Plugin Version:
0.13.0
Plugin Category:
Admin Commands
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
Advanced Workshop Map Loader and Game Type Adjuster
Old 01-06-2014 , 06:37   [CS:GO] Workshop Map Loader (v0.13.0, 2014-06-27)
Reply With Quote #1

Workshop Map Loader
Advanced Workshop Map Loader and Game Type Adjuster

Description
This plugin searches for workshop maps in your servers map directory and assists the admin in handling those. It will also ensure that the current game mode will get automatically adjusted, if requested by the admin.

The plugin was developed for CS:GO and will not work in other games.

Features

Admin menu
The Top-Level menu is dynamically built depending on your servers' workshop maps and their community tags:



Each category hosts the corresponding map:



Note, that a map may appear in multiple categories depending of it's tags.

Vote menu
It's possible to interact with the stock MapChooser plugin or the MapChooser Extended plugin.



Commands
  • sm_wml brings up the map list (for Admins with at least changemap-Permissions)
  • sm_wml_reload refreshes the map list (useful to be triggered by the admin after the server has downloaded new workshop maps)
  • sm_wml_vote_now requests an instant next map vote
  • sm_wml_nominate_random_maps will nominate a given amount of random maps from the database for the next vote. It's behavior is controlled by the sm_wml_nominate_* Cvars.

Snippet for your adminmenu_custom.txt:
Code:
	"ServerCommands"
	{
		"Load Workshop Map"
		{
			"cmd"		"sm_wml"
			"admin"		"sm_changemap"
		}
		"Refresh Workshop Map List"
		{
			"cmd"		"sm_wml_reload"
			"admin"		"sm_changemap"
		}
		"Start Next Workshop Map Vote"
		{
			"cmd"		"sm_wml_vote_now"
			"admin"		"sm_changemap"
		}
	}
Cvars
This plugin generates it's config file in csgo/cfg/sourcemod/wml.cfg after first load.
  • sm_wml_version returns current plugin version
  • sm_wml_changemode will change the game mode corresponding to the selected category <1 = Enabled/Default, 0 = Disabled>
  • sm_wml_autoreload defines if the database content should be refreshed on plugin reload. It's recommended to turn it off after the first successful load for performance reasons <1 = Enabled/Default, 0 = Disabled>
  • sm_wml_armsrace_weapon defines the weapon in Armsrace mode where voting shall pop up if the first player acquired it <awp = Default>
  • sm_wml_nominate_all_maps defines if all maps shall be allowed to get into vote nomination rather than only maps matching the current game mode (e.g. in Casual there won't be Armsrace maps nominated) <1 = Enabled, 0 = Disabled/Default>
  • sm_wml_override_mapcycle creates and sets a custom mapcycle file on each mapchange with workshop maps matching the current game mode. This will allow excellent automated interaction with stock map management plugins <1 = Enabled/Default, 0 = Disabled>

Translations
  • English
  • German
  • Russian
  • Romanian

Plans/TODOs
Suggestions welcome!
  • More translations
  • Add map blacklist to exclude "broken" map IDs

Changelog
Spoiler


Upgrading
If you are upgrading from a version pre-0.3.x please process the following steps:
  • Remove directory sourcemod/data/sm_wml
  • Empty directory sourcemod/data/wml
  • Remove file cfg/sourcemod/sm_wml.cfg
If you have at least version 0.5.0 installed you can auto-update this plugin with the Updater plugin.

Optional Dependencies
  • If you haven't already, take a peek at the Updater so the plugin will be updated automatically. (recommended)
  • I recommend using it with MapChooser Extended if you like to utilize advanced voting.
  • You also might have a look at my Server Hibernate Fix plugin to avoid locking up your server on hibernation.

Installation/Requirements
  1. You should have at least SourceMod v1.5.3
  2. Your server must be running at least one of the following extensions:
  3. Write-Permissions to sourcemod/data directory.
  4. Write-Permissions to sourcemod/data/sqlite directory.
  5. Download latest archive from Github using the download link below.
  6. Extract the contents of WorkshopMapLoader-master into your servers csgo/addons/sourcemod directory.
  7. Restart your server or load the plugin by hand.
  8. Adjust the configuration file to your needs or just go with the defaults.
  9. Leave feedback!
Download latest ZIP archive with all necessary files
...or head over to the project site for more information

Important: this plugin can't be compiled on the Forum, please use the provided download link to get the ready-to-use plugin or source code to compile by yourself.

Demonstration

A small unspectacular demo video showing WML doing it's job:

Last edited by Nefarius; 01-18-2015 at 15:34. Reason: Updated version
Nefarius is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-06-2014 , 10:36   Re: [CS:GO] Workshop Map Loader (v0.0.1)
Reply With Quote #2

Outstanding... was such a PITA to manually update the map files when we changed up our collection. This is going on my CS:GO servers STAT. Thank you!

...:: TnT Edit ::...

If only Valve offered some sort of xml page that had info on the collection (map names, update date, file size, mapId, etc). Then we could grab the list from that site with a different command so the list is populated with only maps from the collectionId
__________________
View my Plugins | Donate

Last edited by TnTSCS; 01-06-2014 at 10:49.
TnTSCS is offline
Nefarius
Member
Join Date: Sep 2010
Old 01-06-2014 , 11:03   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #3

Thank you kindly, I already shipped the first update It fixes the "Unknown command: sm_wml_reload" client error message. I also added an example snippet for the admin menu in my first post.

Well, Valve indeed offers a lot through their Web API, I'll have a look...
Nefarius is offline
Prechan
Member
Join Date: Jan 2012
Old 01-06-2014 , 11:15   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #4

Smart idea !
A first menu with map type (like ar_, de_, ze_ ...) could be a good idea to spend less time in navigation don't you think ?
Prechan is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-06-2014 , 11:16   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #5

Cool, hopefully one exists. The updated .sp still has version 0.0.1

Quote:
Originally Posted by Prechan View Post
... A first menu with map type (like ar_, de_, ze_ ...) could be a good idea ...
+1

...:: TnT Edit ::...
Actually, you could just look at the information from the collectionIds site (http://steamcommunity.com/sharedfile...ollection#Here), it has all information in there. Tells you how many maps are in the collection
Code:
<div class="workshopItemDescriptionTitle">
	Items			<span class="childCount">(12)</span>
</div>
And it gives information for each one, although the file name I couldn't find, but you could get that since you have the mapId,
__________________
View my Plugins | Donate

Last edited by TnTSCS; 01-06-2014 at 11:31.
TnTSCS is offline
Nefarius
Member
Join Date: Sep 2010
Old 01-06-2014 , 11:30   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #6

Corrected the version number, thanks.

As for the suggestion: oh no, nested menus! Well, grouping the maps needs an unique identifier within the map name like the de_, cs_ and so on prefixes. This would imply that the workshop maintainer uses "standardized" names; everything else would reside in a sub menu like "Other". Any suggestions for the top menu item names? Like:
  • Arms Race Maps
  • Demolition Maps
  • Casual Maps
  • etc.
Is there a finite amount of "map types"? If so, would you please submit them?

EDIT: OK I'll read into the steam API.

Last edited by Nefarius; 01-06-2014 at 12:31.
Nefarius is offline
Lordearon
Member
Join Date: Jan 2013
Location: Vietnam
Old 01-06-2014 , 12:58   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #7

Awesome job!
__________________
iGame.vn
Lordearon is offline
Nefarius
Member
Join Date: Sep 2010
Old 01-06-2014 , 17:17   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #8

Good god, finding this undocumented API took me ages but here we have it

Workshop Items through Steam Web API
Actually on host_workshop_map the server builds the following query:
Code:
https://api.steampowered.com/Service/PublishedFile/GetDetails/v1/?format=vdf&publishedfileids[0]=206674556&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&minimal_details=1
Spoiler

where publishedfileids[0] is equal to the id Attribute in the Steam Community request:
Code:
http://steamcommunity.com/sharedfiles/filedetails/?id=206674556
With a valid Web API Auth Key we can submit a request and get the following:



So far so good, I'll let this information flow into the further improvement of the plugin. Sadly I haven't yet found out where the supported Game Mode is stored, as it would make a nice criterion for categorizing the maps.

EDIT: Sleep suxx so I'm still on it and finally got rewarded for my patience it seems Here comes the real deal:



Yay! Now, good night
Attached Thumbnails
Click image for larger version

Name:	06-01-2014 22-29-07.jpg
Views:	34811
Size:	86.1 KB
ID:	129245   Click image for larger version

Name:	06-01-2014 22-26-20.jpg
Views:	34333
Size:	76.2 KB
ID:	129246   Click image for larger version

Name:	07-01-2014 00-06-40.jpg
Views:	34434
Size:	78.7 KB
ID:	129251  

Last edited by Nefarius; 01-06-2014 at 18:25.
Nefarius is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-07-2014 , 15:29   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #9

Quote:
Originally Posted by Nefarius View Post
So far so good, I'll let this information flow into the further improvement of the plugin. Sadly I haven't yet found out where the supported Game Mode is stored, as it would make a nice criterion for categorizing the maps.
The game mode is likely stored inside the file itself, although it's possbile that CS:GO works exclusively on the map's filename. I know you can generally find out map types by checking netprops on the game's gamerules entity when the map is actually running (or at least you can on TF2). Of course, with csgo, you already set the gamemode and gametype commands (cvars?) on startup...

(Of course, TF2 has its own special little hell by only supporting 5 distinct game modes (4 plus General/Single Player) which are then subdivided into game types from there... but for CP maps, you can't just find out which of the 3 types (A/D CP, 5CP, TC) is running from the gamerules and specific entities alone. To this day, I don't know how the game internally determines this.)
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Nefarius
Member
Join Date: Sep 2010
Old 01-08-2014 , 04:09   Re: [CS:GO] Workshop Map Loader (v0.0.2)
Reply With Quote #10

Quote:
Originally Posted by Powerlord View Post
The game mode is likely stored inside the file itself, although it's possbile that CS:GO works exclusively on the map's filename. I know you can generally find out map types by checking netprops on the game's gamerules entity when the map is actually running (or at least you can on TF2). Of course, with csgo, you already set the gamemode and gametype commands (cvars?) on startup...
This is exactly what I didn't want to rely on. I'm fetching the info from the Web API now. My first Idea was indeed analyzing Game Type, has Map Buy Zone and so on but these methods suck cause you have to load the map, run your analysis code, change the game mode/type if mismatch and reload the map again. Not mentioning that overhead just for building a map menu

EDIT: the game is actually dumber than you think; it (without SourceMod) relies entirely on the game_type and game_mode variables, who may be set correctly on map change but not restricted by the map itself. If you load an Arms Race Map in Casual Mode it works but without the Buy Zone you can only do knife fights unless you heavily mod your server with a Buy Zone Simulator and so on. At this time I myself have ~30 plugins running to make CS:GO playable for my tastes

Quote:
Originally Posted by Powerlord View Post
(Of course, TF2 has its own special little hell by only supporting 5 distinct game modes (4 plus General/Single Player) which are then subdivided into game types from there... but for CP maps, you can't just find out which of the 3 types (A/D CP, 5CP, TC) is running from the gamerules and specific entities alone. To this day, I don't know how the game internally determines this.)
Good question, never thought of that in all my years of playing TF2. Fortunately my code at this stage can retrieve info about TF2 Items as well:


Last edited by Nefarius; 01-08-2014 at 04:18.
Nefarius 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 09:25.


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