updated dedicated-server-api exception usages
This commit is contained in:
@ -7,7 +7,7 @@ use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Plugins\Plugin;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\UnknownPlayerException;
|
||||
|
||||
/**
|
||||
* ManiaControl Chat-Message Plugin
|
||||
@ -384,7 +384,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
|
||||
$message = '$39F Thanks for Playing, please come back soon!$z ';
|
||||
try {
|
||||
$this->maniaControl->client->kick($player->login, $message);
|
||||
} catch (LoginUnknownException $e) {
|
||||
} catch (UnknownPlayerException $e) {
|
||||
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ use ManiaControl\Server\Server;
|
||||
use ManiaControl\Server\ServerCommands;
|
||||
use ManiaControl\Utils\ColorUtil;
|
||||
use Maniaplanet\DedicatedServer\Structures\VoteRatio;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\NotInScriptModeException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
|
||||
|
||||
|
||||
/**
|
||||
@ -235,7 +235,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
||||
$itemQuad->setAction(self::ACTION_START_VOTE . 'pausegame');
|
||||
$this->addVoteMenuItem($itemQuad, 10, 'Vote for a pause of Current Game');
|
||||
}
|
||||
} catch (NotInScriptModeException $e) {
|
||||
} catch (GameModeException $e) {
|
||||
}
|
||||
|
||||
//Menu SkipMap
|
||||
|
@ -193,7 +193,7 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
|
||||
|
||||
break;
|
||||
case self::RANKING_TYPE_RECORDS: //TODO verify workable status
|
||||
if (!$this->maniaControl->pluginManager->isPluginActive('MCTeam\LocalRecordsPlugin')) {
|
||||
if (!$this->maniaControl->pluginManager->isPluginActive(__NAMESPACE__ . '\LocalRecordsPlugin')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
|
||||
$maxRecords = $this->maniaControl->settingManager->getSettingValue($this, self::SETTING_MAX_STORED_RECORDS);
|
||||
|
||||
$query = 'SELECT playerIndex, COUNT(*) AS Cnt
|
||||
FROM ' . \MCTeam\LocalRecordsPlugin::TABLE_RECORDS . '
|
||||
FROM ' . LocalRecordsPlugin::TABLE_RECORDS . '
|
||||
GROUP BY PlayerIndex
|
||||
HAVING Cnt >=' . $requiredRecords;
|
||||
|
||||
@ -212,8 +212,8 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
|
||||
}
|
||||
$result->free_result();
|
||||
|
||||
/** @var \MCTeam\LocalRecordsPlugin $localRecordsPlugin */
|
||||
$localRecordsPlugin = $this->maniaControl->pluginManager->getPlugin('MCTeam\LocalRecordsPlugin');
|
||||
/** @var LocalRecordsPlugin $localRecordsPlugin */
|
||||
$localRecordsPlugin = $this->maniaControl->pluginManager->getPlugin(__NAMESPACE__ . '\LocalRecordsPlugin');
|
||||
$maps = $this->maniaControl->mapManager->getMaps();
|
||||
foreach ($maps as $map) {
|
||||
$records = $localRecordsPlugin->getLocalRecords($map, $maxRecords);
|
||||
|
@ -166,7 +166,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
|
||||
private function displayWidgets() {
|
||||
// Display Map Widget
|
||||
if ($this->maniaControl->settingManager->getSettingValue($this, self::SETTING_MAP_WIDGET_ACTIVATED)) {
|
||||
$this->maniaControl->client->triggerModeScriptEventArray("Siege_SetProgressionLayerPosition", array("160.", "-67.", "0."));
|
||||
$this->maniaControl->client->triggerModeScriptEvent("Siege_SetProgressionLayerPosition", array("160.", "-67.", "0."));
|
||||
$this->displayMapWidget();
|
||||
}
|
||||
if ($this->maniaControl->settingManager->getSettingValue($this, self::SETTING_CLOCK_WIDGET_ACTIVATED)) {
|
||||
@ -397,7 +397,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin {
|
||||
*/
|
||||
public function unload() {
|
||||
//Restore Siege Progression Layer
|
||||
$this->maniaControl->client->triggerModeScriptEventArray("Siege_SetProgressionLayerPosition", array("160.", "90.", "0."));
|
||||
$this->maniaControl->client->triggerModeScriptEvent("Siege_SetProgressionLayerPosition", array("160.", "90.", "0."));
|
||||
|
||||
$this->closeWidget(self::MLID_CLOCKWIDGET);
|
||||
$this->closeWidget(self::MLID_SERVERINFOWIDGET);
|
||||
|
@ -9,7 +9,7 @@ use ManiaControl\Commands\CommandListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Plugins\Plugin;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\NotInScriptModeException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
|
||||
|
||||
/**
|
||||
* ManiaControl Obstacle Plugin
|
||||
@ -120,7 +120,7 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
|
||||
$param = $player->login . ";" . $params[1] . ";";
|
||||
try {
|
||||
$this->maniaControl->client->triggerModeScriptEvent(self::CB_JUMPTO, $param);
|
||||
} catch (NotInScriptModeException $e) {
|
||||
} catch (GameModeException $e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user