replaced ManiaControl log method by direct Logger usage

This commit is contained in:
Steffen Schröder
2014-08-05 01:49:13 +02:00
parent b62d6af929
commit a6b0d749bc
22 changed files with 111 additions and 95 deletions

View File

@ -11,6 +11,7 @@ use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\Controls\Quads\Quad_UIConstructionBullet_Buttons;
use FML\ManiaLink;
use FML\Script\Features\Paging;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
@ -399,7 +400,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener {
// Message
$message = $player->getEscapedNickname() . ' added ' . $map->getEscapedName() . '!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
// Queue requested Map
$this->maniaControl->getMapManager()->getMapQueue()->addMapToMapQueue($player, $map);

View File

@ -9,6 +9,7 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\IconManager;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
@ -221,7 +222,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$message = $player->getEscapedNickname() . ' skipped the current Map!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
}
/**
@ -237,7 +238,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
}
$message = $player->getEscapedNickname() . ' restarted the current Map!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
try {
$this->maniaControl->getClient()->restartMap();
@ -259,7 +260,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
}
$message = $player->getEscapedNickname() . ' replays the current Map!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
$this->maniaControl->getMapManager()->getMapQueue()->addFirstMapToMapQueue($player, $this->maniaControl->getMapManager()->getCurrentMap());
}
@ -293,7 +294,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$message = 'Maplist $<$fff' . $maplist . '$> written.';
$this->maniaControl->getChat()->sendSuccess($message, $player);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
} catch (FaultException $e) {
$this->maniaControl->getChat()->sendError('Cannot write maplist $<$fff' . $maplist . '$>!', $player);
}
@ -329,7 +330,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$message = 'Maplist $<$fff' . $maplist . '$> loaded.';
$this->maniaControl->getMapManager()->restructureMapList();
$this->maniaControl->getChat()->sendSuccess($message, $player);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
} catch (FaultException $e) {
$this->maniaControl->getChat()->sendError('Cannot load maplist $<$fff' . $maplist . '$>!', $player);
}

View File

@ -16,6 +16,7 @@ use FML\Script\Features\Paging;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\IconManager;
use ManiaControl\Manialinks\ManialinkManager;
@ -654,7 +655,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$message = $player->getEscapedNickname() . ' skipped to Map $z' . $map->getEscapedName() . '!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
$this->playerCloseWidget($player);
break;

View File

@ -7,6 +7,7 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Files\FileUtil;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\ManiaExchange\ManiaExchangeList;
use ManiaControl\ManiaExchange\ManiaExchangeManager;
@ -315,7 +316,7 @@ class MapManager implements CallbackListener {
$action = ($eraseFile ? 'erased' : 'removed');
$message = $admin->getEscapedNickname() . ' ' . $action . ' ' . $map->getEscapedName() . '!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
}
}
@ -445,13 +446,13 @@ class MapManager implements CallbackListener {
// Message
$message = $player->getEscapedNickname() . ' added $<' . $mapInfo->name . '$>!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
// Queue requested Map
$this->maniaControl->getMapManager()->getMapQueue()->addMapToMapQueue($login, $mapInfo->uid);
} else {
$message = $player->getEscapedNickname() . ' updated $<' . $mapInfo->name . '$>!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
}
}
@ -513,7 +514,7 @@ class MapManager implements CallbackListener {
try {
$this->maniaControl->getClient()->saveMatchSettings($matchSettingsFileName);
} catch (FileException $e) {
$this->maniaControl->log("Unable to write the playlist file, please checkout your MX-Folders File permissions!");
Logger::logError("Unable to write the playlist file, please checkout your MX-Folders File permissions!");
}
}
}
@ -602,7 +603,7 @@ class MapManager implements CallbackListener {
if ($admin) {
$message = $admin->getEscapedNickname() . ' shuffled the Maplist!';
$this->maniaControl->getChat()->sendSuccess($message);
$this->maniaControl->log($message, true);
Logger::logInfo($message, true, true, true);
}
// Restructure if needed

View File

@ -6,6 +6,7 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
use ManiaControl\Utils\Formatter;
@ -122,8 +123,9 @@ class MapQueue implements CallbackListener, CommandListener {
//Destroy map - queue list
$this->queuedMaps = array();
$this->maniaControl->getChat()->sendInformation('$fa0' . $title . ' $<$fff' . $admin->nickname . '$> cleared the Queued-Map list!');
$this->maniaControl->log($title . ' ' . Formatter::stripCodes($admin->nickname) . ' cleared the Queued-Map list!');
$message = '$fa0' . $title . ' $<$fff' . $admin->nickname . '$> cleared the Map-Queue!';
$this->maniaControl->getChat()->sendInformation($message);
Logger::logInfo($message, true, true, true);
// Trigger callback
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_MAPQUEUE_CHANGED, array('clear'));