PocketMine-MP
5.23.3 git-fbaa125d0ce21ffef98fc1630881a92bedfbaa73
Loading...
Searching...
No Matches
OfflineMessage.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
pocketmine\utils\BinaryDataException
;
20
use
pocketmine\utils\BinaryStream
;
21
22
abstract
class
OfflineMessage
extends
Packet
{
23
27
private
const
MAGIC =
"\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78"
;
28
29
protected
string
$magic = self::MAGIC;
30
35
protected
function
readMagic
(
BinaryStream
$in){
36
$this->magic = $in->
get
(16);
37
}
38
42
protected
function
writeMagic
(
BinaryStream
$out){
43
$out->put($this->magic);
44
}
45
46
public
function
isValid() : bool{
47
return $this->magic === self::MAGIC;
48
}
49
}
pocketmine\utils\BinaryDataException
Definition
BinaryDataException.php:26
pocketmine\utils\BinaryStream
Definition
BinaryStream.php:31
pocketmine\utils\BinaryStream\get
get(int $len)
Definition
BinaryStream.php:67
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\Packet
Definition
raklib/src/protocol/Packet.php:21
vendor
pocketmine
raklib
src
protocol
OfflineMessage.php
Generated by
1.12.0