Actually merge branch 'release/3.4' this time

This commit is contained in:
Dylan K. Taylor 2018-10-19 15:35:23 +01:00
commit 39808dd94f
18 changed files with 156 additions and 76 deletions

View File

@ -2368,7 +2368,7 @@ class Server{
$pk = new PlayerListPacket(); $pk = new PlayerListPacket();
$pk->type = PlayerListPacket::TYPE_ADD; $pk->type = PlayerListPacket::TYPE_ADD;
$pk->entries[] = PlayerListEntry::createAdditionEntry($uuid, $entityId, $name, "", 0, $skin, $xboxUserId); $pk->entries[] = PlayerListEntry::createAdditionEntry($uuid, $entityId, $name, $skin, $xboxUserId);
$this->broadcastPacket($players ?? $this->playerList, $pk); $this->broadcastPacket($players ?? $this->playerList, $pk);
} }
@ -2391,7 +2391,7 @@ class Server{
$pk = new PlayerListPacket(); $pk = new PlayerListPacket();
$pk->type = PlayerListPacket::TYPE_ADD; $pk->type = PlayerListPacket::TYPE_ADD;
foreach($this->playerList as $player){ foreach($this->playerList as $player){
$pk->entries[] = PlayerListEntry::createAdditionEntry($player->getUniqueId(), $player->getId(), $player->getDisplayName(), "", 0, $player->getSkin(), $player->getXuid()); $pk->entries[] = PlayerListEntry::createAdditionEntry($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkin(), $player->getXuid());
} }
$p->sendDataPacket($pk); $p->sendDataPacket($pk);

View File

@ -209,34 +209,38 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
public const DATA_FLAG_INTERESTED = 26; public const DATA_FLAG_INTERESTED = 26;
public const DATA_FLAG_CHARGED = 27; public const DATA_FLAG_CHARGED = 27;
public const DATA_FLAG_TAMED = 28; public const DATA_FLAG_TAMED = 28;
public const DATA_FLAG_LEASHED = 29; public const DATA_FLAG_ORPHANED = 29;
public const DATA_FLAG_SHEARED = 30; public const DATA_FLAG_LEASHED = 30;
public const DATA_FLAG_GLIDING = 31; public const DATA_FLAG_SHEARED = 31;
public const DATA_FLAG_ELDER = 32; public const DATA_FLAG_GLIDING = 32;
public const DATA_FLAG_MOVING = 33; public const DATA_FLAG_ELDER = 33;
public const DATA_FLAG_BREATHING = 34; public const DATA_FLAG_MOVING = 34;
public const DATA_FLAG_CHESTED = 35; public const DATA_FLAG_BREATHING = 35;
public const DATA_FLAG_STACKABLE = 36; public const DATA_FLAG_CHESTED = 36;
public const DATA_FLAG_SHOWBASE = 37; public const DATA_FLAG_STACKABLE = 37;
public const DATA_FLAG_REARING = 38; public const DATA_FLAG_SHOWBASE = 38;
public const DATA_FLAG_VIBRATING = 39; public const DATA_FLAG_REARING = 39;
public const DATA_FLAG_IDLING = 40; public const DATA_FLAG_VIBRATING = 40;
public const DATA_FLAG_EVOKER_SPELL = 41; public const DATA_FLAG_IDLING = 41;
public const DATA_FLAG_CHARGE_ATTACK = 42; public const DATA_FLAG_EVOKER_SPELL = 42;
public const DATA_FLAG_WASD_CONTROLLED = 43; public const DATA_FLAG_CHARGE_ATTACK = 43;
public const DATA_FLAG_CAN_POWER_JUMP = 44; public const DATA_FLAG_WASD_CONTROLLED = 44;
public const DATA_FLAG_LINGER = 45; public const DATA_FLAG_CAN_POWER_JUMP = 45;
public const DATA_FLAG_HAS_COLLISION = 46; public const DATA_FLAG_LINGER = 46;
public const DATA_FLAG_AFFECTED_BY_GRAVITY = 47; public const DATA_FLAG_HAS_COLLISION = 47;
public const DATA_FLAG_FIRE_IMMUNE = 48; public const DATA_FLAG_AFFECTED_BY_GRAVITY = 48;
public const DATA_FLAG_DANCING = 49; public const DATA_FLAG_FIRE_IMMUNE = 49;
public const DATA_FLAG_ENCHANTED = 50; public const DATA_FLAG_DANCING = 50;
public const DATA_FLAG_SHOW_TRIDENT_ROPE = 51; // tridents show an animated rope when enchanted with loyalty after they are thrown and return to their owner. To be combined with DATA_OWNER_EID public const DATA_FLAG_ENCHANTED = 51;
public const DATA_FLAG_CONTAINER_PRIVATE = 52; //inventory is private, doesn't drop contents when killed if true public const DATA_FLAG_SHOW_TRIDENT_ROPE = 52; // tridents show an animated rope when enchanted with loyalty after they are thrown and return to their owner. To be combined with DATA_OWNER_EID
//53 TransformationComponent public const DATA_FLAG_CONTAINER_PRIVATE = 53; //inventory is private, doesn't drop contents when killed if true
public const DATA_FLAG_SPIN_ATTACK = 54; //54 TransformationComponent
public const DATA_FLAG_SWIMMING = 55; public const DATA_FLAG_SPIN_ATTACK = 55;
public const DATA_FLAG_BRIBED = 56; //dolphins have this set when they go to find treasure for the player public const DATA_FLAG_SWIMMING = 56;
public const DATA_FLAG_BRIBED = 57; //dolphins have this set when they go to find treasure for the player
public const DATA_FLAG_PREGNANT = 58;
public const DATA_FLAG_LAYING_EGG = 59;
//60 ??
public static $entityCount = 1; public static $entityCount = 1;
/** @var Entity[] */ /** @var Entity[] */

View File

@ -846,7 +846,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
/* we don't use Server->updatePlayerListData() because that uses batches, which could cause race conditions in async compression mode */ /* we don't use Server->updatePlayerListData() because that uses batches, which could cause race conditions in async compression mode */
$pk = new PlayerListPacket(); $pk = new PlayerListPacket();
$pk->type = PlayerListPacket::TYPE_ADD; $pk->type = PlayerListPacket::TYPE_ADD;
$pk->entries = [PlayerListEntry::createAdditionEntry($this->uuid, $this->id, $this->getName(), $this->getName(), 0, $this->skin)]; $pk->entries = [PlayerListEntry::createAdditionEntry($this->uuid, $this->id, $this->getName(), $this->skin)];
$player->sendDataPacket($pk); $player->sendDataPacket($pk);
} }

View File

@ -95,7 +95,7 @@ class FloatingTextParticle extends Particle{
$add = new PlayerListPacket(); $add = new PlayerListPacket();
$add->type = PlayerListPacket::TYPE_ADD; $add->type = PlayerListPacket::TYPE_ADD;
$add->entries = [PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, $name, 0, new Skin("Standard_Custom", str_repeat("\x00", 8192)))]; $add->entries = [PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, new Skin("Standard_Custom", str_repeat("\x00", 8192)))];
$p[] = $add; $p[] = $add;
$pk = new AddPlayerPacket(); $pk = new AddPlayerPacket();

View File

@ -100,6 +100,7 @@ use pocketmine\network\mcpe\protocol\ResourcePacksInfoPacket;
use pocketmine\network\mcpe\protocol\ResourcePackStackPacket; use pocketmine\network\mcpe\protocol\ResourcePackStackPacket;
use pocketmine\network\mcpe\protocol\RespawnPacket; use pocketmine\network\mcpe\protocol\RespawnPacket;
use pocketmine\network\mcpe\protocol\RiderJumpPacket; use pocketmine\network\mcpe\protocol\RiderJumpPacket;
use pocketmine\network\mcpe\protocol\ScriptCustomEventPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket; use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsResponsePacket; use pocketmine\network\mcpe\protocol\ServerSettingsResponsePacket;
use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket; use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket;
@ -610,4 +611,8 @@ abstract class SessionHandler{
public function handleNetworkStackLatency(NetworkStackLatencyPacket $packet) : bool{ public function handleNetworkStackLatency(NetworkStackLatencyPacket $packet) : bool{
return false; return false;
} }
public function handleScriptCustomEvent(ScriptCustomEventPacket $packet) : bool{
return false;
}
} }

View File

@ -38,10 +38,6 @@ class AddPlayerPacket extends DataPacket{
public $uuid; public $uuid;
/** @var string */ /** @var string */
public $username; public $username;
/** @var string */
public $thirdPartyName = "";
/** @var int */
public $platform = 0;
/** @var int|null */ /** @var int|null */
public $entityUniqueId = null; //TODO public $entityUniqueId = null; //TODO
/** @var int */ /** @var int */
@ -81,8 +77,6 @@ class AddPlayerPacket extends DataPacket{
protected function decodePayload() : void{ protected function decodePayload() : void{
$this->uuid = $this->getUUID(); $this->uuid = $this->getUUID();
$this->username = $this->getString(); $this->username = $this->getString();
$this->thirdPartyName = $this->getString();
$this->platform = $this->getVarInt();
$this->entityUniqueId = $this->getEntityUniqueId(); $this->entityUniqueId = $this->getEntityUniqueId();
$this->entityRuntimeId = $this->getEntityRuntimeId(); $this->entityRuntimeId = $this->getEntityRuntimeId();
$this->platformChatId = $this->getString(); $this->platformChatId = $this->getString();
@ -113,8 +107,6 @@ class AddPlayerPacket extends DataPacket{
protected function encodePayload() : void{ protected function encodePayload() : void{
$this->putUUID($this->uuid); $this->putUUID($this->uuid);
$this->putString($this->username); $this->putString($this->username);
$this->putString($this->thirdPartyName);
$this->putVarInt($this->platform);
$this->putEntityUniqueId($this->entityUniqueId ?? $this->entityRuntimeId); $this->putEntityUniqueId($this->entityUniqueId ?? $this->entityRuntimeId);
$this->putEntityRuntimeId($this->entityRuntimeId); $this->putEntityRuntimeId($this->entityRuntimeId);
$this->putString($this->platformChatId); $this->putString($this->platformChatId);

View File

@ -40,6 +40,9 @@ class EventPacket extends DataPacket{
public const TYPE_BOSS_KILLED = 7; public const TYPE_BOSS_KILLED = 7;
public const TYPE_AGENT_COMMAND = 8; public const TYPE_AGENT_COMMAND = 8;
public const TYPE_AGENT_CREATED = 9; public const TYPE_AGENT_CREATED = 9;
public const TYPE_PATTERN_REMOVED = 10; //???
public const TYPE_COMMANED_EXECUTED = 11;
public const TYPE_FISH_BUCKETED = 12;
/** @var int */ /** @var int */
public $playerRuntimeId; public $playerRuntimeId;

View File

@ -147,6 +147,7 @@ class PacketPool{
static::registerPacket(new SetLocalPlayerAsInitializedPacket()); static::registerPacket(new SetLocalPlayerAsInitializedPacket());
static::registerPacket(new UpdateSoftEnumPacket()); static::registerPacket(new UpdateSoftEnumPacket());
static::registerPacket(new NetworkStackLatencyPacket()); static::registerPacket(new NetworkStackLatencyPacket());
static::registerPacket(new ScriptCustomEventPacket());
} }
/** /**

View File

@ -56,8 +56,6 @@ class PlayerListPacket extends DataPacket{
$entry->uuid = $this->getUUID(); $entry->uuid = $this->getUUID();
$entry->entityUniqueId = $this->getEntityUniqueId(); $entry->entityUniqueId = $this->getEntityUniqueId();
$entry->username = $this->getString(); $entry->username = $this->getString();
$entry->thirdPartyName = $this->getString();
$entry->platform = $this->getVarInt();
$skinId = $this->getString(); $skinId = $this->getString();
$skinData = $this->getString(); $skinData = $this->getString();
@ -90,8 +88,6 @@ class PlayerListPacket extends DataPacket{
$this->putUUID($entry->uuid); $this->putUUID($entry->uuid);
$this->putEntityUniqueId($entry->entityUniqueId); $this->putEntityUniqueId($entry->entityUniqueId);
$this->putString($entry->username); $this->putString($entry->username);
$this->putString($entry->thirdPartyName);
$this->putVarInt($entry->platform);
$this->putString($entry->skin->getSkinId()); $this->putString($entry->skin->getSkinId());
$this->putString($entry->skin->getSkinData()); $this->putString($entry->skin->getSkinData());
$this->putString($entry->skin->getCapeData()); $this->putString($entry->skin->getCapeData());

View File

@ -39,15 +39,15 @@ interface ProtocolInfo{
/** /**
* Actual Minecraft: PE protocol version * Actual Minecraft: PE protocol version
*/ */
public const CURRENT_PROTOCOL = 282; public const CURRENT_PROTOCOL = 291;
/** /**
* Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. * Current Minecraft PE version reported by the server. This is usually the earliest currently supported version.
*/ */
public const MINECRAFT_VERSION = 'v1.6.0'; public const MINECRAFT_VERSION = 'v1.7.0';
/** /**
* Version number sent to clients in ping responses. * Version number sent to clients in ping responses.
*/ */
public const MINECRAFT_VERSION_NETWORK = '1.6.0'; public const MINECRAFT_VERSION_NETWORK = '1.7.0';
public const LOGIN_PACKET = 0x01; public const LOGIN_PACKET = 0x01;
public const PLAY_STATUS_PACKET = 0x02; public const PLAY_STATUS_PACKET = 0x02;
@ -165,4 +165,6 @@ interface ProtocolInfo{
public const UPDATE_SOFT_ENUM_PACKET = 0x72; public const UPDATE_SOFT_ENUM_PACKET = 0x72;
public const NETWORK_STACK_LATENCY_PACKET = 0x73; public const NETWORK_STACK_LATENCY_PACKET = 0x73;
public const SCRIPT_CUSTOM_EVENT_PACKET = 0x75;
} }

View File

@ -0,0 +1,51 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
class ScriptCustomEventPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SCRIPT_CUSTOM_EVENT_PACKET;
/** @var string */
public $eventName;
/** @var string json data */
public $eventData;
protected function decodePayload() : void{
$this->eventName = $this->getString();
$this->eventData = $this->getString();
}
protected function encodePayload() : void{
$this->putString($this->eventName);
$this->putString($this->eventData);
}
public function handle(SessionHandler $handler) : bool{
return $handler->handleScriptCustomEvent($this);
}
}

View File

@ -31,8 +31,8 @@ use pocketmine\network\mcpe\protocol\types\ScorePacketEntry;
class SetScorePacket extends DataPacket{ class SetScorePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_SCORE_PACKET; public const NETWORK_ID = ProtocolInfo::SET_SCORE_PACKET;
public const TYPE_MODIFY_SCORE = 0; public const TYPE_CHANGE = 0;
public const TYPE_RESET_SCORE = 1; public const TYPE_REMOVE = 1;
/** @var int */ /** @var int */
public $type; public $type;
@ -43,9 +43,23 @@ class SetScorePacket extends DataPacket{
$this->type = $this->getByte(); $this->type = $this->getByte();
for($i = 0, $i2 = $this->getUnsignedVarInt(); $i < $i2; ++$i){ for($i = 0, $i2 = $this->getUnsignedVarInt(); $i < $i2; ++$i){
$entry = new ScorePacketEntry(); $entry = new ScorePacketEntry();
$entry->uuid = $this->getUUID(); $entry->scoreboardId = $this->getVarLong();
$entry->objectiveName = $this->getString(); $entry->objectiveName = $this->getString();
$entry->score = $this->getLInt(); $entry->score = $this->getLInt();
if($this->type !== self::TYPE_REMOVE){
$entry->type = $this->getByte();
switch($entry->type){
case ScorePacketEntry::TYPE_PLAYER:
case ScorePacketEntry::TYPE_ENTITY:
$entry->entityUniqueId = $this->getEntityUniqueId();
break;
case ScorePacketEntry::TYPE_FAKE_PLAYER:
$entry->customName = $this->getString();
break;
default:
throw new \UnexpectedValueException("Unknown entry type $entry->type");
}
}
} }
} }
@ -53,9 +67,23 @@ class SetScorePacket extends DataPacket{
$this->putByte($this->type); $this->putByte($this->type);
$this->putUnsignedVarInt(count($this->entries)); $this->putUnsignedVarInt(count($this->entries));
foreach($this->entries as $entry){ foreach($this->entries as $entry){
$this->putUUID($entry->uuid); $this->putVarLong($entry->scoreboardId);
$this->putString($entry->objectiveName); $this->putString($entry->objectiveName);
$this->putLInt($entry->score); $this->putLInt($entry->score);
if($this->type !== self::TYPE_REMOVE){
$this->putByte($entry->type);
switch($entry->type){
case ScorePacketEntry::TYPE_PLAYER:
case ScorePacketEntry::TYPE_ENTITY:
$this->putEntityUniqueId($entry->entityUniqueId);
break;
case ScorePacketEntry::TYPE_FAKE_PLAYER:
$this->putString($entry->customName);
break;
default:
throw new \UnexpectedValueException("Unknown entry type $entry->type");
}
}
} }
} }

View File

@ -45,7 +45,7 @@ class SetScoreboardIdentityPacket extends DataPacket{
$entry = new ScoreboardIdentityPacketEntry(); $entry = new ScoreboardIdentityPacketEntry();
$entry->scoreboardId = $this->getVarLong(); $entry->scoreboardId = $this->getVarLong();
if($this->type === self::TYPE_REGISTER_IDENTITY){ if($this->type === self::TYPE_REGISTER_IDENTITY){
$entry->uuid = $this->getUUID(); $entry->entityUniqueId = $this->getEntityUniqueId();
} }
$this->entries[] = $entry; $this->entries[] = $entry;
@ -58,7 +58,7 @@ class SetScoreboardIdentityPacket extends DataPacket{
foreach($this->entries as $entry){ foreach($this->entries as $entry){
$this->putVarLong($entry->scoreboardId); $this->putVarLong($entry->scoreboardId);
if($this->type === self::TYPE_REGISTER_IDENTITY){ if($this->type === self::TYPE_REGISTER_IDENTITY){
$this->putUUID($entry->uuid); $this->putEntityUniqueId($entry->entityUniqueId);
} }
} }
} }

View File

@ -116,6 +116,8 @@ class StartGamePacket extends DataPacket{
public $hasLockedResourcePack = false; public $hasLockedResourcePack = false;
/** @var bool */ /** @var bool */
public $isFromLockedWorldTemplate = false; public $isFromLockedWorldTemplate = false;
/** @var bool */
public $useMsaGamertagsOnly = false;
/** @var string */ /** @var string */
public $levelId = ""; //base64 string, usually the same as world folder name in vanilla public $levelId = ""; //base64 string, usually the same as world folder name in vanilla
@ -173,6 +175,7 @@ class StartGamePacket extends DataPacket{
$this->hasLockedBehaviorPack = $this->getBool(); $this->hasLockedBehaviorPack = $this->getBool();
$this->hasLockedResourcePack = $this->getBool(); $this->hasLockedResourcePack = $this->getBool();
$this->isFromLockedWorldTemplate = $this->getBool(); $this->isFromLockedWorldTemplate = $this->getBool();
$this->useMsaGamertagsOnly = $this->getBool();
$this->levelId = $this->getString(); $this->levelId = $this->getString();
$this->worldName = $this->getString(); $this->worldName = $this->getString();
@ -232,6 +235,7 @@ class StartGamePacket extends DataPacket{
$this->putBool($this->hasLockedBehaviorPack); $this->putBool($this->hasLockedBehaviorPack);
$this->putBool($this->hasLockedResourcePack); $this->putBool($this->hasLockedResourcePack);
$this->putBool($this->isFromLockedWorldTemplate); $this->putBool($this->isFromLockedWorldTemplate);
$this->putBool($this->useMsaGamertagsOnly);
$this->putString($this->levelId); $this->putString($this->levelId);
$this->putString($this->worldName); $this->putString($this->worldName);

View File

@ -48,10 +48,6 @@ class TextPacket extends DataPacket{
/** @var string */ /** @var string */
public $sourceName; public $sourceName;
/** @var string */ /** @var string */
public $sourceThirdPartyName = "";
/** @var int */
public $sourcePlatform = 0;
/** @var string */
public $message; public $message;
/** @var string[] */ /** @var string[] */
public $parameters = []; public $parameters = [];
@ -69,8 +65,6 @@ class TextPacket extends DataPacket{
/** @noinspection PhpMissingBreakStatementInspection */ /** @noinspection PhpMissingBreakStatementInspection */
case self::TYPE_ANNOUNCEMENT: case self::TYPE_ANNOUNCEMENT:
$this->sourceName = $this->getString(); $this->sourceName = $this->getString();
$this->sourceThirdPartyName = $this->getString();
$this->sourcePlatform = $this->getVarInt();
case self::TYPE_RAW: case self::TYPE_RAW:
case self::TYPE_TIP: case self::TYPE_TIP:
case self::TYPE_SYSTEM: case self::TYPE_SYSTEM:
@ -101,8 +95,6 @@ class TextPacket extends DataPacket{
/** @noinspection PhpMissingBreakStatementInspection */ /** @noinspection PhpMissingBreakStatementInspection */
case self::TYPE_ANNOUNCEMENT: case self::TYPE_ANNOUNCEMENT:
$this->putString($this->sourceName); $this->putString($this->sourceName);
$this->putString($this->sourceThirdPartyName);
$this->putVarInt($this->sourcePlatform);
case self::TYPE_RAW: case self::TYPE_RAW:
case self::TYPE_TIP: case self::TYPE_TIP:
case self::TYPE_SYSTEM: case self::TYPE_SYSTEM:

View File

@ -34,10 +34,6 @@ class PlayerListEntry{
public $entityUniqueId; public $entityUniqueId;
/** @var string */ /** @var string */
public $username; public $username;
/** @var string */
public $thirdPartyName = "";
/** @var int */
public $platform = 0;
/** @var Skin */ /** @var Skin */
public $skin; public $skin;
/** @var string */ /** @var string */
@ -52,13 +48,11 @@ class PlayerListEntry{
return $entry; return $entry;
} }
public static function createAdditionEntry(UUID $uuid, int $entityUniqueId, string $username, string $thirdPartyName, int $platform, Skin $skin, string $xboxUserId = "", string $platformChatId = "") : PlayerListEntry{ public static function createAdditionEntry(UUID $uuid, int $entityUniqueId, string $username, Skin $skin, string $xboxUserId = "", string $platformChatId = "") : PlayerListEntry{
$entry = new PlayerListEntry(); $entry = new PlayerListEntry();
$entry->uuid = $uuid; $entry->uuid = $uuid;
$entry->entityUniqueId = $entityUniqueId; $entry->entityUniqueId = $entityUniqueId;
$entry->username = $username; $entry->username = $username;
$entry->thirdPartyName = $thirdPartyName;
$entry->platform = $platform;
$entry->skin = $skin; $entry->skin = $skin;
$entry->xboxUserId = $xboxUserId; $entry->xboxUserId = $xboxUserId;
$entry->platformChatId = $platformChatId; $entry->platformChatId = $platformChatId;

View File

@ -23,13 +23,23 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types; namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\utils\UUID;
class ScorePacketEntry{ class ScorePacketEntry{
/** @var UUID */ public const TYPE_PLAYER = 1;
public $uuid; public const TYPE_ENTITY = 2;
public const TYPE_FAKE_PLAYER = 3;
/** @var int */
public $scoreboardId;
/** @var string */ /** @var string */
public $objectiveName; public $objectiveName;
/** @var int */ /** @var int */
public $score; public $score;
/** @var int */
public $type;
/** @var int|null (if type entity or player) */
public $entityUniqueId;
/** @var string|null (if type fake player) */
public $customName;
} }

View File

@ -23,12 +23,10 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types; namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\utils\UUID;
class ScoreboardIdentityPacketEntry{ class ScoreboardIdentityPacketEntry{
/** @var int */ /** @var int */
public $scoreboardId; public $scoreboardId;
/** @var UUID|null */ /** @var int|null */
public $uuid; public $entityUniqueId;
} }