mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
rename PacketStream to PacketBatch
This commit is contained in:
@ -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{
|
||||
|
@ -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
|
||||
|
@ -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();
|
Reference in New Issue
Block a user