mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
NetworkSession->getPing() now returns null when no measurement of ping has yet been completed
This commit is contained in:
parent
1d9cb174b6
commit
d3a6da1b3a
@ -117,8 +117,8 @@ class NetworkSession{
|
|||||||
private $port;
|
private $port;
|
||||||
/** @var PlayerInfo */
|
/** @var PlayerInfo */
|
||||||
private $info;
|
private $info;
|
||||||
/** @var int */
|
/** @var int|null */
|
||||||
private $ping;
|
private $ping = null;
|
||||||
|
|
||||||
/** @var PacketHandler */
|
/** @var PacketHandler */
|
||||||
private $handler;
|
private $handler;
|
||||||
@ -235,9 +235,9 @@ class NetworkSession{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the last recorded ping measurement for this session, in milliseconds.
|
* Returns the last recorded ping measurement for this session, in milliseconds, or null if a ping measurement has not yet been recorded.
|
||||||
*/
|
*/
|
||||||
public function getPing() : int{
|
public function getPing() : ?int{
|
||||||
return $this->ping;
|
return $this->ping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user