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