rename PacketStream to PacketBatch

This commit is contained in:
Dylan K. Taylor
2019-05-06 19:58:02 +01:00
parent ce61c6e0fd
commit 427e334426
5 changed files with 13 additions and 13 deletions

View File

@ -57,7 +57,7 @@ class ChunkRequestTask extends AsyncTask{
$pk->chunkZ = $this->chunkZ;
$pk->data = $this->chunk;
$this->setResult(NetworkCompression::compress(PacketStream::fromPackets($pk)->getBuffer(), $this->compressionLevel));
$this->setResult(NetworkCompression::compress(PacketBatch::fromPackets($pk)->getBuffer(), $this->compressionLevel));
}
public function onError() : void{

View File

@ -119,7 +119,7 @@ class NetworkSession{
/** @var NetworkCipher */
private $cipher;
/** @var PacketStream|null */
/** @var PacketBatch|null */
private $sendBuffer;
/** @var \SplQueue|CompressBatchPromise[] */
@ -264,7 +264,7 @@ class NetworkSession{
Timings::$playerNetworkReceiveDecompressTimer->startTiming();
try{
$stream = new PacketStream(NetworkCompression::decompress($payload));
$stream = new PacketBatch(NetworkCompression::decompress($payload));
}catch(\ErrorException $e){
$this->logger->debug("Failed to decompress packet: " . bin2hex($payload));
//TODO: this isn't incompatible game version if we already established protocol version
@ -359,7 +359,7 @@ class NetworkSession{
$timings->startTiming();
try{
if($this->sendBuffer === null){
$this->sendBuffer = new PacketStream();
$this->sendBuffer = new PacketBatch();
}
$this->sendBuffer->putPacket($packet);
$this->manager->scheduleUpdate($this); //schedule flush at end of tick

View File

@ -27,7 +27,7 @@ use pocketmine\network\mcpe\protocol\Packet;
use pocketmine\network\mcpe\protocol\PacketPool;
use pocketmine\utils\BinaryDataException;
class PacketStream extends NetworkBinaryStream{
class PacketBatch extends NetworkBinaryStream{
public function putPacket(Packet $packet) : void{
if(!$packet->isEncoded()){
@ -49,7 +49,7 @@ class PacketStream extends NetworkBinaryStream{
*
* @param Packet ...$packets
*
* @return PacketStream
* @return PacketBatch
*/
public static function fromPackets(Packet ...$packets) : self{
$result = new self();