java.lang.Object
games.stendhal.server.entity.player.Jail
All Implemented Interfaces:
ZoneConfigurator, LoginListener

public class Jail extends Object implements ZoneConfigurator, LoginListener
This class is responsible of keeping players who have misbehaved in a special jail area where they can't do any harm. The misbehaving player will be automatically released after a specified number of minutes.
Author:
daniel
  • Constructor Details

    • Jail

      public Jail()
  • Method Details

    • imprison

      public void imprison(String criminalName, RPEntity policeman, int minutes, String reason)
      Parameters:
      criminalName - The name of the player who should be jailed
      policeman - The object for the RPEntity or admin who wants to jail the criminal
      minutes - The duration of the sentence
      reason - why criminal was jailed
    • imprison

      protected void imprison(Player criminal, RPEntity policeman, int minutes)
    • release

      public boolean release(String inmateName)
      Releases an inmate and teleports him to Semos city, but only if he is still in jail.
      Parameters:
      inmateName - the name of the inmate who should be released
      Returns:
      true if the player has not logged out before he was released
    • isInJail

      public static boolean isInJail(Player inmate)
      Is player in a jail cell? Ignores visitors outside of cells.
      Parameters:
      inmate - player to check
      Returns:
      true, if it is in jail, false otherwise.
    • grantParoleIfPlayerWasAPrisoner

      public void grantParoleIfPlayerWasAPrisoner(Player player)
      Destroy the arrest warrant so that the player is not jailed again on next login.
      Parameters:
      player -
    • 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
    • listJailed

      public String listJailed()
    • getWarrant

      public ArrestWarrant getWarrant(String name)
      Get the ArrestWarrant of a jailed player.
      Parameters:
      name - the name of the player
      Returns:
      the ArrestWarrant for the player, or null if there is none
    • configureZone

      public void configureZone(StendhalRPZone zone, Map<String,​String> attributes)
      Description copied from interface: ZoneConfigurator
      Configure a zone.
      Specified by:
      configureZone in interface ZoneConfigurator
      Parameters:
      zone - The zone to be configured.
      attributes - Configuration attributes.