Players desync shortly after connect - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Players desync shortly after connect (
/showthread.php?tid=652883)
Players desync shortly after connect -
ElMaestro123 - 21.04.2018
Hello guys, I have a problem with my script/server, actually I think the server might cause the problem. Server was running with 170 players online and the samp03svr took roughly ~50% of CPU usage. The OS I am using is linux and the VPS is 10core/10GB RAM/60GB Bandwidth. It's hosted on NFOServers on Internap. I managed to reduce unneeded processes in my script and optimized all minor timers in script.
Also, the script has been running for just around 6 days. Idk if the runtime could be a problem. Please help since players desync randomly.
Re: Players desync shortly after connect -
iKarim - 21.04.2018
Try loading performance profiler plugin and post the result here, it's most likely something takes too long to execute but it's called very often. OnPlayerUpdate?
Re: Players desync shortly after connect -
ElMaestro123 - 22.04.2018
Onplayerupdate is almost empty, just a check for a camera movement, nothing else. I have global timer for anticheat that's been called every 3seconds and another one that's being called every second but with less checks. Here's the profiler from localhost.
Code:
Type Name Calls Self Time Total Time
% Overall Average Worst % Overall Average Worst
normal unknown@0000003c 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@000000ac 1 0.00% 0.0 0.1 0.1 0.00% 0.0 0.6 0.6
normal unknown@0000019c 303 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@000001ec 1 0.00% 0.0 0.2 0.2 0.00% 0.0 0.3 0.3
normal unknown@0000035c 55 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00000458 10156 0.27% 0.0 0.0 0.1 0.04% 0.0 0.0 0.1
normal unknown@00000600 686 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
public OnGameModeInit 1 0.00% 0.0 0.1 0.1 9.69% 6.7 6668.9 6668.9
normal unknown@000063d8 1 0.00% 0.0 0.0 0.0 9.69% 6.7 6668.9 6668.9
normal unknown@0000656c 1 0.00% 0.0 0.1 0.1 9.69% 6.7 6668.9 6668.9
normal unknown@00006f4c 1 0.00% 0.0 0.0 0.0 0.58% 0.4 402.6 402.6
normal unknown@000070a8 1 0.00% 0.0 0.0 0.0 0.58% 0.4 402.6 402.6
normal unknown@000075e4 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00007664 2 5.00% 0.3 166.7 330.4 0.48% 0.3 166.7 330.4
normal unknown@00007868 1792 0.02% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00007a88 1151 3.44% 0.2 0.2 0.8 0.77% 0.5 0.5 1.7
normal unknown@00007cdc 81 0.02% 0.0 0.0 0.1 0.00% 0.0 0.0 0.1
normal unknown@0000810c 560 0.19% 0.0 0.0 0.2 0.02% 0.0 0.0 0.2
normal unknown@000082d8 1132 0.03% 0.0 0.0 0.0 0.76% 0.5 0.5 1.7
normal unknown@00008360 72 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.1
normal unknown@000083e8 134977 3.37% 0.2 0.0 0.2 0.33% 0.2 0.0 0.2
normal unknown@0000860c 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00008680 62587 1.59% 0.1 0.0 0.2 0.20% 0.1 0.0 0.2
normal unknown@00008758 28 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00008868 65903 2.58% 0.2 0.0 0.4 0.30% 0.2 0.0 0.4
normal unknown@00008980 24 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00008a38 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.1 0.1
normal unknown@00008b18 1106 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0000903c 57 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0000912c 70 0.02% 0.0 0.0 0.1 0.02% 0.0 0.2 0.3
normal unknown@000093ec 19 0.00% 0.0 0.0 0.0 0.02% 0.0 0.7 1.5
normal unknown@00009598 1 0.55% 0.0 37.0 37.0 0.58% 0.4 402.6 402.6
normal unknown@0001203c 1 0.00% 0.0 0.0 0.0 0.48% 0.3 333.5 333.5
normal unknown@00012458 1132 0.05% 0.0 0.0 0.0 0.76% 0.5 0.5 1.7
normal unknown@00013118 125008 27.63% 1.8 0.0 1.0 5.34% 3.7 0.0 1.9
normal unknown@00013784 64743 2.66% 0.2 0.0 0.3 0.30% 0.2 0.0 0.3
normal unknown@000139c0 62504 2.09% 0.1 0.0 0.1 0.25% 0.2 0.0 0.2
normal unknown@00013c44 1049 6.50% 0.4 0.4 1.5 8.18% 5.6 5.4 94.8
normal unknown@00014b38 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.1 0.1
normal unknown@00014e10 14 0.00% 0.0 0.0 0.0 0.13% 0.1 6.3 7.3
normal unknown@00014ed8 28 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@000152bc 1078 0.48% 0.0 0.0 0.4 0.21% 0.1 0.1 10.6
normal unknown@00015cfc 14 0.03% 0.0 0.1 0.1 0.21% 0.1 10.5 14.8
normal unknown@00015e10 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.1 0.1
normal unknown@00015eb4 28 0.55% 0.0 1.3 1.4 0.26% 0.2 6.3 10.4
normal unknown@000189d4 72 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00019eec 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.1 0.1
normal unknown@0001a008 1 0.02% 0.0 1.2 1.2 9.10% 6.3 6260.9 6260.9
public zcmd_OnGameModeInit 1 0.00% 0.0 0.0 0.0 9.10% 6.3 6261.0 6261.0
normal unknown@00029bf4 1 0.02% 0.0 1.3 1.3 0.01% 0.0 4.9 4.9
normal unknown@0002a8b4 1180 0.04% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@000305c8 15 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0003dbdc 1 0.23% 0.0 15.6 15.6 0.06% 0.0 39.7 39.7
normal unknown@0028886c 14 0.01% 0.0 0.0 0.1 0.00% 0.0 0.1 0.2
normal unknown@00294dbc 2 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00294fdc 2 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00295234 2 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00295648 38 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@002957f8 24 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@002958b0 20 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00295c80 6 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00295d70 5 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00295e40 5 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00295eb8 3 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00295f68 2 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00296068 2 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00296564 18 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0029d1e4 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0029fdf4 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.1 0.1
normal unknown@002a1148 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@002a11f0 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@002a1298 12 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@002a13e4 11 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@002a2258 1000 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@002b1d9c 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0030ad18 1 0.00% 0.0 0.3 0.3 0.00% 0.0 0.4 0.4
normal unknown@0030da10 13 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0030dfcc 193 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00312a60 63 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@00313090 24 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0031a1d4 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0031b408 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.2 0.2
normal unknown@0031b9b4 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0031e668 6 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0031fe28 1 0.02% 0.0 1.4 1.4 0.01% 0.0 4.5 4.5
normal unknown@00331158 63 0.00% 0.0 0.0 0.0 0.05% 0.0 0.5 1.1
normal unknown@003311d0 63 0.13% 0.0 0.1 0.3 0.05% 0.0 0.5 1.1
normal unknown@00339d50 323 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0033c070 5 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.1
public main 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@0034a010 128 0.11% 0.0 0.1 0.1 0.02% 0.0 0.1 0.1
normal unknown@0036852c 1 0.01% 0.0 0.5 0.5 0.01% 0.0 7.4 7.4
normal unknown@00368c7c 1 0.01% 0.0 0.4 0.4 0.01% 0.0 6.0 6.0
normal unknown@003695d0 896 0.04% 0.0 0.0 0.1 0.07% 0.1 0.1 0.5
normal unknown@00399994 2 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@003ba344 14 0.00% 0.0 0.0 0.0 0.34% 0.2 16.9 21.1
normal unknown@003e54ec 1 0.46% 0.0 30.7 30.7 9.02% 6.2 6211.0 6211.0
normal unknown@003f17fc 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.1 0.1
normal unknown@003f381c 1 0.02% 0.0 1.0 1.0 0.00% 0.0 3.0 3.0
normal unknown@003f89b4 1 0.01% 0.0 0.3 0.3 9.09% 6.3 6259.7 6259.7
native setproperty 15 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native random 24 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native fopen 1108 0.88% 0.1 0.1 0.8 0.09% 0.1 0.1 0.8
native fclose 1135 0.91% 0.1 0.1 5.5 0.09% 0.1 0.1 5.5
native fwrite 4368 0.09% 0.0 0.0 0.0 0.01% 0.0 0.0 0.0
native fread 68427 2.96% 0.2 0.0 0.1 0.29% 0.2 0.0 0.1
native ftemp 28 0.30% 0.0 0.7 0.9 0.03% 0.0 0.7 0.9
native fseek 28 0.04% 0.0 0.1 0.2 0.00% 0.0 0.1 0.2
native fexist 11751 3.47% 0.2 0.0 0.3 0.34% 0.2 0.0 0.3
native fremove 28 0.21% 0.0 0.5 1.2 0.02% 0.0 0.5 1.2
native float 836 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native floatstr 11501 0.35% 0.0 0.0 0.1 0.03% 0.0 0.0 0.1
native floatmul 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native floatadd 406 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native floatsub 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native floatround 86 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native floatcmp 17603 0.11% 0.0 0.0 0.0 0.01% 0.0 0.0 0.0
native strlen 138292 0.99% 0.1 0.0 0.2 0.10% 0.1 0.0 0.2
native strpack 28 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native strcat 68240 0.53% 0.0 0.0 0.2 0.05% 0.0 0.0 0.2
native strcmp 2083026 25.82% 1.7 0.0 0.7 2.50% 1.7 0.0 0.7
native strfind 135631 1.17% 0.1 0.0 0.1 0.11% 0.1 0.0 0.1
native strmid 1100 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native strval 49426 0.43% 0.0 0.0 0.0 0.04% 0.0 0.0 0.0
native valstr 994 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native memcpy 64743 0.47% 0.0 0.0 0.2 0.05% 0.0 0.0 0.2
native gettime 3 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native getdate 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetGameModeText 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetVehicleNumberPlate 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native GetVehicleModel 111 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetVehicleVirtualWorld 15 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native CreateVehicle 15 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native GetVehiclePos 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native ManualVehicleEngineAndLights 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetVehicleParamsEx 15 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native GetVehicleParamsEx 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetWorldTime 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native print 14 0.10% 0.0 0.5 0.8 0.01% 0.0 0.5 0.8
native printf 3 0.01% 0.0 0.3 0.4 0.00% 0.0 0.3 0.4
native format 230668 2.25% 0.2 0.0 0.4 0.22% 0.2 0.0 0.4
native KillTimer 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native GetMaxPlayers 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native ShowPlayerMarkers 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native AllowInteriorWeapons 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetTimerEx 8 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetWeather 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native CallLocalFunction 1 0.00% 0.0 0.0 0.0 9.10% 6.3 6261.0 6261.0
native CreateObject 621 0.03% 0.0 0.0 0.1 0.00% 0.0 0.0 0.1
native SetObjectMaterial 176 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SetObjectMaterialText 8 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawCreate 346 0.01% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawSetString 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawLetterSize 328 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawTextSize 40 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawAlignment 27 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawColor 45 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawUseBox 21 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawBoxColor 21 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawSetShadow 334 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawSetOutline 327 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawBackgroundColor 12 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawFont 346 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawSetProportional 12 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native TextDrawSetSelectable 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native EnableStuntBonusForAll 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native DisableInteriorEnterExits 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native Create3DTextLabel 36 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native Delete3DTextLabel 5 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native Attach3DTextLabelToVehicle 4 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native HTTP 1 0.00% 0.0 0.2 0.2 0.00% 0.0 0.2 0.2
native CreateActor 9 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native ApplyActorAnimation 5 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native LinkVehicleToInterior 14 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
normal unknown@006c5e70 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native SSCANF_Init 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native Profiler_Start 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native funcidx 179 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native CreateDynamicRectangle 5 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native CreateDynamicObjectEx 5571 0.11% 0.0 0.0 0.1 0.01% 0.0 0.0 0.1
native CreateDynamicMapIcon 50 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native CreateDynamicObject 5410 0.11% 0.0 0.0 0.4 0.01% 0.0 0.0 0.4
native SetDynamicObjectMaterial 4851 0.10% 0.0 0.0 0.1 0.01% 0.0 0.0 0.1
native SetDynamicObjectMaterialText 130 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native CreateDynamicPickup 1194 0.08% 0.0 0.0 0.0 0.01% 0.0 0.0 0.0
native DestroyDynamicPickup 6 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
native CreateDynamic3DTextLabel 1180 0.08% 0.0 0.0 0.0 0.01% 0.0 0.0 0.0
native DestroyDynamic3DTextLabel 1 0.00% 0.0 0.0 0.0 0.00% 0.0 0.0 0.0
Re: Players desync shortly after connect -
Uberanwar - 23.04.2018
Compile with -d3 and post again the results here.
https://github.com/Zeex/samp-plugin-...ith-debug-info
You may personally DM me on Discord if you want, because I dealt with this issue too in my server. Izrie#8980