mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +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);
|
Level::getXZ($index, $chunkX, $chunkZ);
|
||||||
$chunkPlayers = $this->getChunkPlayers($chunkX, $chunkZ);
|
$chunkPlayers = $this->getChunkPlayers($chunkX, $chunkZ);
|
||||||
if(count($chunkPlayers) > 0){
|
if(count($chunkPlayers) > 0){
|
||||||
foreach($entries as $pk){
|
$this->server->batchPackets($chunkPlayers, $entries, false, false);
|
||||||
$this->server->broadcastPacket($chunkPlayers, $pk);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user