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
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 01-25-2017 , 17:06   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #211

Quote:
Originally Posted by asherkin View Post
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.
what about warning 237?
__________________

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

I don't mind a warning if it resolves plugins having to be recompiled.

I've got some spare time so I'm actually test this atm...
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-25-2017 , 20:54   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #213

Quote:
Originally Posted by asherkin View Post
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.
It works. Function id 0 is invalid so I used function id 1.

Edit:

Everything is tested and working:

Code:
] sm_rcon sm plugins load dynamic
[SM] Loaded plugin dynamic.smx successfully.

] sm_dynamic_handles 
Dynamic is running a HandleUsage report...
-> Total Handles: 0 (0 persistant handles)

] sm_rcon sm plugins load dynamic-gc-test
[SM] Loaded plugin dynamic-gc-test.smx successfully.

] sm_dynamic_handles 
Dynamic is running a HandleUsage report...
-> Total Handles: 1 (0 persistant handles)
--> ``: 1 Handles (0 persistant handles)

] sm_rcon sm plugins unload dynamic-gc-test
[SM] Plugin dynamic-gc-test.smx will be unloaded on the next frame.

] sm_dynamic_handles 
Dynamic is running a HandleUsage report...
-> Total Handles: 1 (0 persistant handles)

] sm_dynamic_collectgarbage 
Dynamic is starting it's garbage collector...

] sm_dynamic_handles 
Dynamic is running a HandleUsage report...
-> Total Handles: 0 (0 persistant handles)
Before merging anything into the main branch I really want to exhaust not adding a public forward OnPluginUnloaded(Handle plugin) as it would a much cleaner fix.

Final changes for merge
__________________

Last edited by Neuro Toxin; 01-25-2017 at 21:27.
Neuro Toxin is offline
jdlovins
Junior Member
Join Date: Sep 2015
Old 02-06-2017 , 15:56   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #214

I just stumbled upon this and am curious about something that I dont quite understand. Using the class generator it generated a Get() method like

Code:
public get()
		{
			static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
			if (offset == INVALID_DYNAMIC_OFFSET)
			{
				offset = this.GetMemberOffset("Replay");
				if (offset == INVALID_DYNAMIC_OFFSET)
					SetFailState("A serious error occured in Dynamic!");
			}
			return this.GetHandleByOffset(offset);
		}
Isnt this redundant?
Code:
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
This makes more sense to me
Code:
static DynamicOffset offset = this.GetMemberOffset("Replay");
if (offset == INVALID_DYNAMIC_OFFSET)
	SetFailState("A serious error occured in Dynamic!");
return this.GetHandleByOffset(offset);
I'm sure theres a reason for the first if statement but I'm just curious why, thanks!
jdlovins is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-06-2017 , 15:58   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #215

Quote:
Originally Posted by jdlovins View Post
Isnt this redundant?
Code:
static DynamicOffset offset = INVALID_DYNAMIC_OFFSET;
if (offset == INVALID_DYNAMIC_OFFSET)
This makes more sense to me
Code:
static DynamicOffset offset = this.GetMemberOffset("Replay");
if (offset == INVALID_DYNAMIC_OFFSET)
    SetFailState("A serious error occured in Dynamic!");
return this.GetHandleByOffset(offset);
I'm sure theres a reason for the first if statement but I'm just curious why, thanks!
You can't initialize static vars in Sourcepawn with non-constants.
psychonic is offline
jdlovins
Junior Member
Join Date: Sep 2015
Old 02-06-2017 , 16:04   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #216

Quote:
Originally Posted by psychonic View Post
You can't initialize static vars in Sourcepawn with non-constants.
Ah that would do it. Thanks.
jdlovins is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-06-2017 , 17:31   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #217

You only want .GetMemberOffset to be called once and cached for the properties getter.
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-10-2017 , 15:55   Re: Dynamic Objects and Properties - v.0.0.24 - [2017.02.11]
Reply With Quote #218

Dynamic v0.0.24 has been released

- SetStringByOffset fix
__________________
Neuro Toxin is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 02-27-2017 , 00:27   Re: Dynamic Objects and Properties - v.0.0.24 - [2017.02.11]
Reply With Quote #219

Hey,

With the dynamic dump handles command, would it be possible for you to make it dump the info to file as well? I got a slow memory leak and being able to see exactly what the handles are would be very useful.

Also, how do I check if a Dynamic collection is valid? There is not a method for it so I am curious.

Lastly, does the method .WriteKeyValues work on collections or is it only for objects?

Thanks for your time, I am enjoying using Dynamic!

Last edited by SM9; 02-27-2017 at 00:28.
SM9 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-27-2017 , 03:04   Re: Dynamic Objects and Properties - v.0.0.24 - [2017.02.11]
Reply With Quote #220

Quote:
Originally Posted by xCoderx View Post
With the dynamic dump handles command, would it be possible for you to make it dump the info to file as well? I got a slow memory leak and being able to see exactly what the handles are would be very useful.
Do you require further details to be included or just a simple "filename" param?

Quote:
Originally Posted by xCoderx View Post
Also, how do I check if a Dynamic collection is valid? There is not a method for it so I am curious.
A Collection inherits an ArrayList. This means you're expected to manage the pointer like any other standard sourcepawn handle.

Eg. delete / == null

Quote:
Originally Posted by xCoderx View Post
Lastly, does the method .WriteKeyValues work on collections or is it only for objects?!
KeyValues operations are currently only supported on real Dynamic objects.
__________________
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 08:02.


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