mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 15:49:54 +00:00
Fix packet buffers when encoding twice
This commit is contained in:
parent
711d62b5eb
commit
d9da9accbc
@ -84,6 +84,7 @@ abstract class DataPacket extends BinaryStream{
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->encodeHeader();
|
||||
$this->encodePayload();
|
||||
$this->isEncoded = true;
|
||||
}
|
||||
@ -114,11 +115,6 @@ abstract class DataPacket extends BinaryStream{
|
||||
*/
|
||||
abstract public function handle(NetworkSession $session) : bool;
|
||||
|
||||
public function reset(){
|
||||
$this->encodeHeader();
|
||||
$this->offset = 0;
|
||||
}
|
||||
|
||||
public function clean(){
|
||||
$this->buffer = null;
|
||||
$this->isEncoded = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user