PocketMine-MP
5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
ConnectionRequest.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
class
ConnectionRequest
extends
ConnectedPacket
{
20
public
static
$ID =
MessageIdentifiers::ID_CONNECTION_REQUEST
;
21
22
public
int
$clientID;
23
public
int
$sendPingTime;
24
public
bool
$useSecurity =
false
;
25
26
protected
function
encodePayload(
PacketSerializer
$out) :
void
{
27
$out->putLong($this->clientID);
28
$out->putLong($this->sendPingTime);
29
$out->putByte($this->useSecurity ? 1 : 0);
30
}
31
32
protected
function
decodePayload
(
PacketSerializer
$in) : void{
33
$this->clientID = $in->getLong();
34
$this->sendPingTime = $in->
getLong
();
35
$this->useSecurity = $in->
getByte
() !== 0;
36
}
37
}
pocketmine\utils\BinaryStream\getByte
getByte()
Definition
BinaryStream.php:117
pocketmine\utils\BinaryStream\getLong
getLong()
Definition
BinaryStream.php:281
raklib\protocol\ConnectedPacket
Definition
ConnectedPacket.php:22
raklib\protocol\ConnectionRequest
Definition
ConnectionRequest.php:19
raklib\protocol\ConnectionRequest\decodePayload
decodePayload(PacketSerializer $in)
Definition
ConnectionRequest.php:32
raklib\protocol\PacketSerializer
Definition
raklib/src/protocol/PacketSerializer.php:30
raklib\protocol\MessageIdentifiers\ID_CONNECTION_REQUEST
const ID_CONNECTION_REQUEST
C2S: Header(1), GUID(8), Timestamp, HasSecurity(1), Proof(32)
Definition
MessageIdentifiers.php:50
vendor
pocketmine
raklib
src
protocol
ConnectionRequest.php
Generated by
1.12.0