small fix

This commit is contained in:
kremsy 2014-02-15 21:40:42 +01:00 committed by Steffen Schröder
parent 3a8e7089c0
commit 074918aba6

View File

@ -307,15 +307,15 @@ class Server implements CallbackListener {
// Server not yet in given status - Wait for it... // Server not yet in given status - Wait for it...
$waitBegin = time(); $waitBegin = time();
$maxWaitTime = 20; $maxWaitTime = 20;
$lastStatus = $response['Name']; $lastStatus = $response->name;
$this->maniaControl->log("Waiting for server to reach status {$statusCode}..."); $this->maniaControl->log("Waiting for server to reach status {$statusCode}...");
$this->maniaControl->log("Current Status: {$lastStatus}"); $this->maniaControl->log("Current Status: {$lastStatus}");
while($response->code !== 4) { while($response->code !== 4) {
sleep(1); sleep(1);
$response = $this->maniaControl->client->getStatus(); $response = $this->maniaControl->client->getStatus();
if ($lastStatus !== $response['Name']) { if ($lastStatus !== $response->name) {
$this->maniaControl->log("New Status: {$response['Name']}"); $this->maniaControl->log("New Status: {$response->name}");
$lastStatus = $response['Name']; $lastStatus = $response->name;
} }
if (time() - $maxWaitTime > $waitBegin) { if (time() - $maxWaitTime > $waitBegin) {
// It took too long to reach the status // It took too long to reach the status