From eaf6e19a6fef36f98a0ad06fd2d3227608237426 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 12 Dec 2020 19:54:17 +0000 Subject: [PATCH] RakLib sync n.2 --- composer.lock | 8 ++++---- src/network/mcpe/raklib/RakLibInterface.php | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index 75fc95c3f2..2d95ce1479 100644 --- a/composer.lock +++ b/composer.lock @@ -637,12 +637,12 @@ "source": { "type": "git", "url": "https://github.com/pmmp/RakLib.git", - "reference": "4272f15bc47941b59e1d597ca544465f4a59725e" + "reference": "31e513ee53adf8e32cabad072a50f8572f6dfb12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/RakLib/zipball/4272f15bc47941b59e1d597ca544465f4a59725e", - "reference": "4272f15bc47941b59e1d597ca544465f4a59725e", + "url": "https://api.github.com/repos/pmmp/RakLib/zipball/31e513ee53adf8e32cabad072a50f8572f6dfb12", + "reference": "31e513ee53adf8e32cabad072a50f8572f6dfb12", "shasum": "" }, "require": { @@ -672,7 +672,7 @@ "issues": "https://github.com/pmmp/RakLib/issues", "source": "https://github.com/pmmp/RakLib/tree/master" }, - "time": "2020-12-12T02:09:57+00:00" + "time": "2020-12-12T19:33:03+00:00" }, { "name": "pocketmine/snooze", diff --git a/src/network/mcpe/raklib/RakLibInterface.php b/src/network/mcpe/raklib/RakLibInterface.php index 4a8c16a0c2..337f71ab97 100644 --- a/src/network/mcpe/raklib/RakLibInterface.php +++ b/src/network/mcpe/raklib/RakLibInterface.php @@ -138,7 +138,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ } } - public function closeSession(int $sessionId, string $reason) : void{ + public function onClientDisconnect(int $sessionId, string $reason) : void{ if(isset($this->sessions[$sessionId])){ $session = $this->sessions[$sessionId]; unset($this->sessions[$sessionId]); @@ -158,7 +158,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ $this->rakLib->quit(); } - public function openSession(int $sessionId, string $address, int $port, int $clientID) : void{ + public function onClientConnect(int $sessionId, string $address, int $port, int $clientID) : void{ $session = new NetworkSession( $this->server, $this->network->getSessionManager(), @@ -172,7 +172,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ $this->sessions[$sessionId] = $session; } - public function handleEncapsulated(int $sessionId, string $packet) : void{ + public function onPacketReceive(int $sessionId, string $packet) : void{ if(isset($this->sessions[$sessionId])){ if($packet === "" or $packet[0] !== self::MCPE_RAKNET_PACKET_ID){ return; @@ -208,7 +208,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ $this->interface->unblockAddress($address); } - public function handleRaw(string $address, int $port, string $payload) : void{ + public function onRawPacketReceive(string $address, int $port, string $payload) : void{ $this->network->processRawPacket($this, $address, $port, $payload); } @@ -220,7 +220,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ $this->interface->addRawPacketFilter($regex); } - public function notifyACK(int $sessionId, int $identifierACK) : void{ + public function onPacketAck(int $sessionId, int $identifierACK) : void{ } @@ -250,7 +250,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ $this->interface->setPacketsPerTickLimit($limit); } - public function handleBandwidthStats(int $bytesSentDiff, int $bytesReceivedDiff) : void{ + public function onBandwidthStatsUpdate(int $bytesSentDiff, int $bytesReceivedDiff) : void{ $this->network->getBandwidthTracker()->add($bytesSentDiff, $bytesReceivedDiff); } @@ -265,7 +265,7 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ } } - public function updatePing(int $sessionId, int $pingMS) : void{ + public function onPingMeasure(int $sessionId, int $pingMS) : void{ if(isset($this->sessions[$sessionId])){ $this->sessions[$sessionId]->updatePing($pingMS); }