Class LevelCheckingPortal
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPObject
games.stendhal.server.entity.Entity
games.stendhal.server.entity.mapstuff.portal.Portal
games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal
games.stendhal.server.entity.mapstuff.portal.LevelCheckingPortal
- All Implemented Interfaces:
UseListener,Killer,Cloneable,Iterable<String>,Serializable
A portal which allows only certain levels of player to use it.
- Author:
- hendrik
-
Nested Class Summary
Nested classes/interfaces inherited from class games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal
AccessCheckingPortal.SendMessageNested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default maximum level.static final intThe default minimum level.Fields inherited from class games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal
forceStop, instantAction, listeningRadius, passwordAcceptedMessage, passwordRejectedMessage, portalID, portalIDCounter, rejectedAction, rejectedMessage, requiredPasswordFields inherited from class games.stendhal.server.entity.mapstuff.portal.Portal
ATTR_FACE, ATTR_HIDDEN, ATTR_OFFSET, ATTR_USEFields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
ConstructorsConstructorDescriptionLevelCheckingPortal(int minLevel, int maxLevel) Creates a level checking portal.LevelCheckingPortal(int minLevel, int maxLevel, String rejectMessage) Creates a level checking portal. -
Method Summary
Methods inherited from class games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal
getListeningRadius, getPasswordAcceptedMessage, getPasswordRejectedMessage, getRejectedMessage, getRequiredPassword, hasInstanceAction, logic, onUsed, playerIsPortalUnlocked, sendMessage, setForceStop, setInstantAction, setListeningRadius, setPasswordAcceptedMessage, setPasswordRejectedMessage, setRejectedAction, setRejectedMessage, setRequiredPasswordMethods inherited from class games.stendhal.server.entity.mapstuff.portal.Portal
generateRPClass, getDestinationReference, getDestinationZone, getFaceDirection, getIdentifier, getOffset, hasFaceDirection, hasOffset, isHidden, loaded, onPushedOntoFrom, onUsedBackwards, setDestination, setFaceDirection, setFaceDirection, setHidden, setIdentifier, setIgnoreNoDestination, toString, usePortalMethods inherited from class games.stendhal.server.entity.Entity
describe, getAdjacentNodes, getArea, getArea, getCursor, getDescription, getDescriptionName, getEntitySlot, getHeight, getName, getOrigin, getResistance, getResistance, getTitle, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, onAdded, onMoved, onRemoved, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistance, stopped, updateMethods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, size, slots, slotsIterator, store, unhide, unstore, writeObject, writeObject, writeToJsonMethods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlotsMethods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
DEFAULT_MAX
public static final int DEFAULT_MAXThe default maximum level.- See Also:
-
DEFAULT_MIN
public static final int DEFAULT_MINThe default minimum level.- See Also:
-
-
Constructor Details
-
LevelCheckingPortal
public LevelCheckingPortal(int minLevel, int maxLevel) Creates a level checking portal.- Parameters:
minLevel- The minimum level allowed to pass.maxLevel- The maximum level allowed to pass.
-
LevelCheckingPortal
Creates a level checking portal.- Parameters:
minLevel- The minimum level allowed to pass.maxLevel- The maximum level allowed to pass.rejectMessage- The custom rejection message.
-
-
Method Details
-
isAllowed
Determine if this portal can be used.- Specified by:
isAllowedin classAccessCheckingPortal- Parameters:
user- The user to be checked.- Returns:
trueif the user can use the portal.
-
rejected
Called when the user is rejected. This sends a rejection message to the user.- Overrides:
rejectedin classAccessCheckingPortal- Parameters:
user- The rejected user.
-