mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-30 06:55:11 +00:00
PreSpawnPacketHandler: added dedicated timer for the humongous amount of crap that has to be sent pre-spawn
This commit is contained in:
parent
b2f755720d
commit
61b0ad3e7f
@ -44,6 +44,7 @@ use pocketmine\network\mcpe\protocol\types\PlayerMovementType;
|
||||
use pocketmine\network\mcpe\protocol\types\SpawnSettings;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\timings\Timings;
|
||||
use pocketmine\VersionInfo;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use function sprintf;
|
||||
@ -60,6 +61,8 @@ class PreSpawnPacketHandler extends PacketHandler{
|
||||
){}
|
||||
|
||||
public function setUp() : void{
|
||||
Timings::$playerNetworkSendPreSpawnGameData->startTiming();
|
||||
try{
|
||||
$location = $this->player->getLocation();
|
||||
$world = $location->getWorld();
|
||||
|
||||
@ -143,6 +146,9 @@ class PreSpawnPacketHandler extends PacketHandler{
|
||||
|
||||
$this->session->getLogger()->debug("Sending player list");
|
||||
$this->session->syncPlayerList($this->server->getOnlinePlayers());
|
||||
}finally{
|
||||
Timings::$playerNetworkSendPreSpawnGameData->stopTiming();
|
||||
}
|
||||
}
|
||||
|
||||
public function handleRequestChunkRadius(RequestChunkRadiusPacket $packet) : bool{
|
||||
|
@ -68,6 +68,7 @@ abstract class Timings{
|
||||
public static $playerNetworkSendEncrypt;
|
||||
|
||||
public static TimingsHandler $playerNetworkSendInventorySync;
|
||||
public static TimingsHandler $playerNetworkSendPreSpawnGameData;
|
||||
|
||||
/** @var TimingsHandler */
|
||||
public static $playerNetworkReceive;
|
||||
@ -187,6 +188,7 @@ abstract class Timings{
|
||||
self::$playerNetworkSendCompressSessionBuffer = new TimingsHandler("Player Network Send - Compression (Session Buffer)", self::$playerNetworkSendCompress, group: self::GROUP_BREAKDOWN);
|
||||
self::$playerNetworkSendEncrypt = new TimingsHandler("Player Network Send - Encryption", self::$playerNetworkSend, group: self::GROUP_BREAKDOWN);
|
||||
self::$playerNetworkSendInventorySync = new TimingsHandler("Player Network Send - Inventory Sync", self::$playerNetworkSend, group: self::GROUP_BREAKDOWN);
|
||||
self::$playerNetworkSendPreSpawnGameData = new TimingsHandler("Player Network Send - Pre-Spawn Game Data", self::$playerNetworkSend, group: self::GROUP_BREAKDOWN);
|
||||
|
||||
self::$playerNetworkReceive = new TimingsHandler("Player Network Receive", self::$connection);
|
||||
self::$playerNetworkReceiveDecompress = new TimingsHandler("Player Network Receive - Decompression", self::$playerNetworkReceive, group: self::GROUP_BREAKDOWN);
|
||||
|
Loading…
x
Reference in New Issue
Block a user