Added Server->broadcastTip() and Server->broadcastPopup()

Signed-off-by: Michael Yoo <michael@yoo.id.au>
This commit is contained in:
Striker209MPE 2015-05-01 19:33:33 +02:00 committed by Michael Yoo
parent 388f5c2c91
commit adc5aa11ac

View File

@ -1764,8 +1764,8 @@ class Server{
}
/**
* @param $message
* @param Player[] $recipients
* @param $message
* @param Player[]|null $recipients
*
* @return int
*/
@ -1780,6 +1780,40 @@ class Server{
}
}
/**
* @param $tip
* @param Player[]|null $recipients
*
* @return int
*/
public function broadcastTip($tip, $recipients = null){
if(!is_array($recipients)){
return $this->broadcastTip($tip, $this->getOnlinePlayers());
}
/** @var Player[] $recipients */
foreach($recipients as $recipient){
$recipient->sendTip($tip);
}
}
/**
* @param $popup
* @param Player[]|null $recipients
*
* @return int
*/
public function broadcastPopup($popup, $recipients = null){
if(!is_array($recipients)){
return $this->broadcastPopup($popup, $this->getOnlinePlayers());
}
/** @var Player[] $recipients */
foreach($recipients as $recipient){
$recipient->sendPopup($popup);
}
}
/**
* @param string $message
* @param string $permissions