SA-MP Forums Archive
Problem with NetStats_PacketLossPercent - 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: Problem with NetStats_PacketLossPercent (/showthread.php?tid=533535)



Problem with NetStats_PacketLossPercent - rymax99 - 25.08.2014

Hi, I've created a simple command to show a players 'network statistics' which I plan on building on later, but it seems like there isn't something right about 'NetStats_PacketLossPercent. My server is less than 500 miles from me, I get 29ms constantly, my packet loss when pinging it from Windows and in the network statistics(F5) in SA-MP always shows as 0 - but 'NetStats_PacketLossPercent' usually shows it at something higher (.50+) - it also seems to increment down once it gets that high like .1 a second or so. Any ideas?

(the second part of the code is to simply attempt to debug/confirm)
pawn Код:
String("%s's network statistics: ping: %dms | packet loss: %.2f.",gPlayerInfo[id][pName], GetPlayerPing(id), NetStats_PacketLossPercent(id));
SendClientMessage(playerid,-1,string);
   
String("%f",NetStats_PacketLossPercent(id));
SendClientMessage(playerid,-1,string);
Here's some excerps from chat logs to show my theory further:
Код:
[01:21:48] Ryan's network statistics: ping: 47ms | packet loss: 0.00.
[01:21:48] 0.000000
[01:23:00] Ryan's network statistics: ping: 46ms | packet loss: 0.00.
[01:23:00] 0.000000
[01:23:02] Ryan's network statistics: ping: 46ms | packet loss: 0.00.
[01:23:02] 0.000000
[01:23:03] Ryan's network statistics: ping: 46ms | packet loss: 0.00.
[01:23:03] 0.000000
[01:23:07] Ryan's network statistics: ping: 46ms | packet loss: 0.00.
[01:23:07] 0.000000
[01:23:09] Ryan's network statistics: ping: 47ms | packet loss: 0.00.
[01:23:09] 0.000000
[01:23:25] Ryan's network statistics: ping: 46ms | packet loss: 0.85.
[01:23:25] 0.852771
[01:23:26] Ryan's network statistics: ping: 46ms | packet loss: 0.84.
[01:23:26] 0.848593
[01:23:27] Ryan's network statistics: ping: 46ms | packet loss: 0.84.
[01:23:27] 0.844456
[01:23:27] Ryan's network statistics: ping: 46ms | packet loss: 0.84.
[01:23:27] 0.842369
[01:23:28] Ryan's network statistics: ping: 46ms | packet loss: 0.83.
[01:23:28] 0.838292
[01:23:29] Ryan's network statistics: ping: 46ms | packet loss: 0.83.
[01:23:29] 0.834254
[01:23:29] Ryan's network statistics: ping: 46ms | packet loss: 0.83.
[01:23:29] 0.832561
[01:23:30] Ryan's network statistics: ping: 46ms | packet loss: 0.82.
[01:23:30] 0.828579
[01:23:31] Ryan's network statistics: ping: 46ms | packet loss: 0.82.
[01:23:31] 0.824441
[01:23:31] Ryan's network statistics: ping: 46ms | packet loss: 0.82.
[01:23:31] 0.822787
[01:23:33] Ryan's network statistics: ping: 46ms | packet loss: 0.81.
[01:23:33] 0.816524
[01:23:34] Ryan's network statistics: ping: 46ms | packet loss: 0.81.
[01:23:34] 0.812271
[01:23:40] Ryan's network statistics: ping: 46ms | packet loss: 0.79.
[01:23:40] 0.799079
[01:23:41] Ryan's network statistics: ping: 46ms | packet loss: 0.79.
[01:23:41] 0.795409
[01:23:43] Ryan's network statistics: ping: 51ms | packet loss: 0.78.
[01:23:43] 0.787304
[01:23:45] Ryan's network statistics: ping: 51ms | packet loss: 0.78.
[01:23:45] 0.783741
[01:23:46] Ryan's network statistics: ping: 51ms | packet loss: 0.78.
[01:23:46] 0.780168
[01:23:47] Ryan's network statistics: ping: 47ms | packet loss: 0.77.
[01:23:47] 0.774364
[01:23:53] Ryan's network statistics: ping: 47ms | packet loss: 0.75.
[01:23:53] 0.758956
[01:23:56] Ryan's network statistics: ping: 47ms | packet loss: 0.75.
[01:23:56] 0.751493
[01:23:58] Ryan's network statistics: ping: 47ms | packet loss: 0.74.
[01:23:58] 0.746265
[01:24:01] Ryan's network statistics: ping: 47ms | packet loss: 0.73.
[01:24:01] 0.739087
[01:24:04] Ryan's network statistics: ping: 46ms | packet loss: 0.73.
[01:24:04] 0.732236
[01:24:05] Ryan's network statistics: ping: 46ms | packet loss: 0.72.
[01:24:05] 0.729003
[01:24:15] Ryan's network statistics: ping: 46ms | packet loss: 0.70.
[01:24:15] 0.703964
[01:24:18] Ryan's network statistics: ping: 46ms | packet loss: 0.69.
[01:24:18] 0.697285
[01:24:21] Ryan's network statistics: ping: 46ms | packet loss: 0.68.
[01:24:21] 0.688695
[01:24:25] Ryan's network statistics: ping: 47ms | packet loss: 0.67.
[01:24:25] 0.678675
[01:25:36] Ryan's network statistics: ping: 52ms | packet loss: 0.58.
[01:25:36] 0.584664
[01:25:41] Ryan's network statistics: ping: 47ms | packet loss: 0.57.
[01:25:41] 0.576797
[01:25:44] Ryan's network statistics: ping: 46ms | packet loss: 0.57.
[01:25:44] 0.570937
[01:25:45] Ryan's network statistics: ping: 46ms | packet loss: 0.56.
[01:25:45] 0.567884
[01:25:48] Ryan's network statistics: ping: 46ms | packet loss: 0.56.
[01:25:48] 0.563259



Re: Problem with NetStats_PacketLossPercent - Smally - 25.08.2014

I personally wouldn't be concerned with that amount of packet loss, you will find the datacenter of which your server is hosted in has shit routing somewhere along the line.


Re: Problem with NetStats_PacketLossPercent - rymax99 - 25.08.2014

Quote:
Originally Posted by Smally
Посмотреть сообщение
I personally wouldn't be concerned with that amount of packet loss, you will find the datacenter of which your server is hosted in has shit routing somewhere along the line.
Bad routing is absolutely not the case here, it doesn't even seem like packet loss is the issue at all, the only thing that is indicating packet loss is 'NetStats_PacketLossPercent' and it seems to be incrementing back down in an odd way.


Re: Problem with NetStats_PacketLossPercent - rymax99 - 03.09.2014

Any input on this, can someone test this and confirm it?

EDIT: I was totally overthinking this - it's a percentage! It's working fine.