@@ -953,11 +953,13 @@ function SetSpawnInfo(amx, player, team, skin, x, y, z, angle, weap1, weap1_ammo
953953end
954954
955955function NetStats_BytesReceived (amx , player )
956- notImplemented (' NetStats_BytesReceived' )
956+ local networkStat = getNetworkStats (player )
957+ return networkStat .bytesReceived or 0
957958end
958959
959960function NetStats_BytesSent (amx , player )
960- notImplemented (' NetStats_BytesSent' )
961+ local networkStat = getNetworkStats (player )
962+ return networkStat .bytesSent or 0
961963end
962964
963965function NetStats_ConnectionStatus (amx , player )
@@ -968,8 +970,12 @@ function NetStats_GetConnectedTime(amx, player)
968970 notImplemented (' NetStats_GetConnectedTime' )
969971end
970972
971- function NetStats_GetIpPort (amx , player )
972- notImplemented (' NetStats_GetIpPort' )
973+ function NetStats_GetIpPort (amx , player , ip_port , ip_port_len )
974+ local ip = getPlayerIP (player )
975+ local port = 0 -- We haven't a solution for getting a client port
976+ local ipandport = tostring (ip ).. " :" .. tostring (port )
977+ writeMemString (amx , ip_port , ipandport )
978+ return string.len (tostring (ip ).. " :" .. tostring (port ));
973979end
974980
975981function NetStats_MessagesReceived (amx , player )
@@ -985,5 +991,6 @@ function NetStats_MessagesSent(amx, player)
985991end
986992
987993function NetStats_PacketLossPercent (amx , player )
988- notImplemented (' NetStats_PacketLossPercent' )
994+ local networkStat = getNetworkStats (player )
995+ return networkStat .packetlossTotal or 0
989996end
0 commit comments