From 31490576d202a574dec85f9cf36dba0586fd4dfe Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 9 Jun 2013 19:07:58 +0200 Subject: [PATCH] Added packet loss kicks and packet recovery repetition --- src/Player.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Player.php b/src/Player.php index a68892a71..7c7aff80c 100644 --- a/src/Player.php +++ b/src/Player.php @@ -803,8 +803,8 @@ class Player{ $this->lag = array(); $this->sendBuffer(); if($this->packetLoss >= PLAYER_MAX_PACKET_LOSS){ - //$this->sendChat("Your connection suffers high packet loss"); - //$this->close("packet.loss"); + $this->sendChat("Your connection suffers a high packet loss of ".round($this->packetLoss * 100, 2)."%"); + $this->close("packet loss"); } $this->lastMeasure = microtime(true); } @@ -892,7 +892,7 @@ class Player{ unset($this->resendQueue[$count]); $this->packetStats[1]++; $this->lag[] = microtime(true) - $data["sendtime"]; - $this->directDataPacket($data["id"], $data, $data["pid"], false); + $this->directDataPacket($data["id"], $data, $data["pid"]); } } }