org.starhope.appius.game.npc
Class Ejecta

java.lang.Object
  extended by org.starhope.appius.user.GeneralUser
      extended by org.starhope.appius.game.npc.Ejecta
All Implemented Interfaces:
Serializable, Comparable<Object>, RoomListener, Collidable, HasVariables, AbstractUser, DataRecordBacked<UserRecord>
Direct Known Subclasses:
Particle, Projectile

public class Ejecta
extends GeneralUser

An Ejecta object is a particle effect, transient effect, or projectile moving through the game world.

Author:
brpocock@star-hope.org
See Also:
Serialized Form

Field Summary
private  ReentrantLock locationLock
          Locking semaphore for location
private  String myAction
          The action currently being played for the Ejecta
private  AvatarClass myAvatar
          The avatar class for the Ejecta
private  String myFacing
          The avatar's facing direction
private  Coord3D myPosition
          The Ejecta's position
private  Room myRoom
          The Ejecta's room
private  long myStartT
           
private  Coord3D myTarget
          The Ejecta's destination coördinates
private  double myTravelRate
          The Ejecta's rate of travel
private  long myTravelStart
          The Ejecta's travel start time
private  int myUserID
          The Ejecta's user ID
private static AtomicInteger nextUserID
          The next user ID available for Ejecta
private static long serialVersionUID
          WRITEME: Document this brpocock@star-hope.org
 
Fields inherited from class org.starhope.appius.user.GeneralUser
baseStats, collisionBounds, currentRoom, facing, lastUserMovement, pathFinder, userRecord
 
Constructor Summary
Ejecta(AvatarClass avatar, Room room, Coord3D origin, long birth, Coord3D target, double travelRate)
          Specify the avatar file to be provided to the client, and the point of origination, and motion vector.
 
Method Summary
 void acceptErrorReply(String command, String error, org.json.JSONObject result, Room userCurrentRoomInZone)
           
 void acceptGameAction(AbstractUser u, org.json.JSONObject action)
          Broadcast message of a game action taking place
 void acceptGameStateChange(GameEvent gameCode, GameStateFlag gameState)
          Notification of a GameEvent changing state for the room
 void acceptMessage(String title, String label, String content)
          Accept an administrative/moderator message with the full range of options.
 void acceptObjectJoinRoom(Room room, RoomListener object)
          Notification that someone has entered the room.
 void acceptObjectPartRoom(Room room, RoomListener thing)
          Notification that someone has left a room
 void acceptOutOfBandMessage(AbstractUser sender, Room room, org.json.JSONObject body)
          Accept an out-of-band communications packet that was broadcast to a room in which this Listener is listening.
 void acceptPrivateMessage(AbstractUser speaker, String speech)
          Accept a private message from another user (a whisper)
 void acceptPublicMessage(AbstractUser sender, Room room, String message)
          Accept a public chat message or /emote.
 void acceptPublicMessage(AbstractUser from, String message)
          Accept a public chat message.
 void acceptSuccessReply(String command, org.json.JSONObject jsonData, Room room)
           
 void acceptUserVariableUpdate(AbstractUser user, String varName, String varValue)
          Receive notification of the change of an user variable
 void addBuddy(AbstractUser buddy)
           
 void addGiftSubscription(int i, int days)
           
 void addItem(int parseInt)
           
 void assertLocationUnlocked()
          WRITEME: Document this method brpocock@star-hope.org
 void assertStaffLevel(int staffLevelStaffMember)
          Deprecated. use Security.hasCapability(AbstractUser, org.starhope.appius.sys.admin.SecurityCapability)
 void attend(AbstractUser byLogin)
          Attend to an user who may previously have been ignored
 void ban(AbstractUser u, String banReason)
           
 boolean canTalk()
           
 void destroy()
          remove this object from the world
 void doffClothes()
          WRITEME
 void doTransport()
          WRITEME
 boolean equals(Object obj)
           
protected  void finalize()
           
 int getAge()
           
 AgeBracket getAgeGroup()
          Get the user's age bracket.
 String getApprovedDateString()
           
 AvatarClass getAvatarClass()
           
 String getAvatarLabel()
          The avatar label is the text block that is displayed with the avatar for this object.
 Colour getBaseColor()
           
 Collection<String> getBuddyListNames()
          WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)
 String getCurrentAction()
          Normally “Walk” but can be any action that the client recognises for the avatar type
 String getDebugName()
          Get a version of the user's ID and name suitable for use in debugging dumps.
 String getDialect()
           
 String getDisplayName()
           
 Colour getExtraColor()
           
 String getFacing()
          Get the string identifying the direction which this object is facing.
 Inventory getInventory()
          WRITEME: document this method (brpocock@star-hope.org, Feb 19, 2010)
 String getIPAddress()
           
 int getKickedByUserID()
           
 String getKickedMessage()
           
 String getKickedReasonCode()
           
 Timestamp getKickedUntil()
           
 long getLag()
           
 String getLanguage()
           
 Coord3D getLocation()
          Gets the current start coördinates
 Coord3D getLocationForUpdate()
          Gets the current coördinates.
 String getMail()
           
 BigDecimal getMoney(Currency currency)
          To be deprecated in favour of AbstractUser.getWallet() ASAP!
 Date getNameApprovedAt()
           
 Date getNameRequestedAt()
           
 org.json.JSONObject getPublicInfo()
           Returned packet contains:
 String getRegisteredDateString()
           
 String getResponsibleMail()
           Get the eMail address of a responsible person: either the player, or the parent.
 Room getRoom()
          WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)
 int getRoomNumber()
          WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)
 ServerThread getServerThread()
           
 int getStaffLevel()
          WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)
 long getStartT()
           
 Coord3D getTarget()
          Gets the current target
 double getTravelRate()
          This is an overriding method.
 long getTravelStart()
          This is an overriding method.
 int getUserID()
          Get the user ID number for this user
 Map<String,String> getUserVariables()
          WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)
 String getVariable(String string)
          Get the value of a given variable by name.
 Wallet getWallet()
           
 Zone getZone()
          WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)
 int hashCode()
           
 boolean hasStaffLevel(int i)
          Deprecated. use Security.hasCapability(AbstractUser, org.starhope.appius.sys.admin.SecurityCapability)
 boolean hasVariable(String string)
          WRITEME: document this method (brpocock@star-hope.org, Nov 30, 2009)
 void ignore(AbstractUser byLogin)
          Calling this method indicates that this user wants to ignore the other specified user.
 boolean isBanned()
           
 boolean isCanceled()
           
 boolean isKicked()
           
 boolean isNPC()
          WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)
 boolean isOnline()
          WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)
 boolean isPaidMember()
           
 void kick(AbstractUser u, String kickReason, int duration)
           
 void liftBan(AbstractUser authority)
          remove a ban placed upon this user
 boolean needsParent()
          Kid accounts (under 13) require parental confirmation.
 void removeBuddy(AbstractUser byLogin)
           
 void reportedToModeratorBy(AbstractUser u)
           
 void reportedToModeratorBy(AbstractUser u, String reason)
           
 void sendEarnings(Room room, String string)
           
 void sendMigrate(AbstractZone refugeeZone)
          WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)
 void sendOops()
          WRITEME
 void sendResponse(org.json.JSONObject result)
           
 void sendWardrobe()
          WRITEME
 void setAgeGroupToSystem()
          WRITEME
 void setBaseColor(Colour colour)
          WRITEME
 void setCanTalk(boolean b)
          WRITEME
 void setCurrentAction(String newAction)
          Normally “Walk” but can be any action that the client recognizes for the avatar type
 void setExtraColor(Colour colour)
           
 void setFacing(String newFacing)
           
 void setLastActive()
          WRITEME
 void setLocation(Coord3D coord3d)
           
 void setMail(String email)
          WRITEME
 void setParent(Parent newParent)
          If this is a child account (per COPPA), then associate a parent record with it.
 int setRoom(Room room)
          Set the user's current room to the given room.
 void setStartT(long when)
          set the time at which the player started moving — not necessarily the same as AbstractUser.getTravelStart() because that value is updated over time, this value is when they actually started moving along the path altogether
 void setTarget(Coord3D coord3d)
          Sets the new target coördinates
 void setTravelRate(double rate)
          This is an overriding method.
 void setTravelStart(long l)
          WRITEME: Document this method brpocock@star-hope.org
 void setVariable(String varName, String varValue)
          Set an user variable.
 void speak(Room room, String string)
           
 org.json.JSONObject toJSON()
           
 String toSFSXML()
           
 String toString()
           
 void unlockLocation()
          Unlock an user's location, locked by a call to AbstractUser.getLocationForUpdate() (q.v.)
 
Methods inherited from class org.starhope.appius.user.GeneralUser
acceptUserAction, canApproveSelf, canBetaTest, canEnterChatZone, canEnterMenuZone, changeBaseDefenses, compareTo, deleteVariable, getBaseDefenses, getBaseStat, getCenterOfMass, getCollisionBounds, getD, getEffectiveDefenses, getEndMovementTime, getGameEquipItems_JSON, getGameEquipItems, getHeight, getHouse, getItemsByType, getItemsByType, getItemsByTypeAsArray, getMass, getPathFinder, getRegisteredAt, getRegisteredDate, getRequestedName, getSizeScalar, getStartMovementTime, getStat, getUserListIterator, getUserName, getVariables, getVariablesJSON, getVelocity, handleWalkFail, isActive, isApproved, local_publicInfo, purchase, resetVariables, sendBuddyList, setBackingRecord, setCenterOfMass, setVariable, setVariables, setVelocity, takeAttack, updateWallet
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
WRITEME: Document this brpocock@star-hope.org

See Also:
Constant Field Values

nextUserID

private static AtomicInteger nextUserID
The next user ID available for Ejecta


myAction

private String myAction
The action currently being played for the Ejecta


myAvatar

private final AvatarClass myAvatar
The avatar class for the Ejecta


myFacing

private String myFacing
The avatar's facing direction


myPosition

private Coord3D myPosition
The Ejecta's position


myRoom

private Room myRoom
The Ejecta's room


myTarget

private Coord3D myTarget
The Ejecta's destination coördinates


myTravelRate

private double myTravelRate
The Ejecta's rate of travel


myTravelStart

private long myTravelStart
The Ejecta's travel start time


myUserID

private final int myUserID
The Ejecta's user ID


myStartT

private long myStartT
See Also:
AbstractUser.getStartT()

locationLock

private final ReentrantLock locationLock
Locking semaphore for location

See Also:
AbstractUser.getLocationForUpdate(), AbstractUser.unlockLocation()
Constructor Detail

Ejecta

public Ejecta(AvatarClass avatar,
              Room room,
              Coord3D origin,
              long birth,
              Coord3D target,
              double travelRate)
Specify the avatar file to be provided to the client, and the point of origination, and motion vector.

Parameters:
avatar - The avatar file to be provided to the client
room - The room in which the Ejecta is born
origin - The point of origin
birth - The time of origination
target - The destination of motion
travelRate - The rate of travel
Method Detail

acceptErrorReply

public void acceptErrorReply(String command,
                             String error,
                             org.json.JSONObject result,
                             Room userCurrentRoomInZone)
Parameters:
command - The command which produced the error
error - The error code
result - The additional JSON data describing the error
userCurrentRoomInZone - 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 u,
                             org.json.JSONObject action)
Description copied from interface: RoomListener
Broadcast message of a game action taking place

Parameters:
u - the sender
action - The game action. The verb is in action.getString("action").
See Also:
RoomListener.acceptGameAction(org.starhope.appius.user.AbstractUser, org.json.JSONObject)

acceptGameStateChange

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

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 label,
                          String content)
Description copied from interface: AbstractUser
Accept an administrative/moderator message with the full range of options. If the user is currently online, forward this message to them.

Parameters:
title - The title of the message
label - A label which nominally identifies the source of the message
content - The contents of the message
See Also:
AbstractUser.acceptMessage(java.lang.String, java.lang.String, java.lang.String)

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 thing)
Description copied from interface: RoomListener
Notification that someone has left a room

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

acceptOutOfBandMessage

public void acceptOutOfBandMessage(AbstractUser sender,
                                   Room room,
                                   org.json.JSONObject body)
Description copied from interface: RoomListener
Accept an out-of-band communications packet that was broadcast to a room in which this Listener is listening.

Specified by:
acceptOutOfBandMessage in interface RoomListener
Overrides:
acceptOutOfBandMessage in class GeneralUser
Parameters:
sender - The sender of the OOB message
room - The room in which the OOB message is being broadcast
body - A JSON object containing the OOB message. The contents of this message are not constrained.
See Also:
RoomListener.acceptOutOfBandMessage(org.starhope.appius.user.AbstractUser, org.starhope.appius.game.Room, org.json.JSONObject)

acceptPrivateMessage

public void acceptPrivateMessage(AbstractUser speaker,
                                 String speech)
Description copied from interface: AbstractUser
Accept a private message from another user (a whisper)

Parameters:
speaker - the person whispering
speech - what was whispered
See Also:
AbstractUser.acceptPrivateMessage(org.starhope.appius.user.AbstractUser, java.lang.String)

acceptPublicMessage

public void acceptPublicMessage(AbstractUser sender,
                                Room room,
                                String message)
Description copied from interface: RoomListener
Accept a public chat message or /emote.

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 from,
                                String message)
Description copied from interface: RoomListener
Accept a public chat message. This prototype does not specify the room, on the (potentially invalid) assumption that the room listener doesn't care from which room the speech was made.

Parameters:
from - 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)
Parameters:
command - WRITEME
jsonData - WRITEME
room - WRITEME
See Also:
AbstractUser.acceptSuccessReply(java.lang.String, org.json.JSONObject, org.starhope.appius.game.Room)

acceptUserVariableUpdate

public void acceptUserVariableUpdate(AbstractUser user,
                                     String varName,
                                     String varValue)
Description copied from interface: RoomListener
Receive notification of the change of an user variable

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 buddy)
Specified by:
addBuddy in interface AbstractUser
Overrides:
addBuddy in class GeneralUser
Parameters:
buddy - WRITEME
See Also:
AbstractUser.addBuddy(org.starhope.appius.user.AbstractUser)

addGiftSubscription

public void addGiftSubscription(int i,
                                int days)
Parameters:
i - WRITEME
days - WRITEME
See Also:
AbstractUser.addGiftSubscription(int, int)

addItem

public void addItem(int parseInt)
Parameters:
parseInt - the item ID to be instantiated and added
See Also:
AbstractUser.addItem(int)

assertLocationUnlocked

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

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

assertStaffLevel

@Deprecated
public void assertStaffLevel(int staffLevelStaffMember)
                      throws PrivilegeRequiredException
Deprecated. use Security.hasCapability(AbstractUser, org.starhope.appius.sys.admin.SecurityCapability)

Description copied from class: GeneralUser
Assert that this user must have the given staff level (or greater). Throws an exception if this is untrue.

Specified by:
assertStaffLevel in interface AbstractUser
Overrides:
assertStaffLevel in class GeneralUser
Parameters:
staffLevelStaffMember - The minimum staff level which is being asserted
Throws:
PrivilegeRequiredException - if the minimum staff level is not met.

attend

public void attend(AbstractUser byLogin)
Description copied from class: GeneralUser
Attend to an user who may previously have been ignored

Specified by:
attend in interface AbstractUser
Overrides:
attend in class GeneralUser
Parameters:
byLogin - the user to whom to now attend
See Also:
AbstractUser.attend(org.starhope.appius.user.AbstractUser)

ban

public void ban(AbstractUser u,
                String banReason)
         throws PrivilegeRequiredException
Parameters:
u - WRITEME
banReason - WRITEME
Throws:
PrivilegeRequiredException - WRITEME
See Also:
AbstractUser.ban(org.starhope.appius.user.AbstractUser, java.lang.String)

canTalk

public boolean canTalk()
Returns:
WRITEME
See Also:
AbstractUser.canTalk()

destroy

public void destroy()
remove this object from the world


doffClothes

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

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

See Also:
AbstractUser.doTransport()

equals

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

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable
See Also:
Object.finalize()

getAge

public int getAge()
Specified by:
getAge in interface AbstractUser
Overrides:
getAge in class GeneralUser
Returns:
WRITEME
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 age bracket of the user
See Also:
AbstractUser.getAgeGroup()

getApprovedDateString

public String getApprovedDateString()
Specified by:
getApprovedDateString in interface AbstractUser
Overrides:
getApprovedDateString in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getApprovedDateString()

getAvatarClass

public AvatarClass getAvatarClass()
Returns:
WRITEME
See Also:
AbstractUser.getAvatarClass()

getAvatarLabel

public String getAvatarLabel()
Description copied from interface: AbstractUser
The avatar label is the text block that is displayed with the avatar for this object. It should be unique but isn't guaranteed to be distinct as user names are. (At any given moment, there can be only one object with a given avatar label in the room, but there can be only one user with a given name in the multiverse.) For users, this is the user name.

Returns:
The avatar label
See Also:
AbstractUser.getAvatarLabel()

getBaseColor

public Colour getBaseColor()
Returns:
base colour
See Also:
AbstractUser.getBaseColor()

getBuddyListNames

public Collection<String> getBuddyListNames()
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)

Returns:
WRITEME
See Also:
AbstractUser.getBuddyListNames()

getCurrentAction

public String getCurrentAction()
Description copied from class: GeneralUser
Normally “Walk” but can be any action that the client recognises for the avatar type

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

getDebugName

public String getDebugName()
Description copied from interface: AbstractUser
Get a version of the user's ID and name suitable for use in debugging dumps. The format is: “LOGIN” #ID — e.g. "“Pil” #2". Note the use of typographically correct quotation marks

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()
Specified by:
getDialect in interface AbstractUser
Overrides:
getDialect in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getDialect()

getDisplayName

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

getExtraColor

public Colour getExtraColor()
Specified by:
getExtraColor in interface AbstractUser
Overrides:
getExtraColor in class GeneralUser
Returns:
extra colour
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 direction of this object
See Also:
AbstractUser.getFacing()

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:
WRITEME
See Also:
AbstractUser.getInventory()

getIPAddress

public String getIPAddress()
Returns:
WRITEME
See Also:
AbstractUser.getIPAddress()

getKickedByUserID

public int getKickedByUserID()
Specified by:
getKickedByUserID in interface AbstractUser
Overrides:
getKickedByUserID in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getKickedByUserID()

getKickedMessage

public String getKickedMessage()
Returns:
WRITEME
See Also:
AbstractUser.getKickedMessage()

getKickedReasonCode

public String getKickedReasonCode()
Specified by:
getKickedReasonCode in interface AbstractUser
Overrides:
getKickedReasonCode in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getKickedReasonCode()

getKickedUntil

public Timestamp getKickedUntil()
Specified by:
getKickedUntil in interface AbstractUser
Overrides:
getKickedUntil in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.getKickedUntil()

getLag

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

getLanguage

public String getLanguage()
Returns:
WRITEME
See Also:
AbstractUser.getLanguage()

getLocation

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

Returns:
the location at which the user was located at AbstractUser.getTravelStart()
See Also:
AbstractUser.getLocation()

getLocationForUpdate

public Coord3D getLocationForUpdate()
Description copied from interface: AbstractUser
Gets the current coördinates. Performs an update to ensure that they are “current” as of “now.” Also blocks on this method if anyone else is trying to do the same thing. After calling this method, you must call AbstractUser.unlockLocation() to free up other threads' ability to position this AbstractUser.

Specified by:
getLocationForUpdate in interface AbstractUser
Overrides:
getLocationForUpdate in class GeneralUser
Returns:
the current coördinates of the user
See Also:
AbstractUser.getLocationForUpdate()

getMail

public String getMail()
Returns:
WRITEME
See Also:
AbstractUser.getMail()

getMoney

public BigDecimal getMoney(Currency currency)
Description copied from interface: AbstractUser
To be deprecated in favour of AbstractUser.getWallet() ASAP!

Specified by:
getMoney in interface AbstractUser
Overrides:
getMoney in class GeneralUser
Parameters:
currency - units
Returns:
amount
See Also:
AbstractUser.getMoney(org.starhope.appius.mb.Currency)

getNameApprovedAt

public Date getNameApprovedAt()
Returns:
WRITEME
See Also:
AbstractUser.getNameApprovedAt()

getNameRequestedAt

public Date getNameRequestedAt()
Returns:
WRITEME
See Also:
AbstractUser.getNameRequestedAt()

getPublicInfo

public org.json.JSONObject getPublicInfo()
Description copied from interface: AbstractUser

Returned packet contains:

Specified by:
getPublicInfo in interface AbstractUser
Overrides:
getPublicInfo in class GeneralUser
Returns:
JSONObject 'self' including userName and avatarClass
See Also:
AbstractUser.getPublicInfo()

getRegisteredDateString

public String getRegisteredDateString()
Specified by:
getRegisteredDateString in interface AbstractUser
Overrides:
getRegisteredDateString in class GeneralUser
Returns:
Returns an user-visible string describing when the user was registered
See Also:
AbstractUser.getRegisteredDateString()

getResponsibleMail

public String getResponsibleMail()
Description copied from class: GeneralUser

Get the eMail address of a responsible person: either the player, or the parent.

Currently, kids 13-17 return their own mail.

Specified by:
getResponsibleMail in interface AbstractUser
Overrides:
getResponsibleMail in class GeneralUser
Returns:
the eMail address
See Also:
AbstractUser.getResponsibleMail()

getRoom

public Room getRoom()
Description copied from interface: RoomListener
WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)

Specified by:
getRoom in interface RoomListener
Overrides:
getRoom in class GeneralUser
Returns:
The room in which the user currently exists. This might potentially be null.
See Also:
RoomListener.getRoom()

getRoomNumber

public int getRoomNumber()
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)

Specified by:
getRoomNumber in interface AbstractUser
Overrides:
getRoomNumber in class GeneralUser
Returns:
the number of the user's current room; or -1 if the user isn't in any room
See Also:
AbstractUser.getRoomNumber()

getServerThread

public ServerThread getServerThread()
Returns:
WRITEME
See Also:
AbstractUser.getServerThread()

getStaffLevel

public int getStaffLevel()
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)

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

getStartT

public long getStartT()
Specified by:
getStartT in interface AbstractUser
Overrides:
getStartT in class GeneralUser
Returns:
the time at which the user last actually started moving
See Also:
AbstractUser.getStartT()

getTarget

public Coord3D getTarget()
Description copied from interface: AbstractUser
Gets the current target

Specified by:
getTarget in interface AbstractUser
Overrides:
getTarget in class GeneralUser
Returns:
the target toward which the user is moving
See Also:
AbstractUser.getTarget()

getTravelRate

public double getTravelRate()
Description copied from class: GeneralUser
This is an overriding method.

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

getTravelStart

public long getTravelStart()
Description copied from class: GeneralUser
This is an overriding method.

Specified by:
getTravelStart in interface AbstractUser
Overrides:
getTravelStart in class GeneralUser
Returns:
the time at which the object started moving (msec since epoch)
See Also:
AbstractUser.getTravelStart()

getUserID

public int getUserID()
Description copied from interface: AbstractUser
Get the user ID number for this user

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

getUserVariables

public Map<String,String> getUserVariables()
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)

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

getVariable

public String getVariable(String string)
Description copied from class: GeneralUser
Get the value of a given variable by name. Contains special-case for “d”

Specified by:
getVariable in interface HasVariables
Specified by:
getVariable in interface AbstractUser
Overrides:
getVariable in class GeneralUser
Parameters:
string - Variable key
Returns:
Value of the named variable
See Also:
AbstractUser.getVariable(java.lang.String)

getWallet

public Wallet getWallet()
Specified by:
getWallet in interface AbstractUser
Overrides:
getWallet in class GeneralUser
Returns:
the user's wallet (currency inventory)

getZone

public Zone getZone()
Description copied from interface: RoomListener
WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009)

Specified by:
getZone in interface RoomListener
Overrides:
getZone in class GeneralUser
Returns:
the Zone in which this listener can be found
See Also:
RoomListener.getZone()

hashCode

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

hasStaffLevel

@Deprecated
public boolean hasStaffLevel(int i)
Deprecated. use Security.hasCapability(AbstractUser, org.starhope.appius.sys.admin.SecurityCapability)

Description copied from class: GeneralUser
Returns true if the user has the asserted staff level, or a staff level which includes it. Returns false, otherwise.

Specified by:
hasStaffLevel in interface AbstractUser
Overrides:
hasStaffLevel in class GeneralUser
Parameters:
i - The minimum staff level for which we are testing.
Returns:
True, if the user meets the minimum staff level stated; false, otherwise. * @deprecated use Security.hasCapability(AbstractUser, org.starhope.appius.sys.admin.SecurityCapability)

hasVariable

public boolean hasVariable(String string)
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Nov 30, 2009)

Specified by:
hasVariable in interface AbstractUser
Overrides:
hasVariable in class GeneralUser
Parameters:
string - WRITEME
Returns:
WRITEME
See Also:
AbstractUser.hasVariable(java.lang.String)

ignore

public void ignore(AbstractUser byLogin)
Description copied from class: GeneralUser
Calling this method indicates that this user wants to ignore the other specified user.

Specified by:
ignore in interface AbstractUser
Overrides:
ignore in class GeneralUser
Parameters:
byLogin - The user, whom this user wishes to ignore
See Also:
AbstractUser.ignore(org.starhope.appius.user.AbstractUser)

isBanned

public boolean isBanned()
Specified by:
isBanned in interface AbstractUser
Overrides:
isBanned in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.isBanned()

isCanceled

public boolean isCanceled()
Specified by:
isCanceled in interface AbstractUser
Overrides:
isCanceled in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.isCanceled()

isKicked

public boolean isKicked()
Specified by:
isKicked in interface AbstractUser
Overrides:
isKicked in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.isKicked()

isNPC

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

Returns:
WRITEME
See Also:
AbstractUser.isNPC()

isOnline

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

Returns:
WRITEME
See Also:
AbstractUser.isOnline()

isPaidMember

public boolean isPaidMember()
Specified by:
isPaidMember in interface AbstractUser
Overrides:
isPaidMember in class GeneralUser
Returns:
WRITEME
See Also:
AbstractUser.isPaidMember()

kick

public void kick(AbstractUser u,
                 String kickReason,
                 int duration)
          throws PrivilegeRequiredException
Parameters:
u - WRITEME
kickReason - WRITEME
duration - WRITEME
Throws:
PrivilegeRequiredException - WRITEME
See Also:
AbstractUser.kick(org.starhope.appius.user.AbstractUser, java.lang.String, int)

liftBan

public void liftBan(AbstractUser authority)
             throws PrivilegeRequiredException
Description copied from interface: AbstractUser
remove a ban placed upon this user

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

needsParent

public boolean needsParent()
Description copied from class: GeneralUser
Kid accounts (under 13) require parental confirmation. In order to get that, we have to get a parental contact. If this field is false, then the user is either a teenager or adult, or they have a parent on file. It does not mean that they have had their account approved: only that they have given us the parental information (if we needed it). If we ever encounter a user for whom this flag is true, ask them “who's your daddy?”

Specified by:
needsParent in interface AbstractUser
Overrides:
needsParent in class GeneralUser
Returns:
true, if this is a kid account without a known parent (yet)
See Also:
AbstractUser.needsParent()

removeBuddy

public void removeBuddy(AbstractUser byLogin)
Specified by:
removeBuddy in interface AbstractUser
Overrides:
removeBuddy in class GeneralUser
Parameters:
byLogin - WRITEME
See Also:
AbstractUser.removeBuddy(org.starhope.appius.user.AbstractUser)

reportedToModeratorBy

public void reportedToModeratorBy(AbstractUser u)
Parameters:
u - WRITEME
See Also:
AbstractUser.reportedToModeratorBy(org.starhope.appius.user.AbstractUser)

reportedToModeratorBy

public void reportedToModeratorBy(AbstractUser u,
                                  String reason)
Parameters:
u - WRITEME
reason - WRITEME
See Also:
AbstractUser.reportedToModeratorBy(org.starhope.appius.user.AbstractUser, java.lang.String)

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)

sendMigrate

public void sendMigrate(AbstractZone refugeeZone)
                 throws UserDeadException
Description copied from interface: AbstractUser
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010)

Parameters:
refugeeZone - WRITEME
Throws:
UserDeadException - WRITEME
See Also:
AbstractUser.sendMigrate(org.starhope.appius.types.AbstractZone)

sendOops

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

See Also:
AbstractUser.sendOops()

sendResponse

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

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()

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()

setBaseColor

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

Specified by:
setBaseColor in interface AbstractUser
Overrides:
setBaseColor in class GeneralUser
Parameters:
colour - WRITEME
See Also:
AbstractUser.setBaseColor(org.starhope.appius.types.Colour)

setCanTalk

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

Specified by:
setCanTalk in interface AbstractUser
Overrides:
setCanTalk in class GeneralUser
Parameters:
b - WRITEME
See Also:
AbstractUser.setCanTalk(boolean)

setCurrentAction

public void setCurrentAction(String newAction)
Description copied from class: GeneralUser
Normally “Walk” but can be any action that the client recognizes for the avatar type

Specified by:
setCurrentAction in interface AbstractUser
Overrides:
setCurrentAction in class GeneralUser
Parameters:
newAction - the currentAction to set
See Also:
AbstractUser.setCurrentAction(java.lang.String)

setExtraColor

public void setExtraColor(Colour colour)
Specified by:
setExtraColor in interface AbstractUser
Overrides:
setExtraColor in class GeneralUser
Parameters:
colour - WRITEME
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 new facing direction
See Also:
AbstractUser.setFacing(java.lang.String)

setLastActive

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

See Also:
AbstractUser.setLastActive()

setLocation

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

setMail

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

Parameters:
email - WRITEME
Throws:
GameLogicException - WRITEME
See Also:
AbstractUser.setMail(java.lang.String)

setParent

public void setParent(Parent newParent)
               throws GameLogicException,
                      ForbiddenUserException,
                      AlreadyExistsException
Description copied from interface: AbstractUser
If this is a child account (per COPPA), then associate a parent record with it. Affiliated with Parent class and AbstractUser.needsParent()

Parameters:
newParent - the new parent record to associate with this user
Throws:
GameLogicException - if this user account does not need a parent record (adult account or system/robot account)
ForbiddenUserException - if the parent is not allowed to register/associate new child accounts (usually due to having other child accounts which are banned)
AlreadyExistsException - if the parent account has the maximum allowed children.
See Also:
AbstractUser.setParent(org.starhope.appius.user.Parent)

setRoom

public int setRoom(Room room)
Description copied from class: GeneralUser
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
See Also:
AbstractUser.setRoom(org.starhope.appius.game.Room)

setStartT

public void setStartT(long when)
Description copied from interface: AbstractUser
set the time at which the player started moving — not necessarily the same as AbstractUser.getTravelStart() because that value is updated over time, this value is when they actually started moving along the path altogether

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)

setTarget

public void setTarget(Coord3D coord3d)
Description copied from class: GeneralUser
Sets the new target coördinates

Specified by:
setTarget in interface AbstractUser
Overrides:
setTarget in class GeneralUser
Parameters:
coord3d - target coördinates
See Also:
AbstractUser.setTarget(org.starhope.appius.geometry.Coord3D)

setTravelRate

public void setTravelRate(double rate)
Description copied from class: GeneralUser
This is an overriding method.

Specified by:
setTravelRate in interface AbstractUser
Overrides:
setTravelRate in class GeneralUser
Parameters:
rate - WRITEME
See Also:
AbstractUser.setTravelRate(double)

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)

setVariable

public void setVariable(String varName,
                        String varValue)
Description copied from class: GeneralUser
Set an user variable. These are echoed to everyone in the room, and provide various sorts of semi-persisten information about the user. For a discussion see the top of the AbstractUser manual page.

Specified by:
setVariable in interface HasVariables
Specified by:
setVariable in interface AbstractUser
Overrides:
setVariable in class GeneralUser
Parameters:
varName - The name of the variable
varValue - The value
See Also:
AbstractUser.setVariable(java.lang.String, java.lang.String)

speak

public void speak(Room room,
                  String string)
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)

toJSON

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

toSFSXML

public String toSFSXML()
Returns:
a string representing Smart Fox Server Pro style of XML data
See Also:
AbstractUser.toSFSXML()

toString

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

unlockLocation

public void unlockLocation()
Description copied from interface: AbstractUser
Unlock an user's location, locked by a call to AbstractUser.getLocationForUpdate() (q.v.)

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