All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class key.Player

java.lang.Object
   |
   +----key.Atom
           |
           +----key.Container
                   |
                   +----key.AnimatedContainer
                           |
                           +----key.Player

public final class Player
extends AnimatedContainer
implements LatentlyCached, Targetable, CommandContainer
This is the main instance of a player on the program


Variable Index

 o commandList
Commands that are specific for this particular atom.
 o DEFAULT_MAX_FRIENDS
 o DEFAULT_MAX_INFORM
 o DEFAULT_MAX_MAIL
 o DEFAULT_MAX_OBJECTS
 o DEFAULT_MAX_PREFER
 o discard
 o FAIL_PASSWORD_LOG
 o findAction
 o friendAction
 o lagAmount
 o lagOnce
 o MAX_IDLE_TICKS
 o MAX_NAME
 o MIN_NAME
 o seePrivateInfoAction
 o SHOWCHARS
 o SHOWFLAG_DIRECTED
 o SHOWFLAG_ENTER
 o SHOWFLAG_FRIENDS
 o SHOWFLAG_LEAVE
 o SHOWFLAG_LOGIN
 o SHOWFLAG_LOGOUT
 o SHOWFLAG_ROOM
 o SHOWFLAG_SHOUTS
 o SHOWNAMES
 o staticActions
 o staticCommandList
This is a reference to some sort of 'standard' command list for this _type_ of atom.
 o summonAction
 o tellAction

Constructor Index

 o Player()
Constructs a player

Method Index

 o addGenderProperty(String, int)
Adds a new gender property to the player.
 o addMail(Letter)
 o afk(boolean)
 o aspect()
A players aspect is its description when looked at
 o assignInitialOwner()
Players always own themselves
 o authenticate(InteractiveConnection)
Called when a password entry is required
 o beginConnect()
 o brief()
 o canMakeFriend(Player)
 o canSave()
 o canSwap()
 o command(String, InteractiveConnection)
This routine kind of doubles up with ModalCommand, but searches many more places than ModalCommand does.
 o connected()
true if the player is connected
 o connectTo(InteractiveConnection)
Called to connect a player to an interactive connection.
 o containsAction(Action)
Returns true if the action is supported by this class.
 o countRooms()
Returns the number of rooms the player has
 o deallocate()
 o disconnect()
Called to terminate a players connection.
 o dispose()
This is a method that should be called only once.
 o endConnect()
 o enrolIntoClan(Clan)
 o evalReadOnlyProperty(ReadOnlyProperty)
override to return the correct value for the supplied property make sure you call super.evalReadOnlyProperty if you don't understand it before returning null
 o finalize()
 o findCommand(CommandContainer, String)
 o getAction(String)
Returns the action corresponding to the supplied name.
 o getActions()
Returns a list of the actions supported by this class.
 o getBlockingMsg()
 o getBlockMsg()
 o getClan()
 o getCodes()
 o getCommandList()
A shortcut, since matching it from the string could be prohibitively slow
 o getConnection()
 o getContext()
Returns the current players context
 o getCookie(Atom)
 o getExpert()
 o getFriends()
 o getFullName()
 o getHome()
 o getId()
 o getIdle(DateTime)
 o getIdleMsg()
 o getInform()
 o getLastPublicRoom()
 o getLocation()
Gets the players location
 o getPossessiveName()
eg: "subtle's"
 o getPrefer()
 o getQualifierList()
 o getRank()
 o getRepeated()
 o getShowFlags()
 o getStaticCommandList()
A shortcut, since matching it from the string could be prohibitively slow
 o getTerminal()
 o getTimezone()
 o getTitledName()
 o getTotalPlayers()
 o giveFlorins(int)
Transaction based checking here would ensure that the system couldn't be cheated, given that it was a read only property, which it isn't.
 o hasPassword()
 o HeShe()
 o heShe()
 o himHer()
 o HisHer()
 o hisHer()
 o isAfk()
 o isBanished()
 o isBeyond()
 o isCitizen()
 o isHiding()
 o isIdle()
 o isLiberated()
if the player can't be put into a clan
 o isOutRankedBy(Rank)
You can target a player if you can target any of the ranks that they're in.
 o isOwner(Atom)
I hereby declare each player to be a soverign state, owned by no other.
 o isStaff()
 o linkToScape(Scape)
 o loadFrom(DataInput)
 o located()
true if the player has a location
 o maleFemale()
 o maybeSetBeyond()
 o modified()
 o moveTo(Room)
 o moveTo(Room, Effect, Effect)
 o putCode(Character, String)
 o ranks()
 o recalculateIdlePrompt()
 o recieveFlorins(int)
 o resetModify()
 o resetTerminal()
 o roomLook()
 o run()
The main thread of a player - simply starts the parser
 o scapes()
 o sendError(String)
This function is used when the user makes some sort of error in typing - *not* if a command can't be executed because of a failure.
 o sendFailure(String)
 o sendFeedback(String)
This function is used to output direct, *successful* feedback of a players command.
 o sendSystem(String)
 o sendText(String)
Meant to be used to send part of what would normally be a paragraph.
 o setCanPage(boolean)
 o setContext(Atom)
 o setCookie(Atom, Object)
 o setGender(Gender)
 o setHome(Room)
 o setLag(int, boolean)
 o setPassword(String)
 o setSaved()
 o setTerminal(String)
 o splash(Effect, SuppressionList)
When an effect occurs, people within its "splash" range are notified (that is, they can choose to notice or ignore it).
 o swapout()
Similar to dispose(), the swapout() method prepares a Atom to be swapped out non-destructively You should probably sync() before doing this...
 o sync()
 o unIdle()
Called by the interactive connection to reset the players idletime to 0
 o unlinkFromScape(Scape)
 o willSync()
 o writeTo(DataOutput)

Variables

 o FAIL_PASSWORD_LOG
 public static final String FAIL_PASSWORD_LOG
 o DEFAULT_MAX_OBJECTS
 public static final int DEFAULT_MAX_OBJECTS
 o DEFAULT_MAX_MAIL
 public static final int DEFAULT_MAX_MAIL
 o DEFAULT_MAX_FRIENDS
 public static final int DEFAULT_MAX_FRIENDS
 o DEFAULT_MAX_PREFER
 public static final int DEFAULT_MAX_PREFER
 o DEFAULT_MAX_INFORM
 public static final int DEFAULT_MAX_INFORM
 o MAX_NAME
 public static final int MAX_NAME
 o MIN_NAME
 public static final int MIN_NAME
 o SHOWFLAG_DIRECTED
 public static final int SHOWFLAG_DIRECTED
 o SHOWFLAG_FRIENDS
 public static final int SHOWFLAG_FRIENDS
 o SHOWFLAG_ROOM
 public static final int SHOWFLAG_ROOM
 o SHOWFLAG_SHOUTS
 public static final int SHOWFLAG_SHOUTS
 o SHOWFLAG_ENTER
 public static final int SHOWFLAG_ENTER
 o SHOWFLAG_LEAVE
 public static final int SHOWFLAG_LEAVE
 o SHOWFLAG_LOGIN
 public static final int SHOWFLAG_LOGIN
 o SHOWFLAG_LOGOUT
 public static final int SHOWFLAG_LOGOUT
 o SHOWCHARS
 public static final char SHOWCHARS[]
 o SHOWNAMES
 public static final String SHOWNAMES[]
 o commandList
 protected AtomicProperty commandList
Commands that are specific for this particular atom. Examples might be custom commands in rooms, such as 'look' (if its overridden to give different messages each time you type it)

 o staticCommandList
 protected ReferenceProperty staticCommandList
This is a reference to some sort of 'standard' command list for this _type_ of atom. It will generally be set when the atom is created or loaded, and left to its own devices after that.

 o MAX_IDLE_TICKS
 public static final int MAX_IDLE_TICKS
 o lagAmount
 protected int lagAmount
 o lagOnce
 protected boolean lagOnce
 o discard
 protected boolean discard
 o staticActions
 protected static StringKeyCollection staticActions
 o tellAction
 public static Action tellAction
 o findAction
 public static Action findAction
 o friendAction
 public static Action friendAction
 o summonAction
 public static Action summonAction
 o seePrivateInfoAction
 public static Action seePrivateInfoAction

Constructors

 o Player
 public Player()
Constructs a player

Methods

 o assignInitialOwner
 protected void assignInitialOwner()
Players always own themselves

Overrides:
assignInitialOwner in class Atom
 o putCode
 public final void putCode(Character c,
                           String value)
 o getCodes
 public final Hashtable getCodes()
 o brief
 public boolean brief()
 o isBeyond
 public boolean isBeyond()
 o setTerminal
 public synchronized boolean setTerminal(String name)
 o resetTerminal
 public synchronized void resetTerminal()
 o getTerminal
 public Terminal getTerminal()
 o getRepeated
 public Repeated getRepeated()
 o addMail
 public void addMail(Letter l) throws NonUniqueKeyException, BadKeyException
 o getQualifierList
 public QualifierList getQualifierList()
 o getClan
 public final Clan getClan()
 o setCanPage
 public void setCanPage(boolean v)
 o getIdleMsg
 public String getIdleMsg()
 o getBlockMsg
 public String getBlockMsg()
 o getBlockingMsg
 public String getBlockingMsg()
 o isCitizen
 public final boolean isCitizen()
 o getExpert
 public final boolean getExpert()
 o getTimezone
 public final Duration getTimezone()
 o isHiding
 public boolean isHiding()
 o isLiberated
 public boolean isLiberated()
if the player can't be put into a clan

 o getLastPublicRoom
 public Room getLastPublicRoom()
 o getHome
 public Room getHome()
 o setHome
 public void setHome(Room r)
 o getFriends
 public Friends getFriends()
 o getPrefer
 public Group getPrefer()
 o getInform
 public InformList getInform()
 o setPassword
 public void setPassword(String newValue)
 o linkToScape
 public void linkToScape(Scape s)
 o unlinkFromScape
 public void unlinkFromScape(Scape s)
 o scapes
 public Enumeration scapes()
 o ranks
 public Enumeration ranks()
 o isOutRankedBy
 public boolean isOutRankedBy(Rank rank)
You can target a player if you can target any of the ranks that they're in. That means that most staff members will _not_ be in the 'resident' rank (so they can't hurt each other.

 o getPossessiveName
 public final String getPossessiveName()
eg: "subtle's"

 o getLocation
 public final Room getLocation()
Gets the players location

 o modified
 public boolean modified()
 o resetModify
 public void resetModify()
 o deallocate
 public void deallocate()
 o unIdle
 public final void unIdle()
Called by the interactive connection to reset the players idletime to 0

 o getIdle
 public final Duration getIdle(DateTime now)
 o aspect
 public Paragraph aspect()
A players aspect is its description when looked at

Overrides:
aspect in class Atom
 o authenticate
 public boolean authenticate(InteractiveConnection ic) throws IOException, PlayerDoesntWantThisNameException
Called when a password entry is required

 o beginConnect
 public void beginConnect()
 o endConnect
 public void endConnect()
 o setContext
 public void setContext(Atom r)
 o getContext
 public Atom getContext()
Returns the current players context

 o setLag
 public void setLag(int amount,
                    boolean continual)
 o run
 public void run()
The main thread of a player - simply starts the parser

Overrides:
run in class AnimatedContainer
 o recalculateIdlePrompt
 public final void recalculateIdlePrompt()
 o isIdle
 public final boolean isIdle()
 o afk
 public final void afk(boolean v)
 o isAfk
 public final boolean isAfk()
 o findCommand
 public Object findCommand(CommandContainer search,
                           String command)
 o command
 public void command(String fullLine,
                     InteractiveConnection ic)
This routine kind of doubles up with ModalCommand, but searches many more places than ModalCommand does. Searches the current context + others

 o connected
 public boolean connected()
true if the player is connected

 o getConnection
 public InteractiveConnection getConnection()
 o located
 public boolean located()
true if the player has a location

 o connectTo
 public synchronized void connectTo(InteractiveConnection connection) throws NonUniqueKeyException, BadKeyException
Called to connect a player to an interactive connection.

 o dispose
 public void dispose()
This is a method that should be called only once.

Overrides:
dispose in class Container
 o swapout
 public void swapout()
Similar to dispose(), the swapout() method prepares a Atom to be swapped out non-destructively You should probably sync() before doing this...

Overrides:
swapout in class Container
 o disconnect
 public synchronized void disconnect()
Called to terminate a players connection.

 o setSaved
 public void setSaved()
 o willSync
 public boolean willSync()
 o hasPassword
 public boolean hasPassword()
 o canSave
 public boolean canSave()
 o isStaff
 public boolean isStaff()
 o getRank
 public String getRank()
 o sync
 public void sync() throws IOException
Overrides:
sync in class Atom
 o moveTo
 public void moveTo(Room newLocation,
                    Effect leave,
                    Effect enter)
 o roomLook
 public void roomLook()
 o moveTo
 protected void moveTo(Room newLocation)
 o giveFlorins
 public void giveFlorins(int amount)
Transaction based checking here would ensure that the system couldn't be cheated, given that it was a read only property, which it isn't.

 o getShowFlags
 public boolean[] getShowFlags()
 o himHer
 public final String himHer()
 o HisHer
 public final String HisHer()
 o hisHer
 public final String hisHer()
 o HeShe
 public final String HeShe()
 o heShe
 public final String heShe()
 o maleFemale
 public final String maleFemale()
 o setGender
 public final void setGender(Gender ng)
 o enrolIntoClan
 public synchronized void enrolIntoClan(Clan newClan)
 o recieveFlorins
 public void recieveFlorins(int amount)
 o canMakeFriend
 public boolean canMakeFriend(Player p)
 o getTitledName
 public String getTitledName()
 o getFullName
 public String getFullName()
 o evalReadOnlyProperty
 public Object evalReadOnlyProperty(ReadOnlyProperty p)
override to return the correct value for the supplied property make sure you call super.evalReadOnlyProperty if you don't understand it before returning null

Overrides:
evalReadOnlyProperty in class Container
 o loadFrom
 public synchronized void loadFrom(DataInput from) throws IOException
Overrides:
loadFrom in class Container
 o writeTo
 public synchronized void writeTo(DataOutput to) throws IOException
Overrides:
writeTo in class Container
 o getId
 public String getId()
Overrides:
getId in class Atom
 o isOwner
 public boolean isOwner(Atom potential)
I hereby declare each player to be a soverign state, owned by no other. ;p~

Overrides:
isOwner in class Atom
 o addGenderProperty
 protected DataProperty addGenderProperty(String name,
                                          int value)
Adds a new gender property to the player. Probably best if the player only has one ;). Value should be one of: Gender.MALE, Gender.FEMALE or Gender.NEUTER

 o splash
 public void splash(Effect e,
                    SuppressionList s)
When an effect occurs, people within its "splash" range are notified (that is, they can choose to notice or ignore it).

Overrides:
splash in class Atom
 o sendSystem
 public void sendSystem(String message)
 o sendFeedback
 public void sendFeedback(String message)
This function is used to output direct, *successful* feedback of a players command. It is important that this feedback is normal and expected by the player, since it generally won't be hilited in any way. Please try to restrict this output to a single line.

this command does start a new line

Examples:

You tell name 'hi'

Parameters:
message - the text to be displayed
 o sendError
 public void sendError(String message)
This function is used when the user makes some sort of error in typing - *not* if a command can't be executed because of a failure. So, Command not found would go here, but 'Not enough privs to nuke snapper' wouldn't.

this command does start a new line

 o sendFailure
 public void sendFailure(String message)
 o sendText
 public void sendText(String message)
Meant to be used to send part of what would normally be a paragraph.

 o maybeSetBeyond
 public final void maybeSetBeyond()
 o countRooms
 public final int countRooms()
Returns the number of rooms the player has

 o getCommandList
 public final CommandList getCommandList()
A shortcut, since matching it from the string could be prohibitively slow

 o getStaticCommandList
 public final CommandList getStaticCommandList()
A shortcut, since matching it from the string could be prohibitively slow

 o getActions
 public Enumeration getActions()
Returns a list of the actions supported by this class.

Overrides:
getActions in class Container
 o containsAction
 public boolean containsAction(Action a)
Returns true if the action is supported by this class.

Overrides:
containsAction in class Container
 o getAction
 public Action getAction(String name)
Returns the action corresponding to the supplied name. This routine will need to be overriden by sub-classes using actions.

Overrides:
getAction in class Container
 o getTotalPlayers
 public static int getTotalPlayers()
 o finalize
 protected void finalize() throws Throwable
Overrides:
finalize in class Container
 o canSwap
 public boolean canSwap()
Overrides:
canSwap in class AnimatedContainer
 o isBanished
 public boolean isBanished()
 o setCookie
 public void setCookie(Atom key,
                       Object value)
 o getCookie
 public Object getCookie(Atom key)

All Packages  Class Hierarchy  This Package  Previous  Next  Index