Packet Loss detecter
#1

hello. Is it possible to define a Packet Loss? If so, how?
Reply
#2

Hmm.. But here - 78.129.221.58:7784 - is available Packet Loss detecter and it works!
Reply
#3

GetPlayerNetworkStats contains packetloss. you just need to parse it out of the string
Reply
#4

Maybe.. But I do not have a precise definition. It suffices to define the event as a true / false. Maybe you know how to do it?
Reply
#5

Quote:
Originally Posted by S1avaK
Посмотреть сообщение
Maybe.. But I do not have a precise definition. It suffices to define the event as a true / false. Maybe you know how to do it?
Read the wiki for GetPlayerNetworkStats, it should be easy enough to understand and make it yourself.
Reply
#6

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
GetPlayerNetworkStats contains packetloss. you just need to parse it out of the string
How? Can you give an example of code?
Reply
#7

Код:
Network Active: 1
Network State: 8
Messages in Send buffer: 0
Messages sent: 46
Bytes sent: 1944
Acks sent: 12
Acks in send buffer: 0
Messages waiting for ack: 0
Messages resent: 0
Bytes resent: 0
Packetloss: 0.0
Messages received: 57
Bytes received: 1524
Acks received: 0
Duplicate acks received: 0
Inst. KBits per second: 28.8
KBits per second sent: 2.2
KBits per second received: 1.7
Example output
You can use e.g. sscanf, regex or strfind to parse the interesting data out of it
Reply
#8

How to export the packetloss pls bro help me.
Reply
#9

pawn Код:
new str[350];
GetPlayerNetworkStats(0, str, 350);
new start = strfind(str, "Packetloss", false);
strmid(str, str, start + 12, strfind(str, "Messages", false, start) - 2);
new Float:packetloss = floatstr(str);
No testing on your own=no learning but ok.
This should do it. Dont know what values packetloss will have, either 0-100 or 0.0-1.0 i guess.
Reply
#10

I'll test it thank you.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)