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

Disabled plugin question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
C00LSH33P
Member
Join Date: Apr 2013
Location: Meow City
Old 10-16-2016 , 14:07   Disabled plugin question
Reply With Quote #1

Hi. Quick example, in "maps" folder I have a disabled a plugin in "plugins_de.ini" by putting "disabled" at the end but then I want to re-enable the same plugin in "plugins-de_dust2.ini" and here is where I'm stucked. How do I re-load the plugin from there? Or is there a way to do this at all? Example like:

From:
Code:
plugin.amxx disabled
To:
Code:
plugin.amxx load
or
plugin.amxx run
Something like this. . . can be done?

Again. I want to disable a certain plugin in de_ prefix maps but ignores for de_dust2 map. Guide me.

Last edited by C00LSH33P; 10-17-2016 at 04:18. Reason: Fixed from .cfg to .ini typos
C00LSH33P is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-16-2016 , 15:57   Re: Disabled plugin question
Reply With Quote #2

Plugins are enabled/disabled in INI files. So, in "plugins-de.ini" will contain plugins to enable or disable for all "de" prefixed maps and "plugins-de_dust2.ini" will contain plugins to enable or disable for de_dust2.

So, normally, "plugins-de.ini" should contain "myplugin.amxx disabled" and "plugins-de_dust2.cfg" should contain "myplugin.amxx".

However, according to the documentation, map-specific configurations are loaded first and prefix-specific configurations are loaded second. If this is true, what you want will not easily be possible. You would have to add a map-specific file for all but de_dust2 to disable the plugin so that the plugin is active on de_dust2.

See the official documentation for this feature here.
__________________

Last edited by fysiks; 10-16-2016 at 15:58.
fysiks is offline
C00LSH33P
Member
Join Date: Apr 2013
Location: Meow City
Old 10-17-2016 , 04:51   Re: Disabled plugin question
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Plugins are enabled/disabled in INI files. So, in "plugins-de.ini" will contain plugins to enable or disable for all "de" prefixed maps and "plugins-de_dust2.ini" will contain plugins to enable or disable for de_dust2.
Whoops. That just a typos ignore that. I meant write in .ini format not .cfg one.
Quote:
Originally Posted by fysiks View Post
However, according to the documentation, map-specific configurations are loaded first and prefix-specific configurations are loaded second. If this is true, what you want will not easily be possible. You would have to add a map-specific file for all but de_dust2 to disable the plugin so that the plugin is active on de_dust2.
Yes, that is how I'm doing it now. But the "problem" is that you know I need to make like 20+ .ini files for all available de_ prefixed maps in my server. Would be way easier if there is a tag like "force-load" to put at the end of the plugin in "plugins-de_dust2.ini" to ignore and force load the same plugin tagged "disabled" in "plugins-de.ini" since the prefix-specific one is read last. But, I don't see such command exists anyway nor if it's possible. Damn, if only the map-specific one read last instead... and it make more sense for it to read last anyway. Thanks for the doc.
C00LSH33P is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 10-17-2016 , 07:35   Re: Disabled plugin question
Reply With Quote #4

Quote:
Originally Posted by C00LSH33P View Post
But the "problem" is that you know I need to make like 20+ .ini files for all available de_ prefixed maps in my server. Would be way easier if there is a tag like "force-load" to put at the end of the plugin in "plugins-de_dust2.ini" to ignore and force load the same plugin tagged "disabled" in "plugins-de.ini" since the prefix-specific one is read last. But, I don't see such command exists anyway nor if it's possible.
You may write an AMXX plugin to do it for you. Should be simple.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-17-2016 , 09:28   Re: Disabled plugin question
Reply With Quote #5

Quote:
Originally Posted by C00LSH33P View Post
Damn, if only the map-specific one read last instead... and it make more sense for it to read last anyway.
I agree that doing the most specific one last would make more sense. I would suggest just trying it to see if maybe the documentation has it backwards.
__________________
fysiks is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-17-2016 , 10:05   Re: Disabled plugin question
Reply With Quote #6

Well, both way (map-prefix > map and map > map-prefix) make sense.
Checking prefix first, then specific map or checking the specific map first, then fallback to prefix.

I guess it would be reasonable to have an option to choose the logic, or maybe a tag don't know.
__________________
Arkshine is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-17-2016 , 21:18   Re: Disabled plugin question
Reply With Quote #7

I can't think of any case where I would want a configuration for a large subset to take priority over a configuration for a very specific specific subset. However, it would probably be best to have it configurable (and is essentially a requirement now since you have to maintain backwards compatibility).

To summarize my stance: "The most specific gets the most priority"
__________________

Last edited by fysiks; 10-17-2016 at 22:16.
fysiks is offline
C00LSH33P
Member
Join Date: Apr 2013
Location: Meow City
Old 10-18-2016 , 03:14   Re: Disabled plugin question
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
I would suggest just trying it to see if maybe the documentation has it backwards.
Nope. Didn't work like I expected and I also did try this before this thread. The doc is right.
Quote:
Originally Posted by Arkshine View Post
Well, both way (map-prefix > map and map > map-prefix) make sense.
Checking prefix first, then specific map or checking the specific map first, then fallback to prefix.
Hmm... Arkshine, can you give an example why would ever prioritize the prefix over the single map? I don't see any useful..?
Quote:
Originally Posted by fysiks View Post
To summarize my stance: "The most specific gets the most priority"
Yes. This is how it should be... just like how Map Config Files does where the config for specific map is configures last. Why Map Specific Plugins is the other way around?

For now, I'll follow addons_zz suggestion. Thanks.
C00LSH33P is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-18-2016 , 05:16   Re: Disabled plugin question
Reply With Quote #9

Looking at the old commits, it was probably intended to have global > specific from the start.

- Per-map config files have been added in v1.76 there (prefix added later): https://github.com/alliedmodders/amx...dece63cd95aac9

- Later an attempt to support prefix in v1.77 there: https://github.com/alliedmodders/amx...951a5a9c69042e. You notice map prefix is loaded before the map name. I'm saying an attempt because it's incomplete. Here, it was just parsing the plugins for auto-loading the modules.

- This above issue has been fixed much later there https://github.com/alliedmodders/amx...d84c4415680997. The change at the bottom shows the missing loading part, but unfortunately for some reasons has been appended instead of being inserted right before. Likely a mistake. Quite weird no one complained.

About the documentation, it would seem a user updated the wiki to reflect the change: https://wiki.alliedmods.net/index.ph...261&oldid=5260.

Anyway, for backward compatibility, it can't be changed, but a configuration should be welcomed. Maybe the best place is in core.ini, since loaded one time at server start and before everything.
__________________
Arkshine 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 21:12.


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