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

client_disconnected() <-> plugin_end()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Senior Member
Join Date: Jun 2010
Old 05-13-2019 , 12:36   client_disconnected() <-> plugin_end()
Reply With Quote #1

hi guys. i have made a plugin which is using mysql module. problem accuress when map change is happening..meaning server is 'freezed' for about 10sec (which should be 2-3max sec normal)...when the plugin is off -> all good...so i started to analize where is the problem for that, and my brain is telling me:

plugin is sending too much queries at map change, why that:

on client_disconnected( id ) im updating every player one colomn (column for last connection), server is almost everyday 30/32

so is client_disconnected( id ) called right before plugin_end() ?

*pls dont write : go test it, cuz im not in situation to test it
on plugin_end() im doing sql_freehandle
__________________
KZ Public Autocup

Private (selling) works:

KZ Melee & 1v1 Cup plugin & MapPool (like for XJ)
PrimeKZ Plugin (MySql) - 86% (pointsystem, sv_aa and /slowmo per client, Record Bot[Leet] ect...)
Checkpoin zones for KZ (& DR)
Deathrun Timer
JocAnis is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-13-2019 , 12:47   Re: client_disconnected() <-> plugin_end()
Reply With Quote #2

Go test it. Put a print in plugin_end and in client_disconnect with the current game time, change the map and see if you get similar timestamps.
It literally takes 5 seconds to test and it works even in local servers.
__________________
HamletEagle is offline
JocAnis
Senior Member
Join Date: Jun 2010
Old 05-13-2019 , 12:57   Re: client_disconnected() <-> plugin_end()
Reply With Quote #3

Ok i will test on lan with one/two players, im not sure if thats proper test but thank you for trying to help
__________________
KZ Public Autocup

Private (selling) works:

KZ Melee & 1v1 Cup plugin & MapPool (like for XJ)
PrimeKZ Plugin (MySql) - 86% (pointsystem, sv_aa and /slowmo per client, Record Bot[Leet] ect...)
Checkpoin zones for KZ (& DR)
Deathrun Timer
JocAnis is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-13-2019 , 13:03   Re: client_disconnected() <-> plugin_end()
Reply With Quote #4

You can try to use on amx 1.9, and see if lag occurs.

PHP Code:
public server_changelevel(map[])
{
    
// code here

__________________

Last edited by iceeedr; 05-13-2019 at 13:03.
iceeedr is offline
Send a message via Skype™ to iceeedr
JocAnis
Senior Member
Join Date: Jun 2010
Old 05-13-2019 , 13:18   Re: client_disconnected() <-> plugin_end()
Reply With Quote #5

@iceeedr that seems optimistic

ill see later when i have time for it..im just hoping amx_nextmap isnt working with changelevel because server_changelevel cant catch it?
__________________
KZ Public Autocup

Private (selling) works:

KZ Melee & 1v1 Cup plugin & MapPool (like for XJ)
PrimeKZ Plugin (MySql) - 86% (pointsystem, sv_aa and /slowmo per client, Record Bot[Leet] ect...)
Checkpoin zones for KZ (& DR)
Deathrun Timer
JocAnis is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-13-2019 , 13:21   Re: client_disconnected() <-> plugin_end()
Reply With Quote #6

amx_nextmap in amx 1.9 uses the server_changelevel command, it's just an attempt rs
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
JocAnis
Senior Member
Join Date: Jun 2010
Old 05-13-2019 , 16:32   Re: client_disconnected() <-> plugin_end()
Reply With Quote #7

thank you @iceeedr,

Code:
[pub_mysql_ranking.amxx] changemap: 7.226326
L 05/13/2019 - 22:16:15: [pub_mysql_ranking.amxx] disconnect() 7.241017
L 05/13/2019 - 22:16:15: [pub_mysql_ranking.amxx] plugin_end() 7.241017
adding bool to server_changelevel is enough in my opinion

ps: again 10sec waiting :/ i think its in conflict with another mysql plugin or smth
__________________
KZ Public Autocup

Private (selling) works:

KZ Melee & 1v1 Cup plugin & MapPool (like for XJ)
PrimeKZ Plugin (MySql) - 86% (pointsystem, sv_aa and /slowmo per client, Record Bot[Leet] ect...)
Checkpoin zones for KZ (& DR)
Deathrun Timer

Last edited by JocAnis; 05-13-2019 at 16:49.
JocAnis is offline
Old 05-13-2019, 17:04
Gabe Iggy
This message has been deleted by Gabe Iggy. Reason: nvm
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-14-2019 , 08:02   Re: client_disconnected() <-> plugin_end()
Reply With Quote #8

What's the latency from your game server to your MySQL server? Queries will execute in order (even if they are threaded), and if say the latency is 100ms and you query 30 times on mapchange, that will be 3 seconds of querying in total. You could update all 30 rows in 1 query if you build the query dynamically, and while that is not ideal at all, it's probably better. I really don't know whats the right way to get rid off this limitation.

Anyway I'm just guessing what could be the problem here, I don't know anything about your setup.
__________________
KliPPy is offline
JocAnis
Senior Member
Join Date: Jun 2010
Old 05-15-2019 , 16:07   Re: client_disconnected() <-> plugin_end()
Reply With Quote #9

@klippy i have no idea how to see latency from server <-> mysql

but after pausing GameMe plugin and adding bool into server_changelevel for this plugin 'problem' is solved, thanks guys
__________________
KZ Public Autocup

Private (selling) works:

KZ Melee & 1v1 Cup plugin & MapPool (like for XJ)
PrimeKZ Plugin (MySql) - 86% (pointsystem, sv_aa and /slowmo per client, Record Bot[Leet] ect...)
Checkpoin zones for KZ (& DR)
Deathrun Timer
JocAnis is offline
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 12:30.


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