mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Updated to latest RakLib bleeding edge
this version brings quite a few inter-thread communication improvements.
This commit is contained in:
parent
eb7c31d3ff
commit
f779881b6a
9
composer.lock
generated
9
composer.lock
generated
@ -529,16 +529,15 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pmmp/RakLib.git",
|
"url": "https://github.com/pmmp/RakLib.git",
|
||||||
"reference": "48c67e3325bc222cbba51de7bd5d7e9847b8de7b"
|
"reference": "76e8d9f15c5ecc0d08d39968023380a2086f0d31"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/48c67e3325bc222cbba51de7bd5d7e9847b8de7b",
|
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/76e8d9f15c5ecc0d08d39968023380a2086f0d31",
|
||||||
"reference": "48c67e3325bc222cbba51de7bd5d7e9847b8de7b",
|
"reference": "76e8d9f15c5ecc0d08d39968023380a2086f0d31",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-bcmath": "*",
|
|
||||||
"ext-pthreads": "~3.2.0",
|
"ext-pthreads": "~3.2.0",
|
||||||
"ext-sockets": "*",
|
"ext-sockets": "*",
|
||||||
"php": ">=7.2.0",
|
"php": ">=7.2.0",
|
||||||
@ -564,7 +563,7 @@
|
|||||||
"GPL-3.0"
|
"GPL-3.0"
|
||||||
],
|
],
|
||||||
"description": "A RakNet server implementation written in PHP",
|
"description": "A RakNet server implementation written in PHP",
|
||||||
"time": "2020-03-28T01:04:17+00:00"
|
"time": "2020-03-29T10:00:16+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pocketmine/snooze",
|
"name": "pocketmine/snooze",
|
||||||
|
@ -139,15 +139,15 @@ class RakLibInterface implements ServerInstance, AdvancedNetworkInterface{
|
|||||||
$this->sessions[$sessionId] = $session;
|
$this->sessions[$sessionId] = $session;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleEncapsulated(int $sessionId, EncapsulatedPacket $packet, int $flags) : void{
|
public function handleEncapsulated(int $sessionId, string $packet) : void{
|
||||||
if(isset($this->sessions[$sessionId])){
|
if(isset($this->sessions[$sessionId])){
|
||||||
if($packet->buffer === "" or $packet->buffer{0} !== self::MCPE_RAKNET_PACKET_ID){
|
if($packet === "" or $packet[0] !== self::MCPE_RAKNET_PACKET_ID){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//get this now for blocking in case the player was closed before the exception was raised
|
//get this now for blocking in case the player was closed before the exception was raised
|
||||||
$session = $this->sessions[$sessionId];
|
$session = $this->sessions[$sessionId];
|
||||||
$address = $session->getIp();
|
$address = $session->getIp();
|
||||||
$buf = substr($packet->buffer, 1);
|
$buf = substr($packet, 1);
|
||||||
try{
|
try{
|
||||||
$session->handleEncoded($buf);
|
$session->handleEncoded($buf);
|
||||||
}catch(BadPacketException $e){
|
}catch(BadPacketException $e){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user