mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
skins fixed and added SetPlayerGameTypePacket
This commit is contained in:
@ -74,6 +74,7 @@ use pocketmine\network\protocol\TakeItemEntityPacket;
|
||||
use pocketmine\network\protocol\BlockEventPacket;
|
||||
use pocketmine\network\protocol\UpdateBlockPacket;
|
||||
use pocketmine\network\protocol\UseItemPacket;
|
||||
use pocketmine\network\protocol\SetPlayerGameTypePacket;
|
||||
use pocketmine\network\protocol\PlayerListPacket;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\Server;
|
||||
@ -352,6 +353,7 @@ class Network{
|
||||
$this->registerPacket(ProtocolInfo::BLOCK_ENTITY_DATA_PACKET, BlockEntityDataPacket::class);
|
||||
$this->registerPacket(ProtocolInfo::FULL_CHUNK_DATA_PACKET, FullChunkDataPacket::class);
|
||||
$this->registerPacket(ProtocolInfo::SET_DIFFICULTY_PACKET, SetDifficultyPacket::class);
|
||||
$this->registerPacket(ProtocolInfo::SET_PLAYER_GAMETYPE_PACKET, SetPlayerGameTypePacket::class);
|
||||
$this->registerPacket(ProtocolInfo::PLAYER_LIST_PACKET, PlayerListPacket::class);
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ interface Info{
|
||||
const FULL_CHUNK_DATA_PACKET = 0xbf;
|
||||
const SET_DIFFICULTY_PACKET = 0xc0;
|
||||
//const CHANGE_DIMENSION_PACKET = 0xc1;
|
||||
//const SET_PLAYER_GAMETYPE_PACKET = 0xc2;
|
||||
const SET_PLAYER_GAMETYPE_PACKET = 0xc2;
|
||||
const PLAYER_LIST_PACKET = 0xc3;
|
||||
//const TELEMETRY_EVENT_PACKET = 0xc4;
|
||||
//const SPAWN_EXPERIENCE_ORB_PACKET = 0xc5
|
||||
|
@ -52,8 +52,8 @@ class LoginPacket extends DataPacket{
|
||||
$this->serverAddress = $this->getString();
|
||||
$this->clientSecret = $this->getString();
|
||||
|
||||
$this->getByte(); // TODO: skin transparency, experimental or not?
|
||||
$this->slim = $this->getByte() > 0;
|
||||
$this->getByte(); // TODO: skin transparency, experimental or not?
|
||||
$this->skin = $this->getString();
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,8 @@ class PlayerListPacket extends DataPacket{
|
||||
$this->putUUID($d[0]);
|
||||
$this->putLong($d[1]);
|
||||
$this->putString($d[2]);
|
||||
$this->putByte(0); // TODO: skin transparency, experimental or not?
|
||||
$this->putByte($d[3] ? 1 : 0);
|
||||
$this->putByte(0); // TODO: skin transparency, experimental or not?
|
||||
$this->putString($d[4]);
|
||||
}else{
|
||||
$this->putUUID($d[0]);
|
||||
|
41
src/pocketmine/network/protocol/SetPlayerGameTypePacket.php
Normal file
41
src/pocketmine/network/protocol/SetPlayerGameTypePacket.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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 SetPlayerGameTypePacket extends DataPacket{
|
||||
const NETWORK_ID = Info::SET_PLAYER_GAMETYPE_PACKET;
|
||||
|
||||
public $gamemode;
|
||||
|
||||
public function decode(){
|
||||
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->gamemode);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user