DataPacket now encapsulates NetworkBinaryStream instead of extending it

ultimately the goal is to remove the NetworkBinaryStream crap entirely, but this change has most of the same benefits and is less disruptive.
This commit is contained in:
Dylan K. Taylor
2020-02-24 18:59:54 +00:00
parent 7c2741e4f5
commit ce0af8b040
146 changed files with 1249 additions and 1269 deletions

View File

@ -38,15 +38,15 @@ class PhotoTransferPacket extends DataPacket implements ClientboundPacket{
public $bookId; //photos are stored in a sibling directory to the games folder (screenshots/(some UUID)/bookID/example.png)
protected function decodePayload() : void{
$this->photoName = $this->getString();
$this->photoData = $this->getString();
$this->bookId = $this->getString();
$this->photoName = $this->buf->getString();
$this->photoData = $this->buf->getString();
$this->bookId = $this->buf->getString();
}
protected function encodePayload() : void{
$this->putString($this->photoName);
$this->putString($this->photoData);
$this->putString($this->bookId);
$this->buf->putString($this->photoName);
$this->buf->putString($this->photoData);
$this->buf->putString($this->bookId);
}
public function handle(PacketHandler $handler) : bool{