mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Merge branch 'mcpe-1.0.3.0'
This commit is contained in:
commit
f5e39ea9ad
@ -90,6 +90,7 @@ use pocketmine\network\protocol\SpawnExperienceOrbPacket;
|
||||
use pocketmine\network\protocol\StartGamePacket;
|
||||
use pocketmine\network\protocol\TakeItemEntityPacket;
|
||||
use pocketmine\network\protocol\TextPacket;
|
||||
use pocketmine\network\protocol\TransferPacket;
|
||||
use pocketmine\network\protocol\UpdateBlockPacket;
|
||||
use pocketmine\network\protocol\UseItemPacket;
|
||||
use pocketmine\Player;
|
||||
@ -365,6 +366,7 @@ class Network{
|
||||
$this->registerPacket(ProtocolInfo::START_GAME_PACKET, StartGamePacket::class);
|
||||
$this->registerPacket(ProtocolInfo::TAKE_ITEM_ENTITY_PACKET, TakeItemEntityPacket::class);
|
||||
$this->registerPacket(ProtocolInfo::TEXT_PACKET, TextPacket::class);
|
||||
$this->registerPacket(ProtocolInfo::TRANSFER_PACKET, TransferPacket::class);
|
||||
$this->registerPacket(ProtocolInfo::UPDATE_BLOCK_PACKET, UpdateBlockPacket::class);
|
||||
$this->registerPacket(ProtocolInfo::USE_ITEM_PACKET, UseItemPacket::class);
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ interface Info{
|
||||
/**
|
||||
* Actual Minecraft: PE protocol version
|
||||
*/
|
||||
const CURRENT_PROTOCOL = 100;
|
||||
const MINECRAFT_VERSION = "v1.0.0.16";
|
||||
const MINECRAFT_VERSION_NETWORK = "1.0.0.16";
|
||||
const CURRENT_PROTOCOL = 101;
|
||||
const MINECRAFT_VERSION = "v1.0.3.0";
|
||||
const MINECRAFT_VERSION_NETWORK = "1.0.3.0";
|
||||
|
||||
const LOGIN_PACKET = 0x01;
|
||||
const PLAY_STATUS_PACKET = 0x02;
|
||||
@ -115,5 +115,6 @@ interface Info{
|
||||
const RESOURCE_PACK_DATA_INFO_PACKET = 0x4f;
|
||||
const RESOURCE_PACK_CHUNK_DATA_PACKET = 0x50;
|
||||
const RESOURCE_PACK_CHUNK_REQUEST_PACKET = 0x51;
|
||||
const TRANSFER_PACKET = 0x52;
|
||||
|
||||
}
|
@ -40,6 +40,8 @@ class LoginPacket extends DataPacket{
|
||||
public $skinId;
|
||||
public $skin = null;
|
||||
|
||||
public $clientData = [];
|
||||
|
||||
public function decode(){
|
||||
$this->protocol = $this->getInt();
|
||||
|
||||
@ -70,18 +72,14 @@ class LoginPacket extends DataPacket{
|
||||
}
|
||||
}
|
||||
|
||||
$skinToken = $this->decodeToken($this->get($this->getLInt()));
|
||||
if(isset($skinToken["ClientRandomId"])){
|
||||
$this->clientId = $skinToken["ClientRandomId"];
|
||||
}
|
||||
if(isset($skinToken["ServerAddress"])){
|
||||
$this->serverAddress = $skinToken["ServerAddress"];
|
||||
}
|
||||
if(isset($skinToken["SkinData"])){
|
||||
$this->skin = base64_decode($skinToken["SkinData"]);
|
||||
}
|
||||
if(isset($skinToken["SkinId"])){
|
||||
$this->skinId = $skinToken["SkinId"];
|
||||
$this->clientData = $this->decodeToken($this->get($this->getLInt()));
|
||||
|
||||
$this->clientId = $this->clientData["ClientRandomId"] ?? null;
|
||||
$this->serverAddress = $this->clientData["ServerAddress"] ?? null;
|
||||
$this->skinId = $this->clientData["SkinId"] ?? null;
|
||||
|
||||
if(isset($this->clientData["SkinData"])){
|
||||
$this->skin = base64_decode($this->clientData["SkinData"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
42
src/pocketmine/network/protocol/TransferPacket.php
Normal file
42
src/pocketmine/network/protocol/TransferPacket.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?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/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\network\protocol;
|
||||
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
class TransferPacket extends DataPacket{
|
||||
const NETWORK_ID = Info::TRANSFER_PACKET;
|
||||
|
||||
public $address;
|
||||
public $port = 19132;
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putString($this->address);
|
||||
$this->putLShort($this->port);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user