Removed @deprecated classes, methods and properties, added some type hints

This commit is contained in:
Shoghi Cervantes
2015-09-12 17:10:11 +02:00
parent 29a5012c02
commit 3ffdb8e552
39 changed files with 166 additions and 891 deletions

View File

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