Update to API 12

This commit is contained in:
kotyaralih 2022-01-08 09:13:51 -08:00
parent 731ada7b38
commit c59b4776ae
149 changed files with 6850 additions and 1918 deletions

View file

@ -47,6 +47,9 @@ class ConsoleAPI{
if(!defined("NO_THREADS")){
$this->loop->stop();
$this->loop->notify();
//@fclose($this->loop->fp);
usleep(50000);
$this->loop->kill();
//$this->loop->join();
}
}
@ -204,22 +207,16 @@ class ConsoleAPI{
break;
case "a":
case "all":
if($issuer instanceof Player)
{
if($this->server->api->ban->isOp($issuer->username))
{
if($issuer instanceof Player){
if($this->server->api->ban->isOp($issuer->username)){
$output = "";
foreach($this->server->api->player->getAll() as $p){
$output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias);
}
}
else
{
}else{
$issuer->sendChat("You don't have permissions to use this command.\n");
}
}
else
{
}else{
$output = "";
foreach($this->server->api->player->getAll() as $p){
$output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias);
@ -294,7 +291,7 @@ class ConsoleLoop extends Thread{
public $stop;
public $base;
public $ev;
public $fp;
public $fp;
public function __construct(){
$this->line = false;
$this->stop = false;
@ -319,7 +316,7 @@ class ConsoleLoop extends Thread{
public function run(){
if(!extension_loaded("readline")){
$this->fp = fopen( "php://stdin", "r" );
$this->fp = fopen("php://stdin", "r");
}
while($this->stop === false){
@ -328,7 +325,7 @@ class ConsoleLoop extends Thread{
$this->line = false;
}
if(!$this->haveReadline){
if(!extension_loaded("readline")){
@fclose($fp);
}
exit(0);