Added RakNetDataPacket::reset() to all the packets

This commit is contained in:
Shoghi Cervantes 2014-02-08 00:48:00 +01:00
parent 580ef46513
commit f6ecf51516
11 changed files with 12 additions and 5 deletions

View File

@ -31,6 +31,7 @@ class AdventureSettingsPacket extends RakNetDataPacket{
}
public function encode(){
$this->reset();
$this->putInt($this->flags);
}

View File

@ -31,6 +31,7 @@ class ChatPacket extends RakNetDataPacket{
}
public function encode(){
$this->reset();
$this->putString($this->message);
}

View File

@ -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){

View File

@ -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);

View File

@ -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);

View File

@ -29,7 +29,7 @@ class DisconnectPacket extends RakNetDataPacket{
}
public function encode(){
$this->reset();
}
}

View File

@ -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);

View File

@ -30,7 +30,7 @@ class MoveEntityPacket extends RakNetDataPacket{
}
public function encode(){
$this->reset();
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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;
}