diff --git a/application/plugins/MCTeam/WidgetPlugin.php b/application/plugins/MCTeam/WidgetPlugin.php index aea5c0b3..5a624ed5 100644 --- a/application/plugins/MCTeam/WidgetPlugin.php +++ b/application/plugins/MCTeam/WidgetPlugin.php @@ -127,7 +127,8 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::BEGINMAP, $this, 'handleOnBeginMap'); $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ENDMAP, $this, 'handleOnEndMap'); $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERCONNECT, $this, 'handlePlayerConnect'); - $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect'); + $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'updateWidgets'); + $this->maniaControl->callbackManager->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'updateWidgets'); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED, true); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MAP_WIDGET_POSX, 160 - 20); @@ -512,9 +513,9 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { } /** - * Handle PlayerDisconnect Callback + * Update Widget on certain callbacks */ - public function handlePlayerDisconnect() { + public function updateWidgets() { if ($this->maniaControl->settingManager->getSettingValue($this, self::SETTING_SERVERINFO_WIDGET_ACTIVATED)) { $this->displayServerInfoWidget(); }