mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Added packet loss kicks and packet recovery repetition
This commit is contained in:
parent
b4f95fad11
commit
31490576d2
@ -803,8 +803,8 @@ class Player{
|
|||||||
$this->lag = array();
|
$this->lag = array();
|
||||||
$this->sendBuffer();
|
$this->sendBuffer();
|
||||||
if($this->packetLoss >= PLAYER_MAX_PACKET_LOSS){
|
if($this->packetLoss >= PLAYER_MAX_PACKET_LOSS){
|
||||||
//$this->sendChat("Your connection suffers high packet loss");
|
$this->sendChat("Your connection suffers a high packet loss of ".round($this->packetLoss * 100, 2)."%");
|
||||||
//$this->close("packet.loss");
|
$this->close("packet loss");
|
||||||
}
|
}
|
||||||
$this->lastMeasure = microtime(true);
|
$this->lastMeasure = microtime(true);
|
||||||
}
|
}
|
||||||
@ -892,7 +892,7 @@ class Player{
|
|||||||
unset($this->resendQueue[$count]);
|
unset($this->resendQueue[$count]);
|
||||||
$this->packetStats[1]++;
|
$this->packetStats[1]++;
|
||||||
$this->lag[] = microtime(true) - $data["sendtime"];
|
$this->lag[] = microtime(true) - $data["sendtime"];
|
||||||
$this->directDataPacket($data["id"], $data, $data["pid"], false);
|
$this->directDataPacket($data["id"], $data, $data["pid"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user