mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Added 4 RCON threads
This commit is contained in:
parent
1cb3e25bf9
commit
d08807abaf
@ -35,4 +35,5 @@ require_once(FILE_PATH."/src/dependencies.php");
|
||||
$server = new ServerAPI();
|
||||
$server->start();
|
||||
|
||||
kill(getmypid()); //Fix for ConsoleAPI being blocked
|
||||
exit(0);
|
@ -54,7 +54,7 @@ class ConsoleAPI{
|
||||
$this->loop->stop = true;
|
||||
@fclose(STDIN);
|
||||
$this->loop->notify();
|
||||
$this->loop->join();
|
||||
//$this->loop->join();
|
||||
}
|
||||
|
||||
public function defaultCommands($cmd, $params, $issuer, $alias){
|
||||
|
@ -36,6 +36,23 @@ if(!function_exists("cli_set_process_title")){
|
||||
}
|
||||
}
|
||||
|
||||
function kill($pid){
|
||||
switch(Utils::getOS()){
|
||||
case "win":
|
||||
ob_start();
|
||||
passthru("%WINDIR%\\System32\\taskkill.exe /F /PID ".((int) $pid));
|
||||
ob_end_clean();
|
||||
break;
|
||||
case "mac":
|
||||
case "linux":
|
||||
default:
|
||||
ob_start();
|
||||
passthru("kill -9 ".((int) $pid));
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function require_all($path, &$count = 0){
|
||||
$dir = dir($path."/");
|
||||
$dirs = array();
|
||||
|
@ -30,7 +30,7 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
class RCON{
|
||||
private $socket, $password, $workers, $threads;
|
||||
|
||||
public function __construct($password, $port = 19132, $threads = 1){
|
||||
public function __construct($password, $port = 19132, $threads = 4){
|
||||
$this->workers = array();
|
||||
$this->password = (string) $password;
|
||||
console("[INFO] Starting remote control listener");
|
||||
|
Loading…
x
Reference in New Issue
Block a user