@@ -955,11 +955,13 @@ function SetSpawnInfo(amx, player, team, skin, x, y, z, angle, weap1, weap1_ammo
955955end
956956
957957function NetStats_BytesReceived (amx , player )
958- notImplemented (' NetStats_BytesReceived' )
958+ local networkStat = getNetworkStats (player )
959+ return networkStat .bytesReceived or 0
959960end
960961
961962function NetStats_BytesSent (amx , player )
962- notImplemented (' NetStats_BytesSent' )
963+ local networkStat = getNetworkStats (player )
964+ return networkStat .bytesSent or 0
963965end
964966
965967function NetStats_ConnectionStatus (amx , player )
@@ -970,8 +972,12 @@ function NetStats_GetConnectedTime(amx, player)
970972 notImplemented (' NetStats_GetConnectedTime' )
971973end
972974
973- function NetStats_GetIpPort (amx , player )
974- notImplemented (' NetStats_GetIpPort' )
975+ function NetStats_GetIpPort (amx , player , ip_port , ip_port_len )
976+ local ip = getPlayerIP (player )
977+ local port = 0 -- We haven't a solution for getting a client port
978+ local ipandport = tostring (ip ).. " :" .. tostring (port )
979+ writeMemString (amx , ip_port , ipandport )
980+ return string.len (tostring (ip ).. " :" .. tostring (port ));
975981end
976982
977983function NetStats_MessagesReceived (amx , player )
@@ -987,5 +993,6 @@ function NetStats_MessagesSent(amx, player)
987993end
988994
989995function NetStats_PacketLossPercent (amx , player )
990- notImplemented (' NetStats_PacketLossPercent' )
996+ local networkStat = getNetworkStats (player )
997+ return networkStat .packetlossTotal or 0
991998end
0 commit comments