Raised This Month: $32 Target: $400
 8% 

Solved Block MSG_ALL SVC_TEMPENTITY for a player


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-26-2021 , 08:27   Re: Block MSG_ALL SVC_TEMPENTITY for a player
Reply With Quote #11

I know problem solved but now there's a memory leak because i am creating dynamic arrays and destroying them on pfnMessageEnd but i am not sure where is the leak comming from.


If you've a better method without the need of dynamic arrays feel free to post.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-26-2021 at 08:47.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-26-2021 , 09:05   Re: Block MSG_ALL SVC_TEMPENTITY for a player
Reply With Quote #12

If you don't post your code I can not tell you where the leak is. Also, how do you know there is a leak?

You can get rid of dynamic arrays if you find the maximum number of arguments a TE_* message can have, then size the array accordingly and when saving arguments in the array make sure to track the current number of arguments. I'd rather just fix the leak tho, if there is indeed a leak.
__________________

Last edited by HamletEagle; 10-26-2021 at 09:07.
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-26-2021 , 09:12   Re: Block MSG_ALL SVC_TEMPENTITY for a player
Reply With Quote #13

Quote:
Originally Posted by HamletEagle View Post
If you don't post your code I can not tell you where the leak is. Also, how do you know there is a leak?
Because i was checking the machine memory usage and it was higher than usual every time someone plays and disconnect.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-27-2021 at 16:20.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Old 10-26-2021, 16:42
Natsheh
This message has been deleted by Natsheh. Reason: nvm solved
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-28-2021 , 05:35   Re: Block MSG_ALL SVC_TEMPENTITY for a player
Reply With Quote #14

Sorry, I didn't get to reply yesterday. Using float for the 3rd parameter is wrong.

It is declared as float* which in this case refers to a float array of 3 elements/vec3_t/Vector(the name of an array is a pointer to the start of that array which is why it can be defined as float*). So, to properly get the origin you have to use Vector* in the signature file and the header should look like this:

PHP Code:
public pfnMessageBegin(messageDestmessageTypeFloat:origin[3], id
__________________

Last edited by HamletEagle; 10-28-2021 at 05:36.
HamletEagle 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 00:24.


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