Raised This Month: $7 Target: $400
 1% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Muhlex
Junior Member
Join Date: Mar 2019
Old 05-12-2019 , 10:01   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #281

I am currently trying to implement Dynamic into a series of plugins, simply for allowing easy access to data tied to clients for each plugin. Thus I am trying to use the static player settings object. This seems to work so far, however the data is not cleared when a client disconnects.

The wiki mentions that "Player Settings members are reset during Sourcemod's OnClientDisconnect_Post forward". Contrary to that, set values persist for the clients, even after rejoining the server.

Looking at the plugin code of dynamic.sp, this seems to be due to the OnClientDisconnect_Post forward not using public, but being declared as stock instead.

PHP Code:
stock void OnClientDisconnect_Post(int client)
{
    
_Dynamic_ResetObject(client);

I am still an amateur at Sourcepawn so I might have completely missed something obvious here.
Muhlex is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-12-2019 , 18:48   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #282

Quote:
Originally Posted by ThatOneGuy View Post
They PM'd me. I believe it may be an error on my end.

In Event_PlayerDeath (and round end for those still alive), I was combining stats from multiple dynamic objects held in an ArrayList, I was removing/disposing one each time they were combined. In doing so, I didnt have the .IsValid check and thought I was fine without it by tracking how many cells the array had, using the .Erase function (shifting it), and going in reverse order. Somewhere, my logic has a scenario the leads to an invalid object. My fix for now is the .IsValid check. Am waiting to hear back from the poster regarding whether or not the issue is resolved, but I dont believe the error involves dynamic.

To make it more confusing for me, I had a memory leak (now patched) in that I forgot to dispose the objects being removed from the arraylist when they were combined. I was only disposing dynamic objects on next round start. That said, it is strange that an object was already disposed if there was no disposing until after all the processing was done...Is there not multiple seconds between round end/start events (during which all processing should be complete, so all objects should have still been valid)? I suppose I should test that assumption. That said, assuming there is time between those events, I dont understand how any dynamic object being processed could be already disposed. I can send you my code if needed. The .inc file was auto-generated from your tool.

EDIT: .IsValid causes other errors. Plugin is now recoded without Dynamic and all errors are gone.
.Dispose has a parameter disposemembers which defaults to true. This disposes Dynamic member types and deletes Handle member types.

It sounds like they had been referencing the disposed object elsewhere which was being disposed by its parent.
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-12-2019 , 18:50   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #283

Quote:
Originally Posted by Muhlex View Post
I am currently trying to implement Dynamic into a series of plugins, simply for allowing easy access to data tied to clients for each plugin. Thus I am trying to use the static player settings object. This seems to work so far, however the data is not cleared when a client disconnects.

The wiki mentions that "Player Settings members are reset during Sourcemod's OnClientDisconnect_Post forward". Contrary to that, set values persist for the clients, even after rejoining the server.

Looking at the plugin code of dynamic.sp, this seems to be due to the OnClientDisconnect_Post forward not using public, but being declared as stock instead.

PHP Code:
stock void OnClientDisconnect_Post(int client)
{
    
_Dynamic_ResetObject(client);

I am still an amateur at Sourcepawn so I might have completely missed something obvious here.
That would be the error. Thanks for letting me know. Try making the void public and recompiling.

I need to push some updates so I will try patch it up in the next few days.
__________________
Neuro Toxin is offline
Muhlex
Junior Member
Join Date: Mar 2019
Old 05-12-2019 , 19:04   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #284

I tried to do that but faced some errors on compile which are probably due to me having left out a file when installing. I didn't bother afterwards and can't get around to trying it again at the moment. However I did try to just include Dynamic_ResetObject(client) on Disconnect_Post in my own plugin earlier, which did fix the issue.

Last edited by Muhlex; 05-12-2019 at 19:07.
Muhlex is offline
freak.exe_uLow
AlliedModders Donor
Join Date: Jul 2012
Location: Germany
Old 09-02-2019 , 17:31   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #285

Hey, i hope the plugin still has support I use the plugin for an advertising plugin and wanted to have a look at the handles, can it be that these leaks has?

Code:
Plugin               Handles             Memory
dynamic.smx	     240	         76336 bytes

Last edited by freak.exe_uLow; 09-02-2019 at 17:32.
freak.exe_uLow is offline
milutinke
AlliedModders Donor
Join Date: Jun 2012
Location: Serbia
Old 04-10-2020 , 08:03   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #286

PHP Code:
L 04/10/2020 13:54:33: [SMException reportedScript execution timed out
L 04
/10/2020 13:54:33: [SMBlamingdynamic.smx
L 04
/10/2020 13:54:33: [SMCall stack trace:
L 04/10/2020 13:54:33: [SM]   [1Line 117, ..\dynamic.sp::OnPluginEnd
L 04
/10/2020 13:54:33Error log file session closed
Does it have something with the unclosed Dynamic?
I close my Dynamic at OnPluginEnd(), and create it at OnAllPluginsLoaded().
Should I just increase the timeout time, but this maybe will freeze the server on the map change?

Edit: I have solved the error by closing the dynamic immediately after I am done with it.
But sometimes Dynamics freezes the server OnPluginEnd without any operations performed. (I tried running just the default plugins and Dynamic)

Last edited by milutinke; 04-10-2020 at 08:53.
milutinke is offline
Send a message via Skype™ to milutinke
Reply


Thread Tools
Display Modes

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 06:46.


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