getQuitMessage() 공개 메소드

public getQuitMessage ( )
예제 #1
0
 /**
  * Kicks a player from the server
  *
  * @param string $reason
  * @param bool   $isAdmin
  *
  * @return bool
  */
 public function kick($reason = "Disconnected from server.")
 {
     $this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, TextFormat::YELLOW . $this->username . " has left the game"));
     if (!$ev->isCancelled()) {
         $message = $reason;
         $this->sendMessage($message);
         $this->close($ev->getQuitMessage(), $message);
         return true;
     }
     return false;
 }
예제 #2
0
 /**
  * Kicks a player from the server
  *
  * @param string $reason
  * @param bool   $isAdmin
  *
  * @return bool
  */
 public function kick($reason = "", $isAdmin = true)
 {
     $this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, $this->getLeaveMessage()));
     if (!$ev->isCancelled()) {
         if ($isAdmin) {
             $message = "Kicked by admin." . ($reason !== "" ? " Reason: " . $reason : "");
         } else {
             if ($reason === "") {
                 $message = "disconnectionScreen.noReason";
             } else {
                 $message = $reason;
             }
         }
         $this->close($ev->getQuitMessage(), $message);
         return true;
     }
     return false;
 }
예제 #3
0
 /**
  * Kicks a player from the server
  *
  * @param string $reason
  *
  * @return bool
  */
 public function kick($reason = "")
 {
     $this->server->getPluginManager()->callEvent($ev = new PlayerKickEvent($this, $reason, TextFormat::YELLOW . $this->username . " has left the game"));
     if (!$ev->isCancelled()) {
         $message = "Kicked by admin." . ($reason !== "" ? " Reason: " . $reason : "");
         $this->sendMessage($message);
         $this->close($ev->getQuitMessage(), $message);
         return true;
     }
     return false;
 }