Raised This Month: $ Target: $400
 0% 

ForwardEx - A more extensive forward management system


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-27-2012 , 10:21   Re: ForwardEx - A more extensive forward management system
Reply With Quote #1

Quote:
Originally Posted by minimoney1 View Post
Hello everyone.
For Simple Chat Processor (Redux), I needed a way to call each forward one by one (as the current forward manager's methods call either the first or the highest depending on your settings set in CreateForward).
Are you talking about return values here?

The forward manager is supposed to call all private forwards registered. The value it returns depends on the execution type.

ET_Ignore doesn't return anything.
ET_Single returns the value from the last forward.
ET_Event runs all forwards until it hits a forward that returns something other than Plugin_Continue (or runs all of them). It then returns that value.
ET_Hook runs all forwards until it hits a forward that returns Plugin_Stop (or runs all of them). It then returns the highest value that was returned.

By highest value, I mean out of these values:
Code:
    Plugin_Continue = 0,    /**< Continue with the original action */
    Plugin_Changed = 1,        /**< Inputs or outputs have been overridden with new values */
    Plugin_Handled = 3,        /**< Handle the action at the end (don't call it) */
    Plugin_Stop = 4,        /**< Immediately stop the hook chain and handle the original */
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 11-27-2012 at 10:24.
Powerlord is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 11-27-2012 , 20:03   Re: ForwardEx - A more extensive forward management system
Reply With Quote #2

Quote:
Originally Posted by Powerlord View Post
Are you talking about return values here?

The forward manager is supposed to call all private forwards registered. The value it returns depends on the execution type.

ET_Ignore doesn't return anything.
ET_Single returns the value from the last forward.
ET_Event runs all forwards until it hits a forward that returns something other than Plugin_Continue (or runs all of them). It then returns that value.
ET_Hook runs all forwards until it hits a forward that returns Plugin_Stop (or runs all of them). It then returns the highest value that was returned.

By highest value, I mean out of these values:
Code:
    Plugin_Continue = 0,    /**< Continue with the original action */
    Plugin_Changed = 1,        /**< Inputs or outputs have been overridden with new values */
    Plugin_Handled = 3,        /**< Handle the action at the end (don't call it) */
    Plugin_Stop = 4,        /**< Immediately stop the hook chain and handle the original */
Yes, I needed to get the return value of every single forward to change things based on its return value, hence why I made this library.
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 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 18:37.


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