Renamed LoginStatusPacket to PlayStatusPacket, added spawn status, new colors

This commit is contained in:
Shoghi Cervantes
2015-03-12 10:35:39 +01:00
parent 15ee0c37c6
commit 8ddd701d76
5 changed files with 43 additions and 32 deletions

View File

@ -49,7 +49,7 @@ use pocketmine\network\protocol\InteractPacket;
use pocketmine\network\protocol\LevelEventPacket;
use pocketmine\network\protocol\DisconnectPacket;
use pocketmine\network\protocol\LoginPacket;
use pocketmine\network\protocol\LoginStatusPacket;
use pocketmine\network\protocol\PlayStatusPacket;
use pocketmine\network\protocol\MessagePacket;
use pocketmine\network\protocol\MoveEntityPacket;
use pocketmine\network\protocol\MovePlayerPacket;
@ -306,7 +306,7 @@ class RakLibInterface implements ServerInstance, SourceInterface{
$this->packetPool = new \SplFixedArray(256);
$this->registerPacket(ProtocolInfo::LOGIN_PACKET, LoginPacket::class);
$this->registerPacket(ProtocolInfo::LOGIN_STATUS_PACKET, LoginStatusPacket::class);
$this->registerPacket(ProtocolInfo::PLAY_STATUS_PACKET, PlayStatusPacket::class);
$this->registerPacket(ProtocolInfo::DISCONNECT_PACKET, DisconnectPacket::class);
$this->registerPacket(ProtocolInfo::MESSAGE_PACKET, MessagePacket::class);
$this->registerPacket(ProtocolInfo::SET_TIME_PACKET, SetTimePacket::class);

View File

@ -33,7 +33,7 @@ interface Info{
const CURRENT_PROTOCOL = 21;
const LOGIN_PACKET = 0x82;
const LOGIN_STATUS_PACKET = 0x83;
const PLAY_STATUS_PACKET = 0x83;
const DISCONNECT_PACKET = 0x84;

View File

@ -24,14 +24,20 @@ namespace pocketmine\network\protocol;
#include <rules/DataPacket.h>
class LoginStatusPacket extends DataPacket{
class PlayStatusPacket extends DataPacket{
const LOGIN_SUCCESS = 0;
const LOGIN_FAILED_CLIENT = 1;
const LOGIN_FAILED_SERVER = 2;
const PLAYER_SPAWN = 3;
public static $pool = [];
public static $next = 0;
public $status;
public function pid(){
return Info::LOGIN_STATUS_PACKET;
return Info::PLAY_STATUS_PACKET;
}
public function decode(){
@ -43,4 +49,4 @@ class LoginStatusPacket extends DataPacket{
$this->putInt($this->status);
}
}
}