Class AccessCheckingPortal
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
- All Implemented Interfaces:
UseListener,Killer,Cloneable,Iterable<String>,Serializable
- Direct Known Subclasses:
ConditionAndActionPortal,Door,HousePortal,KeyedPortal,LevelCheckingPortal,MylingWellPortal,QuestCheckingPortal,QuestCompletedPortal
An access checking portal is a special kind of portal which requires some
condition to use.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA turn listener that sends a user message.Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanOverride continuous movement setting.protected booleanImmediate execution of action when player says password.protected intRadius at which portal will "listen" for speaking players.protected StringOptional message to give when correct password used.protected StringOptional message to give when incorrect password used.protected intID for the portalprotected static intprotected ChatActionOptional action to take when access is rejected.protected StringThe message to give when rejected.protected StringOptional password to use portal.Fields 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
ConstructorsConstructorDescriptionCreates an access checking portal with default values.AccessCheckingPortal(String rejectMessage) Creates an access checking portal.AccessCheckingPortal(RPObject object) -
Method Summary
Modifier and TypeMethodDescriptionintGets the message to send when player is denied access to portal.Gets the password required to use the portal.booleanChecks if the portal executes an action immediately after password is said.protected abstract booleanDetermine if this portal can be used.voidlogic()booleanUse the portal, if allowed.booleanplayerIsPortalUnlocked(Player player, Portal portal) protected voidCalled when the user is rejected.protected voidsendMessage(RPEntity user, String text) Wrapper to send a message to a user, without getting lost.voidsetForceStop(boolean forceStop) Sets flag to override continuous movement & force entity to stop.voidsetInstantAction(boolean instant) voidsetListeningRadius(int radius) Sets the radius at which the portal will "hear" speaking players.voidsetPasswordAcceptedMessage(String message) Set the password accepted message.voidsetPasswordRejectedMessage(String message) Set the password rejected message.voidsetRejectedAction(ChatAction rejectedAction) Initiates an action to take on rejection.voidsetRejectedMessage(String message) Set the rejection message.voidsetRequiredPassword(String password) Methods 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
-
instantAction
protected boolean instantActionImmediate execution of action when player says password. -
listeningRadius
protected int listeningRadiusRadius at which portal will "listen" for speaking players. -
passwordAcceptedMessage
Optional message to give when correct password used. -
passwordRejectedMessage
Optional message to give when incorrect password used. -
portalID
protected int portalIDID for the portal -
portalIDCounter
protected static int portalIDCounter -
rejectedMessage
The message to give when rejected. -
requiredPassword
Optional password to use portal. -
rejectedAction
Optional action to take when access is rejected. -
forceStop
protected boolean forceStopOverride continuous movement setting.
-
-
Constructor Details
-
AccessCheckingPortal
public AccessCheckingPortal()Creates an access checking portal with default values. -
AccessCheckingPortal
Creates an access checking portal.- Parameters:
rejectMessage- The message to given when rejected.
-
AccessCheckingPortal
- Parameters:
object-
-
-
Method Details
-
getPasswordAcceptedMessage
- Returns:
- Message when password is accepted.
-
getPasswordRejectedMessage
- Returns:
- Messager when password is rejected.
-
getListeningRadius
public int getListeningRadius()- Returns:
- Radius at which portal detects player speech.
-
getRejectedMessage
Gets the message to send when player is denied access to portal.- Returns:
- Rejected message
-
getRequiredPassword
Gets the password required to use the portal.- Returns:
- Required password
-
hasInstanceAction
public boolean hasInstanceAction()Checks if the portal executes an action immediately after password is said.- Returns:
- instantAction
-
isAllowed
Determine if this portal can be used.- Parameters:
user- The user to be checked.- Returns:
trueif the user can use the portal.
-
playerIsPortalUnlocked
-
logic
public void logic() -
onUsed
Use the portal, if allowed.- Specified by:
onUsedin interfaceUseListener- Overrides:
onUsedin classPortal- Parameters:
user- that wants to pass.- Returns:
- true if passed , false otherwise.
-
rejected
Called when the user is rejected. This sends a rejection message to the user if set.- Parameters:
user- The rejected user.
-
sendMessage
Wrapper to send a message to a user, without getting lost.- Parameters:
user- The user to send to.text- The message to send.
-
setInstantAction
public void setInstantAction(boolean instant) - Parameters:
instant- Use portal automatically.
-
setPasswordAcceptedMessage
Set the password accepted message.- Parameters:
message- Optional message to be given when correct password used.
-
setPasswordRejectedMessage
Set the password rejected message.- Parameters:
message- Optional message to be given when incorrect password used.
-
setListeningRadius
public void setListeningRadius(int radius) Sets the radius at which the portal will "hear" speaking players.- Parameters:
radius- Distance at wich portal listens for players speaking.
-
setRejectedMessage
Set the rejection message.- Parameters:
message- The message to give when rejected.
-
setRequiredPassword
- Parameters:
password-
-
setRejectedAction
Initiates an action to take on rejection.- Parameters:
rejectedAction- ChatAction to execute.
-
setForceStop
public void setForceStop(boolean forceStop) Sets flag to override continuous movement & force entity to stop.- Parameters:
forceStop- Iftrue, entity is forced to stop movement.
-