Kill BatchPacket, clean up batching related things

DataPacketSendEvent and DataPacketReceiveEvent will no longer capture BatchPackets
In most places strings are now used instead of DataPackets, to remove limitations on what data can be sent to a network interface
Removed CraftingManager's cyclic dependency on Server

There is a lot more work to do aside from this, but this commit is intended to clean up what is necessary to fix the handling of BatchPacket.
This commit is contained in:
Dylan K. Taylor
2018-07-19 14:52:34 +01:00
parent 85647c03bf
commit bdd9a7eb52
15 changed files with 152 additions and 256 deletions

View File

@@ -26,7 +26,6 @@ declare(strict_types=1);
*/
namespace pocketmine\network;
use pocketmine\network\mcpe\protocol\DataPacket;
use pocketmine\Player;
/**
@@ -42,14 +41,14 @@ interface NetworkInterface{
/**
* Sends a DataPacket to the interface, returns an unique identifier for the packet if $needACK is true
*
* @param Player $player
* @param DataPacket $packet
* @param bool $needACK
* @param bool $immediate
* @param Player $player
* @param string $payload
* @param bool $needACK
* @param bool $immediate
*
* @return int|null
*/
public function putPacket(Player $player, DataPacket $packet, bool $needACK = false, bool $immediate = true) : ?int;
public function putPacket(Player $player, string $payload, bool $needACK = false, bool $immediate = true) : ?int;
/**
* Terminates the connection