PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
ConnectedPong.php
1<?php
2
3/*
4 * This file is part of RakLib.
5 * Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/RakLib>
6 *
7 * RakLib is not affiliated with Jenkins Software LLC nor RakNet.
8 *
9 * RakLib is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 */
14
15declare(strict_types=1);
16
17namespace raklib\protocol;
18
20 public static $ID = MessageIdentifiers::ID_CONNECTED_PONG;
21
22 public int $sendPingTime;
23 public int $sendPongTime;
24
25 public static function create(int $sendPingTime, int $sendPongTime) : self{
26 $result = new self;
27 $result->sendPingTime = $sendPingTime;
28 $result->sendPongTime = $sendPongTime;
29 return $result;
30 }
31
32 protected function encodePayload(PacketSerializer $out) : void{
33 $out->putLong($this->sendPingTime);
34 $out->putLong($this->sendPongTime);
35 }
36
37 protected function decodePayload(PacketSerializer $in) : void{
38 $this->sendPingTime = $in->getLong();
39 $this->sendPongTime = $in->getLong();
40 }
41}
decodePayload(PacketSerializer $in)
const ID_CONNECTED_PONG
Pong from a connected system. Update timestamps (internal use only)