- replaced logMessage() with ManiaControl->log
- Moved Chatlog DATE constant into plugin class
This commit is contained in:
@ -64,7 +64,6 @@ class ManiaControl implements CommandListener {
|
||||
*/
|
||||
const VERSION = '0.01';
|
||||
const API_VERSION = '2013-04-16';
|
||||
const DATE = 'd-m-y h:i:sa T';
|
||||
|
||||
/**
|
||||
* Public properties
|
||||
@ -183,7 +182,7 @@ class ManiaControl implements CommandListener {
|
||||
$this->client->Terminate();
|
||||
}
|
||||
|
||||
logMessage('Quitting ManiaControl!');
|
||||
$this->log('Quitting ManiaControl!');
|
||||
exit();
|
||||
}
|
||||
|
||||
@ -191,7 +190,7 @@ class ManiaControl implements CommandListener {
|
||||
* Run ManiaControl
|
||||
*/
|
||||
public function run() {
|
||||
logMessage('Starting ManiaControl v' . self::VERSION . '!');
|
||||
$this->log('Starting ManiaControl v' . self::VERSION . '!');
|
||||
|
||||
// Load plugins
|
||||
$this->pluginManager->loadPlugins();
|
||||
|
@ -287,14 +287,14 @@ class Server {
|
||||
$waitBegin = time();
|
||||
$maxWaitTime = 20;
|
||||
$lastStatus = $response['Name'];
|
||||
logMessage("Waiting for server to reach status {$statusCode}...");
|
||||
logMessage("Current Status: {$lastStatus}");
|
||||
$this->maniaControl->log("Waiting for server to reach status {$statusCode}...");
|
||||
$this->maniaControl->log("Current Status: {$lastStatus}");
|
||||
while ($response['Code'] !== 4) {
|
||||
sleep(1);
|
||||
$this->maniaControl->client->query('GetStatus');
|
||||
$response = $this->maniaControl->client->getResponse();
|
||||
if ($lastStatus !== $response['Name']) {
|
||||
logMessage("New Status: " . $response['Name']);
|
||||
$this->maniaControl->log("New Status: " . $response['Name']);
|
||||
$lastStatus = $response['Name'];
|
||||
}
|
||||
if (time() - $maxWaitTime > $waitBegin) {
|
||||
|
Reference in New Issue
Block a user