Added 4 RCON threads

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-22 14:29:30 +02:00
parent 1cb3e25bf9
commit d08807abaf
4 changed files with 20 additions and 2 deletions

View File

@ -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);

View File

@ -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){

View File

@ -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();

View File

@ -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");