ÂRakLib 0.15

This commit is contained in:
Dylan K. Taylor 2023-02-13 14:00:16 +00:00
parent 2d56aa50b9
commit 525f62e1e4
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 25 additions and 23 deletions

View File

@ -48,8 +48,8 @@
"pocketmine/log-pthreads": "^0.5.0",
"pocketmine/math": "^0.4.0",
"pocketmine/nbt": "^0.3.2",
"pocketmine/raklib": "^0.14.2",
"pocketmine/raklib-ipc": "^0.1.0",
"pocketmine/raklib": "^0.15.0",
"pocketmine/raklib-ipc": "^0.2.0",
"pocketmine/snooze": "^0.4.0",
"ramsey/uuid": "^4.1",
"symfony/filesystem": "^5.4"

36
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "627198dc2e7f08e616478e9ca8ce9ae7",
"content-hash": "4e1a995669862685144f13d26f45fd6d",
"packages": [
{
"name": "adhocore/json-comment",
@ -780,16 +780,16 @@
},
{
"name": "pocketmine/raklib",
"version": "0.14.5",
"version": "0.15.0",
"source": {
"type": "git",
"url": "https://github.com/pmmp/RakLib.git",
"reference": "85b4e5cb7117d37e010eeadb3ff53b21276c6f48"
"reference": "1f490cff6bf5e9eb46ebdbf7a7994d62be2bd2c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/85b4e5cb7117d37e010eeadb3ff53b21276c6f48",
"reference": "85b4e5cb7117d37e010eeadb3ff53b21276c6f48",
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/1f490cff6bf5e9eb46ebdbf7a7994d62be2bd2c1",
"reference": "1f490cff6bf5e9eb46ebdbf7a7994d62be2bd2c1",
"shasum": ""
},
"require": {
@ -801,7 +801,7 @@
"pocketmine/log": "^0.3.0 || ^0.4.0"
},
"require-dev": {
"phpstan/phpstan": "1.7.7",
"phpstan/phpstan": "1.9.17",
"phpstan/phpstan-strict-rules": "^1.0"
},
"type": "library",
@ -817,33 +817,33 @@
"description": "A RakNet server implementation written in PHP",
"support": {
"issues": "https://github.com/pmmp/RakLib/issues",
"source": "https://github.com/pmmp/RakLib/tree/0.14.5"
"source": "https://github.com/pmmp/RakLib/tree/0.15.0"
},
"time": "2022-08-25T16:16:44+00:00"
"time": "2023-02-13T12:56:35+00:00"
},
{
"name": "pocketmine/raklib-ipc",
"version": "0.1.1",
"version": "0.2.0",
"source": {
"type": "git",
"url": "https://github.com/pmmp/RakLibIpc.git",
"reference": "922a6444b0c6c7daaa5aa5a832107e1ec4738aed"
"reference": "26ed56fa9db06e4ca6e8920c0ede2e01e219bb9c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/RakLibIpc/zipball/922a6444b0c6c7daaa5aa5a832107e1ec4738aed",
"reference": "922a6444b0c6c7daaa5aa5a832107e1ec4738aed",
"url": "https://api.github.com/repos/pmmp/RakLibIpc/zipball/26ed56fa9db06e4ca6e8920c0ede2e01e219bb9c",
"reference": "26ed56fa9db06e4ca6e8920c0ede2e01e219bb9c",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"php-64bit": "*",
"pocketmine/binaryutils": "^0.2.0",
"pocketmine/raklib": "^0.13.1 || ^0.14.0"
"pocketmine/raklib": "^0.15.0"
},
"require-dev": {
"phpstan/phpstan": "0.12.81",
"phpstan/phpstan-strict-rules": "^0.12.2"
"phpstan/phpstan": "1.9.17",
"phpstan/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
"autoload": {
@ -858,9 +858,9 @@
"description": "Channel-based protocols for inter-thread/inter-process communication with RakLib",
"support": {
"issues": "https://github.com/pmmp/RakLibIpc/issues",
"source": "https://github.com/pmmp/RakLibIpc/tree/0.1.1"
"source": "https://github.com/pmmp/RakLibIpc/tree/0.2.0"
},
"time": "2021-09-22T17:01:12+00:00"
"time": "2023-02-13T13:40:40+00:00"
},
{
"name": "pocketmine/snooze",

View File

@ -39,6 +39,7 @@ use pocketmine\Server;
use pocketmine\snooze\SleeperNotifier;
use pocketmine\timings\Timings;
use pocketmine\utils\Utils;
use raklib\generic\DisconnectReason;
use raklib\generic\SocketException;
use raklib\protocol\EncapsulatedPacket;
use raklib\protocol\PacketReliability;
@ -142,11 +143,11 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{
}
}
public function onClientDisconnect(int $sessionId, string $reason) : void{
public function onClientDisconnect(int $sessionId, int $reason) : void{
if(isset($this->sessions[$sessionId])){
$session = $this->sessions[$sessionId];
unset($this->sessions[$sessionId]);
$session->onClientDisconnect($reason);
$session->onClientDisconnect(DisconnectReason::toString($reason));
}
}

View File

@ -31,6 +31,7 @@ use raklib\generic\SocketException;
use raklib\server\ipc\RakLibToUserThreadMessageSender;
use raklib\server\ipc\UserToRakLibThreadMessageReceiver;
use raklib\server\Server;
use raklib\server\ServerSocket;
use raklib\server\SimpleProtocolAcceptor;
use raklib\utils\ExceptionTraceCleaner;
use raklib\utils\InternetAddress;
@ -119,7 +120,7 @@ class RakLibServer extends Thread{
register_shutdown_function([$this, "shutdownHandler"]);
try{
$socket = new Socket($this->address->deserialize());
$socket = new ServerSocket($this->address->deserialize());
}catch(SocketException $e){
$this->setCrashInfo(RakLibThreadCrashInfo::fromThrowable($e));
return;