Skip to content

Commit

Permalink
Fix #216
Browse files Browse the repository at this point in the history
  • Loading branch information
Muqsit committed Jul 13, 2023
1 parent 392ebc5 commit 363c211
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Closure;
use muqsit\invmenu\session\network\NetworkStackLatencyEntry;
use pocketmine\network\mcpe\protocol\types\DeviceOS;
use function mt_rand;

final class PlayerNetworkHandlerRegistry{

Expand All @@ -17,7 +18,8 @@ final class PlayerNetworkHandlerRegistry{

public function __construct(){
$this->registerDefault(new ClosurePlayerNetworkHandler(static function(Closure $then) : NetworkStackLatencyEntry{
return new NetworkStackLatencyEntry(mt_rand() * 1000 /* TODO: remove this hack */, $then);
$timestamp = mt_rand();
return new NetworkStackLatencyEntry($timestamp * 1000000, $then, $timestamp);
}));
$this->register(DeviceOS::PLAYSTATION, new ClosurePlayerNetworkHandler(static function(Closure $then) : NetworkStackLatencyEntry{
$timestamp = mt_rand();
Expand Down

0 comments on commit 363c211

Please sign in to comment.