SA-MP Forums Archive
Server lag on disconnect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server lag on disconnect (/showthread.php?tid=484549)



Server lag on disconnect - L.Hudson - 31.12.2013

As the tittle says, when someone on the server quits,crashes or gets kicked the server lags for about 3 seconds, what could cause that issue? Any help is appriciated.


Re: Server lag on disconnect - doreto - 31.12.2013

Post your OnPlayerDisconnect


Re: Server lag on disconnect - L.Hudson - 31.12.2013

Because I hardly wanna publish parts of the script, I will just say that alot of lines are included in OnPlayerDisconneect, could that lag the server on disconnect? If it still doesn't help I am willing to post the OnPlayerDisconnect.


Re: Server lag on disconnect - ViciousRoleplay123 - 31.12.2013

If u don't show ur script OnPlayerDisconnect, we won't be able to reply.


Re: Server lag on disconnect - PrivatioBoni - 31.12.2013

Quote:
Originally Posted by L.Hudson
Посмотреть сообщение
Because I hardly wanna publish parts of the script, I will just say that alot of lines are included in OnPlayerDisconneect, could that lag the server on disconnect? If it still doesn't help I am willing to post the OnPlayerDisconnect.
If you don't want to publish your script when it's needed, then you won't be able to get any help. It's unfortunately a two way street. If you don't trust us with your code, you shouldn't be asking for help.


Re: Server lag on disconnect - L.Hudson - 31.12.2013

Sorry for the delay, http://pastebin.com/dK3VpzFH


Re: Server lag on disconnect - dominik523 - 31.12.2013

I think stock SavePlayer(playerid) may cause a lag. Which saving system do you use?


Re: Server lag on disconnect - L.Hudson - 19.01.2014

bump


AW: Server lag on disconnect - Nero_3D - 19.01.2014

You should use the Performance profiler and compile your mode with the -d3 flag
Than run your gamemode and join / disconnect sometime and check the log
Afterwards you will know if it was SavePlayer, UnrentVehicle or just the 4 MAX_PLAYERS loops in OnPlayerDisconnect
Either way you will need to rewrite that part of your code or delay it with a timer


Re: AW: Server lag on disconnect - Nick_Phelps - 09.02.2014

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
You should use the Performance profiler and compile your mode with the -d3 flag
Than run your gamemode and join / disconnect sometime and check the log
Afterwards you will know if it was SavePlayer, UnrentVehicle or just the 4 MAX_PLAYERS loops in OnPlayerDisconnect
Either way you will need to rewrite that part of your code or delay it with a timer
http://www.2shared.com/complete/eWXb...P-profile.html

Here are the results, thanks to "Not Important"