Added DataPacketBroadcastEvent, refactor broadcast handling, close #1521

batchPackets() is now considered internal and shouldn't be used by plugins.

Added Server->broadcastPackets(Player[], DataPacket[]) : bool
This commit is contained in:
Dylan K. Taylor
2018-08-02 15:54:30 +01:00
parent c345e6f22c
commit 7560880168
4 changed files with 140 additions and 37 deletions

View File

@ -202,7 +202,9 @@ class NetworkSession{
}
//TODO: implement buffering (this is just a quick fix)
$this->server->batchPackets([$this->player], [$packet], true, $immediate);
$stream = new PacketStream();
$stream->putPacket($packet);
$this->server->batchPackets([$this], $stream, true, $immediate);
return true;
}finally{