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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureZone(StendhalRPZone zone, Map<String,String> attributes)
Configure a zone.getWarrant(String name)
Get the ArrestWarrant of a jailed player.void
grantParoleIfPlayerWasAPrisoner(Player player)
Destroy the arrest warrant so that the player is not jailed again on next login.protected void
void
static boolean
Is player in a jail cell? Ignores visitors outside of cells.void
onLoggedIn(Player player)
Is called after a player logged into the game.boolean
Releases 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:LoginListener
Is called after a player logged into the game.- Specified by:
onLoggedIn
in 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:ZoneConfigurator
Configure a zone.- Specified by:
configureZone
in interfaceZoneConfigurator
- Parameters:
zone
- The zone to be configured.attributes
- Configuration attributes.
-