Raised This Month: $32 Target: $400
 8% 

Map configs with prefix support 1.3


Post New Thread Reply   
 
Thread Tools Display Modes
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 10-26-2014 , 12:48   Re: Map configs with prefix support 1.2
Reply With Quote #111

HI tabakhase, thanks for your contribution.

I just released a new version 1.2 with your change.

Greetings, ~Berni
__________________
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
berni is offline
12345
Senior Member
Join Date: Dec 2004
Old 10-26-2014 , 13:39   Re: Map configs with prefix support
Reply With Quote #112

Quote:
Originally Posted by tabakhase View Post
Its working just fine for me on CS:GO (linux)...

And I added workshop support!
(or any other arbitrary folders in maps/)

@berni - I send you a PullRequest hope you are okay with the "v1.2", feel free to merge & update OP

-------

Find below: v1.2
Normalizes mapnames so that
  • workshop/1337/de_map
  • topmaps/de_map
  • de_map
ends up as de_map
Really appreciate for sharing.
12345 is offline
Tank Missile
Member
Join Date: Aug 2013
Old 10-26-2014 , 18:03   Re: Map configs with prefix support 1.2
Reply With Quote #113

It would be great if this had partial name/suffix support. I'd love to be able to use a config for _event maps.
Tank Missile is offline
MIKEE
Member
Join Date: Aug 2012
Location: CA san diego
Old 10-31-2014 , 11:33   Re: Map configs with prefix support 1.2
Reply With Quote #114

Most important is the SM for example when I add sm_cpsaver_enable 0 in the file, it doesn't disable the plugin.

I works or not?
MIKEE is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-31-2014 , 16:26   Re: Map configs with prefix support 1.2
Reply With Quote #115

The map normalization code works fine... if the game always uses / for the path separator.

Here's some code I'm using in a rewrite for the mapchooser plugin, which among other things takes user input via mapcycle files:

Code:
/**
 * Remove the path from the map name
 * This was intended to remove workshop paths.
 * Used internally by MapEqual and FindMapStringInArray.
 * 
 * @param map			Map name
 * @param destination	String to copy map name to
 * @param maxlen		Length of destination string
 * 
 * @return				True if path was removed, false if map and destination are the same
 */
stock bool:RemoveMapPath(const char[] map, char[] destination, int maxlen)
{
	if (strlen(map) < 1)
	{
		ThrowError("Bad map name: %s", map);
	}
	
	// UNIX paths
	int pos = FindCharInString(map, '/', true);
	if (pos == -1)
	{
		// Windows paths
		pos = FindCharInString(map, '\\', true);
		if (pos == -1)
		{
			// Copy the path out unchanged, but return false
			strcopy(destination, maxlen, map);
			return false;
		}
	}

	// strlen is the null terminator position, which is fine as strcopy wants +1 for the null terminator
	int len = strlen(map) - pos;

	// pos + 1 is because pos is the last / or \ location and we want to start one char further
	strcopy(destination, (len < maxlen ? len : maxlen), map[pos+1]);
	
	return true;
}
Note: This uses SM 1.7 syntax as it's actually from the 1.7 version of mapchooser.inc. Assuming it gets accepted into SM 1.7.

Edit: WTF is with the text for that ThrowError? Not sure what I was thinking there.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-31-2014 at 16:32.
Powerlord is offline
yuppicide
Member
Join Date: Dec 2013
Old 11-14-2014 , 23:38   Re: Map configs with prefix support 1.2
Reply With Quote #116

Question.. I've been putting off installing this, but I really need it for only two custom settings. Will my server still load server.cfg and gamemode_casual.cfg and then your cfg override only the settings I need?

I have a map limit of 25 minutes and round times of 5 minutes each. I need to set for only a few maps one long round of 25 minutes. It's a BHOP map you take no fall damage.. you just keep playing.

I don't see repeating ALL the settings in ALL the cfg's.. only the settings I need to be different, correct?
yuppicide is offline
csa.lt
Member
Join Date: Nov 2014
Old 12-01-2014 , 07:20   Re: Map configs with prefix support 1.2
Reply With Quote #117

This plugin crash server in gameplay after ~20min. without errors on csgo logs. Have using with plugin below, because in another way it is not changing default weapons on awp maps like india.

PHP Code:
#include <sdkhooks>
#include <sdktools>

public OnEntityCreated(entity, const String:classname[])
{
    if(
StrEqual(classname"game_player_equip"))
    {
        
AcceptEntityInput(entity"Kill");
    }


Last edited by csa.lt; 12-01-2014 at 07:27.
csa.lt is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 12-02-2014 , 16:11   Re: Map configs with prefix support 1.2
Reply With Quote #118

I doubt that this plugin is directly involved in your crash. It only loads configs during map load.
__________________
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
berni is offline
alencore
Senior Member
Join Date: Oct 2011
Old 12-02-2014 , 19:56   Re: Map configs with prefix support 1.2
Reply With Quote #119

Quote:
Originally Posted by yuppicide View Post
Question.. I've been putting off installing this, but I really need it for only two custom settings. Will my server still load server.cfg and gamemode_casual.cfg and then your cfg override only the settings I need?

I have a map limit of 25 minutes and round times of 5 minutes each. I need to set for only a few maps one long round of 25 minutes. It's a BHOP map you take no fall damage.. you just keep playing.

I don't see repeating ALL the settings in ALL the cfg's.. only the settings I need to be different, correct?
you just make map configs and put the settings you need on certain maps you want that on or off and just named the map config accordingly to make sure that's what the engine reads during loading time, it's that's simple hopefully for you hehe.
__________________
alencore is offline
csa.lt
Member
Join Date: Nov 2014
Old 12-05-2014 , 16:52   Re: Map configs with prefix support 1.2
Reply With Quote #120

Quote:
Originally Posted by berni View Post
I doubt that this plugin is directly involved in your crash. It only loads configs during map load.
Yes problem was in my plugin!
__________________
LOL CSGO SERVER cs.csa.lt
LOL CSGO SERVER cs.csa.lt
csa.lt 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 05:38.


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