PocketMine-MP 5.40.1 git-25718e8ccd903d1408fb25666ef84028379bbea6
Loading...
Searching...
No Matches
ServerTelemetryData.php
1<?php
2
3/*
4 * This file is part of BedrockProtocol.
5 * Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6 *
7 * BedrockProtocol is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13declare(strict_types=1);
14
15namespace pocketmine\network\mcpe\protocol\types;
16
17use pmmp\encoding\ByteBufferReader;
18use pmmp\encoding\ByteBufferWriter;
20
22
23 public function __construct(
24 private string $serverId,
25 private string $scenarioId,
26 private string $worldId,
27 private string $ownerId,
28 ){}
29
30 public function getServerId() : string{ return $this->serverId; }
31
32 public function getScenarioId() : string{ return $this->scenarioId; }
33
34 public function getWorldId() : string{ return $this->worldId; }
35
36 public function getOwnerId() : string{ return $this->ownerId; }
37
38 public static function read(ByteBufferReader $in) : self{
39 $serverId = CommonTypes::getString($in);
40 $scenarioId = CommonTypes::getString($in);
41 $worldId = CommonTypes::getString($in);
42 $ownerId = CommonTypes::getString($in);
43
44 return new self(
45 $serverId,
46 $scenarioId,
47 $worldId,
48 $ownerId
49 );
50 }
51
52 public function write(ByteBufferWriter $out) : void{
53 CommonTypes::putString($out, $this->serverId);
54 CommonTypes::putString($out, $this->scenarioId);
55 CommonTypes::putString($out, $this->worldId);
56 CommonTypes::putString($out, $this->ownerId);
57 }
58}