0.9.0 clients can join

This commit is contained in:
Shoghi Cervantes
2014-06-09 23:47:09 +02:00
parent fb46faa320
commit 3fbc411e17
9 changed files with 127 additions and 46 deletions

View File

@@ -73,6 +73,7 @@ use pocketmine\network\protocol\StartGamePacket;
use pocketmine\network\protocol\TakeItemEntityPacket;
use pocketmine\network\protocol\TileEventPacket;
use pocketmine\network\protocol\UnknownPacket;
use pocketmine\network\protocol\UnloadChunkPacket;
use pocketmine\network\protocol\UpdateBlockPacket;
use pocketmine\network\protocol\UseItemPacket;
use pocketmine\Player;
@@ -263,9 +264,6 @@ class RakLibInterface implements ServerInstance, SourceInterface{
case ProtocolInfo::REQUEST_CHUNK_PACKET:
$data = new RequestChunkPacket();
break;
case ProtocolInfo::CHUNK_DATA_PACKET:
$data = new ChunkDataPacket();
break;
case ProtocolInfo::PLAYER_EQUIPMENT_PACKET:
$data = new PlayerEquipmentPacket();
break;
@@ -332,6 +330,9 @@ class RakLibInterface implements ServerInstance, SourceInterface{
case ProtocolInfo::ENTITY_DATA_PACKET:
$data = new EntityDataPacket();
break;
case ProtocolInfo::UNLOAD_CHUNK_PACKET:
$data = new UnloadChunkPacket();
break;
default:
$data = new UnknownPacket();
$data->packetID = $pid;

View File

@@ -0,0 +1,43 @@
<?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;
class FullChunkDataPacket extends DataPacket{
public $chunkX;
public $chunkZ;
public $data;
public function pid(){
return Info::FULL_CHUNK_DATA_PACKET;
}
public function decode(){
}
public function encode(){
$this->reset();
$this->put($this->data);
}
}

View File

@@ -30,7 +30,7 @@ interface Info{
/**
* Actual Minecraft: PE protocol version
*/
const CURRENT_PROTOCOL = 15;
const CURRENT_PROTOCOL = 14; //WTF Mojang
const LOGIN_PACKET = 0x82;
@@ -61,7 +61,7 @@ interface Info{
const TILE_EVENT_PACKET = 0x9c;
const ENTITY_EVENT_PACKET = 0x9d;
const REQUEST_CHUNK_PACKET = 0x9e;
const CHUNK_DATA_PACKET = 0x9f;
const PLAYER_EQUIPMENT_PACKET = 0xa0;
const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa1;
const INTERACT_PACKET = 0xa2;
@@ -88,5 +88,7 @@ interface Info{
const ADVENTURE_SETTINGS_PACKET = 0xb7;
const ENTITY_DATA_PACKET = 0xb8;
//const PLAYER_INPUT_PACKET = 0xb9;
const FULL_CHUNK_DATA_PACKET = 0xba;
const UNLOAD_CHUNK_PACKET = 0xbb;
}

View File

@@ -41,7 +41,7 @@ class LevelEventPacket extends DataPacket{
$this->reset();
$this->putShort($this->evid);
$this->putInt($this->x);
$this->putInt($this->y);
$this->putShort($this->y);
$this->putInt($this->z);
$this->putInt($this->data);
}

View File

@@ -30,11 +30,15 @@ class ReadyPacket extends DataPacket{
}
public function decode(){
$this->status = $this->getByte();
$this->x = $this->getFloat();
$this->y = $this->getFloat();
$this->z = $this->getFloat();
}
public function encode(){
$this->putFloat($this->x);
$this->putFloat($this->y);
$this->putFloat($this->z);
}
}

View File

@@ -22,13 +22,12 @@
namespace pocketmine\network\protocol;
class ChunkDataPacket extends DataPacket{
class UnloadChunkPacket extends DataPacket{
public $chunkX;
public $chunkZ;
public $data;
public function pid(){
return Info::CHUNK_DATA_PACKET;
return Info::UNLOAD_CHUNK_PACKET;
}
public function decode(){
@@ -39,7 +38,6 @@ class ChunkDataPacket extends DataPacket{
$this->reset();
$this->putInt($this->chunkX);
$this->putInt($this->chunkZ);
$this->put($this->data);
}
}