org.starhope.appius.user
Class User

java.lang.Object
  extended by org.starhope.appius.user.GeneralUser
      extended by org.starhope.appius.user.User
All Implemented Interfaces:
Serializable, Comparable<Object>, RoomListener, Collidable, HasVariables, AbstractPerson, AbstractUser, DataRecordBacked<UserRecord>, HasSubversionRevision

public abstract class User
extends GeneralUser
implements AbstractPerson, HasSubversionRevision

This class encapsulates all of the user/player information for the game. Most of the neat stuff is in UserRecord now, though.

Author:
Bruce-Robert Pocock brpocock@star-hope.org, Tim Heys twheys@gmail.com, ewinkelman
See Also:
UserRecord, AbstractUser, Serialized Form

Field Summary
private  Gender gender
          gender of the user
private  List<String> ignoreList
          List of users being ignored
private  Timestamp lastActive
          the time at which the user last was logged on, or the current time (plus 5 seconds) if they're on now.
static int MAX_LOGIN_LENGTH
          Maximum length of a login/username (in characters)
static int MAX_PW_LENGTH
          Maximum length of a password (in characters)
static int MIN_LOGIN_LENGTH
          Minimum length of a login/username (in characters)
static int MIN_PW_LENGTH
          Minimum length of a password (in characters)
private  int mySerial
          unique instance ID
private  long pathController
          Are we being controlled by a pathing routine? This should be the timer event for the next path-finding Kalendor Activity.
 Semaphore positioning
          Semaphore to lock down positioning updates by physics and such
private  long roundTripLag
          round-trip lag/latency to/from the client
private static AtomicInteger serial
          the instantiation serial number for the next user instantiated
private static long serialVersionUID
          Serial Version Unique Identifier for Java Serialization.
(package private)  ServerThread serverThread
          The server thread through which this user is connected.
static int STAFF_LEVEL_ACCOUNT_SERVICE
          Staff level for users able to view account (subscription) data
static int STAFF_LEVEL_DESIGNER
          Staff level for users able to edit the game world
static int STAFF_LEVEL_DEVELOPER
          Staff level for software developers
static int STAFF_LEVEL_MODERATOR
          Staff level for moderators (including life guards and tour guides)
static int STAFF_LEVEL_PUBLIC
          Staff level for public users (free or paid users)
static int STAFF_LEVEL_STAFF_MEMBER
          Staff level for all members of the staff (Sidereal employees)
private  boolean usePathFinder
          Deprecated. testing only
 
Fields inherited from class org.starhope.appius.user.GeneralUser
baseDefenses, baseStats, collisionBounds, currentRoom, facing, lastUserMovement, location, pathFinder, target, travelStartTime, userRecord, userVariables
 
Constructor Summary
protected User(Date birthDate1, String avatarTitle, String userNameRequest, String passwordAnswer, String passwordQuestion, String password)
          Create a new user account
  User(int id)
          Instantiate a user object from an existing user account ID
  User(String newUserLogin)
          Instantiate a user object from an existing user account ID
  User(UserRecord rec)
          Instantiate the user who goes with a given record.
 
Method Summary
 void acceptErrorReply(String command, String error, org.json.JSONObject result, Room room)
           
 void acceptGameAction(AbstractUser sender, org.json.JSONObject action)
          This is an overriding method.
 void acceptGameStateChange(GameEvent gameCode, GameStateFlag gameState)
          Notification of a GameEvent changing state for the room
 void acceptMessage(String title, String caption, String message)
          Accept an administrative/moderator message with the full range of options.
 void acceptObjectJoinRoom(Room room, AbstractUser object)
          Accept notification of a user or object joining the room.
 void acceptObjectJoinRoom(Room room, RoomListener object)
          Notification that someone has entered the room.
 void acceptObjectPartRoom(Room room, RoomListener object)
          Accept notification of a user or object departing the room.
 void acceptOutOfBandMessage(AbstractUser sender, Room room, org.json.JSONObject body)
          Accept an out-of-band message from a room.
 void acceptPrivateMessage(AbstractUser from, String message)
          Accept an incoming private message (“whisper”) from another user.
 void acceptPublicMessage(AbstractUser sender, Room room, String message)
          This is an overriding method.
 void acceptPublicMessage(AbstractUser speaker, String message)
          This is an overriding method.
 void acceptSuccessReply(String command, org.json.JSONObject jsonData, Room room)
           
 void acceptUserAction(Room r, AbstractUser u)
          User actions (go/do actions) propagate through this channel.
 void acceptUserVariableUpdate(AbstractUser user, String varName, String varValue)
          This is an overriding method.
 void addBuddy(AbstractUser newBuddy)
          Adds a user to this user's buddy list.
 void addDefaultFreeItem(int id)
          Deprecated. use Inventory.addDefaultFreeItem(int, boolean)
 void addDefaultFreeItem(int id, boolean forceActive)
          Deprecated. use Inventory#addDefaultFreeItem(int,boolean)
protected  void addFreeClothing(InventoryItem clothingItem)
          Deprecated. use Inventory.addDefaultFreeItem(int, boolean)
 void addGiftSubscription(int months, int days)
           Create a gift subscription for a user, to last the given number of months plus the given number of days.
 void addItem(int itemID)
          Deprecated. use Inventory.add(InventoryItem)
 void addItem(InventoryItem item)
          Deprecated. use Inventory.add(InventoryItem)
 void addRoom(int roomNumber)
           
 void affirmFreeMember()
          Affirm that this is a free (non-premium) member and remove clothing and patterns.
 void affirmPaidMember()
          Ensure that this user has the benefits of being a paid member, effective immediately
 void approveName(AbstractUser abstractUser)
          Approve the user's requested name, and make it active
static void assertUserNameAvailable(String userNameRequested)
          Deprecated. Use Nomenclator.assertLoginAvailable(String) instead
 void ban(AbstractUser bannedBy, String bannedReason)
          Ban a user, preventing any future access to the server.
 void blog(String message)
          send a message with various debugging information to the journals
 boolean canContact()
          Can this person be contacted for marketing and other purposes?
 boolean canLogIn(String passGuess)
          Determine whether the user can log in with the given password.
 boolean canMakePurchase()
           Only adults are allowed to make purchases.
static boolean canSeeSmartFoxServer()
          Deprecated. 
 boolean canTalk()
           
 Room changeRoom(Room room)
          Deprecated. use setRoom(Room)
 boolean checkPassword(String passwordGuess)
          Returns true if the password is correct.
static void configUpdated()
          This is the callback that is called whenever the AppiusConfig reloads the configuration or has a runtime configuration value changed.
static AbstractUser create(Date date, String string, String nick)
          Deprecated. Use Nomenclator.create(Date,String,String) instead
 boolean deleteMail(int messageID)
          Mark a message as being deleted in the messages database.
 void doffClothes()
          Get naked
 void doTransport()
          WRITEME
 void enablePathFinder(boolean b)
          Deprecated. testing only
 boolean equals(Object o)
          This is an overriding method.
 boolean equals(User o)
          Determine if two user objects are identical.
 void equip(InventoryItem item)
          Equip an item
 boolean forgotPassword(String forgottenPasswordQ, String forgottenPasswordA)
          Send the user their forgotten password if they know the answer to their secret question.
 void generateSystemName()
          Deprecated. Use UserRecord.generateSystemName() instead
static AbstractUser get(org.json.JSONObject object)
          Deprecated. Use Nomenclator.get(JSONObject) instead
 org.json.JSONObject getActiveClothing()
          Deprecated. use Inventory.getActiveClothing_JSON()
 Collection<InventoryItem> getActiveDecorations(int roomNumber)
          get the decorations active (placed) in a room of this user's house
 InventoryItem getActiveItemByType(String oneTypeString)
          Deprecated. use Inventory.getActiveItemsByType(InventoryItemType)
 Collection<InventoryItem> getActiveItemsByType(InventoryItemType t)
          Returns the active item for an item type.
 Collection<InventoryItem> getActiveItemsByType(String t)
          Deprecated. use getActiveItemsByType(InventoryItemType)
 int getAge()
          Get the current age of the user.
 AgeBracket getAgeGroup()
          Get the user's age bracket.
abstract  String getApprovalCookie()
          Get a cookie object for sending mail.
 Date getApprovedDate()
           
 String getApprovedDateString()
           
 AvatarClass getAvatarClass()
           
 String getAvatarLabel()
          This is an overriding method.
 Colour getBaseColor()
          get the base colour for this avatar (typically, a skin colour)
 Date getBirthDate()
           
 Collection<String> getBuddyListNames()
          Get the names of everyone on the user's buddy list.
 String[] getBuddyListNamesAsArray()
          Get the names of everyone on the user's buddy list.
static AbstractUser getByID(int id)
          Deprecated. Use Nomenclator.getUserByID(int) instead
static AbstractUser getByLogin(String login)
          Deprecated. Use Nomenclator.getUserByLogin(String) instead
static AbstractUser[] getByMail(String mail)
          Deprecated. Use Nomenclator.getUsersByMail(String) instead
static AbstractUser getByRequestedName(String userNameRequested)
          Deprecated. Use Nomenclator.getUserByRequestedName(String) instead
 Colour getChatBG()
           
 Colour getChatFG()
           
 String getConfirmationTemplate()
          This is an overriding method.
 String getConnectedFrom()
          Get the IP address or hostname from which the user is connected (if we can tell).
 String getDebugName()
          This is an overriding method.
 String getDialect()
          Get this person's preferred language-dialect.
 String getDisplayName()
          Get the name to be displayed in user interface for this person.
 Date getEmailPlusDate()
           
 String getEmailPlusDateString()
           
 Colour getExtraColor()
           
 String getFacing()
          Get the string identifying the direction which this object is facing.
 String getForgotPasswordAnswer()
          Get the forgotten password question
 String getForgotPasswordQuestion()
          Get the forgotten password question
 InventoryItem getFurnitureBySlot(int slotNumber)
          Get a home décor (furniture or structure) item from this user's inventory by its slot number
 boolean getGameFlag(String name)
          Return the status of the indicated game flag.
 Gender getGender()
           
 String getGivenName()
           
 HashMap<Timestamp,HashMap<String,String>> getHistory(Date after, int limit)
          Returns the historical contents of this user's record.
static int getIDForLiveUserName(String name)
          Deprecated. Use Nomenclator.getIDForLiveUserName(String) instead
static int getIDForLogin(String name)
          Deprecated. Use Nomenclator.getUserIDForLogin(String) instead
static int getIDForUserName(String name)
          Deprecated. Nomenclator.getUserIDForLogin(String)
 Inventory getInventory()
          WRITEME: document this method (brpocock@star-hope.org, Feb 19, 2010)
 String getIpAddress()
          Deprecated. Smart Fox Server misspelling of getIPAddress()
 String getIPAddress()
           
 int getKickedByUserID()
           
 String getKickedMessage()
           
 String getKickedReasonCode()
           
 Timestamp getKickedUntil()
           
 long getLag()
           
 String getLanguage()
           
 Timestamp getLastActive()
           
 String getLastZone()
           
 Coord3D getLocation()
          Gets the current start coördinates
 String getLogin()
           
 String getMail()
           
 Date getMailConfirmed()
           
 int getMySerial()
           
 String getName()
           
 Timestamp getNameApprovedAt()
           
 long getNameApprovedByUserID()
           
 Timestamp getNameRequestedAt()
           
static AbstractUser getOnlineUserByLogin(String login)
          Deprecated. Use Nomenclator.getOnlineUserByLogin(String) instead
static Colour getOutlineColourForBaseColour(Colour baseColour)
          Based upon configuration settings, determine the outline colour for a given base colour
 Parent getParent()
           
 boolean getParentApprovedName()
           
 int getParentID()
           
 org.json.JSONObject getPassport_JSON()
           
 String getPassword()
           
 String getPotentialUserName()
          This is an overriding method.
 String getReferer()
          Get the referral/affiliate code from this user's initial signup
static String getRev()
           
 long getRoundTripLag()
           
 long getSerial()
          Get the unique instance serial number for this instance of this user.
 ServerThread getServerThread()
          Get the Appius Claudius Caecus server thread (if any) associated with this User (if they are logged-in).
 String getSubversionRevision()
           Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
static AbstractUser getSystemUser()
          Deprecated. Use Nomenclator.getSystemUser() instead
 Collection<UserEnrolment> getUserEnrolments()
           
 UserEnrolment[] getUserEnrolmentsAsArray()
           
static String getUserNameForID(int id)
          Deprecated. Use Nomenclator.getLoginForID(int) instead
 String getUserNameOrRequest()
          return the user's login name, if they have one; or the name that they have requested, if it hasn't been approved yet.
static Collection<AbstractUser> getUsersAwaitingNameApproval()
           Get up to 20 users who are awaiting approval of their names.
 Map<String,String> getUserVariables()
          Deprecated. use getVariables for consistency
static String[] getZ$Z()
          Z$Z
 Zone getZone()
          Get the user's current Zone, if the user is online.
 Coord3D handleWalkFail(Room room, Coord3D to)
          Called from pathfinders and rooms when the user tries to go someplace and can't get there, to allow them to plot a course around obstacles.
 int hashCode()
          Get a (hopefully unique) hash code for this user.
 boolean hasItem(int id)
          Deprecated. use Inventory.hasItem(int)
 boolean hasItem(InventoryItem item)
          Deprecated. use Inventory.hasItem(int)
private  boolean ignoring(AbstractUser speaker)
           
 boolean isBanned()
           
 boolean isBirthday()
           
 boolean isCanceled()
           
 boolean isCanContact()
          Deprecated. use canContact()
 boolean isCanEnterChatZone()
          Deprecated. GeneralUser.canEnterChatZone()
 boolean isCanEnterMenuZone()
          Deprecated. use GeneralUser.canEnterMenuZone()
 boolean isCanTalk()
           
 boolean isEphemeral()
           
static boolean isItGood()
          Perform basic self-tests upon the User database to identify whether things are good enough to proceed with booting.
 boolean isKicked()
          Returns true if the user has been kicked offline (and the time has not yet elapsed).
static boolean isNameAvailable(String name)
          Deprecated. Use Nomenclator.isLoginAvailable(String) instead
static boolean isNameForbidden(String userNameRequested)
          Deprecated. Use Nomenclator.isLoginForbidden(String) instead
static boolean isNameValid(String userName)
          Determines whether the name provided contains allowed characters for an user name.
 boolean isNeedsNaming()
          Returns whether this account has a system-provided (not user-provided) name, or no name at all, and we need to prompt the user (or parent) to name it.
 boolean isNeedsParentAttention()
           
 boolean isNPC()
          Determine whether this user is a player-character, or non-player-character.
 boolean isOnline()
          WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)
 boolean isPaidMember()
           
 void kick(AbstractUser u, String kickReason, int duration)
          This is an overriding method.
 void kick(AbstractUser kickedBy, String kickedReason, long kickedMinutes)
          Kick a user offline for a number of minutes.
 void kick(AbstractUser kickedBy, String kickedReason, Timestamp allowBack)
          Kick the user offline, until a certain date & time.
 void liftBan(AbstractUser authority)
          Lift the ban upon this user.
 void local_create()
          Hook for special stuff to be done right after a new user account is created
 void loggedIn(String zoneName, ServerThread newServerThread)
           
 void loggedIn(String zoneName, SocketChannel channel)
          Deprecated. 
 String login(String chapSeed, String passwordGuess)
          Validate the user's login attempt, returning a failure message if it could not happen (e.g.
 boolean nameNeedsApproval()
          Returns true if this user has requested a name but it hasn't yet been approved by a Lifeguard
 boolean nameNeedsParentalApproval()
           
 boolean needsNaming()
          Returns whether this account has a system-provided (not user-provided) name, or no name at all, and we need to prompt the user (or parent) to name it.
 void notifyFurnitureInventory(Room room)
          sent notification of the furniture inventory
 void parentApprovedAccount(boolean whether)
          Call this method when the parent determines whether to approve or disapprove this account.
 void parentApprovedName(boolean whether)
           
 void postLoginGlobal()
          Perform global post-login handling — right now, just sends the Message of the Day if the zone isn't a "$" zone.
 void remindPassword()
          This is an overriding method.
 void removeBuddy(AbstractUser otherGuy)
          Don't want for him to be my buddy any more
 void rename(String newName)
           Rename the user account, updating all necessary related records.
 void reportedToModeratorBy(AbstractUser u)
          Another user reported this user.
 void reportedToModeratorBy(AbstractUser u, String reason)
           twheys@gmail.com Feb 17, 2010
 void requestNewUserName(String userNameRequested)
           Post a request to the lifeguards to get approval of a user name
 void requestParentApproval()
          request parent approval
 void sendConfirmationForPremium()
          Send a confirmation eMail for a premium user.
 void sendConfirmationMail()
          Sends confirmation mail to whomever should receive it
 void sendEarnings(Room room, String string)
           
 void sendGameAction(GeneralUser from, org.json.JSONObject data)
          Deprecated. 
 void sendMigrate(AbstractZone refugeeZone)
          Send a notification to the user that s/he should reconnect to a different zone
 void sendOops()
          WRITEME
 void sendPrivateMessage(AbstractUser from, String message)
          Deprecated. 
 void sendPublicMessage(GeneralUser from, String speech)
          Deprecated. use acceptPublicMessage(AbstractUser, String)
 void sendResponse(org.json.JSONObject result)
           
 void sendResponse(org.json.JSONObject result, int room)
          Deprecated. use sendResponse(JSONObject)
 void sendStaffPasswordReset()
          Sends mail to user or parent when a staff member resets their password.
private  void sendSuccessReply(String source, org.json.JSONObject reply, AbstractUser sender, int room)
          Send a “success” reply to the client if one is connected
 void sendWardrobe()
          WRITEME
 void sentConfirmationMail()
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 void setActive(boolean isActive1)
           
 AgeBracket setAgeGroup()
          Sets the age group based upon the user's date of birth.
 void setAgeGroupToSystem()
          WRITEME
 void setApprovedDate(Date date)
           
 void setAvatarClass(AvatarClass avatarClass)
          set the avatar class for this user
 void setBaseColor(Colour newBaseColor)
          WRITEME
 void setBirthDate(Date birthDate1)
           
 void setCanceled(boolean isCanceled1)
           
 void setCanContact(boolean canContact1)
           
 void setCanEnterChatZone(boolean canEnterChatZone1)
           
 void setCanEnterMenuZone(boolean canEnterMenuZone1)
           
 void setCanTalk(boolean canTalk1)
          WRITEME
 void setChatBG(Colour newChatBG)
           
 void setChatFG(Colour newChatFG)
           
 void setEmailPlusDate(Date emailPlusDate1)
           
 void setExtraColor(Colour extraColor1)
           
 void setFacing(String newFacing)
           
 void setForgotPasswordAnswer(String answer)
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 void setForgotPasswordQuestion(String question)
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 void setGender(Gender setGender)
           
 void setGivenName(String givenName1)
           
 void setLastActive()
          WRITEME
(package private)  void setLastActive(Timestamp timestamp)
           
 void setLocation(Coord3D coord3d)
          Set the user's location; but note that you should be using Room.putHere(AbstractUser, Coord3D) to position a player
 void setLoggedIn(String ipAddress, String zone)
           Notify the multiverse that the user is logging in
 void setLogin(String from, String zone)
          Deprecated. use setLoggedIn(String, String) — less ambiguous/misleading name
 void setLot(int newLotID)
          Deprecated. use UserHouse.setLotID(int)
 void setLotID(int newLotID)
          Deprecated. use UserHouse#setLotID (int)
 void setMail(String newMail)
          WRITEME
 void setMailConfirmed(Date mailConfirmed1)
          Sets the user capabilities to allow talking, and permits the user entry into both chat zones and menu-chat-only zones.
 void setMailConfirmSent(Date date)
           
 boolean setNeedsNaming(boolean needsNaming1)
           
 void setParent(Parent parent)
          Set this to be a child account with the specified parent.
 void setParentByParent(Parent parent)
          Set this to be a child account with the specified parent.
 void setPassword(String password1)
          Changes the person's password
 void setPasswordAndPasswordRecovery(String question, String answer, String newPassword)
           
 void setPasswordRecovery(String forgottenPasswordQuestion, String forgottenPasswordAnswer)
          Set the password-recovery question and answer pair
 String setRandomPassword()
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 void setReferer(String theReferer)
           Set the referrer from whom we were sent this new user.
 void setRegisteredAt(Timestamp newRegisteredAt)
           
 int setRoom(Room room)
          Set the user's current room to the given room.
 void setRoundTripLag(long l)
          Update the lag time associated with this user
 void setServerThread(ServerThread serverThread2)
          Set the server thread controlling this user.
 void setStaffLevel(int newStaffLevel)
           
 void setStartT(long when)
          This is an overriding method.
 void setStructure(InventoryItem item)
          Activate one structural element in lieu of any others that occupy the same slot.
protected  void setSubclassValues(ResultSet resultSet)
          Set the values specific to a subclass of User
 void setTravelStart(long l)
          WRITEME: Document this method brpocock@star-hope.org
 void setUserName(String newLogin)
           
 void setUserNameFromUser(String userRequestedLogin)
           Set a user name, requested by the user.
 void speak(Room room, String string)
           
 void startEnrolment(UserEnrolment userEnrolment)
           
 org.json.JSONObject toJSON()
           
 org.json.JSONObject toJSONRef()
          This is analogous to toSFSXML() for the pure JSON “to infinity and beyond” interface
 String toSFSXML()
           
 String toString()
           
 void updateWallet()
          review your current wallet currency amounts, they may have changed
 
Methods inherited from class org.starhope.appius.user.GeneralUser
assertLocationUnlocked, assertStaffLevel, attend, canApproveSelf, canBetaTest, canEnterChatZone, canEnterMenuZone, changeBaseDefenses, compareTo, deleteVariable, getBaseDefenses, getBaseStat, getCenterOfMass, getCollisionBounds, getCurrentAction, getD, getEffectiveDefenses, getEndMovementTime, getGameEquipItems_JSON, getGameEquipItems, getHeight, getHouse, getItemsByType, getItemsByType, getItemsByTypeAsArray, getLocationForUpdate, getMass, getMoney, getPathFinder, getPublicInfo, getRegisteredAt, getRegisteredDate, getRegisteredDateString, getRequestedName, getResponsibleMail, getRoom, getRoomNumber, getSizeScalar, getStaffLevel, getStartMovementTime, getStartT, getStat, getTarget, getTravelRate, getTravelStart, getUserID, getUserListIterator, getUserName, getVariable, getVariables, getVariablesJSON, getVelocity, getWallet, hasStaffLevel, hasVariable, ignore, isActive, isApproved, local_publicInfo, needsParent, purchase, resetVariables, sendBuddyList, setBackingRecord, setCenterOfMass, setCurrentAction, setTarget, setTravelRate, setVariable, setVariable, setVariables, setVelocity, takeAttack, unlockLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.starhope.appius.user.AbstractPerson
getResponsibleMail
 

Field Detail

MAX_LOGIN_LENGTH

public static final int MAX_LOGIN_LENGTH
Maximum length of a login/username (in characters)

See Also:
Constant Field Values

MAX_PW_LENGTH

public static final int MAX_PW_LENGTH
Maximum length of a password (in characters)

See Also:
Constant Field Values

MIN_LOGIN_LENGTH

public static final int MIN_LOGIN_LENGTH
Minimum length of a login/username (in characters)

See Also:
Constant Field Values

MIN_PW_LENGTH

public static final int MIN_PW_LENGTH
Minimum length of a password (in characters)

See Also:
Constant Field Values

serial

private static AtomicInteger serial
the instantiation serial number for the next user instantiated


serialVersionUID

private static final long serialVersionUID
Serial Version Unique Identifier for Java Serialization. serialVersionUID (long)

See Also:
Constant Field Values

STAFF_LEVEL_ACCOUNT_SERVICE

public static final int STAFF_LEVEL_ACCOUNT_SERVICE
Staff level for users able to view account (subscription) data

See Also:
Constant Field Values

STAFF_LEVEL_DESIGNER

public static final int STAFF_LEVEL_DESIGNER
Staff level for users able to edit the game world

See Also:
Constant Field Values

STAFF_LEVEL_DEVELOPER

public static final int STAFF_LEVEL_DEVELOPER
Staff level for software developers

See Also:
Constant Field Values

STAFF_LEVEL_MODERATOR

public static final int STAFF_LEVEL_MODERATOR
Staff level for moderators (including life guards and tour guides)

See Also:
Constant Field Values

STAFF_LEVEL_PUBLIC

public static final int STAFF_LEVEL_PUBLIC
Staff level for public users (free or paid users)

See Also:
Constant Field Values

STAFF_LEVEL_STAFF_MEMBER

public static final int STAFF_LEVEL_STAFF_MEMBER
Staff level for all members of the staff (Sidereal employees)

See Also:
Constant Field Values

gender

private Gender gender
gender of the user


ignoreList

private final transient List<String> ignoreList
List of users being ignored


lastActive

private Timestamp lastActive
the time at which the user last was logged on, or the current time (plus 5 seconds) if they're on now.


mySerial

private final transient int mySerial
unique instance ID


pathController

private final long pathController
Are we being controlled by a pathing routine? This should be the timer event for the next path-finding Kalendor Activity.

See Also:
Constant Field Values

positioning

public Semaphore positioning
Semaphore to lock down positioning updates by physics and such


roundTripLag

private long roundTripLag
round-trip lag/latency to/from the client


serverThread

transient ServerThread serverThread
The server thread through which this user is connected.


usePathFinder

@Deprecated
private boolean usePathFinder
Deprecated. testing only
Temporary: use the testing path finder

Constructor Detail

User

protected User(Date birthDate1,
               String avatarTitle,
               String userNameRequest,
               String passwordAnswer,
               String passwordQuestion,
               String password)
        throws AlreadyUsedException,
               ForbiddenUserException,
               NumberFormatException
Create a new user account

Parameters:
birthDate1 - The player's date of birth
avatarTitle - The name of the avatar (class) which the player wants to use. This must be one of the fixed string names of the Basic 8 Toots™
userNameRequest - The user name requested
password - the user's password
passwordQuestion - the password recovery question
passwordAnswer - the answer to the password recovery question
Throws:
ForbiddenUserException - If the user is administratively prohibited from registering, e.g. due to a bad user name
AlreadyUsedException - If the user name is not available
NumberFormatException - If the date of birth is irrational

User

public User(int id)
     throws NotFoundException
Instantiate a user object from an existing user account ID

Parameters:
id - user ID value
Throws:
NotFoundException - if the user can't be found in the database.

User

public User(String newUserLogin)
     throws NotFoundException
Instantiate a user object from an existing user account ID

Parameters:
newUserLogin - user login name
Throws:
NotFoundException - if the user can't be found in the database.

User

public User(UserRecord rec)
Instantiate the user who goes with a given record. Also sets the “notable” user variable, if applicable.

Parameters:
rec - the user record
Method Detail

assertUserNameAvailable

@Deprecated
public static void assertUserNameAvailable(String userNameRequested)
                                    throws AlreadyUsedException,
                                           ForbiddenUserException
Deprecated. Use Nomenclator.assertLoginAvailable(String) instead

Make the assertion that the user name supplied is available to be requested or assigned to this user.

Note that having another user request the name, which has not been either permitted or denied, will still throw an AlreadyUsedException.

This routine returns void, because it throws exceptions if the name is forbidden or already used. For a boolean version, see Nomenclator.isLoginAvailable(String)

Parameters:
userNameRequested - The name which is being requested
Throws:
AlreadyUsedException - if the user name has been requested or accepted already
ForbiddenUserException - if the user name is forbidden from use (obscene, gives away personal information, or so forth). See Nomenclator.isLoginForbidden(String)

canSeeSmartFoxServer

@Deprecated
public static boolean canSeeSmartFoxServer()
Deprecated. 

Check whether the SmartFox Server is available and visible to us (sharing this VM). If so, the static member variable "sfs" will be set to it. Since this is not longer supported, the results will always be false and this method is deprecated.

Returns:
true, if we have access to Smart Fox Server.

configUpdated

public static void configUpdated()
This is the callback that is called whenever the AppiusConfig reloads the configuration or has a runtime configuration value changed.


create

@Deprecated
public static AbstractUser create(Date date,
                                             String string,
                                             String nick)
                           throws AlreadyUsedException,
                                  ForbiddenUserException
Deprecated. Use Nomenclator.create(Date,String,String) instead

Create a new user account

Parameters:
date - User's date of birth
string - Character class or type designator
nick - User's requested nickname
Returns:
the new user object
Throws:
AlreadyUsedException - if the nickname is not available
ForbiddenUserException - if the user account is not permitted to be created, e.g. for having an obscene user ID

get

@Deprecated
public static AbstractUser get(org.json.JSONObject object)
Deprecated. Use Nomenclator.get(JSONObject) instead

Pick up a user from a JSON object containing either the ID or login (user name) string

Parameters:
object - A JSON object with either an { id: userID } or { login: userName }
Returns:
the User thusly fetched

getByID

@Deprecated
public static AbstractUser getByID(int id)
Deprecated. Use Nomenclator.getUserByID(int) instead

Instantiate a user object from an existing user account ID

Parameters:
id - The user ID to instantiate
Returns:
the instantiated user record, or null if the user ID doesn't represent a user record (too high, or the record was destroyed somehow) — not returned for deleted or banned accounts, though.

getByLogin

@Deprecated
public static AbstractUser getByLogin(String login)
Deprecated. Use Nomenclator.getUserByLogin(String) instead

Parameters:
login - the user login name
Returns:
the User record, or null if no user currently has that login name

getByMail

@Deprecated
public static AbstractUser[] getByMail(String mail)
Deprecated. Use Nomenclator.getUsersByMail(String) instead

Returns an array of all users associated with a given eMail address. This includes all users who report it as being their own eMail address, as well as the children of any parents using it.

Parameters:
mail - The eMail address for which we are searching
Returns:
An array of any/all such users. If the array consists only of one element, which is the value "null," then there are too many results and special effort is required to recall the list.

getByRequestedName

@Deprecated
public static AbstractUser getByRequestedName(String userNameRequested)
Deprecated. Use Nomenclator.getUserByRequestedName(String) instead

Get the user who has requested a certain name, if any.

Parameters:
userNameRequested - the user name for which we're searching
Returns:
null, if no user has requested the name; otherwise, the user who requested it. (Note that the name might have been approved, or might not have been.)

getIDForLiveUserName

@Deprecated
public static int getIDForLiveUserName(String name)
Deprecated. Use Nomenclator.getIDForLiveUserName(String) instead

Find the user name for a user who is currently signed on.

Parameters:
name - User name to look up
Returns:
The user ID number, if the user is online; else -1

getIDForLogin

@Deprecated
public static int getIDForLogin(String name)
Deprecated. Use Nomenclator.getUserIDForLogin(String) instead

Fetch the user ID number for a user name

Parameters:
name - The user name (login)
Returns:
the user ID

getIDForUserName

@Deprecated
public static int getIDForUserName(String name)
Deprecated. Nomenclator.getUserIDForLogin(String)

Fetch the user ID number for a user name

Parameters:
name - The user name (login)
Returns:
the user ID

getOnlineUserByLogin

@Deprecated
public static AbstractUser getOnlineUserByLogin(String login)
Deprecated. Use Nomenclator.getOnlineUserByLogin(String) instead

Parameters:
login - user login
Returns:
an online user, if one is found, else, null.≥

getOutlineColourForBaseColour

public static Colour getOutlineColourForBaseColour(Colour baseColour)
Based upon configuration settings, determine the outline colour for a given base colour

Parameters:
baseColour - the base colour (will not be altered)
Returns:
the outline colour

getRev

public static String getRev()
Returns:
the Subversion revision number of this file

getSystemUser

@Deprecated
public static AbstractUser getSystemUser()
Deprecated. Use Nomenclator.getSystemUser() instead

Get the System user object (the user which represents the system program itself). In particular, the System object's eMail address and givenName are used to address mail to users.

Returns:
the System user object

getUserNameForID

@Deprecated
public static String getUserNameForID(int id)
Deprecated. Use Nomenclator.getLoginForID(int) instead

Parameters:
id - The user ID value
Returns:
The user's login name

getUsersAwaitingNameApproval

public static Collection<AbstractUser> getUsersAwaitingNameApproval()

Get up to 20 users who are awaiting approval of their names. Will not return more than 20 users in a set, but could return an empty set.

XXX contains SQL

Returns:
A set of users who are awaiting name approval

getZ$Z

public static String[] getZ$Z()
Z$Z

Returns:
Z$Z

isItGood

public static boolean isItGood()
Perform basic self-tests upon the User database to identify whether things are good enough to proceed with booting.

Returns:
true if things are good.

isNameAvailable

@Deprecated
public static boolean isNameAvailable(String name)
Deprecated. Use Nomenclator.isLoginAvailable(String) instead

Determine whether the given name is potentially available for use. Returns false if the name has already been forbidden (by virtue of matching a negative filter rule, or having been previously denied to another user), or if the name is currently either in use or requested by another user.

Parameters:
name - The user name being checked
Returns:
true, if the name can potentially be tried.

isNameForbidden

@Deprecated
public static boolean isNameForbidden(String userNameRequested)
Deprecated. Use Nomenclator.isLoginForbidden(String) instead

Determine whether a name is forbidden

... A user name is “forbidden” if it matches a negative filter (if it contains forbidden word(s) or phrase(s)), or if it has previously been banned for some reason

Parameters:
userNameRequested - The name to be checked
Returns:
True, if the requested name is forbidden

isNameValid

public static boolean isNameValid(String userName)
Determines whether the name provided contains allowed characters for an user name.

Parameters:
userName - the user name to be checked
Returns:
true, if the name consists of valid characters

acceptErrorReply

public void acceptErrorReply(String command,
                             String error,
                             org.json.JSONObject result,
                             Room room)
Specified by:
acceptErrorReply in interface AbstractUser
Parameters:
command - The command which produced the error
error - The error code
result - The additional JSON data describing the error
room - The room in which the user was standing when the error occurred.
See Also:
AbstractUser.acceptErrorReply(java.lang.String, java.lang.String, org.json.JSONObject, org.starhope.appius.game.Room)

acceptGameAction

public void acceptGameAction(AbstractUser sender,
                             org.json.JSONObject action)
This is an overriding method.

Specified by:
acceptGameAction in interface RoomListener
Parameters:
sender - the sender
action - The game action. The verb is in action.getString("action").
See Also:
RoomListener.acceptGameAction(AbstractUser, JSONObject)

acceptGameStateChange

public void acceptGameStateChange(GameEvent gameCode,
                                  GameStateFlag gameState)
Description copied from interface: RoomListener
Notification of a GameEvent changing state for the room

Specified by:
acceptGameStateChange in interface RoomListener
Parameters:
gameCode - The GameEvent whose state is changing
gameState - The new state
See Also:
RoomListener.acceptGameStateChange(org.starhope.appius.game.GameEvent, org.starhope.appius.game.GameStateFlag)

acceptMessage

public void acceptMessage(String title,
                          String caption,
                          String message)
Accept an administrative/moderator message with the full range of options. If the user is currently online, forward this message to them.

Specified by:
acceptMessage in interface AbstractUser
Parameters:
title - The title of the message
caption - The caption; usually ADMIN for administrative messages
message - The message body text

acceptObjectJoinRoom

public void acceptObjectJoinRoom(Room room,
                                 AbstractUser object)
Accept notification of a user or object joining the room.

Parameters:
room - the room in question
object - the object leaving the room
See Also:
RoomListener.acceptObjectJoinRoom(Room, RoomListener)

acceptObjectJoinRoom

public void acceptObjectJoinRoom(Room room,
                                 RoomListener object)
Description copied from interface: RoomListener
Notification that someone has entered the room.

Specified by:
acceptObjectJoinRoom in interface RoomListener
Overrides:
acceptObjectJoinRoom in class GeneralUser
Parameters:
room - The room
object - The thing (probably user) entering
See Also:
RoomListener.acceptObjectJoinRoom(org.starhope.appius.game.Room, org.starhope.appius.game.RoomListener)

acceptObjectPartRoom

public void acceptObjectPartRoom(Room room,
                                 RoomListener object)
Accept notification of a user or object departing the room.

Specified by:
acceptObjectPartRoom in interface RoomListener
Overrides:
acceptObjectPartRoom in class GeneralUser
Parameters:
room - The room
object - The thing (probably user) departing
See Also:
RoomListener.acceptObjectPartRoom(Room, RoomListener)

acceptOutOfBandMessage

public void acceptOutOfBandMessage(AbstractUser sender,
                                   Room room,
                                   org.json.JSONObject body)
Accept an out-of-band message from a room.

Specified by:
acceptOutOfBandMessage in interface RoomListener
Overrides:
acceptOutOfBandMessage in class GeneralUser
Parameters:
sender - The user transmitting the out-of-band message
body - The contents of that message (in JSO)
room - The room in which the sender is found — and, typically, also this recipient.
See Also:
RoomListener.acceptOutOfBandMessage(org.starhope.appius.user.AbstractUser, org.starhope.appius.game.Room, org.json.JSONObject)

acceptPrivateMessage

public void acceptPrivateMessage(AbstractUser from,
                                 String message)
Accept an incoming private message (“whisper”) from another user.

Specified by:
acceptPrivateMessage in interface AbstractUser
Parameters:
from - The user “whispering” to this one
message - The contents of the message

acceptPublicMessage

public void acceptPublicMessage(AbstractUser sender,
                                Room room,
                                String message)
This is an overriding method.

Specified by:
acceptPublicMessage in interface RoomListener
Parameters:
sender - The speaker
room - The room in which the words were spoken
message - The spoken text or /emote
See Also:
RoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser, org.starhope.appius.game.Room, java.lang.String)

acceptPublicMessage

public void acceptPublicMessage(AbstractUser speaker,
                                String message)
This is an overriding method.

Specified by:
acceptPublicMessage in interface RoomListener
Parameters:
speaker - The speaker
message - The spoken text or /emote
See Also:
RoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser, java.lang.String)

acceptSuccessReply

public void acceptSuccessReply(String command,
                               org.json.JSONObject jsonData,
                               Room room)
Specified by:
acceptSuccessReply in interface AbstractUser
Parameters:
command - the command sending the successful reply
jsonData - additional JSON data
room - the room in which the success happened

acceptUserAction

public void acceptUserAction(Room r,
                             AbstractUser u)
Description copied from interface: RoomListener
User actions (go/do actions) propagate through this channel.

Specified by:
acceptUserAction in interface RoomListener
Overrides:
acceptUserAction in class GeneralUser
Parameters:
r - the room in which the user is taking an action
u - the user taking an action
See Also:
RoomListener.acceptUserAction(Room, AbstractUser)

acceptUserVariableUpdate

public void acceptUserVariableUpdate(AbstractUser user,
                                     String varName,
                                     String varValue)
This is an overriding method.

Specified by:
acceptUserVariableUpdate in interface RoomListener
Overrides:
acceptUserVariableUpdate in class GeneralUser
Parameters:
user - The user updating their variable
varName - The name of the variable (key)
varValue - The new value (null if unset)
See Also:
RoomListener.acceptUserVariableUpdate(org.starhope.appius.user.AbstractUser, java.lang.String, java.lang.String)

addBuddy

public void addBuddy(AbstractUser newBuddy)
Adds a user to this user's buddy list. Note that this does not implement the buddy-request functionality at this level, that's implemented by the client at present.

Specified by:
addBuddy in interface AbstractUser
Overrides:
addBuddy in class GeneralUser
Parameters:
newBuddy - the user to be the new buddy
See Also:
AbstractUser.addBuddy(org.starhope.appius.user.AbstractUser)

addDefaultFreeItem

@Deprecated
public void addDefaultFreeItem(int id)
Deprecated. use Inventory.addDefaultFreeItem(int, boolean)

Identical to @link addDefaultFreeItem(int, boolean) with “false” for the second parameter

Parameters:
id - the item ID.

addDefaultFreeItem

@Deprecated
public void addDefaultFreeItem(int id,
                                          boolean forceActive)
Deprecated. use Inventory#addDefaultFreeItem(int,boolean)

Add an item which every user gets for free to the user's inventory, if it does not already exist. This method is used to enforce a minimum inventory upon users. Examples of default free items in Tootsville™ include the Basic 8 Toots patterns, and the default TootsBook theme.

Parameters:
id - the item ID
forceActive - if true, force the item to be active upon adding it to the user's inventory

addFreeClothing

@Deprecated
protected void addFreeClothing(InventoryItem clothingItem)
Deprecated. use Inventory.addDefaultFreeItem(int, boolean)

Parameters:
clothingItem - The item to be added to the user's inventory as a free gift (or prize)

addGiftSubscription

public void addGiftSubscription(int months,
                                int days)

Create a gift subscription for a user, to last the given number of months plus the given number of days.

To create a lifetime subscription, provide 1000 as the number of months.

Specified by:
addGiftSubscription in interface AbstractUser
Parameters:
months - either 1000 (or any greater value over 1000) for a lifetime subscription, or, the number of months for a gift subscription.
days - the number of days for a gift subscription. Ignored for lifetime subscriptions.

addItem

@Deprecated
public void addItem(int itemID)
Deprecated. use Inventory.add(InventoryItem)

Add an item to the user's inventory.

Specified by:
addItem in interface AbstractUser
Parameters:
itemID - The item's database ID number.

addItem

@Deprecated
public void addItem(InventoryItem item)
Deprecated. use Inventory.add(InventoryItem)

Add an item to the user's inventory. This does not conduct a purchase event.

Parameters:
item - The item to be added to inventory.

addRoom

public void addRoom(int roomNumber)
Parameters:
roomNumber - add a room to the user's house

affirmFreeMember

public void affirmFreeMember()
Affirm that this is a free (non-premium) member and remove clothing and patterns.


affirmPaidMember

public void affirmPaidMember()
Ensure that this user has the benefits of being a paid member, effective immediately


approveName

public void approveName(AbstractUser abstractUser)
                 throws PrivilegeRequiredException,
                        AlreadyUsedException
Approve the user's requested name, and make it active

Parameters:
abstractUser - the user approving the name (requires moderator privileges)
Throws:
PrivilegeRequiredException - if the user approving the name does not have moderator privileges
AlreadyUsedException - if the name is already in use by someone else

ban

public void ban(AbstractUser bannedBy,
                String bannedReason)
         throws PrivilegeRequiredException
Ban a user, preventing any future access to the server.

Specified by:
ban in interface AbstractUser
Parameters:
bannedBy - The moderator by which the user was banned.
bannedReason - the reason for which the user was banned
Throws:
PrivilegeRequiredException - if the user does not have moderator-level (or better) privileges

blog

public void blog(String message)
send a message with various debugging information to the journals

Parameters:
message - the message to be recorded

canContact

public boolean canContact()
Description copied from interface: AbstractPerson
Can this person be contacted for marketing and other purposes?

Specified by:
canContact in interface AbstractPerson
Returns:
true, if this person permits communications of that sort
See Also:
AbstractPerson.canContact()

canLogIn

public boolean canLogIn(String passGuess)
Determine whether the user can log in with the given password.

Parameters:
passGuess - The user's attempted password
Returns:
true, if the user gave the correct password, and is allowed to log in. False, if any of these is not true (but does not give any information why)

canMakePurchase

public boolean canMakePurchase()

Only adults are allowed to make purchases. Determine whether this user is allowed to make purchases, or if we should ask them to get their parents to buy things for them.

In the future, this might not be just a test to check whether the user is an adult. We might, for example, have kids with gift cards that will be able to make some purchases on their own.

Returns:
true, if this user is allowed to purchase things. False, if they have to get their parents' permission.

canTalk

public boolean canTalk()
Specified by:
canTalk in interface AbstractUser
Returns:
the canTalk

changeRoom

@Deprecated
public Room changeRoom(Room room)
Deprecated. use setRoom(Room)

Parameters:
room - the new room to be joined
Returns:
the old room which was departed (if any)

checkPassword

public boolean checkPassword(String passwordGuess)
Description copied from interface: AbstractPerson
Returns true if the password is correct. Returns false if password is not set or the guess was blank.

Specified by:
checkPassword in interface AbstractPerson
Parameters:
passwordGuess - the supplied password that we want to check
Returns:
true, if the password supplied is correct

deleteMail

public boolean deleteMail(int messageID)
Mark a message as being deleted in the messages database.

Parameters:
messageID - The message ID to be marked as deleted.
Returns:
true if anything were deleted

doffClothes

public void doffClothes()
Get naked

Specified by:
doffClothes in interface AbstractUser
Overrides:
doffClothes in class GeneralUser
See Also:
AbstractUser.doffClothes()

doTransport

public void doTransport()
Description copied from interface: AbstractUser
WRITEME

Specified by:
doTransport in interface AbstractUser
See Also:
AbstractUser.doTransport()

enablePathFinder

@Deprecated
public void enablePathFinder(boolean b)
Deprecated. testing only

Temporary: use the testing path finder

Parameters:
b - whether to use it or not

equals

public boolean equals(Object o)
This is an overriding method.

Overrides:
equals in class GeneralUser
See Also:
Object.equals(java.lang.Object)

equals

public boolean equals(User o)
Determine if two user objects are identical. Two objects are equal if they have both the same serial number and user ID.

Parameters:
o - the other user
Returns:
true, if the two instances are totally identical

equip

public void equip(InventoryItem item)
           throws GameLogicException
Equip an item

Parameters:
item - The item to be equipped
Throws:
GameLogicException - if the user does not have the item

forgotPassword

public boolean forgotPassword(String forgottenPasswordQ,
                              String forgottenPasswordA)
Send the user their forgotten password if they know the answer to their secret question. WRITEME clarify

Specified by:
forgotPassword in interface AbstractPerson
Parameters:
forgottenPasswordQ - The question being answered
forgottenPasswordA - The answer provided
Returns:
true if answer is correct and false if it is not also triggers the send password e-mail if correct.

generateSystemName

@Deprecated
public void generateSystemName()
Deprecated. Use UserRecord.generateSystemName() instead

Generate a new "anonymous user name" for the user.


getActiveClothing

@Deprecated
public org.json.JSONObject getActiveClothing()
Deprecated. use Inventory.getActiveClothing_JSON()

Returns:
A JSON array of clothing being worn (including pattern and Pivitz) in the order preferred by the client

getActiveDecorations

public Collection<InventoryItem> getActiveDecorations(int roomNumber)
                                               throws NotFoundException
get the decorations active (placed) in a room of this user's house

Parameters:
roomNumber - which room of the user's house
Returns:
home décor items in this room
Throws:
NotFoundException - if the room does not exist

getActiveItemByType

@Deprecated
public InventoryItem getActiveItemByType(String oneTypeString)
Deprecated. use Inventory.getActiveItemsByType(InventoryItemType)

Parameters:
oneTypeString - An InventoryItemType string
Returns:
an item of that type which is active; or, null.

getActiveItemsByType

public Collection<InventoryItem> getActiveItemsByType(InventoryItemType t)
Returns the active item for an item type.

Parameters:
t - An Item type to match by.
Returns:
The active inventory item for type t

getActiveItemsByType

@Deprecated
public Collection<InventoryItem> getActiveItemsByType(String t)
Deprecated. use getActiveItemsByType(InventoryItemType)

Returns the active item for an item type.

Parameters:
t - A string of the item type. Use Constants from InventoryItem
Returns:
The active inventory item for type t

getAge

public int getAge()
Get the current age of the user. This is set up such that the user's age will increment on their birthday.

Specified by:
getAge in interface AbstractUser
Overrides:
getAge in class GeneralUser
Returns:
The user's legal age, in years.
See Also:
AbstractUser.getAge()

getAgeGroup

public AgeBracket getAgeGroup()
Description copied from interface: AbstractUser
Get the user's age bracket. Note that system (robot) users will have the special age bracket type AgeBracket.System.

Specified by:
getAgeGroup in interface AbstractUser
Overrides:
getAgeGroup in class GeneralUser
Returns:
the ageGroup
See Also:
AbstractUser.getAgeGroup()

getApprovalCookie

public abstract String getApprovalCookie()
Description copied from interface: AbstractPerson
Get a cookie object for sending mail. Cookies are generated differently between User and Parent.

Specified by:
getApprovalCookie in interface AbstractPerson
Returns:
an opaque string that identifies the user uniquely
See Also:
AbstractPerson.getApprovalCookie()

getApprovedDate

public Date getApprovedDate()
Returns:
the date on which this account was approved

getApprovedDateString

public String getApprovedDateString()
Specified by:
getApprovedDateString in interface AbstractUser
Overrides:
getApprovedDateString in class GeneralUser
Returns:
Returns an user-visible string describing whether the user has been approved, and if so, when
See Also:
getApprovedDate()

getAvatarClass

public AvatarClass getAvatarClass()
Specified by:
getAvatarClass in interface AbstractUser
Returns:
the avatarClassID

getAvatarLabel

public String getAvatarLabel()
This is an overriding method.

Specified by:
getAvatarLabel in interface AbstractUser
Returns:
The avatar label
See Also:
AbstractUser.getAvatarLabel()

getBaseColor

public Colour getBaseColor()
get the base colour for this avatar (typically, a skin colour)

Specified by:
getBaseColor in interface AbstractUser
Returns:
the base colour

getBirthDate

public Date getBirthDate()
Returns:
player's date of birth, if known

getBuddyListNames

public Collection<String> getBuddyListNames()
Get the names of everyone on the user's buddy list. See GeneralUser.getUserListIterator(String)

Specified by:
getBuddyListNames in interface AbstractUser
Returns:
set of user strings

getBuddyListNamesAsArray

public String[] getBuddyListNamesAsArray()
Get the names of everyone on the user's buddy list.

Returns:
String array of user names

getChatBG

public Colour getChatBG()
Returns:
the chat background colour

getChatFG

public Colour getChatFG()
Returns:
the chat foreground colour

getConfirmationTemplate

public String getConfirmationTemplate()
This is an overriding method.

Specified by:
getConfirmationTemplate in interface AbstractPerson
Returns:
the template filename to be used for confirming this account
See Also:
AbstractPerson.getConfirmationTemplate()

getConnectedFrom

public String getConnectedFrom()
Get the IP address or hostname from which the user is connected (if we can tell). See isOnline() for the usual caveats

Returns:
Hostname "/" IP address. Hostname is often absent.

getDebugName

public String getDebugName()
This is an overriding method.

Specified by:
getDebugName in interface AbstractUser
Returns:
A string with the user's login string and user ID number, formatted for debugging output
See Also:
AbstractUser.getDebugName()

getDialect

public String getDialect()
Description copied from interface: AbstractPerson
Get this person's preferred language-dialect.

Specified by:
getDialect in interface AbstractPerson
Specified by:
getDialect in interface AbstractUser
Overrides:
getDialect in class GeneralUser
Returns:
the dialect
See Also:
AbstractUser.getDialect()

getDisplayName

public String getDisplayName()
Description copied from interface: AbstractPerson
Get the name to be displayed in user interface for this person. This should give the person's given name, but if that information is unavailable, fall back upon other unique identifier such as their avatar label

Specified by:
getDisplayName in interface AbstractPerson
Specified by:
getDisplayName in interface AbstractUser
Overrides:
getDisplayName in class GeneralUser
Returns:
WRITEME
See Also:
AbstractPerson.getDisplayName()

getEmailPlusDate

public Date getEmailPlusDate()
Returns:
the emailPlusDate

getEmailPlusDateString

public String getEmailPlusDateString()
Returns:
Returns a user-displayable English string describing when the eMail Plus confirmation happened, if it has.
See Also:
getEmailPlusDate()

getExtraColor

public Colour getExtraColor()
Specified by:
getExtraColor in interface AbstractUser
Overrides:
getExtraColor in class GeneralUser
Returns:
the extraColor
See Also:
AbstractUser.getExtraColor()

getFacing

public String getFacing()
Description copied from interface: AbstractUser
Get the string identifying the direction which this object is facing. One of: N,S,E,W,NE,NW,SW,SE.

Specified by:
getFacing in interface AbstractUser
Overrides:
getFacing in class GeneralUser
Returns:
the facing
See Also:
AbstractUser.getFacing()

getForgotPasswordAnswer

public String getForgotPasswordAnswer()
Description copied from interface: AbstractPerson
Get the forgotten password question

Specified by:
getForgotPasswordAnswer in interface AbstractPerson
Returns:
the question to ask
See Also:
AbstractPerson.getForgotPasswordAnswer()

getForgotPasswordQuestion

public String getForgotPasswordQuestion()
Description copied from interface: AbstractPerson
Get the forgotten password question

Specified by:
getForgotPasswordQuestion in interface AbstractPerson
Returns:
the question to ask
See Also:
AbstractPerson.getForgotPasswordQuestion()

getFurnitureBySlot

public InventoryItem getFurnitureBySlot(int slotNumber)
                                 throws NotFoundException
Get a home décor (furniture or structure) item from this user's inventory by its slot number

Parameters:
slotNumber - the slot number for the user's inventory
Returns:
the home décor item in the given inventory slot
Throws:
NotFoundException - if the slot number doesn't refer to a furniture item owned by the user

getGameFlag

public boolean getGameFlag(String name)
Return the status of the indicated game flag. Note that all game flags default to false.

Parameters:
name - The unique identifier for the game flag
Returns:
the state (or presence) of the flag

getGender

public Gender getGender()
Returns:
the gender

getGivenName

public String getGivenName()
Specified by:
getGivenName in interface AbstractPerson
Returns:
the given name of the user, if one were set.

getHistory

public HashMap<Timestamp,HashMap<String,String>> getHistory(Date after,
                                                            int limit)
Returns the historical contents of this user's record.

Specified by:
getHistory in interface AbstractPerson
Parameters:
after - If non-null, specifies the date after which we want to view records. To see all records, back to the creation of the user record, supply a null.
limit - If this is a positive number, it limits the results to this number of records.
Returns:
A map of timestamps to key/value pairs. All values are expressed as strings (even though they may have numeric, enumerative, or date / datetime types in the database), since this is primarily (only?) for human-viewable auditing.

getInventory

public Inventory getInventory()
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Feb 19, 2010)

Specified by:
getInventory in interface AbstractUser
Overrides:
getInventory in class GeneralUser
Returns:
the inventory
See Also:
AbstractUser.getInventory()

getIpAddress

@Deprecated
public String getIpAddress()
Deprecated. Smart Fox Server misspelling of getIPAddress()

Returns:
The string form of the user's IP address (may be IPv4 or IPv6)

getIPAddress

public String getIPAddress()
Specified by:
getIPAddress in interface AbstractUser
Returns:
WRITEME
See Also:
AbstractUser.getIPAddress()

getKickedByUserID

public int getKickedByUserID()
Specified by:
getKickedByUserID in interface AbstractUser
Overrides:
getKickedByUserID in class GeneralUser
Returns:
the user ID by which this user was kicked (or banned)
See Also:
AbstractUser.getKickedByUserID()

getKickedMessage

public String getKickedMessage()
Specified by:
getKickedMessage in interface AbstractUser
Returns:
the message explaining the user being kicked (or banned)

getKickedReasonCode

public String getKickedReasonCode()
Specified by:
getKickedReasonCode in interface AbstractUser
Overrides:
getKickedReasonCode in class GeneralUser
Returns:
the reason code, explaining why the user was kicked (or banned)
See Also:
AbstractUser.getKickedReasonCode()

getKickedUntil

public Timestamp getKickedUntil()
Specified by:
getKickedUntil in interface AbstractUser
Overrides:
getKickedUntil in class GeneralUser
Returns:
the time at which the user can return to playing the game, if s/he has been kicked out temporarily
See Also:
AbstractUser.getKickedUntil()

getLag

public long getLag()
Specified by:
getLag in interface AbstractUser
Returns:
round-trip lag time
See Also:
AbstractUser.getLag()

getLanguage

public String getLanguage()
Specified by:
getLanguage in interface AbstractPerson
Specified by:
getLanguage in interface AbstractUser
Returns:
the language
See Also:
AbstractPerson.getLanguage()

getLastActive

public Timestamp getLastActive()
Returns:
the time at which the user last was logged on or active

getLastZone

public String getLastZone()
Returns:
the last (or current) zone for the player

getLocation

public Coord3D getLocation()
Description copied from interface: AbstractUser
Gets the current start coördinates

Specified by:
getLocation in interface AbstractUser
Returns:
the location at which the user was located at AbstractUser.getTravelStart()
See Also:
AbstractUser.getLocation(), AbstractUser.getLocationForUpdate()

getLogin

public String getLogin()
Returns:
the user's login

getMail

public String getMail()
Specified by:
getMail in interface AbstractPerson
Specified by:
getMail in interface AbstractUser
Returns:
the mail
See Also:
AbstractPerson.getMail()

getMailConfirmed

public Date getMailConfirmed()
Specified by:
getMailConfirmed in interface AbstractPerson
Returns:
the mailConfirmed
See Also:
AbstractPerson.getMailConfirmed()

getMySerial

public int getMySerial()
Returns:
the mySerial

getName

public String getName()
Returns:
Get the user's login name

getNameApprovedAt

public Timestamp getNameApprovedAt()
Specified by:
getNameApprovedAt in interface AbstractUser
Returns:
The time at which the user's name was approved, if it has been (null if not).

getNameApprovedByUserID

public long getNameApprovedByUserID()
Returns:
the user ID of the moderator who approved this user's name, if approved. (-1 if not)

getNameRequestedAt

public Timestamp getNameRequestedAt()
Specified by:
getNameRequestedAt in interface AbstractUser
Returns:
the date & time at which the moderator approved this user's name, if approved (null if not).

getParent

public Parent getParent()
Returns:
this user's parent (if any) — null if none.

getParentApprovedName

public boolean getParentApprovedName()
Returns:
true, if the parent has approved this user's name

getParentID

public int getParentID()
Returns:
the ID number of this user's parent, if any (-1 if none)

getPassport_JSON

public org.json.JSONObject getPassport_JSON()
                                     throws SQLException,
                                            org.json.JSONException
Returns:
a JSON object representing the user's Passport.
Throws:
SQLException - if the passport records can't be obtained or interpreted
org.json.JSONException - if the passport can't be represented in JSON form

getPassword

public String getPassword()
Specified by:
getPassword in interface AbstractPerson
Returns:
the user's cleartext password, if available. If the password storage mechanism does not permit cleartext retrieval, returns a null.
See Also:
AbstractPerson.getPassword()

getPotentialUserName

public String getPotentialUserName()
This is an overriding method.

Specified by:
getPotentialUserName in interface AbstractPerson
Returns:
a user name that could be used
See Also:
AbstractPerson.getPotentialUserName()

getReferer

public String getReferer()
Get the referral/affiliate code from this user's initial signup

Returns:
the referral or affiliate code

getRoundTripLag

public long getRoundTripLag()
Returns:
the round-trip lag time to the client in milliseconds

getSerial

public long getSerial()
Get the unique instance serial number for this instance of this user. Ideally, there should never be two instances of the same user in core at once; these serial numbers are used for debugging to be able to detect if that were to happen.

Returns:
the unique instance serial number

getServerThread

public ServerThread getServerThread()
Get the Appius Claudius Caecus server thread (if any) associated with this User (if they are logged-in).

Specified by:
getServerThread in interface AbstractUser
Returns:
the active server thread, or null

getSubversionRevision

public String getSubversionRevision()
Description copied from interface: HasSubversionRevision

Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.

As an example,the Subversion revision string for this file is "$Rev: 1968 $"

 
 @Override
 public String getSubversionRevision () {
        return "$Rev: ";
 }
 

Specified by:
getSubversionRevision in interface HasSubversionRevision
Returns:
The Subversion revision level for this class's source code file.
See Also:
HasSubversionRevision.getSubversionRevision()

getUserEnrolments

public Collection<UserEnrolment> getUserEnrolments()
Returns:
all enrolments for this user

getUserEnrolmentsAsArray

public UserEnrolment[] getUserEnrolmentsAsArray()
Returns:
all enrolments for this user

getUserNameOrRequest

public String getUserNameOrRequest()
return the user's login name, if they have one; or the name that they have requested, if it hasn't been approved yet. If they have not requested any name at all, returns the string "(No name)" .

Returns:
the user's login name, or their requested name, or a string indicating that they have neither.

getUserVariables

@Deprecated
public Map<String,String> getUserVariables()
Deprecated. use getVariables for consistency

Get all user variables in a hash map

Specified by:
getUserVariables in interface AbstractUser
Overrides:
getUserVariables in class GeneralUser
Returns:
A hashmap containing all user variables
See Also:
AbstractUser.getUserVariables()

getZone

public Zone getZone()
Get the user's current Zone, if the user is online.

Specified by:
getZone in interface RoomListener
Overrides:
getZone in class GeneralUser
Returns:
the current zone of the user, if any. Null if the user is offline.
See Also:
RoomListener.getZone()

handleWalkFail

public Coord3D handleWalkFail(Room room,
                              Coord3D to)
Description copied from interface: AbstractUser
Called from pathfinders and rooms when the user tries to go someplace and can't get there, to allow them to plot a course around obstacles.

Specified by:
handleWalkFail in interface AbstractUser
Overrides:
handleWalkFail in class GeneralUser
Parameters:
room - the destination room
to - the destination coördinates
Returns:
the coördinates in the current room toward which the user should proceed
See Also:
GeneralUser.handleWalkFail(org.starhope.appius.game.Room, org.starhope.appius.geometry.Coord3D)

hashCode

public int hashCode()
Get a (hopefully unique) hash code for this user.

Overrides:
hashCode in class GeneralUser
See Also:
Object.hashCode()

hasItem

@Deprecated
public boolean hasItem(int id)
Deprecated. use Inventory.hasItem(int)

Determine whether this user has this item

Parameters:
id - The item ID
Returns:
true, if the user has the item

hasItem

@Deprecated
public boolean hasItem(InventoryItem item)
Deprecated. use Inventory.hasItem(int)

determine whether the user has an item

Parameters:
item - the item in question
Returns:
true, if the user has the given item; else, false

ignoring

private boolean ignoring(AbstractUser speaker)
Parameters:
speaker - the person who might be getting ignored
Returns:
true, if we're ignoring them

isBanned

public boolean isBanned()
Specified by:
isBanned in interface AbstractUser
Overrides:
isBanned in class GeneralUser
Returns:
true, if the account is banned (neither active nor canceled)
See Also:
AbstractUser.isBanned()

isBirthday

public boolean isBirthday()
Returns:
true, if today is the user's birthday

isCanceled

public boolean isCanceled()
Specified by:
isCanceled in interface AbstractUser
Overrides:
isCanceled in class GeneralUser
Returns:
true if the user account was canceled (not active, nor banned)
See Also:
AbstractUser.isCanceled()

isCanContact

@Deprecated
public boolean isCanContact()
Deprecated. use canContact()

Returns:
the canContact

isCanEnterChatZone

@Deprecated
public boolean isCanEnterChatZone()
Deprecated. GeneralUser.canEnterChatZone()

Returns:
the canEnterChatZone

isCanEnterMenuZone

@Deprecated
public boolean isCanEnterMenuZone()
Deprecated. use GeneralUser.canEnterMenuZone()

Returns:
the canEnterMenuZone

isCanTalk

public boolean isCanTalk()
Returns:
canTalk()

isEphemeral

public boolean isEphemeral()
Returns:
the isEphemeral

isKicked

public boolean isKicked()
Returns true if the user has been kicked offline (and the time has not yet elapsed). Returns false otherwise. This does not check the status as to whether the user might have been banned.

Specified by:
isKicked in interface AbstractUser
Overrides:
isKicked in class GeneralUser
Returns:
true, if the user is kicked offline.
See Also:
AbstractUser.isKicked()

isNeedsNaming

public boolean isNeedsNaming()
Returns whether this account has a system-provided (not user-provided) name, or no name at all, and we need to prompt the user (or parent) to name it.

Returns:
true if this user needs to be named

isNeedsParentAttention

public boolean isNeedsParentAttention()
Returns:
true if there is a flag of some kind on this user, that the parent needs to pay attention to.

isNPC

public boolean isNPC()
Determine whether this user is a player-character, or non-player-character.

Specified by:
isNPC in interface AbstractUser
Returns:
true, if this User is NPC-controlled.

isOnline

public boolean isOnline()
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)

Specified by:
isOnline in interface AbstractUser
Returns:
true, if the user is online; false, if they're offline (or we can't tell for certain, e.g. we can't see the SmartFox Server / Appius Claudius Caecus)

isPaidMember

public boolean isPaidMember()
Specified by:
isPaidMember in interface AbstractUser
Overrides:
isPaidMember in class GeneralUser
Returns:
true, if the user is a paid member (or staff member)
See Also:
UserRecord.isPaidMember()

kick

public void kick(AbstractUser u,
                 String kickReason,
                 int duration)
          throws PrivilegeRequiredException
This is an overriding method.

Specified by:
kick in interface AbstractUser
Parameters:
u - WRITEME
kickReason - WRITEME
duration - WRITEME
Throws:
PrivilegeRequiredException - WRITEME
See Also:
AbstractUser.kick(org.starhope.appius.user.AbstractUser, java.lang.String, int)

kick

public void kick(AbstractUser kickedBy,
                 String kickedReason,
                 long kickedMinutes)
          throws PrivilegeRequiredException
Kick a user offline for a number of minutes.

Parameters:
kickedBy - The user who is kicking this user offline
kickedReason - The reason for which s/he is being kicked
kickedMinutes - The duration for which s/he should be kicked, in minutes. Read that again: minutes — not msec!
Throws:
PrivilegeRequiredException - if the person trying to kick this user off doesn't have moderator privileges

kick

public void kick(AbstractUser kickedBy,
                 String kickedReason,
                 Timestamp allowBack)
          throws PrivilegeRequiredException
Kick the user offline, until a certain date & time.

Parameters:
kickedBy - The user who is kicking this user offline
kickedReason - The reason for which s/he is being kicked
allowBack - The time at which this user is permitted to be online again.
Throws:
PrivilegeRequiredException - if the person trying to kick this user off doesn't have moderator privileges

liftBan

public void liftBan(AbstractUser authority)
             throws PrivilegeRequiredException
Lift the ban upon this user.

Specified by:
liftBan in interface AbstractUser
Parameters:
authority - WRITEME
Throws:
PrivilegeRequiredException - WRITEME
See Also:
AbstractUser.liftBan(org.starhope.appius.user.AbstractUser)

local_create

public void local_create()
Hook for special stuff to be done right after a new user account is created


loggedIn

public void loggedIn(String zoneName,
                     ServerThread newServerThread)
Parameters:
zoneName - The name of the zone too which the user has logged in
newServerThread - The server thread in which the user is logged in

loggedIn

@Deprecated
public void loggedIn(String zoneName,
                                SocketChannel channel)
Deprecated. 

Record that the user has logged in

Parameters:
zoneName - The zone name into which the user signed in
channel - The I/O channel on which the user is connected

login

public String login(String chapSeed,
                    String passwordGuess)
Validate the user's login attempt, returning a failure message if it could not happen (e.g. the user is kicked). Returns null if the user CAN log in. DOES NOT log the user in to SFS though!

Parameters:
chapSeed - The CHAP random seed (or null, if no seed was used)
passwordGuess - The guessed password. This should be an MD5sum if CHAP is being used (if the seed is not null), or the plaintext password otherwise
Returns:
an error string for the user, or null, if successful.

nameNeedsApproval

public boolean nameNeedsApproval()
Returns true if this user has requested a name but it hasn't yet been approved by a Lifeguard

Returns:
true, if user has requested a new name and it hasn't yet been approved

nameNeedsParentalApproval

public boolean nameNeedsParentalApproval()
Returns:
true if the name hasn't been approved by the parent yet

needsNaming

public boolean needsNaming()
Returns whether this account has a system-provided (not user-provided) name, or no name at all, and we need to prompt the user (or parent) to name it.

Returns:
true if this user needs to be named

notifyFurnitureInventory

public void notifyFurnitureInventory(Room room)
sent notification of the furniture inventory

Parameters:
room - room

parentApprovedAccount

public void parentApprovedAccount(boolean whether)
Call this method when the parent determines whether to approve or disapprove this account.

Parameters:
whether - whether the parent has approved the account; true = approved; false = disapproved

parentApprovedName

public void parentApprovedName(boolean whether)
Parameters:
whether - True if the parent has approved the name; false if they disapprove and want a system suggested name.

postLoginGlobal

public void postLoginGlobal()
Perform global post-login handling — right now, just sends the Message of the Day if the zone isn't a "$" zone.


remindPassword

public void remindPassword()
                    throws NotReadyException
This is an overriding method. If this user is a staff member, resets their password.

Specified by:
remindPassword in interface AbstractPerson
Throws:
NotReadyException - if the reminder can't be sent because the user has no confirmed mail address on file
See Also:
AbstractPerson.remindPassword()

removeBuddy

public void removeBuddy(AbstractUser otherGuy)
Don't want for him to be my buddy any more

Specified by:
removeBuddy in interface AbstractUser
Overrides:
removeBuddy in class GeneralUser
Parameters:
otherGuy - who?
See Also:
AbstractUser.removeBuddy(org.starhope.appius.user.AbstractUser)

rename

public void rename(String newName)
            throws GameLogicException,
                   AlreadyUsedException,
                   ForbiddenUserException

Rename the user account, updating all necessary related records. Note, in particular, that Smartfox is wholly dependant upon user names, so all records related to Smartfox must be updated!

If the user is currently online, this will fuck up hilariously, I think.

This is an overriding method.

Specified by:
rename in interface AbstractPerson
Parameters:
newName - The new user name
Throws:
GameLogicException - if the user is online (and therefore can't be renamed)
ForbiddenUserException - if the user isn't allowed to choose the name (e.g. filter violation)
AlreadyUsedException - if the new name is already taken by someone else
See Also:
AbstractPerson.rename(java.lang.String)

reportedToModeratorBy

public void reportedToModeratorBy(AbstractUser u)
Another user reported this user. No reason given.

Specified by:
reportedToModeratorBy in interface AbstractUser
Parameters:
u - User that is reporting this user.

reportedToModeratorBy

public void reportedToModeratorBy(AbstractUser u,
                                  String reason)
 twheys@gmail.com Feb 17, 2010
 
TO reportedToModeratorBy Mail customer service with a report of users reporting each other. WRITEME twheys@gmail.com

Specified by:
reportedToModeratorBy in interface AbstractUser
Parameters:
u - WRITEME twheys@gmail.com
reason - WRITEME twheys@gmail.com

requestNewUserName

public void requestNewUserName(String userNameRequested)
                        throws AlreadyUsedException,
                               ForbiddenUserException

Post a request to the lifeguards to get approval of a user name

Does not work, is not used

Parameters:
userNameRequested - The user name which the user has requested
Throws:
ForbiddenUserException - if the user name is forbidden (e.g. obscene or previously denied for any reason)
AlreadyUsedException - if someone has already requested or used it

requestParentApproval

public void requestParentApproval()
request parent approval


sendConfirmationForPremium

public void sendConfirmationForPremium()
Send a confirmation eMail for a premium user.


sendConfirmationMail

public void sendConfirmationMail()
Description copied from interface: AbstractPerson
Sends confirmation mail to whomever should receive it

Specified by:
sendConfirmationMail in interface AbstractPerson
See Also:
AbstractPerson.sendConfirmationMail()

sendEarnings

public void sendEarnings(Room room,
                         String string)
Specified by:
sendEarnings in interface AbstractUser
Overrides:
sendEarnings in class GeneralUser
Parameters:
room - WRITEME
string - WRITEME
See Also:
AbstractUser.sendEarnings(org.starhope.appius.game.Room, java.lang.String)

sendGameAction

@Deprecated
public void sendGameAction(GeneralUser from,
                                      org.json.JSONObject data)
                    throws org.json.JSONException
Deprecated. 

Send a game action to another user.

Parameters:
from - The user sending the game action (to this user)
data - The game action data
Throws:
org.json.JSONException - if the data can't be sent in JSON

sendMigrate

public void sendMigrate(AbstractZone refugeeZone)
                 throws UserDeadException
Send a notification to the user that s/he should reconnect to a different zone

Specified by:
sendMigrate in interface AbstractUser
Parameters:
refugeeZone - the zone to which the user should migrate
Throws:
UserDeadException - if the user is no longer online anyway

sendOops

public void sendOops()
Description copied from interface: AbstractUser
WRITEME

Specified by:
sendOops in interface AbstractUser
See Also:
AbstractUser.sendOops()

sendPrivateMessage

@Deprecated
public void sendPrivateMessage(AbstractUser from,
                                          String message)
Deprecated. 

Deprecated. See the more accurately-named acceptPrivateMessage(AbstractUser, String)

Parameters:
from - the user speaking
message - the words spoken
See Also:
acceptPrivateMessage(AbstractUser, String)

sendPublicMessage

@Deprecated
public void sendPublicMessage(GeneralUser from,
                                         String speech)
Deprecated. use acceptPublicMessage(AbstractUser, String)

Accept a public message.

Parameters:
from - The user speaking
speech - the words spoken
See Also:
acceptPublicMessage(AbstractUser, String)

sendResponse

public void sendResponse(org.json.JSONObject result)
Specified by:
sendResponse in interface AbstractUser
Parameters:
result - WRITEME
See Also:
AbstractUser.sendResponse(org.json.JSONObject)

sendResponse

@Deprecated
public void sendResponse(org.json.JSONObject result,
                                    int room)
Deprecated. use sendResponse(JSONObject)

Send a response to this user's client, if one is connected.

Parameters:
result - the response datagram in JSON
room - the room from which the response is coming (or -1 for not-specified) (ignored)

sendStaffPasswordReset

public void sendStaffPasswordReset()
Description copied from interface: AbstractPerson
Sends mail to user or parent when a staff member resets their password.

Specified by:
sendStaffPasswordReset in interface AbstractPerson
See Also:
AbstractPerson.sendStaffPasswordReset()

sendSuccessReply

private void sendSuccessReply(String source,
                              org.json.JSONObject reply,
                              AbstractUser sender,
                              int room)
Send a “success” reply to the client if one is connected

Parameters:
source - The method returning success
reply - additional details of the success to be returned to the client
sender - the user reporting success
room - the room in which the success happened, or -1 if not specified

sendWardrobe

public void sendWardrobe()
Description copied from interface: AbstractUser
WRITEME

Specified by:
sendWardrobe in interface AbstractUser
Overrides:
sendWardrobe in class GeneralUser
See Also:
AbstractUser.sendWardrobe()

sentConfirmationMail

public void sentConfirmationMail()
Description copied from interface: AbstractPerson
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)

Specified by:
sentConfirmationMail in interface AbstractPerson
See Also:
AbstractPerson.sentConfirmationMail()

setActive

public void setActive(boolean isActive1)
Parameters:
isActive1 - the isActive to set

setAgeGroup

public AgeBracket setAgeGroup()
Sets the age group based upon the user's date of birth.

Returns:
The age group computed for this user

setAgeGroupToSystem

public void setAgeGroupToSystem()
Description copied from interface: AbstractUser
WRITEME

Specified by:
setAgeGroupToSystem in interface AbstractUser
Overrides:
setAgeGroupToSystem in class GeneralUser
See Also:
AbstractUser.setAgeGroupToSystem()

setApprovedDate

public void setApprovedDate(Date date)
Parameters:
date - the approvedDate to set

setAvatarClass

public void setAvatarClass(AvatarClass avatarClass)
set the avatar class for this user

Parameters:
avatarClass - the new avatar class

setBaseColor

public void setBaseColor(Colour newBaseColor)
Description copied from interface: AbstractUser
WRITEME

Specified by:
setBaseColor in interface AbstractUser
Overrides:
setBaseColor in class GeneralUser
Parameters:
newBaseColor - the baseColor to set
See Also:
AbstractUser.setBaseColor(org.starhope.appius.types.Colour)

setBirthDate

public void setBirthDate(Date birthDate1)
Parameters:
birthDate1 - the birthDate to set

setCanceled

public void setCanceled(boolean isCanceled1)
Parameters:
isCanceled1 - the isCanceled to set

setCanContact

public void setCanContact(boolean canContact1)
Specified by:
setCanContact in interface AbstractPerson
Parameters:
canContact1 - the canContact to set

setCanEnterChatZone

public void setCanEnterChatZone(boolean canEnterChatZone1)
Parameters:
canEnterChatZone1 - the canEnterChatZone to set

setCanEnterMenuZone

public void setCanEnterMenuZone(boolean canEnterMenuZone1)
Parameters:
canEnterMenuZone1 - the canEnterMenuZone to set

setCanTalk

public void setCanTalk(boolean canTalk1)
Description copied from interface: AbstractUser
WRITEME

Specified by:
setCanTalk in interface AbstractUser
Overrides:
setCanTalk in class GeneralUser
Parameters:
canTalk1 - the canTalk to set
See Also:
AbstractUser.setCanTalk(boolean)

setChatBG

public void setChatBG(Colour newChatBG)
Parameters:
newChatBG - the new chat background colour

setChatFG

public void setChatFG(Colour newChatFG)
Parameters:
newChatFG - the chat foreground colour to set

setEmailPlusDate

public void setEmailPlusDate(Date emailPlusDate1)
Parameters:
emailPlusDate1 - the emailPlusDate to set

setExtraColor

public void setExtraColor(Colour extraColor1)
Specified by:
setExtraColor in interface AbstractUser
Overrides:
setExtraColor in class GeneralUser
Parameters:
extraColor1 - the extraColor to set
See Also:
AbstractUser.setExtraColor(org.starhope.appius.types.Colour)

setFacing

public void setFacing(String newFacing)
Specified by:
setFacing in interface AbstractUser
Overrides:
setFacing in class GeneralUser
Parameters:
newFacing - the facing to set
See Also:
AbstractUser.setFacing(java.lang.String)

setForgotPasswordAnswer

public void setForgotPasswordAnswer(String answer)
Description copied from interface: AbstractPerson
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)

Specified by:
setForgotPasswordAnswer in interface AbstractPerson
Parameters:
answer - WRITEME
See Also:
AbstractPerson.setForgotPasswordAnswer(java.lang.String)

setForgotPasswordQuestion

public void setForgotPasswordQuestion(String question)
Description copied from interface: AbstractPerson
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)

Specified by:
setForgotPasswordQuestion in interface AbstractPerson
Parameters:
question - WRITEME
See Also:
AbstractPerson.setForgotPasswordQuestion(java.lang.String)

setGender

public void setGender(Gender setGender)
Parameters:
setGender - the gender to set

setGivenName

public void setGivenName(String givenName1)
Specified by:
setGivenName in interface AbstractPerson
Parameters:
givenName1 - the givenName to set

setLastActive

public void setLastActive()
WRITEME

Specified by:
setLastActive in interface AbstractUser

setLastActive

void setLastActive(Timestamp timestamp)
Parameters:
timestamp - the time at which this user was last active

setLocation

public void setLocation(Coord3D coord3d)
Set the user's location; but note that you should be using Room.putHere(AbstractUser, Coord3D) to position a player

Specified by:
setLocation in interface AbstractUser
Overrides:
setLocation in class GeneralUser
Parameters:
coord3d - new location
See Also:
AbstractUser.setLocation(org.starhope.appius.geometry.Coord3D)

setLoggedIn

public void setLoggedIn(String ipAddress,
                        String zone)

Notify the multiverse that the user is logging in

Set up the User records, indicating that the user has (in fact) logged in to the game. Record the IP address and Zone server.

XXX: contains SQL

Parameters:
ipAddress - The IP address (or something like it) from which the user has logged-in
zone - The active server zone into which the User has logged-in.

setLogin

@Deprecated
public void setLogin(String from,
                                String zone)
Deprecated. use setLoggedIn(String, String) — less ambiguous/misleading name

Parameters:
from - the login source
zone - the zone into which the user logged in

setLot

@Deprecated
public void setLot(int newLotID)
Deprecated. use UserHouse.setLotID(int)

Parameters:
newLotID - the new lot ID

setLotID

@Deprecated
public void setLotID(int newLotID)
Deprecated. use UserHouse#setLotID (int)

Choose the lot ID (neighbourhood) in which this user wishes to build their new house. These are mapped to the room numbers of the primary areas

Parameters:
newLotID - the new lot ID

setMail

public void setMail(String newMail)
             throws GameLogicException
Description copied from interface: AbstractUser
WRITEME

Specified by:
setMail in interface AbstractPerson
Specified by:
setMail in interface AbstractUser
Parameters:
newMail - the mail to set
Throws:
GameLogicException - if attempting to set an eMail address on a kid account

setMailConfirmed

public void setMailConfirmed(Date mailConfirmed1)
Sets the user capabilities to allow talking, and permits the user entry into both chat zones and menu-chat-only zones.

Specified by:
setMailConfirmed in interface AbstractPerson
Parameters:
mailConfirmed1 - the date and time at which the user's mail was confirmed.

setMailConfirmSent

public void setMailConfirmSent(Date date)
Specified by:
setMailConfirmSent in interface AbstractPerson
Parameters:
date - the date on which the mail confirmation message was sent
See Also:
AbstractPerson.setMailConfirmSent(java.sql.Date)

setNeedsNaming

public boolean setNeedsNaming(boolean needsNaming1)
Parameters:
needsNaming1 - the needsNaming to set
Returns:
whether the user needs naming

setParent

public void setParent(Parent parent)
               throws GameLogicException,
                      ForbiddenUserException,
                      AlreadyExistsException
Set this to be a child account with the specified parent.

Specified by:
setParent in interface AbstractUser
Parameters:
parent - the parent to set
Throws:
GameLogicException - if this user is an adult
ForbiddenUserException - if the parent has banned child accounts (and therefore cannot adopt more)
AlreadyExistsException - if the parent has more than the maximum allowed children.

setParentByParent

public void setParentByParent(Parent parent)
                       throws GameLogicException
Set this to be a child account with the specified parent.

Parameters:
parent - the parent to set
Throws:
GameLogicException - if this user is an adult

setPassword

public void setPassword(String password1)
Description copied from interface: AbstractPerson
Changes the person's password

Specified by:
setPassword in interface AbstractPerson
Parameters:
password1 - the password to set
See Also:
AbstractPerson.setPassword(java.lang.String)

setPasswordAndPasswordRecovery

public void setPasswordAndPasswordRecovery(String question,
                                           String answer,
                                           String newPassword)
                                    throws GameLogicException
Specified by:
setPasswordAndPasswordRecovery in interface AbstractPerson
Parameters:
question - WRITEME
answer - WRITEME
newPassword - WRITEME
Throws:
GameLogicException - WRITEME
See Also:
AbstractPerson.setPasswordAndPasswordRecovery(java.lang.String, java.lang.String, java.lang.String)

setPasswordRecovery

public void setPasswordRecovery(String forgottenPasswordQuestion,
                                String forgottenPasswordAnswer)
Description copied from interface: AbstractPerson
Set the password-recovery question and answer pair

Specified by:
setPasswordRecovery in interface AbstractPerson
Parameters:
forgottenPasswordQuestion - the question
forgottenPasswordAnswer - the correct answer
See Also:
AbstractPerson.setPasswordRecovery(java.lang.String, java.lang.String)

setRandomPassword

public String setRandomPassword()
Description copied from interface: AbstractPerson
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)

Specified by:
setRandomPassword in interface AbstractPerson
Returns:
WRITEME
See Also:
AbstractPerson.setRandomPassword()

setReferer

public void setReferer(String theReferer)

Set the referrer from whom we were sent this new user. This value can only be set once, and is permanent for that user. The valid referrer values are stored in a table. (WRITEME twheys@gmail.com what table?)

Yes, referer is misspelled in homage to HTTP

Parameters:
theReferer - a four-character identifier

setRegisteredAt

public void setRegisteredAt(Timestamp newRegisteredAt)
Parameters:
newRegisteredAt - the registeredAt to set

setRoom

public int setRoom(Room room)
Set the user's current room to the given room. This will part from the prior room, if the user was in a room already. It also sets the user variable “d” to (-100,-100) coördinates.

Specified by:
setRoom in interface AbstractUser
Overrides:
setRoom in class GeneralUser
Parameters:
room - the room in which the user must exist
Returns:
the room number set

setRoundTripLag

public void setRoundTripLag(long l)
Update the lag time associated with this user

Parameters:
l - milliseconds round-trip lag

setServerThread

public void setServerThread(ServerThread serverThread2)
Set the server thread controlling this user. Disconnect any pre-existing server thread.

Parameters:
serverThread2 - The new server thread.

setStaffLevel

public void setStaffLevel(int newStaffLevel)
Parameters:
newStaffLevel - the staffLevel to set

setStartT

public void setStartT(long when)
This is an overriding method.

Specified by:
setStartT in interface AbstractUser
Overrides:
setStartT in class GeneralUser
Parameters:
when - the time at which the user last made a conscious change in their movement
See Also:
AbstractUser.setStartT(long)

setStructure

public void setStructure(InventoryItem item)
Activate one structural element in lieu of any others that occupy the same slot.

Parameters:
item - WRITEME

setSubclassValues

protected void setSubclassValues(ResultSet resultSet)
                          throws SQLException
Set the values specific to a subclass of User

Parameters:
resultSet - WRITEME
Throws:
SQLException - WRITEME

setTravelStart

public void setTravelStart(long l)
Description copied from interface: AbstractUser
WRITEME: Document this method brpocock@star-hope.org

Specified by:
setTravelStart in interface AbstractUser
Overrides:
setTravelStart in class GeneralUser
Parameters:
l - WRITEME
See Also:
AbstractUser.setTravelStart(long)

setUserName

public void setUserName(String newLogin)
                 throws AlreadyUsedException,
                        ForbiddenUserException,
                        GameLogicException
Parameters:
newLogin - the userName to set
Throws:
ForbiddenUserException - if the user name is not allowed
AlreadyUsedException - if the user name is in-use
GameLogicException - if the user is online and can't be renamed

setUserNameFromUser

public void setUserNameFromUser(String userRequestedLogin)
                         throws AlreadyUsedException,
                                ForbiddenUserException

Set a user name, requested by the user. (Sends to lifeguards for approval)

Clears needsNaming.

Parameters:
userRequestedLogin - the userName to set
Throws:
ForbiddenUserException - if the user name isn't allowed
AlreadyUsedException - if the user name has already been used (or requested)

speak

public void speak(Room room,
                  String string)
Specified by:
speak in interface AbstractUser
Parameters:
room - the room in which to speak. Typically, the user must be present in that room.
string - the speech (or emote)
See Also:
AbstractUser.speak(org.starhope.appius.game.Room, java.lang.String)

startEnrolment

public void startEnrolment(UserEnrolment userEnrolment)
Parameters:
userEnrolment - the enrolment to be started for this user

toJSON

public org.json.JSONObject toJSON()
Specified by:
toJSON in interface AbstractUser
Returns:
a JavaScript Object representing this user
See Also:
AbstractUser.toJSON()

toJSONRef

public org.json.JSONObject toJSONRef()
This is analogous to toSFSXML() for the pure JSON “to infinity and beyond” interface

Returns:
the brief JSON record giving the user's name, ID, and variables.

toSFSXML

public String toSFSXML()
Specified by:
toSFSXML in interface AbstractUser
Returns:
The User record in the sense of Smart Fox Server's XML format, as used in joinOK and uER (user enters room) messages

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

updateWallet

public void updateWallet()
Description copied from interface: AbstractUser
review your current wallet currency amounts, they may have changed

Specified by:
updateWallet in interface AbstractUser
Overrides:
updateWallet in class GeneralUser
See Also:
GeneralUser.updateWallet()