Compare commits

...

3 Commits

Author SHA1 Message Date
beu
6f1411c5c3 fix empty settings values 2026-01-31 11:27:08 +01:00
beu
811ef7215c improve error logging 2026-01-28 12:20:32 +01:00
beu
783cc0c311 fix listing on larger size 2026-01-28 12:20:03 +01:00
3 changed files with 95 additions and 29 deletions

View File

@@ -43,7 +43,7 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
* MARK: Constants
*/
const PLUGIN_ID = 152;
const PLUGIN_VERSION = 6.2;
const PLUGIN_VERSION = 6.3;
const PLUGIN_NAME = 'MatchManager Core';
const PLUGIN_AUTHOR = 'Beu';
@@ -1070,7 +1070,7 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
foreach ($gameSettings as $settingname => $info) {
$gameSettings[$settingname]['value'] = $this->maniaControl->getSettingManager()->getSettingValue($this, $settingname);
if ($gameSettings[$settingname]['value'] == null) {
if ($gameSettings[$settingname]['value'] === null) {
$gameSettings[$settingname]['value'] = $info['default'];
}
settype($gameSettings[$settingname]['value'], $info['type']);

View File

@@ -39,7 +39,7 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
* Constants
*/
const PLUGIN_ID = 156;
const PLUGIN_VERSION = 2.5;
const PLUGIN_VERSION = 2.6;
const PLUGIN_NAME = 'MatchManager GSheet';
const PLUGIN_AUTHOR = 'Beu';
@@ -217,7 +217,7 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
*
* @param mixed $message
*/
private function log(mixed $message) {
private function log($message) {
Logger::log(self::LOG_PREFIX . $message);
}
@@ -226,7 +226,7 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
*
* @param mixed $message
*/
private function logError(mixed $message) {
private function logError($message) {
Logger::logError(self::LOG_PREFIX . $message);
}
@@ -391,8 +391,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
if (isset($data->device_code)) {
@@ -446,8 +452,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -493,8 +505,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -571,8 +589,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -663,8 +687,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -697,8 +727,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -732,8 +768,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -796,8 +838,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -944,8 +992,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -967,8 +1021,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}
@@ -1007,8 +1067,14 @@ class MatchManagerGSheet implements CallbackListener, TimerListener, CommandLis
return;
}
if (property_exists($data, "error")) {
$this->logError('Request error: ' . $data->error->code . " ". $data->error->message);
$this->maniaControl->getChat()->sendErrorToAdmins('$this->MatchManagerCore->getChatPrefix() .Request error: ' . $data->error->code . " ". $data->error->message);
$error = 'Unknown error';
if (is_string($data->error)) {
$error = $data->error;
} else if (is_object($data->error) && property_exists($data->error, 'message') && property_exists($data->error, 'code')) {
$error = $data->error->code . " ". $data->error->message;
}
$this->logError('Request error: ' . $error);
$this->maniaControl->getChat()->sendErrorToAdmins($this->MatchManagerCore->getChatPrefix() .'Request error: ' .$error);
return;
}

View File

@@ -44,7 +44,7 @@ class MatchManagerMultipleConfigManager implements ManialinkPageAnswerListener,
* Constants
*/
const PLUGIN_ID = 171;
const PLUGIN_VERSION = 1.8;
const PLUGIN_VERSION = 1.9;
const PLUGIN_NAME = 'MatchManager Multiple Config Manager';
const PLUGIN_AUTHOR = 'Beu';
@@ -516,7 +516,7 @@ class MatchManagerMultipleConfigManager implements ManialinkPageAnswerListener,
$pageFrame = null;
foreach ($this->getSavedConfigs() as $config) {
if ($index % 16 === 0) {
if ($index % (floor(($height - 20.) / 4)) === 0) {
$pageFrame = new Frame();
$frame->addChild($pageFrame);
$posY = $height / 2 - 10;