Class Jail
java.lang.Object
games.stendhal.server.entity.player.Jail
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureZone(StendhalRPZone zone, Map<String, String> attributes) Configure a zone.getWarrant(String name) Get the ArrestWarrant of a jailed player.voidDestroy the arrest warrant so that the player is not jailed again on next login.protected voidvoidstatic booleanIs player in a jail cell? Ignores visitors outside of cells.voidonLoggedIn(Player player) Is called after a player logged into the game.booleanReleases an inmate and teleports him to Semos city, but only if he is still in jail.
-
Constructor Details
-
Jail
public Jail()
-
-
Method Details
-
imprison
- Parameters:
criminalName- The name of the player who should be jailedpoliceman- The object for the RPEntity or admin who wants to jail the criminalminutes- The duration of the sentencereason- why criminal was jailed
-
imprison
-
release
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
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
Destroy the arrest warrant so that the player is not jailed again on next login.- Parameters:
player-
-
onLoggedIn
Description copied from interface:LoginListenerIs called after a player logged into the game.- Specified by:
onLoggedInin interfaceLoginListener- Parameters:
player- the player who has logged in
-
listJailed
-
getWarrant
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
Description copied from interface:ZoneConfiguratorConfigure a zone.- Specified by:
configureZonein interfaceZoneConfigurator- Parameters:
zone- The zone to be configured.attributes- Configuration attributes.
-