mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Removed @deprecated classes, methods and properties, added some type hints
This commit is contained in:
@ -31,6 +31,11 @@ class RCONInstance extends Thread{
|
||||
private $socket;
|
||||
private $password;
|
||||
private $maxClients;
|
||||
private $waiting;
|
||||
|
||||
public function isWaiting(){
|
||||
return $this->waiting === true;
|
||||
}
|
||||
|
||||
|
||||
public function __construct($socket, $password, $maxClients = 50){
|
||||
@ -137,8 +142,10 @@ class RCONInstance extends Thread{
|
||||
socket_getpeername($client, $addr, $port);
|
||||
$this->response = "[INFO] Successful Rcon connection from: /$addr:$port";
|
||||
$this->synchronized(function (){
|
||||
$this->waiting = true;
|
||||
$this->wait();
|
||||
});
|
||||
$this->waiting = false;
|
||||
$this->response = "";
|
||||
$this->writePacket($client, $requestID, 2, "");
|
||||
$this->{"status" . $n} = 1;
|
||||
@ -156,8 +163,10 @@ class RCONInstance extends Thread{
|
||||
if(strlen($payload) > 0){
|
||||
$this->cmd = ltrim($payload);
|
||||
$this->synchronized(function (){
|
||||
$this->waiting = true;
|
||||
$this->wait();
|
||||
});
|
||||
$this->waiting = false;
|
||||
$this->writePacket($client, $requestID, 0, str_replace("\n", "\r\n", trim($this->response)));
|
||||
$this->response = "";
|
||||
$this->cmd = "";
|
||||
|
Reference in New Issue
Block a user