mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
NetworkStackLatencyPacket: added named constructors
This commit is contained in:
parent
d56cf35385
commit
1eabc3fe75
@ -35,6 +35,20 @@ class NetworkStackLatencyPacket extends DataPacket implements ClientboundPacket,
|
||||
/** @var bool */
|
||||
public $needResponse;
|
||||
|
||||
public static function request(int $timestampNs) : self{
|
||||
$result = new self;
|
||||
$result->timestamp = $timestampNs;
|
||||
$result->needResponse = true;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function response(int $timestampNs) : self{
|
||||
$result = new self;
|
||||
$result->timestamp = $timestampNs;
|
||||
$result->needResponse = false;
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function decodePayload(PacketSerializer $in) : void{
|
||||
$this->timestamp = $in->getLLong();
|
||||
$this->needResponse = $in->getBool();
|
||||
|
Loading…
x
Reference in New Issue
Block a user