add callbacks for PlayerActions
This commit is contained in:
parent
4b9ea37217
commit
afe617b642
@ -47,6 +47,17 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
const SPECTATOR_BUT_KEEP_SELECTABLE = 3;
|
||||
const ECHO_WARN_PLAYER = 'ManiaControl.PlayerManager.WarnPlayer';
|
||||
|
||||
/*
|
||||
* Callback Constants
|
||||
*/
|
||||
const CB_PLAYER_FORCED_TO_PLAY = 'PlayerActions.PlayerForcedToPlay';
|
||||
const CB_PLAYER_FORCED_TO_TEAM = 'PlayerActions.PlayerForcedToTeam';
|
||||
const CB_PLAYER_FORCED_TO_SPEC = 'PlayerActions.PlayerForcedToSpec';
|
||||
const CB_PLAYER_MUTED = 'PlayerActions.PlayerMuted';
|
||||
const CB_PLAYER_WARNED = 'PlayerActions.PlayerWarned';
|
||||
const CB_PLAYER_KICKED = 'PlayerActions.PlayerKicked';
|
||||
const CB_PLAYER_BANNED = 'PlayerActions.PlayerBanned';
|
||||
|
||||
/*
|
||||
* Permission Setting Constants
|
||||
*/
|
||||
@ -201,6 +212,8 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PLAYER_FORCED_TO_TEAM, $target, $teamId);
|
||||
|
||||
$message = false;
|
||||
$teamName = '';
|
||||
if ($teamId === self::TEAM_BLUE) {
|
||||
@ -229,7 +242,7 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
|
||||
if ($message) {
|
||||
$this->maniaControl->getChat()->sendInformation($message);
|
||||
Logger::logInfo($chatMessage, true);
|
||||
Logger::logInfo($message, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -281,6 +294,8 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
}
|
||||
}
|
||||
|
||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PLAYER_FORCED_TO_PLAY, $target);
|
||||
|
||||
// Announce force
|
||||
if ($displayAnnouncement) {
|
||||
if ($calledByAdmin) {
|
||||
@ -340,6 +355,8 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PLAYER_FORCED_TO_SPEC, $target);
|
||||
|
||||
if ($calledByAdmin) {
|
||||
$title = $admin->getAuthLevelName();
|
||||
$message = $this->maniaControl->getChat()->formatMessage(
|
||||
@ -460,6 +477,8 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PLAYER_MUTED, $target);
|
||||
|
||||
if ($calledByAdmin) {
|
||||
$title = $admin->getAuthLevelName();
|
||||
$message = $this->maniaControl->getChat()->formatMessage(
|
||||
@ -561,6 +580,8 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
// Display manialink
|
||||
$this->maniaControl->getManialinkManager()->displayWidget($maniaLink, $target);
|
||||
|
||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PLAYER_WARNED, $target);
|
||||
|
||||
if ($calledByAdmin) {
|
||||
$title = $admin->getAuthLevelName();
|
||||
$message = $this->maniaControl->getChat()->formatMessage(
|
||||
@ -625,6 +646,8 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
}
|
||||
}
|
||||
|
||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PLAYER_KICKED, $target);
|
||||
|
||||
if ($calledByAdmin) {
|
||||
$title = $admin->getAuthLevelName();
|
||||
$message = $this->maniaControl->getChat()->formatMessage(
|
||||
@ -679,6 +702,8 @@ class PlayerActions implements EchoListener, CommunicationListener, UsageInforma
|
||||
return;
|
||||
}
|
||||
|
||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PLAYER_BANNED, $target);
|
||||
|
||||
$title = $admin->getAuthLevelName();
|
||||
$message = $this->maniaControl->getChat()->formatMessage(
|
||||
"{$title} %s banned %s!",
|
||||
|
Loading…
Reference in New Issue
Block a user