mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Send area broadcasted packets in batches
- I don't know why it wasn't done like this to start with - This provides a significant lightening of workload for large servers with lots of players in the same area because packets are only compressed once instead of for each player. - Improves client-sided performance receiving these in batches instead of being spammed with many individual packets.
This commit is contained in:
parent
c6e800cf42
commit
29e88d8592
@ -786,9 +786,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
Level::getXZ($index, $chunkX, $chunkZ);
|
||||
$chunkPlayers = $this->getChunkPlayers($chunkX, $chunkZ);
|
||||
if(count($chunkPlayers) > 0){
|
||||
foreach($entries as $pk){
|
||||
$this->server->broadcastPacket($chunkPlayers, $pk);
|
||||
}
|
||||
$this->server->batchPackets($chunkPlayers, $entries, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user