Raised This Month: $ Target: $400
 0% 

[ANY] Autoindexing Subplugins?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nergal
Veteran Member
Join Date: Apr 2012
Old 11-14-2014 , 07:14   [ANY] Autoindexing Subplugins?
Reply With Quote #1

I'm not sure how complicated this process would be but how would I be able to automatically index subplugins for a core plugin and give them a SerialID to easily track them?

As well as Strings for plugin information?
__________________
nergal is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 11-15-2014 , 04:24   Re: [ANY] Autoindexing Subplugins?
Reply With Quote #2

Use the library system?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
rswallen
SourceMod Donor
Join Date: Jun 2013
Location: 127.0.0.1
Old 11-15-2014 , 13:11   Re: [ANY] Autoindexing Subplugins?
Reply With Quote #3

@friagram, I believe the intent is to do it without the use of the library system

@nergal, Its complicated but doable

In the core plugin, you need a native that sub-plugins must call to register and receive an ID (and another to de-register in the event that the sub-plugin unloads). When the registration native is called, store the plugin handle of the sub-plugin with the new ID (suggest ADT array for this) and return the ID:
Spoiler

When the de-registration native is called, look for the plugin handle in the array, and remove it:
Spoiler

If at any time you want to check if sub-plugin is loaded (or if a sub-plugin was unloaded and did not de-register), create something like this:
Spoiler

WORD OF WARNING:
This system relies on all participating plugins being honest (ie returning the correct value in the forward). If a plugin contains a modified forward (such that it always returns true), bad things will happen :s
__________________
rswallen is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 11-15-2014 , 13:13   Re: [ANY] Autoindexing Subplugins?
Reply With Quote #4

Quote:
Originally Posted by friagram View Post
Use the library system?
ok that actually made me lol but I'm asking this as a serious question as I don't know how and I'm stumped on making it....
__________________
nergal is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 11-15-2014 , 13:16   Re: [ANY] Autoindexing Subplugins?
Reply With Quote #5

Quote:
Originally Posted by rswallen View Post
@friagram, I believe the intent is to do it without the use of the library system

@nergal, Its complicated but doable

In the core plugin, you need a native that sub-plugins must call to register and receive an ID (and another to de-register in the event that the sub-plugin unloads). When the registration native is called, store the plugin handle of the sub-plugin with the new ID (suggest ADT array for this) and return the ID:
Spoiler

When the de-registration native is called, look for the plugin handle in the array, and remove it:
Spoiler

If at any time you want to check if sub-plugin is loaded (or if a sub-plugin was unloaded and did not de-register), create something like this:
Spoiler

WORD OF WARNING:
This system relies on all participating plugins being honest (ie returning the correct value in the forward). If a plugin contains a modified forward (such that it always returns true), bad things will happen :s

Thx RSWallen!

I've heard from Bailopan that the natives and forwards system will be removed in the future when the API and Syntax goes into higher phase than now.
What are your thoughts on that? Just curious.
__________________
nergal is offline
rswallen
SourceMod Donor
Join Date: Jun 2013
Location: 127.0.0.1
Old 11-15-2014 , 13:21   Re: [ANY] Autoindexing Subplugins?
Reply With Quote #6

Quote:
Originally Posted by nergal View Post
Thx RSWallen!

I've heard from Bailopan that the natives and forwards system will be removed in the future when the API and Syntax goes into higher phase than now.
What are your thoughts on that? Just curious.
I'm happy with natives/forwards as they are. I can only hope that if/when they are retired, the system that replaces them is just as good.
__________________
rswallen is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 11-15-2014 , 14:37   Re: [ANY] Autoindexing Subplugins?
Reply With Quote #7

Quote:
Originally Posted by rswallen View Post
I'm happy with natives/forwards as they are. I can only hope that if/when they are retired, the system that replaces them is just as good.
If I remember correctly, Bail said the natives and forwards stuff was added because of Pawns faulty memory and how inter-plugin communication was corrupting plugin memory? Something like that.
__________________
nergal 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 11:53.


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