mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
RakLibInterface: include Snooze events in Connection Handler timings
This commit is contained in:
parent
664089861a
commit
a8556dff02
@ -36,6 +36,8 @@ use pocketmine\network\NetworkInterfaceStartException;
|
||||
use pocketmine\network\PacketHandlingException;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\snooze\SleeperNotifier;
|
||||
use pocketmine\timings\Timings;
|
||||
use pocketmine\timings\TimingsHandler;
|
||||
use pocketmine\utils\Utils;
|
||||
use raklib\generic\SocketException;
|
||||
use raklib\protocol\EncapsulatedPacket;
|
||||
@ -110,7 +112,12 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
|
||||
|
||||
public function start() : void{
|
||||
$this->server->getTickSleeper()->addNotifier($this->sleeper, function() : void{
|
||||
while($this->eventReceiver->handle($this));
|
||||
Timings::$connection->startTiming();
|
||||
try{
|
||||
while($this->eventReceiver->handle($this));
|
||||
}finally{
|
||||
Timings::$connection->stopTiming();
|
||||
}
|
||||
});
|
||||
$this->server->getLogger()->debug("Waiting for RakLib to start...");
|
||||
try{
|
||||
|
Loading…
x
Reference in New Issue
Block a user