mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
Found an unknown field in TextPacket and added some docs
This commit is contained in:
parent
1576a79644
commit
6480f7a989
@ -40,15 +40,20 @@ class TextPacket extends DataPacket{
|
|||||||
const TYPE_WHISPER = 6;
|
const TYPE_WHISPER = 6;
|
||||||
const TYPE_ANNOUNCEMENT = 7;
|
const TYPE_ANNOUNCEMENT = 7;
|
||||||
|
|
||||||
|
/** @var int */
|
||||||
public $type;
|
public $type;
|
||||||
public $unknownBool = false;
|
/** @var bool */
|
||||||
|
public $needsTranslation = false;
|
||||||
|
/** @var string */
|
||||||
public $source;
|
public $source;
|
||||||
|
/** @var string */
|
||||||
public $message;
|
public $message;
|
||||||
|
/** @var string[] */
|
||||||
public $parameters = [];
|
public $parameters = [];
|
||||||
|
|
||||||
protected function decodePayload(){
|
protected function decodePayload(){
|
||||||
$this->type = $this->getByte();
|
$this->type = $this->getByte();
|
||||||
$this->unknownBool = $this->getBool();
|
$this->needsTranslation = $this->getBool();
|
||||||
switch($this->type){
|
switch($this->type){
|
||||||
case self::TYPE_POPUP:
|
case self::TYPE_POPUP:
|
||||||
case self::TYPE_CHAT:
|
case self::TYPE_CHAT:
|
||||||
@ -73,7 +78,7 @@ class TextPacket extends DataPacket{
|
|||||||
|
|
||||||
protected function encodePayload(){
|
protected function encodePayload(){
|
||||||
$this->putByte($this->type);
|
$this->putByte($this->type);
|
||||||
$this->putBool($this->unknownBool);
|
$this->putBool($this->needsTranslation);
|
||||||
switch($this->type){
|
switch($this->type){
|
||||||
case self::TYPE_POPUP:
|
case self::TYPE_POPUP:
|
||||||
case self::TYPE_CHAT:
|
case self::TYPE_CHAT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user