mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
Merge #3456: Added protocol DeviceOS constants
close #3456 since this is a protocol addition and not API, this belongs on stable so that protocol changes can consistently use it without worrying about branch compatibility.
This commit is contained in:
parent
f5a49b6d55
commit
25fb5140a2
@ -28,6 +28,7 @@ namespace pocketmine\network\mcpe\protocol;
|
|||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\network\mcpe\NetworkSession;
|
use pocketmine\network\mcpe\NetworkSession;
|
||||||
|
use pocketmine\network\mcpe\protocol\types\DeviceOS;
|
||||||
use pocketmine\network\mcpe\protocol\types\EntityLink;
|
use pocketmine\network\mcpe\protocol\types\EntityLink;
|
||||||
use pocketmine\utils\UUID;
|
use pocketmine\utils\UUID;
|
||||||
use function count;
|
use function count;
|
||||||
@ -84,7 +85,7 @@ class AddPlayerPacket extends DataPacket{
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
public $deviceId = ""; //TODO: fill player's device ID (???)
|
public $deviceId = ""; //TODO: fill player's device ID (???)
|
||||||
/** @var int */
|
/** @var int */
|
||||||
public $buildPlatform = -1;
|
public $buildPlatform = DeviceOS::UNKNOWN;
|
||||||
|
|
||||||
protected function decodePayload(){
|
protected function decodePayload(){
|
||||||
$this->uuid = $this->getUUID();
|
$this->uuid = $this->getUUID();
|
||||||
|
44
src/pocketmine/network/mcpe/protocol/types/DeviceOS.php
Normal file
44
src/pocketmine/network/mcpe/protocol/types/DeviceOS.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?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\types;
|
||||||
|
|
||||||
|
final class DeviceOS{
|
||||||
|
|
||||||
|
public const UNKNOWN = -1;
|
||||||
|
public const ANDROID = 1;
|
||||||
|
public const IOS = 2;
|
||||||
|
public const OSX = 3;
|
||||||
|
public const AMAZON = 4;
|
||||||
|
public const GEAR_VR = 5;
|
||||||
|
public const HOLOLENS = 6;
|
||||||
|
public const WINDOWS_10 = 7;
|
||||||
|
public const WIN32 = 8;
|
||||||
|
public const DEDICATED = 9;
|
||||||
|
public const TVOS = 10;
|
||||||
|
public const PLAYSTATION = 11;
|
||||||
|
public const NINTENDO = 12;
|
||||||
|
public const XBOX = 13;
|
||||||
|
public const WINDOWS_PHONE = 14;
|
||||||
|
|
||||||
|
}
|
@ -40,7 +40,7 @@ class PlayerListEntry{
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
public $platformChatId = "";
|
public $platformChatId = "";
|
||||||
/** @var int */
|
/** @var int */
|
||||||
public $buildPlatform = -1;
|
public $buildPlatform = DeviceOS::UNKNOWN;
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
public $isTeacher = false;
|
public $isTeacher = false;
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user