mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Added RakNetDataPacket::reset() to all the packets
This commit is contained in:
parent
580ef46513
commit
f6ecf51516
@ -31,6 +31,7 @@ class AdventureSettingsPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->flags);
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ class ChatPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putString($this->message);
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,7 @@ class ContainerSetContentPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putShort(count($this->slots));
|
||||
foreach($this->slots as $slot){
|
||||
|
@ -33,6 +33,7 @@ class ContainerSetDataPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putShort($this->property);
|
||||
$this->putShort($this->value);
|
||||
|
@ -35,6 +35,7 @@ class ContainerSetSlotPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putShort($this->slot);
|
||||
$this->putSlot($this->item);
|
||||
|
@ -29,7 +29,7 @@ class DisconnectPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
}
|
@ -37,6 +37,7 @@ class EntityDataPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putShort($this->x);
|
||||
$this->putByte($this->y);
|
||||
$this->putShort($this->z);
|
||||
|
@ -30,7 +30,7 @@ class MoveEntityPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
}
|
@ -33,6 +33,7 @@ class SetSpawnPositionPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->x);
|
||||
$this->putInt($this->z);
|
||||
$this->putByte($this->y);
|
||||
|
@ -35,6 +35,7 @@ class UpdateBlockPacket extends RakNetDataPacket{
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->x);
|
||||
$this->putInt($this->z);
|
||||
$this->putByte($this->y);
|
||||
|
@ -144,9 +144,8 @@ class RakNetCodec{
|
||||
$this->putInt($pk->splitCount);
|
||||
$this->putShort($pk->splitID);
|
||||
$this->putInt($pk->splitIndex);
|
||||
}else{
|
||||
$this->putByte($pk->pid());
|
||||
}
|
||||
}
|
||||
|
||||
$this->buffer .= $pk->buffer;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user