Code cleanup

This commit is contained in:
Shoghi Cervantes
2014-08-21 17:26:41 +02:00
parent e1ef86074e
commit db7222976e
105 changed files with 932 additions and 896 deletions

View File

@ -29,7 +29,6 @@ use pocketmine\command\RemoteConsoleCommandSender;
use pocketmine\event\server\RemoteServerCommandEvent;
use pocketmine\scheduler\CallbackTask;
use pocketmine\Server;
use pocketmine\utils\MainLogger;
use pocketmine\utils\TextFormat;
@ -87,7 +86,7 @@ class RCON{
}elseif($this->workers[$n]->isWaiting()){
if($this->workers[$n]->response !== ""){
$this->server->getLogger()->info($this->workers[$n]->response);
$this->workers[$n]->synchronized(function(RCONInstance $thread){
$this->workers[$n]->synchronized(function (RCONInstance $thread){
$thread->notify();
}, $this->workers[$n]);
}else{
@ -102,7 +101,7 @@ class RCON{
}
$this->workers[$n]->response = TextFormat::clean($response->getMessage());
$this->workers[$n]->synchronized(function(RCONInstance $thread){
$this->workers[$n]->synchronized(function (RCONInstance $thread){
$thread->notify();
}, $this->workers[$n]);
}

View File

@ -133,7 +133,7 @@ class RCONInstance extends \Thread{
if($payload === $this->password){
@socket_getpeername($client, $addr, $port);
$this->response = "[INFO] Successful Rcon connection from: /$addr:$port";
$this->synchronized(function(){
$this->synchronized(function (){
$this->wait();
});
$this->response = "";
@ -152,7 +152,7 @@ class RCONInstance extends \Thread{
}
if(strlen($payload) > 0){
$this->cmd = ltrim($payload);
$this->synchronized(function(){
$this->synchronized(function (){
$this->wait();
});
$this->writePacket($client, $requestID, 0, str_replace("\n", "\r\n", trim($this->response)));