PocketMine-MP 5.14.2 git-50e2c469a547a16a23b2dc691e70a51d34e29395
PlayerListEntry.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
18use Ramsey\Uuid\UuidInterface;
19
21
22 public UuidInterface $uuid;
23 public int $actorUniqueId;
24 public string $username;
25 public SkinData $skinData;
26 public string $xboxUserId;
27 public string $platformChatId = "";
28 public int $buildPlatform = DeviceOS::UNKNOWN;
29 public bool $isTeacher = false;
30 public bool $isHost = false;
31 public bool $isSubClient = false;
32
33 public static function createRemovalEntry(UuidInterface $uuid) : PlayerListEntry{
34 $entry = new PlayerListEntry();
35 $entry->uuid = $uuid;
36
37 return $entry;
38 }
39
40 public static function createAdditionEntry(
41 UuidInterface $uuid,
42 int $actorUniqueId,
43 string $username,
44 SkinData $skinData,
45 string $xboxUserId = "",
46 string $platformChatId = "",
47 int $buildPlatform = -1,
48 bool $isTeacher = false,
49 bool $isHost = false,
50 bool $isSubClient = false
52 $entry = new PlayerListEntry();
53 $entry->uuid = $uuid;
54 $entry->actorUniqueId = $actorUniqueId;
55 $entry->username = $username;
56 $entry->skinData = $skinData;
57 $entry->xboxUserId = $xboxUserId;
58 $entry->platformChatId = $platformChatId;
59 $entry->buildPlatform = $buildPlatform;
60 $entry->isTeacher = $isTeacher;
61 $entry->isHost = $isHost;
62 $entry->isSubClient = $isSubClient;
63
64 return $entry;
65 }
66}