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

Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]


Post New Thread Reply   
 
Thread Tools Display Modes
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-23-2017 , 18:10   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #201

I just created a new branch and implemented a patch based on KyleS's advice along with asherkin's confirmation.

The branch is not yet tested and might have a bug or two.

The changes are here.
__________________
Neuro Toxin is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 01-23-2017 , 20:28   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #202

Quote:
Originally Posted by Neuro Toxin View Post
I just created a new branch and implemented a patch based on KyleS's advice along with asherkin's confirmation.

The branch is not yet tested and might have a bug or two.

The changes are here.
If you really want to go that route, the __Public_Func() has to be in your include, and will force a recompilation.
KyleS is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-24-2017 , 17:35   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #203

I dont exactly follow what you saying.
__________________
Neuro Toxin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-24-2017 , 18:54   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #204

Quote:
Originally Posted by Neuro Toxin View Post
I dont exactly follow what you saying.
Add to forward requires a public function from the plugin's who handle you supplied, what your doing will result in undefined behavior or a native error.
__________________
WildCard65 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-24-2017 , 21:00   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #205

Ok. Understood.

So just move the function I use to dynamic include.

I dont need to typedef do I?
__________________
Neuro Toxin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-24-2017 , 21:11   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #206

Quote:
Originally Posted by Neuro Toxin View Post
Ok. Understood.

So just move the function I use to dynamic include.

I dont need to typedef do I?
No, you don't need a typedef, you just need a public function definition (try using a name that you believe NO ONE will use).

How public functions work:
Any function with the "public" key (pre-1. get an entry into a section called ".publics" in the ".smx", this entry exposes 2 things):
1) The offset into the plugin's runtime memory where SP can find it's name.
2) The offset into the plugin's runtime memory where the function execution begins.

spcomp handles the "Function" tag by taking the function given and returning it's index in the publics section (an array index).

SourcePawn retrieves the function through the index of it's entry in the publics section.
__________________

Last edited by WildCard65; 01-24-2017 at 21:12.
WildCard65 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-24-2017 , 23:40   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #207

That's good knowledge. Thanking you.

So the main include now has:

Code:
public void _Dynamic_Plugins_PrivateFowardCallback()
{
	return;
}
And I use this to register the forward.

Code:
	// Create forward and add plugin handle
	Handle pluginforward = CreateForward(ET_Ignore);
	AddToForward(pluginforward, plugin, _Dynamic_Plugins_PrivateFowardCallback);
A compile version is in the branch - changes
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-25-2017 , 03:21   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #208

Quote:
Originally Posted by KyleS View Post
If you really want to go that route, the __Public_Func() has to be in your include, and will force a recompilation.
Probably wont merge this fix due to plugins using Dynamic needing a recompile.
__________________
Neuro Toxin is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-25-2017 , 07:07   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #209

Quote:
Originally Posted by Neuro Toxin View Post
That's good knowledge. Thanking you.

So the main include now has:

Code:
public void _Dynamic_Plugins_PrivateFowardCallback()
{
	return;
}
And I use this to register the forward.

Code:
	// Create forward and add plugin handle
	Handle pluginforward = CreateForward(ET_Ignore);
	AddToForward(pluginforward, plugin, _Dynamic_Plugins_PrivateFowardCallback);
A compile version is in the branch - changes
You need to pass the return value of "FindFunctionByName" as you need the function id (array index of entry into ".publics") of the function from the plugin your working with.
__________________
WildCard65 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-25-2017 , 08:26   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #210

Theoretically you could just always pass 0 as the function id to add whatever the plugin's first public is, avoiding the need to recompile plugins - the forward will never be called anyway.
__________________
asherkin 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 15:15.


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