Raised This Month: $ Target: $400
 0% 

[CS:GO] Handles spam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
You9
Member
Join Date: Mar 2016
Old 01-04-2017 , 14:40   [CS:GO] Handles spam
Reply With Quote #1

My zombie server after refresh restart use 300mb RAM, but 2-3 hours later it uses 700mb RAM. So i used sm_dump_handles, but there is only "410494 bytes" used, that should not be too much?

But still, i have much-much IBaseMenu lines there, are there anyway i can close those?
Every menu has MenuAction: delete menu; btw

Spoiler
You9 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-04-2017 , 14:45   Re: [CS:GO] Handles spam
Reply With Quote #2

Tell the creator of the plugin to close the damn handles when the client closes the menu.
didn't see that the menu handles are being closed on End.

Last edited by Mitchell; 01-04-2017 at 17:25.
Mitchell is offline
You9
Member
Join Date: Mar 2016
Old 01-04-2017 , 15:01   Re: [CS:GO] Handles spam
Reply With Quote #3

Quote:
Originally Posted by Mitchell View Post
Tell the creator of the plugin to close the damn handles when the client closes the menu.
delete menu; = CloseHandle(menu);?
You9 is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 01-04-2017 , 15:03   Re: [CS:GO] Handles spam
Reply With Quote #4

Quote:
Originally Posted by You9 View Post
delete menu; = CloseHandle(menu);?
Yes, show us the code...you might of used it improperly.
__________________
Chaosxk is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-04-2017 , 15:09   Re: [CS:GO] Handles spam
Reply With Quote #5

deleteing the menu option on every MenuAction is a bad idea, and could crash the server (iirc) or cause plugin errors.
Mitchell is offline
You9
Member
Join Date: Mar 2016
Old 01-04-2017 , 15:47   Re: [CS:GO] Handles spam
Reply With Quote #6

Quote:
Originally Posted by Chaosxk View Post
Yes, show us the code...you might of used it improperly.
It's custom plugin and has lot's of lines
But here's 1 menu handler example:
Spoiler


Quote:
Originally Posted by Mitchell
deleteing the menu option on every MenuAction is a bad idea, and could crash the server (iirc) or cause plugin errors.
Even alliedmods wiki is using "delete menu;", and i thought it's the best way

Last edited by You9; 01-04-2017 at 15:47.
You9 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-04-2017 , 16:23   Re: [CS:GO] Handles spam
Reply With Quote #7

What about the creation of the menu handle. are you setting it so cancel ends the menu? I'm not sure what the setup of the menus even are and how many menus you are creating. You could be creating a very large menu for each of the clients, instead of creating one menu and handling it through the draw actions.
Mitchell is offline
You9
Member
Join Date: Mar 2016
Old 01-04-2017 , 17:06   Re: [CS:GO] Handles spam
Reply With Quote #8

That is 1 example of all menus, and i have lot's of menus, but they all have same structure.

PHP Code:
Menu rmenu = new Menu(MenuHandler_PrimaryRifle);
rmenu.SetTitle("Rifle:");
rmenu.AddItem("1""M4A1-s");
rmenu.AddItem("2""AK-47");
rmenu.AddItem("3""Famas");
rmenu.AddItem("4""Galil");
rmenu.AddItem("5""AWP");
rmenu.AddItem("6""MP7");
rmenu.ExitButton true;
rmenu.Display(client35);

public 
int MenuHandler_PrimaryRifle(Menu menuMenuAction actionint clientint item
{
    switch(
action){
        case 
MenuAction_Select: {
            
int chosen GetMenuInt(menuitem);
            
Cookie_Rifle[client] = chosen;
            
SetCookieInt(clientCookHandler_Riflechosen);
            
CPrintToChat(clientCHAT_TAG"Changed option rifle1");
        }
        
        case 
MenuAction_Enddelete menu;
    }

You9 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-04-2017 , 17:25   Re: [CS:GO] Handles spam
Reply With Quote #9

You are creating a static menu for each client which displays the same information. Try creating the menu on pluginstart and then when you want to display it use the handle you created in pluginstart.
Mitchell is offline
You9
Member
Join Date: Mar 2016
Old 01-04-2017 , 20:19   Re: [CS:GO] Handles spam
Reply With Quote #10

What should i do with the "not static" menus? I mean like where every time you open menu there is all terrorist team players, or database data what is always new.
You9 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:45.


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