|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AbstractUser
Any “thing” that exists in the game world and participates therein should implement the AbstractUser interface. This interface provides the “physicality” (no, that's not a word) necessary for something to participate in the game rooms.
AbstractUser, along with Room
and AbstractZone
, are
the three main classes that are used to describe the game world. (
AppiusClaudiusCaecus
and AppiusConfig
are also major
ingredients, however.)
Pretty much everything in the Appius game server hangs off of these few classes.
The AbstractUser provides a messaging interface for users (players),
non-player characters, and also moving “animate” objects in the
world, like Ejecta
(which include projectiles, particles, and
the like).
Users have delegate objects which describe them more fully, such as enrolments (subscriptions), inventory, buddy lists, and avatar classes.
A user always exists in exactly one room. To “hide” from the game, the user can enter into a Limbo room; typically, each zone has a room named “nowhere” for that purpose.
A user also has a hash map of string-string user variables associated with it. These variables are used to portray important information to connected game clients, and often reflect server-side status information. For example, users who should not be interacted with as though they were normal characters/players in the game will have “noClick” set to “true”.
Certain user variables are defined for all Appian clients and implementations. In general, any user variables in ALL CAPS are reserved for implementors' own use, and the core server will not interfere with such variables.
Implementors are free to pick and choose from among the following for their own purposes, but the Appius server may set — and may expect to be honoured, to various degrees — the following variables.
This was used exclusively in Appius 1.0 for player placement and
movement. Note that this has been superseded by the
more flexible Commands.do_go(JSONObject, AbstractUser, Room)
“go do” system.
The directional vector data is split on the character “~” into the following series of fields:
Room.getLag()
It must be noted that the avatar's position along the directional vector specified by “d” can be the start (not yet moving), the end (already completed), or any point along the line segment connecting them. It is the responsibility of the client application to properly compute the current position of the avatar.
Ejecta
)
ejecta object, such as a projectile or a simple animated effect (puff
of smoke, &c.) The client may wish to treat it differently in user
interface operations.
Method Summary | |
---|---|
void |
acceptErrorReply(String command,
String error,
org.json.JSONObject result,
Room userCurrentRoomInZone)
|
void |
acceptMessage(String title,
String label,
String content)
Accept an administrative/moderator message with the full range of options. |
void |
acceptPrivateMessage(AbstractUser speaker,
String speech)
Accept a private message from another user (a whisper) |
void |
acceptSuccessReply(String command,
org.json.JSONObject jsonData,
Room room)
|
void |
addBuddy(AbstractUser buddy)
|
void |
addGiftSubscription(int months,
int days)
|
void |
addItem(int itemID)
|
void |
assertLocationUnlocked()
WRITEME: Document this method brpocock@star-hope.org |
void |
assertStaffLevel(int staffLevelStaffMember)
x-deprecated use Security.hasCapability(AbstractUser, SecurityCapability)
for new code |
void |
attend(AbstractUser byLogin)
|
void |
ban(AbstractUser u,
String banReason)
|
boolean |
canTalk()
|
void |
doffClothes()
WRITEME |
void |
doTransport()
WRITEME |
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 recognizes 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. |
double |
getHeight()
Height in pixels. |
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 getWallet() ASAP! |
Date |
getNameApprovedAt()
|
Date |
getNameRequestedAt()
|
PathFinder |
getPathFinder()
WRITEME: Document this method brpocock@star-hope.org |
org.json.JSONObject |
getPublicInfo()
Returned packet contains: |
String |
getRegisteredDateString()
|
String |
getResponsibleMail()
|
int |
getRoomNumber()
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010) |
ServerThread |
getServerThread()
|
double |
getSizeScalar()
WRITEME: Document this method brpocock@star-hope.org |
int |
getStaffLevel()
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010) |
long |
getStartT()
|
Coord3D |
getTarget()
Gets the current target |
double |
getTravelRate()
WRITEME: document this method (brpocock@star-hope.org, Nov 24, 2009) |
long |
getTravelStart()
WRITEME: document this method (brpocock@star-hope.org, Nov 24, 2009) |
int |
getUserID()
Get the user ID number for this user |
Iterator<UserListEntry> |
getUserListIterator(String moniker)
WRITEME: Document this method brpocock@star-hope.org |
Map<String,String> |
getUserVariables()
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010) |
String |
getVariable(String string)
WRITEME: document this method (brpocock@star-hope.org, Oct 31, 2009) |
Wallet |
getWallet()
|
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. |
boolean |
hasStaffLevel(int i)
|
boolean |
hasVariable(String string)
WRITEME: document this method (brpocock@star-hope.org, Nov 30, 2009) |
void |
ignore(AbstractUser byLogin)
|
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()
Identify whether this account is owned by a child (per COPPA age-13 rules), and if it needs a parent account associated with it to give permission to play the game. |
void |
purchase(GenericItemReference itemToBuy)
WRITEME: Document this method brpocock@star-hope.org |
void |
removeBuddy(AbstractUser byLogin)
|
void |
reportedToModeratorBy(AbstractUser u)
|
void |
reportedToModeratorBy(AbstractUser u,
String reason)
|
void |
sendBuddyList(String whichList,
List<UserListEntry> users)
Sends a buddy list JSON packet |
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)
|
void |
setStartT(long when)
set the time at which the player started moving — not necessarily the same as 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 target coordinates for movement |
void |
setTravelRate(double rate)
WRITEME: document this method (brpocock@star-hope.org, Nov 24, 2009) |
void |
setTravelStart(long l)
WRITEME: Document this method brpocock@star-hope.org |
void |
setVariable(String varName,
String varValue)
WRITEME: document this method (brpocock@star-hope.org, Dec 1, 2009) |
void |
speak(Room room,
String string)
|
boolean |
takeAttack(DamageTypeRanks attack)
WRITEME: Document this method brpocock@star-hope.org |
org.json.JSONObject |
toJSON()
|
String |
toSFSXML()
|
void |
unlockLocation()
Unlock an user's location, locked by a call to getLocationForUpdate() (q.v.) |
void |
updateWallet()
review your current wallet currency amounts, they may have changed |
Methods inherited from interface org.starhope.appius.game.RoomListener |
---|
acceptGameAction, acceptGameStateChange, acceptObjectJoinRoom, acceptObjectPartRoom, acceptOutOfBandMessage, acceptPublicMessage, acceptPublicMessage, acceptUserAction, acceptUserVariableUpdate, getRoom, getZone |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface org.starhope.appius.types.HasVariables |
---|
deleteVariable, getVariables, resetVariables, setVariable, setVariables |
Methods inherited from interface org.starhope.appius.user.DataRecordBacked |
---|
setBackingRecord |
Method Detail |
---|
void acceptErrorReply(String command, String error, org.json.JSONObject result, Room userCurrentRoomInZone)
command
- The command which produced the errorerror
- The error coderesult
- The additional JSON data describing the erroruserCurrentRoomInZone
- The room in which the user was
standing when the error occurred.void acceptMessage(String title, String label, String content)
content
- The contents of the messagetitle
- The title of the messagelabel
- A label which nominally identifies the source of the
messagevoid acceptPrivateMessage(AbstractUser speaker, String speech)
speaker
- the person whisperingspeech
- what was whisperedvoid acceptSuccessReply(String command, org.json.JSONObject jsonData, Room room)
room
- WRITEMEcommand
- WRITEMEjsonData
- WRITEMEvoid addBuddy(AbstractUser buddy)
buddy
- WRITEMEvoid addGiftSubscription(int months, int days)
months
- WRITEMEdays
- WRITEMEvoid addItem(int itemID)
itemID
- the item ID to be instantiated and addedvoid assertLocationUnlocked()
void assertStaffLevel(int staffLevelStaffMember) throws PrivilegeRequiredException
Security.hasCapability(AbstractUser, SecurityCapability)
for new code
staffLevelStaffMember
- WRITEME
PrivilegeRequiredException
- WRITEMEvoid attend(AbstractUser byLogin)
byLogin
- WRITEMEvoid ban(AbstractUser u, String banReason) throws PrivilegeRequiredException
u
- WRITEMEbanReason
- WRITEME
PrivilegeRequiredException
- WRITEMEboolean canTalk()
void doffClothes()
void doTransport()
int getAge()
AgeBracket getAgeGroup()
AgeBracket.System
.
AgeBracket
String getApprovedDateString()
AvatarClass getAvatarClass()
String getAvatarLabel()
Colour getBaseColor()
Collection<String> getBuddyListNames()
String getCurrentAction()
String getDebugName()
String getDialect()
String getDisplayName()
Colour getExtraColor()
String getFacing()
double getHeight()
Inventory getInventory()
String getIPAddress()
int getKickedByUserID()
String getKickedMessage()
String getKickedReasonCode()
Timestamp getKickedUntil()
long getLag()
String getLanguage()
Coord3D getLocation()
getTravelStart()
Coord3D getLocationForUpdate()
unlockLocation()
to free up other threads' ability
to position this AbstractUser
.
String getMail()
BigDecimal getMoney(Currency currency)
getWallet()
ASAP!
currency
- units
Date getNameApprovedAt()
Date getNameRequestedAt()
PathFinder getPathFinder()
org.json.JSONObject getPublicInfo()
Returned packet contains:
String getRegisteredDateString()
String getResponsibleMail()
int getRoomNumber()
ServerThread getServerThread()
double getSizeScalar()
int getStaffLevel()
long getStartT()
Coord3D getTarget()
double getTravelRate()
long getTravelStart()
int getUserID()
Iterator<UserListEntry> getUserListIterator(String moniker)
moniker
- WRITEME
Map<String,String> getUserVariables()
String getVariable(String string)
getVariable
in interface HasVariables
string
- WRITEME
Wallet getWallet()
Coord3D handleWalkFail(Room room, Coord3D to)
room
- the destination roomto
- the destination coördinates
boolean hasStaffLevel(int i)
i
- WRITEME
Security.hasCapability(AbstractUser,SecurityCapability)
boolean hasVariable(String string)
string
- WRITEME
void ignore(AbstractUser byLogin)
byLogin
- WRITEMEboolean isBanned()
boolean isCanceled()
boolean isKicked()
boolean isNPC()
boolean isOnline()
boolean isPaidMember()
void kick(AbstractUser u, String kickReason, int duration) throws PrivilegeRequiredException
u
- WRITEMEkickReason
- WRITEMEduration
- WRITEME
PrivilegeRequiredException
- WRITEMEvoid liftBan(AbstractUser authority) throws PrivilegeRequiredException
authority
- WRITEME
PrivilegeRequiredException
- WRITEMEboolean needsParent()
void purchase(GenericItemReference itemToBuy) throws NonSufficientFundsException, NotFoundException, AlreadyExistsException
itemToBuy
- WRITEME
NonSufficientFundsException
- WRITEME
NotFoundException
- WRITEME
AlreadyExistsException
- WRITEMEvoid removeBuddy(AbstractUser byLogin)
byLogin
- WRITEMEvoid reportedToModeratorBy(AbstractUser u)
u
- WRITEMEvoid reportedToModeratorBy(AbstractUser u, String reason)
u
- WRITEMEreason
- WRITEMEvoid sendBuddyList(String whichList, List<UserListEntry> users)
whichList
- the name of the user list. Special names are
“$buddy” or “$ignore”users
- the users on that listvoid sendEarnings(Room room, String string)
room
- WRITEMEstring
- WRITEMEvoid sendMigrate(AbstractZone refugeeZone) throws UserDeadException
refugeeZone
- WRITEME
UserDeadException
- WRITEMEvoid sendOops()
void sendResponse(org.json.JSONObject result)
result
- WRITEMEvoid sendWardrobe()
void setAgeGroupToSystem()
void setBaseColor(Colour colour)
colour
- WRITEMEvoid setCanTalk(boolean b)
b
- WRITEMEvoid setCurrentAction(String newAction)
newAction
- the currentAction to setvoid setExtraColor(Colour colour)
colour
- WRITEMEvoid setFacing(String newFacing)
newFacing
- the new facing directionvoid setLastActive()
void setLocation(Coord3D coord3d)
coord3d
- new 3D coordinatesvoid setMail(String email) throws GameLogicException
email
- WRITEME
GameLogicException
- WRITEMEvoid setParent(Parent newParent) throws GameLogicException, ForbiddenUserException, AlreadyExistsException
needsParent()
newParent
- the new parent record to associate with this
user
ForbiddenUserException
- if the parent is not allowed to
register/associate new child accounts (usually due to
having other child accounts which are banned)
GameLogicException
- if this user account does not need a
parent record (adult account or system/robot account)
AlreadyExistsException
- if the parent account has the
maximum allowed children.int setRoom(Room room)
room
- WRITEME
void setStartT(long when)
getTravelStart()
because that value is
updated over time, this value is when they actually started
moving along the path altogether
when
- the time at which the user last made a conscious
change in their movementvoid setTarget(Coord3D coord3d)
coord3d
- the new targetvoid setTravelRate(double rate)
rate
- WRITEMEvoid setTravelStart(long l)
l
- WRITEMEvoid setVariable(String varName, String varValue)
HasVariables
setVariable
in interface HasVariables
varName
- the user variable namevarValue
- the user variable valuevoid speak(Room room, String string)
room
- the room in which to speak. Typically, the user must
be present in that room.string
- the speech (or emote)boolean takeAttack(DamageTypeRanks attack)
attack
- WRITEME
org.json.JSONObject toJSON()
String toSFSXML()
void unlockLocation()
getLocationForUpdate()
(q.v.)
void updateWallet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |