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

Forward for plugin end?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-20-2017 , 02:22   Forward for plugin end?
Reply With Quote #1

From one plugin...

Can I get a forward if another plugin is ending?
__________________
Neuro Toxin is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 01-20-2017 , 02:29   Re: Forward for plugin end?
Reply With Quote #2

Without building in a forward in one that the other can listen to?

There's the Extra Plugin API extension, which can do that with OnPluginUnload2(Handle plugin).
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 01-20-2017 , 04:25   Re: Forward for plugin end?
Reply With Quote #3

OnLibraryRemoved?
__________________
8guawong is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-20-2017 , 07:26   Re: Forward for plugin end?
Reply With Quote #4

I already use OnLibraryRemoved. If a plugin doesn't register a library I cant pickup it's ended.

OnPluginUnload2 is exactly what I need. But I don't want to force people to use an extension.

This is for Dynamic. Plugins forwarding to it is not an option.
__________________

Last edited by Neuro Toxin; 01-20-2017 at 07:27.
Neuro Toxin is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-20-2017 , 17:19   Re: Forward for plugin end?
Reply With Quote #5

There is no way to do this as no forward is fired when a plugin unloads to tell other plugins. This is why libraries exist.

Even if a forward did exist, it would not help you, as the plugin handle, name, or filename would still have to be listened for in your plugin... Filenames do change, and different plugins can have the same name.

Use libraries.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-20-2017 , 17:51   Re: Forward for plugin end?
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
OnPluginUnload2 is exactly what I need. But I don't want to force people to use an extension.
Unfortunately, first-party SM doesn't expose IPluginsListener(2) to SM plugins, my extension exposes 2 of the callbacks from that interface.
__________________
WildCard65 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-20-2017 , 19:20   Re: Forward for plugin end?
Reply With Quote #7

A forward could fire before the handle is deleted that would be fine.

All good but. I'll just recommend any plugins that unload mid map either.

1. Dispose their own dynamic objects
2. Register a library name
__________________
Neuro Toxin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-20-2017 , 19:42   Re: Forward for plugin end?
Reply With Quote #8

Quote:
Originally Posted by Neuro Toxin View Post
A forward could fire before the handle is deleted that would be fine.
That would require a change to SM's handle-system to add a forward then trigger it before void IHandleTypeDispatch::OnHandleDestroy(HandleTy pe_t, void *);
__________________
WildCard65 is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 01-21-2017 , 01:00   Re: Forward for plugin end?
Reply With Quote #9

A forward for this would be great because I have a plugin that needs exactly this. I don't want to have to do RegPluginLibrary on all the OTHER plugins.
blaacky is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-21-2017 , 03:28   Re: Forward for plugin end?
Reply With Quote #10

Quote:
Originally Posted by WildCard65 View Post
That would require a change to SM's handle-system to add a forward then trigger it before void IHandleTypeDispatch::OnHandleDestroy(HandleTy pe_t, void *);
If you could add a forward and do the triggering before the handle is destroyed id be happy to send some paypal cash.
__________________
Neuro Toxin 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 20:52.


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