Class GagManager

java.lang.Object
games.stendhal.server.entity.player.GagManager
All Implemented Interfaces:
LoginListener

public class GagManager extends Object implements LoginListener
Manages gags.
  • Method Details

    • get

      public static GagManager get()
      returns the GagManager object (Singleton Pattern).
      Returns:
      GagManager
    • gag

      public void gag(String criminalName, Player policeman, int minutes, String reason)
      Parameters:
      criminalName - The name of the player who should be gagged
      policeman - The name of the admin who wants to gag the criminal
      minutes - The duration of the sentence
      reason - why criminal was gagged
    • release

      public void release(Player inmate)
      Removes a gag.
      Parameters:
      inmate - player who should be released
    • isGagged

      public static boolean isGagged(Player player)
      Is player gagged?
      Parameters:
      player - player to check
      Returns:
      true, if it is gagged, false otherwise.
    • checkIsGaggedAndInformPlayer

      public static boolean checkIsGaggedAndInformPlayer(Player player)
      Like isGagged(player) but informs the player in case it is gagged.
      Parameters:
      player - player to check
      Returns:
      true, if it is gagged, false otherwise.
    • onLoggedIn

      public void onLoggedIn(Player player)
      Description copied from interface: LoginListener
      Is called after a player logged into the game.
      Specified by:
      onLoggedIn in interface LoginListener
      Parameters:
      player - the player who has logged in
    • getTimeRemaining

      public long getTimeRemaining(Player criminal)
      Gets time remaining in milliseconds.
      Parameters:
      criminal - player to check
      Returns:
      time remaining in milliseconds