PocketMine-MP
5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
OpenConnectionRequest2.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
15
declare(strict_types=1);
16
17
namespace
raklib\protocol;
18
19
use
raklib\utils\InternetAddress
;
20
21
class
OpenConnectionRequest2
extends
OfflineMessage
{
22
public
static
$ID =
MessageIdentifiers::ID_OPEN_CONNECTION_REQUEST_2
;
23
24
public
int
$clientID;
25
public
InternetAddress
$serverAddress;
26
public
int
$mtuSize;
27
28
protected
function
encodePayload(
PacketSerializer
$out) :
void
{
29
$this->
writeMagic
($out);
30
$out->putAddress($this->serverAddress);
31
$out->putShort($this->mtuSize);
32
$out->putLong($this->clientID);
33
}
34
35
protected
function
decodePayload
(
PacketSerializer
$in) : void{
36
$this->
readMagic
($in);
37
$this->serverAddress = $in->
getAddress
();
38
$this->mtuSize = $in->
getShort
();
39
$this->clientID = $in->
getLong
();
40
}
41
}
pocketmine\utils\BinaryStream\getLong
getLong()
Definition
BinaryStream.php:281
pocketmine\utils\BinaryStream\getShort
getShort()
Definition
BinaryStream.php:129
raklib\protocol\OfflineMessage
Definition
OfflineMessage.php:22
raklib\protocol\OfflineMessage\writeMagic
writeMagic(BinaryStream $out)
Definition
OfflineMessage.php:42
raklib\protocol\OfflineMessage\readMagic
readMagic(BinaryStream $in)
Definition
OfflineMessage.php:35
raklib\protocol\OpenConnectionRequest2
Definition
OpenConnectionRequest2.php:21
raklib\protocol\OpenConnectionRequest2\decodePayload
decodePayload(PacketSerializer $in)
Definition
OpenConnectionRequest2.php:35
raklib\protocol\PacketSerializer
Definition
raklib/src/protocol/PacketSerializer.php:30
raklib\protocol\PacketSerializer\getAddress
getAddress()
Definition
raklib/src/protocol/PacketSerializer.php:42
raklib\utils\InternetAddress
Definition
InternetAddress.php:19
raklib\protocol\MessageIdentifiers\ID_OPEN_CONNECTION_REQUEST_2
const ID_OPEN_CONNECTION_REQUEST_2
Definition
MessageIdentifiers.php:46
vendor
pocketmine
raklib
src
protocol
OpenConnectionRequest2.php
Generated by
1.12.0