|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.user.Person
org.starhope.appius.user.User
public abstract class User
This class encapsulates all of the user/player information for the game.
Field Summary | |
---|---|
private AgeBracket |
ageGroup
The age bracket to which this user belongs: currently kid (0-12), teen (13-17), or adult (18+). |
private Date |
approvedDate
The date on which the account was approved (by parent) or eMail was validated (by self). |
private AvatarClass |
avatarClass
The type of avatar in play |
private Colour |
baseColor
The base colour of the avatar |
private Date |
birthDate
The user's date of birth. |
private UserList |
buddyList
The list of buddies for this user. |
private boolean |
canEnterChatZone
True if the user can enter a zone where people can chat freely. |
private boolean |
canEnterMenuZone
True if the user can enter a zone where dialogue is chosen from menus. |
private boolean |
canTalk
True if the user is allowed to type chat. |
private Colour |
chatBG
background colour for chat text |
private Colour |
chatFG
foreground colour for chat text |
private AbstractRoom |
currentRoom
The current room in which the user is active. |
private Date |
emailPlusDate
For kids, this is the date on which eMail Plus secondary eMail is sent out. |
private Colour |
extraColor
The extra colour of the avatar. |
private String |
facing
The direction in which the user is facing. |
private boolean |
haveInventory
Has the user's inventory been loaded? |
private UserList |
ignoreList
The list of users whom this user is ignoring. |
private HashSet<org.starhope.appius.game.inventory.InventoryItem> |
inventory
All types of inventory in a single set. |
private boolean |
isActive
If true, the account is active (not canceled nor banned) |
private boolean |
isBanned
If true, the account is banned (not active nor canceled) |
private boolean |
isCanceled
If true, the account is canceled (not active nor banned) |
private int |
kickedByUserID
The user ID who kicked this user offline. |
private String |
kickedReasonCode
The reason that this user is kicked offline or banned. |
private Timestamp |
kickedUntil
The date at which the user is no longer kicked offline. |
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. |
private String |
lastZoneName
the last zone on which the user had been logged on; or, their current zone, if we can see Smartfox from here. |
private static ConcurrentHashMap<String,User> |
liveCache
A simple cache of live users |
private String |
login
The user's current, active login name. |
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 Timestamp |
nameApprovedAt
The timestamp of Lifeguard approval of the user's name (or null, if it hasn't been approved yet) |
private long |
nameApprovedByUserID
The user ID of the moderator who approved this user's name |
protected Timestamp |
nameRequestedAt
The time at which this user entered his/her request for a new name. |
protected boolean |
needsNaming
If true, the user hasn't picked a name for this account (but it may have a system-assigned random one), so we need to nag them to pick a name. |
private boolean |
parentApprovedName
Whether the user's parent has approved the name yet. |
private int |
parentID
Pointer to the parent of this user, if the user's age bracket is "kid" |
protected String |
referer
The 1-4 character code representing the source of a referral which resulted in this user signing up. |
private Timestamp |
registeredAt
Time when the user originally registered |
protected String |
requestedName
The user name which the user has requested, but has not yet been approved. |
private HashSet<Integer> |
rooms
The set of rooms in this user's house (and yard). |
private static int |
serial
|
private static long |
serialVersionUID
Serial Version Unique Identifier for Java Serialization. |
private AppiusClaudiusCaecus |
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) |
protected int |
staffLevel
The level of staff authority possessed by this user. |
private double |
targetX
The destination ordinate toward which the user is currently moving. |
private double |
targetY
The destination mantissa toward which the user is currently moving. |
private double |
travelRate
The rate of movement (in pixels per millisecond) of this user. |
private long |
travelStartTime
The time at which the user started moving on their current movement vector. |
private static com.whirlycott.cache.Cache |
userCache
The WhirleyCache of users |
protected int |
userID
The user's numeric ID, for database purposes. |
private ConcurrentHashMap<String,String> |
userVariables
Arbitrary user variables which can be set or retrieved by the front-end |
private double |
x
The user's origination ordinate |
private double |
y
The user's origination abcessa |
Fields inherited from class org.starhope.appius.user.Person |
---|
canContact, dialect, forgotPasswordAnswer, forgotPasswordQuestion, givenName, language, mail, mailConfirmed, mailConfirmSent, password |
Constructor Summary | |
---|---|
protected |
User(Date birthDate1,
String avatarTitle,
String userNameRequest)
Create a new user account |
|
User(int id)
Instantiate a user object from an existing user account ID |
protected |
User(ResultSet rs)
Instantiate a User object based upon the contents of a ResultSet. |
|
User(String newUserLogin)
Instantiate a user object from an existing user account ID |
Method Summary | |
---|---|
protected static void |
__debugTracePeanuts(AbstractUser me)
theys Jan 7, 2010 |
void |
acceptAdminMessage(AbstractRoom room,
String string)
Deprecated. use acceptAdminMessage(String, String, String)
instead |
void |
acceptAdminMessage(Integer room,
String string)
Deprecated. use acceptAdminMessage(String, String, String)
instead |
void |
acceptAdminMessage(String message,
String title,
String label)
Send an administrative or moderator message to the client |
void |
acceptErrorReply(String command,
String error,
org.json.JSONObject result,
AbstractRoom room)
|
void |
acceptGameAction(AbstractUser sender,
org.json.JSONObject action)
This is an overriding method. |
void |
acceptGameStateChange(GameEvent gameCode,
GameStateFlag gameState)
This is an overriding method. |
void |
acceptMessage(String title,
String caption,
String message)
Accept an administrative/moderator message with the full range of options |
void |
acceptObjectJoinRoom(AbstractRoom room,
AbstractUser object)
Accept notification of a user or object joining the room. |
void |
acceptObjectJoinRoom(AbstractRoom room,
RoomListener object)
Notification that someone has entered the room. |
void |
acceptObjectPartRoom(AbstractRoom room,
RoomListener object)
Accept notification of a user or object departing the room. |
void |
acceptOutOfBandMessage(AbstractUser sender,
AbstractRoom 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,
AbstractRoom room,
String message)
This is an overriding method. |
void |
acceptPublicMessage(AbstractUser from,
String message)
This is an overriding method. |
void |
acceptSuccessReply(AbstractZone zone,
AbstractRoom room,
String command,
org.json.JSONObject jsonData)
Deprecated. for shorter acceptSuccessReply(String, JSONObject, AbstractRoom) |
void |
acceptSuccessReply(String command,
org.json.JSONObject jsonData,
AbstractRoom room)
|
void |
addBuddy(AbstractUser newBuddy)
Adds a user to this user's buddy list. |
void |
addDefaultFreeItem(int id)
Identical to @link addDefaultFreeItem(int, boolean) with
“false” for the second parameter |
void |
addDefaultFreeItem(int id,
boolean forceActive)
Add an item which every user gets for free to the user's inventory, if it does not already exist. |
protected void |
addFreeClothing(org.starhope.appius.game.inventory.ClothingItem clothingItem)
|
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)
Add an item to the user's inventory. |
void |
addItem(org.starhope.appius.game.inventory.InventoryItem item)
Add an item to the user's inventory. |
void |
addRoom(int roomNumber)
|
protected 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 |
void |
assertStaffLevel(int staffLevelNeeded)
Assert that this user must have the given staff level (or greater). |
static void |
assertUserNameAvailable(String userNameRequested)
Make the assertion that the user name supplied is available to be requested or assigned to this user. |
void |
attend(AbstractUser otherGuy)
Attend to an user who may previously have been ignored |
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 |
canApproveSelf()
If the user is a teen (13+) or adult, they are allowed to approve their own account. |
void |
cancelEvent(int eventID)
TODO: document this method (brpocock, Jan 15, 2010) |
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()
|
void |
changed()
This is an overriding method. |
AbstractRoom |
changeRoom(AbstractRoom room)
|
boolean |
checkPassword(String passwordGuess)
Returns true if the password is correct. |
int |
compareTo(User o)
This is an overriding method. |
static void |
configUpdated()
This is the callback that is called whenever the AppiusConfig reloads the configuration or has a runtime configuration value changed. |
static User |
create(Date date,
String string,
String nick)
Create a new user account |
static void |
dangerous__removeTestUsers()
Delete test users: test???? accounts with email of testing@tootsville.com will be DESTROYED from the database. |
boolean |
deleteMail(int messageID)
Mark a message as being deleted in the messages database. |
void |
deleteVariable(String key)
This is an overriding method. |
void |
doff(org.starhope.appius.game.inventory.ClothingItem item)
Doff a wearable item |
void |
doffClothes()
Get naked |
void |
doffPatterns()
Get bare |
void |
doffPivitz()
Remove Pivitz |
private static void |
dumpLiveCache()
Print out a nasty, verbose debugging dump of the users live cache to the STDOUT. |
void |
endEventPurchaseRaw(int eventID,
int itemID)
WRITEME: document this method (brpocock, Aug 31, 2009) |
protected abstract void |
endEventPurchaseRaw(int eventID,
ItemCreationTemplate itemCreationTemplate)
WRITEME: document this method (brpocock, Dec 30, 2009) |
org.json.JSONObject |
endMultiplayerEvent(Integer eventID,
String gameMoniker,
String gameCode,
BigDecimal playerScoreDecimal,
LinkedHashMap<Integer,Integer> sortedScores)
This is an overriding method. |
abstract org.json.JSONObject |
endMultiplayerEvent(int eventID,
String moniker,
String gameCode,
BigDecimal score,
LinkedHashMap<Integer,Integer> scores)
end a multiplayer event … WRITEME details? |
boolean |
equals(Object o)
This is an overriding method. |
boolean |
equals(User o)
Determine if two user objects are identical. |
void |
equip(org.starhope.appius.game.inventory.InventoryItem item)
Equip an item |
protected void |
fetch_avatarInfo(ResultSet resultSet)
Fetch the user's avatar information from the database |
protected void |
fetch_chatColours(ResultSet resultSet)
Fetch the chat colours for this user from the database |
protected void |
fetch_dobInfo(ResultSet resultSet)
Fetch the user's date of birth and related information from the database record provided |
private void |
fetch_inventory()
Sub-fetch routine called by set(ResultSet) to handle
inventory load. |
protected void |
fetch_language(ResultSet resultSet)
Fetch the user's language and dialect information from the database record |
protected void |
fetch_laston()
Fetch the user's last activity information from the database record |
protected void |
fetch_mailInfo(ResultSet resultSet)
Fetch the user's eMail info from the database record |
protected void |
fetch_more(ResultSet resultSet)
Fetch additional results fields from a database record — mostly intended to be overridden by derived classes |
protected void |
fetch_parentInfo(ResultSet resultSet)
Fetch information about the user's parent (if any). |
protected void |
fetch_passwordResetInfo(ResultSet resultSet)
Fetch the password reset question and answer from the provided database record. |
protected void |
fetch_permissionsInfo(ResultSet resultSet)
Fetch the permissions-related portion of a user's record out of the SQL ResultSet. |
protected void |
fetch_userBasicInfo(ResultSet resultSet)
Fetch the user's basic information: user ID, user name, and password — from the provided database record |
protected void |
flush_breakOut_chatColours(PreparedStatement update,
int bgColumnNumber,
int fgColumnNumber)
WRITEME: document this method (brpocock, Jan 8, 2010) |
protected void |
flush_breakOut_dob(PreparedStatement update)
Breakout of the flush operation to update the user's date of birth and age group |
protected void |
flush_breakOut_language(PreparedStatement update)
WRITEME: document this method (brpocock, Sep 23, 2009) |
protected void |
flush_breakOut_loginPass(PreparedStatement update)
WRITEME: document this method (brpocock, Sep 23, 2009) |
protected void |
flush_breakOut_mail(PreparedStatement update)
Flush the user's eMail information to the database |
protected void |
flush_breakOut_nameRequest(PreparedStatement update)
Prepare the name-request details for flush() |
protected void |
flush_breakOut_parent(PreparedStatement update)
Prepare the user's parent's details for flush() |
protected void |
flush_breakOut_permissions(PreparedStatement update)
set permissions for a database flush |
protected void |
flush_breakOut_referer(PreparedStatement update,
int column)
Prepare the “referer” field for flush() |
abstract void |
flush()
|
boolean |
forgotPassword(String forgottenPasswordQ,
String forgottenPasswordA)
Send the user their forgotten password if they know the answer to their secret question. |
void |
generateSystemName()
Generate a new "anonymous user name" for the user. |
static AbstractUser |
get(org.json.JSONObject object)
Pick up a user from a JSON object containing either the ID or login (user name) string |
org.json.JSONObject |
getActiveClothing()
|
Collection<org.starhope.appius.game.inventory.HomeDecorItem> |
getActiveDecorations(int roomNumber)
get the decorations active (placed) in a room of this user's house |
org.starhope.appius.game.inventory.InventoryItem |
getActiveItemByType(InventoryItemType t)
Returns the active item for an item type. |
org.starhope.appius.game.inventory.InventoryItem |
getActiveItemByType(String t)
Returns the active item for an item type. |
static org.starhope.appius.game.inventory.InventoryItem |
getActiveItemByTypeAndUserID(int typeID,
int userID)
WRITEME: Document this field. |
static org.starhope.appius.game.inventory.InventoryItem |
getActiveItemByTypeAndUserID(InventoryItemType type,
int userID)
WRITEME: Document this field. |
int |
getAge()
Get the current age of the user. |
AgeBracket |
getAgeGroup()
|
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()
|
Date |
getBirthDate()
|
UserList |
getBuddyList()
Get the user's buddy list (a UserList ) |
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)
Instantiate a user object from an existing user account ID |
static AbstractUser |
getByLogin(String login)
|
static AbstractUser[] |
getByMail(String mail)
Returns an array of all users associated with a given eMail address. |
static User |
getByRequestedName(String userNameRequested)
Get the user who has requested a certain name, if any. |
protected String |
getCacheUniqueID()
This is an overriding method. |
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 |
getDialect()
|
String |
getDisplayName()
This method's only use is for more closely aligning User and Parent classes. |
Date |
getEmailPlusDate()
|
String |
getEmailPlusDateString()
|
Colour |
getExtraColor()
|
String |
getFacing()
Get the string identifying the direction which this object is facing. |
org.starhope.appius.game.inventory.HomeDecorItem |
getFurnitureBySlot(int slotNumber)
|
private org.starhope.appius.game.inventory.GameEquipItem |
getGameEquipItem()
If the user has a game item equipped (e.g. |
boolean |
getGameFlag(String name)
Return the status of the indicated game flag. |
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)
Find the user name for a user who is currently signed on. |
static int |
getIDForLogin(String name)
Fetch the user ID number for a user name |
static int |
getIDForUserName(String name)
Deprecated. getIDForLogin(String) |
UserList |
getIgnoreList()
|
protected HashSet<org.starhope.appius.game.inventory.InventoryItem> |
getInventory()
|
String |
getIpAddress()
Deprecated. Smart Fox Server misspelling of getIPAddress() |
String |
getIPAddress()
|
Collection<org.starhope.appius.game.inventory.InventoryItem> |
getItemsByType(String typeString)
Get all items that identify as the type string. |
Collection<org.starhope.appius.game.inventory.InventoryItem> |
getItemsByType(String[] types)
WRITEME: document this method (brpocock, Aug 28, 2009) |
org.starhope.appius.game.inventory.InventoryItem[] |
getItemsByTypeAsArray(String typeString)
Get all items that identify as the type string. |
int |
getKickedByUserID()
|
String |
getKickedMessage()
|
String |
getKickedReasonCode()
|
Timestamp |
getKickedUntil()
String?? TODO? FIXME? |
Timestamp |
getLastActive()
|
String |
getLastZone()
|
RoomAndZone |
getLocation()
Get the user's current location (room and zone) if the user is online; or, “null” if the user is not online. |
String |
getLogin()
|
int |
getMySerial()
|
String |
getName()
|
Timestamp |
getNameApprovedAt()
|
long |
getNameApprovedByUserID()
|
Timestamp |
getNameRequestedAt()
|
Parent |
getParent()
|
boolean |
getParentApprovedName()
|
int |
getParentID()
|
org.json.JSONObject |
getPassport_JSON()
|
String |
getPotentialUserName()
This is an overriding method. |
org.json.JSONObject |
getPublicInfo()
TODO: document this method (brpocock, Oct 31, 2009) avatar, userName, clothes, colors |
String |
getReferer()
Get the referral/affiliate code from this user's initial signup |
Timestamp |
getRegisteredAt()
|
Date |
getRegisteredDate()
|
String |
getRegisteredDateString()
|
String |
getRequestedName()
|
String |
getResponsibleMail()
Get the eMail address of a responsible person: either the player, or the parent. |
static String |
getRev()
|
AbstractRoom |
getRoom()
TODO: document this method (brpocock, Oct 31, 2009) |
int |
getRoomNumber()
TODO: document this method (brpocock, Jan 11, 2010) |
long |
getSerial()
Get the unique instance serial number for this instance of this user. |
AppiusClaudiusCaecus |
getServerThread()
Get the Appius Claudius Caecus server thread (if any) associated with this User (if they are logged-in). |
int |
getStaffLevel()
TODO: document this method (brpocock, Jan 11, 2010) |
private String |
getSystemNameAdjective()
|
private String |
getSystemNameNoun()
|
static AbstractUser |
getSystemUser()
Get the System user object (the user which represents the system program itself). |
double |
getTargetX()
TODO: document this method (brpocock, Oct 31, 2009) |
double |
getTargetY()
TODO: document this method (brpocock, Oct 31, 2009) |
double |
getTravelRate()
This is an overriding method. |
long |
getTravelStart()
This is an overriding method. |
Collection<UserEnrolment> |
getUserEnrolments()
|
UserEnrolment[] |
getUserEnrolmentsAsArray()
|
int |
getUserID()
TODO: document this method (brpocock, Oct 31, 2009) |
String |
getUserName()
|
static String |
getUserNameForID(int id)
|
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. |
HashMap<String,String> |
getUserVariables()
Get all user variables in a hash map |
String |
getVariable(String string)
TODO: document this method (brpocock, Oct 31, 2009) |
double |
getX()
TODO: document this method (brpocock, Oct 31, 2009) |
double |
getY()
TODO: document this method (brpocock, Oct 31, 2009) |
static String[] |
getZ$Z()
Z$Z |
AbstractZone |
getZone()
Get the user's current Zone, if the user is online. |
int |
hashCode()
Get a (hopefully unique) hash code for this user. |
boolean |
hasItem(int id)
Determine whether this user has this item |
boolean |
hasItem(org.starhope.appius.game.inventory.InventoryItem item)
determine whether the user has an item |
boolean |
hasStaffLevel(int staffLevelNeeded)
Returns true if the user has the asserted staff level, or a staff level which includes it. |
boolean |
hasVariable(String string)
This is an overriding method. |
void |
ignore(AbstractUser otherUser)
Calling this method indicates that this user wants to ignore the other specified user. |
protected abstract void |
insertIntoDatabase(Date birthDate1)
WRITEME: document this method (brpocock, Jan 4, 2010) |
private static User |
instantiateUser(ResultSet rs)
Instantiate a User (using the selected subclass) from the result set garnered from a SELECT * |
void |
invalidateCache()
Invalidate the live cache records of this user after s/he has signed off. |
boolean |
isActive()
|
boolean |
isApproved()
See approvedDate for discussion |
boolean |
isBanned()
|
boolean |
isBirthday()
|
boolean |
isCanceled()
|
boolean |
isCanContact()
TODO: document this method (brpocock, Oct 13, 2009) |
boolean |
isCanEnterChatZone()
|
boolean |
isCanEnterMenuZone()
|
boolean |
isCanTalk()
|
static void |
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)
Determine whether the given name is potentially available for use. |
static boolean |
isNameForbidden(String userNameRequested)
Determine whether a name is forbidden |
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()
TODO: document this method (brpocock, Oct 31, 2009) |
boolean |
isPaidMember()
|
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. |
abstract void |
local_create()
Hook for special stuff to be done right after a new user account is created |
protected void |
local_publicInfo(org.json.JSONObject userInfo)
Append information in the subclass to the already-prepared JSON data for the getPublicInfo call |
void |
loggedIn(String zoneName,
AppiusClaudiusCaecus 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. |
boolean |
needsParent()
Kid accounts (under 13) require parental confirmation. |
void |
notifyFurnitureInventory(AbstractRoom room)
|
void |
parentApprovedAccount(boolean whether)
Call this method when the parent determines whether to approve or disapprove this account. |
void |
parentApprovedName(boolean whether)
|
protected void |
populateByID(int id)
Private method used to look up User in the database and fill in the attributes |
protected void |
populateByLogin(String loadLogin)
Fetch a user record out of the database based upon its login name |
void |
postLoginGlobal()
WRITEME: document this method (brpocock, Jan 8, 2010) |
void |
readExternal(ObjectInput in)
XXX Java serialization stuff |
protected 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)
WRITEME: document this method (brpocock, Aug 31, 2009) |
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 |
sendEarnings(AbstractRoom room,
String string)
|
void |
sendGameAction(User 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(User 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) |
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 |
sendUserLists()
Sends the user an asynchronous notification of their user lists' status. |
void |
sendWardrobe()
|
protected void |
set(ResultSet resultSet)
|
void |
setActive(boolean isActive1)
|
AgeBracket |
setAgeGroup()
Sets the age group based upon the user's date of birth. |
void |
setAgeGroupToSystem()
Declares this to be an inhuman, ergo ageless, user account. |
void |
setApprovedDate(Date date)
|
void |
setAvatarClass(AvatarClass avatarClass1)
|
void |
setBaseColor(Colour newBaseColor)
|
void |
setBirthDate(Date birthDate1)
|
void |
setCanceled(boolean isCanceled1)
|
void |
setCanContact(boolean canContact1)
|
void |
setCanEnterChatZone(boolean canEnterChatZone1)
|
void |
setCanEnterMenuZone(boolean canEnterMenuZone1)
|
void |
setCanTalk(boolean canTalk1)
|
void |
setChatBG(Colour newChatBG)
|
void |
setChatFG(Colour newChatFG)
|
void |
setEmailPlusDate(Date emailPlusDate1)
|
void |
setExtraColor(Colour extraColor1)
|
void |
setFacing(String newFacing)
|
void |
setGivenName(String givenName1)
|
void |
setLastActive()
WRITEME |
void |
setLogin(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. |
void |
setMail(String newMail)
|
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 |
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 |
setReferer(String theReferer)
WRITEME: document this method (brpocock, Sep 22, 2009) |
void |
setRegisteredAt(Timestamp newRegisteredAt)
|
int |
setRoom(AbstractRoom room)
Set the user's current room to the given room. |
void |
setServerThread(AppiusClaudiusCaecus newThread)
Set the server thread controlling this user. |
void |
setStaffLevel(int newStaffLevel)
|
void |
setStartT(long when)
This is an overriding method. |
void |
setStructure(org.starhope.appius.game.inventory.HomeDecorItem 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 |
setTargetX(double newTargetX)
|
void |
setTargetY(double newTargetY)
|
void |
setTravelRate(double rate)
This is an overriding method. |
void |
setUserName(String newLogin)
|
void |
setUserNameFromUser(String userRequestedLogin)
Set a user name, requested by the user. |
void |
setVariable(Map.Entry<String,String> var)
This is an overriding method. |
void |
setVariable(String varName,
String varValue)
WRITEME: document this method (brpocock, Oct 19, 2009) |
void |
setVariables(Map<String,String> map)
This is an overriding method. |
void |
setX(double newX)
TODO: document this method (brpocock, Nov 24, 2009) |
void |
setY(double newY)
TODO: document this method (brpocock, Nov 24, 2009) |
void |
speak(AbstractRoom room,
String string)
|
abstract void |
startEnrolment(UserEnrolment userEnrolment)
|
org.json.JSONObject |
toJSONRef()
This is analogous to toSFSXML() for the pure JSON “to
infinity and beyond” interface |
String |
toSFSXML()
TODO: document this method (brpocock, Oct 31, 2009) |
String |
toString()
|
void |
updateCache()
Update the Whirley cache to know about this object. |
void |
wear(org.starhope.appius.game.inventory.ClothingItem item)
|
void |
wear(org.starhope.appius.game.inventory.ClothingItem item,
Colour colour)
Put on a wearable item, to include Pivitz as well as clothing and so forth. |
void |
wear(org.starhope.appius.game.inventory.ClothingItem item,
int color)
WRITEME: document this method (brpocock, Jan 12, 2010) |
void |
writeExternal(ObjectOutput out)
This is an overriding method. |
Methods inherited from class org.starhope.appius.user.Person |
---|
generateNewPassword, getCouponCode, getForgotPasswordAnswer, getForgotPasswordQuestion, getLanguage, getMail, getMailConfirmed, getPassword, getResponsiblePerson, sendConfirmationMail, sendStaffPasswordReset, sentConfirmationMail, setCouponCode, setForgotPasswordAnswer, setForgotPasswordQuestion, setPassword, setPasswordAndPasswordRecovery, setPasswordRecovery, setRandomPassword |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
findInCache, get, saveInCache, set, toJSON |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.starhope.appius.user.AbstractUser |
---|
doTransport, endEvent, getLanguage, getMail, kick, startEvent, toJSON |
Field Detail |
---|
private static final ConcurrentHashMap<String,User> liveCache
public static final int MAX_LOGIN_LENGTH
public static final int MAX_PW_LENGTH
public static final int MIN_LOGIN_LENGTH
public static final int MIN_PW_LENGTH
private static int serial
private static final long serialVersionUID
public static final int STAFF_LEVEL_ACCOUNT_SERVICE
public static final int STAFF_LEVEL_DESIGNER
public static final int STAFF_LEVEL_DEVELOPER
public static final int STAFF_LEVEL_MODERATOR
public static final int STAFF_LEVEL_PUBLIC
public static final int STAFF_LEVEL_STAFF_MEMBER
private static com.whirlycott.cache.Cache userCache
private AgeBracket ageGroup
private Date approvedDate
private AvatarClass avatarClass
private Colour baseColor
private Date birthDate
private UserList buddyList
private boolean canEnterChatZone
private boolean canEnterMenuZone
private boolean canTalk
private Colour chatBG
private Colour chatFG
private transient AbstractRoom currentRoom
private Date emailPlusDate
private Colour extraColor
private String facing
private boolean haveInventory
private UserList ignoreList
private final HashSet<org.starhope.appius.game.inventory.InventoryItem> inventory
private boolean isActive
private boolean isBanned
private boolean isCanceled
private int kickedByUserID
private String kickedReasonCode
private Timestamp kickedUntil
private Timestamp lastActive
private String lastZoneName
private String login
private final transient int mySerial
private Timestamp nameApprovedAt
private long nameApprovedByUserID
protected Timestamp nameRequestedAt
protected boolean needsNaming
private boolean parentApprovedName
private int parentID
protected String referer
private Timestamp registeredAt
protected String requestedName
private final HashSet<Integer> rooms
private transient AppiusClaudiusCaecus serverThread
protected int staffLevel
private double targetX
x
)
private double targetY
y
)
private double travelRate
private long travelStartTime
protected int userID
private final ConcurrentHashMap<String,String> userVariables
private double x
private double y
Constructor Detail |
---|
protected User(Date birthDate1, String avatarTitle, String userNameRequest) throws AlreadyUsedException, ForbiddenUserException, NumberFormatException
birthDate1
- The player's date of birthavatarTitle
- 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
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 irrationalpublic User(int id) throws NotFoundException
id
- user ID value
NotFoundException
- if the user can't be found in the
database.protected User(ResultSet rs)
getUsersAwaitingNameApproval()
rs
- The ResultSet object (with the cursor at the current
row to be instantiated). Note that this implies that
rs.next() has been called at least once.public User(String newUserLogin) throws NotFoundException
newUserLogin
- user login name
NotFoundException
- if the user can't be found in the
database.Method Detail |
---|
protected static void __debugTracePeanuts(AbstractUser me)
theys Jan 7, 2010TO __debugTracePeanuts trace the stack and display the amount of peanuts
me
- The user being debugged.public static void assertUserNameAvailable(String userNameRequested) throws AlreadyUsedException, ForbiddenUserException
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
isNameAvailable(String)
userNameRequested
- The name which is being requested
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 isNameForbidden(String)
@Deprecated public static boolean canSeeSmartFoxServer()
public static void configUpdated()
public static User create(Date date, String string, String nick) throws AlreadyUsedException, ForbiddenUserException
date
- User's date of birthstring
- Character class or type designatornick
- User's requested nickname
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 IDpublic static void dangerous__removeTestUsers() throws SQLException
SQLException
- if it can't be done.private static void dumpLiveCache()
public static AbstractUser get(org.json.JSONObject object)
object
- A JSON object with either an { id: userID } or {
login: userName }
public static org.starhope.appius.game.inventory.InventoryItem getActiveItemByTypeAndUserID(int typeID, int userID)
typeID
- WRITEMEuserID
- WRITEME
public static org.starhope.appius.game.inventory.InventoryItem getActiveItemByTypeAndUserID(InventoryItemType type, int userID)
BRP: I believe the idea here is to bypass actually instantiating an user object just to acquire one's inventory
type
- The item typeuserID
- the user whose inventory we want
public static AbstractUser getByID(int id)
id
- The user ID to instantiate
public static AbstractUser getByLogin(String login)
login
- the user login name
public static AbstractUser[] getByMail(String mail)
mail
- The eMail address for which we are searching
public static User getByRequestedName(String userNameRequested)
userNameRequested
- the user name for which we're searching
public static int getIDForLiveUserName(String name)
name
- User name to look up
public static int getIDForLogin(String name)
name
- The user name (login)
@Deprecated public static int getIDForUserName(String name)
getIDForLogin(String)
name
- The user name (login)
public static String getRev()
public static AbstractUser getSystemUser()
public static String getUserNameForID(int id)
id
- The user ID value
public static Collection<AbstractUser> getUsersAwaitingNameApproval()
public static String[] getZ$Z()
private static User instantiateUser(ResultSet rs)
rs
- The given database record
public static void isItGood()
public static boolean isNameAvailable(String name)
name
- The user name being checked
public static boolean isNameForbidden(String userNameRequested)
... 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
userNameRequested
- The name to be checked
public static boolean isNameValid(String userName)
userName
- the user name to be checked
@Deprecated public void acceptAdminMessage(AbstractRoom room, String string)
acceptAdminMessage(String, String, String)
instead
acceptAdminMessage
in interface AbstractUser
room
- Ignoredstring
- The administrative messageacceptAdminMessage(Integer, String)
@Deprecated public void acceptAdminMessage(Integer room, String string)
acceptAdminMessage(String, String, String)
instead
acceptAdminMessage
in interface AbstractUser
room
- The room in which the administrative message is being
sent (ignored)string
- The administrative message.public void acceptAdminMessage(String message, String title, String label)
acceptAdminMessage
in interface AbstractUser
message
- The body of the messagetitle
- The non-scrolling titlelabel
- The label to apply to the corner of the message boxpublic void acceptErrorReply(String command, String error, org.json.JSONObject result, AbstractRoom room)
acceptErrorReply
in interface AbstractUser
command
- WRITEMEerror
- WRITEMEresult
- WRITEMEroom
- WRITEMEAbstractUser.acceptErrorReply(java.lang.String,
java.lang.String, org.json.JSONObject,
org.starhope.appius.game.AbstractRoom)
public void acceptGameAction(AbstractUser sender, org.json.JSONObject action)
acceptGameAction
in interface RoomListener
sender
- the senderaction
- The game action. The verb is in
action.getString("action").RoomListener.acceptGameAction(AbstractUser,
JSONObject)
public void acceptGameStateChange(GameEvent gameCode, GameStateFlag gameState)
acceptGameStateChange
in interface RoomListener
gameCode
- The GameEvent whose state is changinggameState
- The new stateRoomListener.acceptGameStateChange(org.starhope.appius.game.GameEvent,
org.starhope.appius.game.GameStateFlag)
public void acceptMessage(String title, String caption, String message)
acceptMessage
in interface AbstractUser
title
- The title of the messagecaption
- The caption; usually ADMIN for administrative
messagesmessage
- The message body textpublic void acceptObjectJoinRoom(AbstractRoom room, AbstractUser object)
room
- the room in questionobject
- the object leaving the roomRoomListener.acceptObjectJoinRoom(AbstractRoom,
RoomListener)
public void acceptObjectJoinRoom(AbstractRoom room, RoomListener object)
RoomListener
acceptObjectJoinRoom
in interface RoomListener
room
- The roomobject
- The thing (probably user) enteringRoomListener.acceptObjectJoinRoom(org.starhope.appius.game.AbstractRoom,
org.starhope.appius.game.RoomListener)
public void acceptObjectPartRoom(AbstractRoom room, RoomListener object)
acceptObjectPartRoom
in interface RoomListener
room
- The roomobject
- The thing (probably user) departingRoomListener.acceptObjectPartRoom(AbstractRoom,
RoomListener)
public void acceptOutOfBandMessage(AbstractUser sender, AbstractRoom room, org.json.JSONObject body)
acceptOutOfBandMessage
in interface RoomListener
sender
- The user transmitting the out-of-band messagebody
- The contents of that message (in JSO)room
- The room in which the sender is found — and,
typically, also this recipient.public void acceptPrivateMessage(AbstractUser from, String message)
from
- The user “whispering” to this onemessage
- The contents of the messagepublic void acceptPublicMessage(AbstractUser sender, AbstractRoom room, String message)
acceptPublicMessage
in interface RoomListener
sender
- The speakerroom
- The room in which the words were spokenmessage
- The spoken text or /emoteRoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser,
org.starhope.appius.game.AbstractRoom, java.lang.String)
public void acceptPublicMessage(AbstractUser from, String message)
acceptPublicMessage
in interface RoomListener
from
- The speakermessage
- The spoken text or /emoteRoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser,
java.lang.String)
@Deprecated public void acceptSuccessReply(AbstractZone zone, AbstractRoom room, String command, org.json.JSONObject jsonData)
acceptSuccessReply(String, JSONObject, AbstractRoom)
acceptSuccessReply
in interface AbstractUser
zone
- WRITEMEroom
- WRITEMEcommand
- WRITEMEjsonData
- WRITEMEAbstractUser.acceptSuccessReply(org.starhope.appius.types.AbstractZone,
org.starhope.appius.game.AbstractRoom, java.lang.String,
org.json.JSONObject)
public void acceptSuccessReply(String command, org.json.JSONObject jsonData, AbstractRoom room)
acceptSuccessReply
in interface AbstractUser
command
- the command sending the successful replyjsonData
- additional JSON dataroom
- the room in which the success happenedpublic void addBuddy(AbstractUser newBuddy)
addBuddy
in interface AbstractUser
newBuddy
- the user to be the new buddypublic void addDefaultFreeItem(int id)
addDefaultFreeItem(int, boolean)
with
“false” for the second parameter
id
- the item ID.public void addDefaultFreeItem(int id, boolean forceActive)
id
- the item IDforceActive
- if true, force the item to be active upon
adding it to the user's inventoryprotected void addFreeClothing(org.starhope.appius.game.inventory.ClothingItem clothingItem)
clothingItem
- The item to be added to the user's inventory
as a free gift (or prize)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.
addGiftSubscription
in interface AbstractUser
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.public void addItem(int itemID)
addItem
in interface AbstractUser
itemID
- The item's database ID number.public void addItem(org.starhope.appius.game.inventory.InventoryItem item)
item
- The item to be added to inventory.public void addRoom(int roomNumber)
roomNumber
- add a room to the user's houseprotected void affirmFreeMember()
public void affirmPaidMember()
public void approveName(AbstractUser abstractUser) throws PrivilegeRequiredException
abstractUser
- the user approving the name (requires
moderator privileges)
PrivilegeRequiredException
- if the user approving the name
does not have moderator privilegespublic void assertStaffLevel(int staffLevelNeeded) throws PrivilegeRequiredException
assertStaffLevel
in interface AbstractUser
staffLevelNeeded
- The minimum staff level which is being
asserted
PrivilegeRequiredException
- if the minimum staff level is
not met.public void attend(AbstractUser otherGuy)
attend
in interface AbstractUser
otherGuy
- the user to whom to now attendpublic void ban(AbstractUser bannedBy, String bannedReason) throws PrivilegeRequiredException
ban
in interface AbstractUser
bannedBy
- The moderator by which the user was banned.bannedReason
- the reason for which the user was banned
PrivilegeRequiredException
- if the user does not have
moderator-level (or better) privilegespublic void blog(String message)
message
- the message to be recordedpublic boolean canApproveSelf()
public void cancelEvent(int eventID)
AbstractUser
cancelEvent
in interface AbstractUser
eventID
- the event ID to be canceledpublic boolean canLogIn(String passGuess)
passGuess
- The user's attempted password
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.
public boolean canTalk()
canTalk
in interface AbstractUser
public void changed()
changed
in class SQLPeerDatum
SQLPeerDatum.changed()
public AbstractRoom changeRoom(AbstractRoom room)
room
- the new room to be joined
public boolean checkPassword(String passwordGuess)
Person
checkPassword
in class Person
passwordGuess
- the supplied password that we want to check
public int compareTo(User o)
compareTo
in interface Comparable<User>
o
- The other user
Comparable.compareTo(java.lang.Object)
public boolean deleteMail(int messageID)
messageID
- The message ID to be marked as deleted.
public void deleteVariable(String key)
deleteVariable
in interface HasVariables
key
- WRITEMEHasVariables.deleteVariable(java.lang.String)
public void doff(org.starhope.appius.game.inventory.ClothingItem item)
item
- the item to be removedwear(ClothingItem)
public void doffClothes()
doffClothes
in interface AbstractUser
public void doffPatterns()
public void doffPivitz()
public void endEventPurchaseRaw(int eventID, int itemID) throws NotFoundException, NonSufficientFundsException, AlreadyExistsException
eventID
- WRITEMEitemID
- WRITEME
NotFoundException
- WRITEME
NonSufficientFundsException
- WRITEME
AlreadyExistsException
- WRITEMEprotected abstract void endEventPurchaseRaw(int eventID, ItemCreationTemplate itemCreationTemplate) throws NotFoundException, NonSufficientFundsException, AlreadyExistsException
eventID
- WRITEMEitemCreationTemplate
- WRITEME
NotFoundException
- WRITEME
NonSufficientFundsException
- WRITEME
AlreadyExistsException
- WRITEMEpublic abstract org.json.JSONObject endMultiplayerEvent(int eventID, String moniker, String gameCode, BigDecimal score, LinkedHashMap<Integer,Integer> scores) throws org.json.JSONException
eventID
- the event instance IDmoniker
- the moniker of the event in progressgameCode
- the game code of the multiplayer game eventscore
- the score of this playerscores
- the set of user ID's and scores of all players
org.json.JSONException
- if the event's results can't be expressed
in JSONpublic org.json.JSONObject endMultiplayerEvent(Integer eventID, String gameMoniker, String gameCode, BigDecimal playerScoreDecimal, LinkedHashMap<Integer,Integer> sortedScores) throws org.json.JSONException
endMultiplayerEvent
in interface AbstractUser
eventID
- WRITEMEgameMoniker
- WRITEMEgameCode
- WRITEMEplayerScoreDecimal
- WRITEMEsortedScores
- WRITEME
org.json.JSONException
- WRITEMEAbstractUser.endMultiplayerEvent(java.lang.Integer,
java.lang.String, java.lang.String, java.math.BigDecimal,
java.util.LinkedHashMap)
public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public boolean equals(User o)
o
- the other user
public void equip(org.starhope.appius.game.inventory.InventoryItem item) throws GameLogicException
item
- The item to be equipped
GameLogicException
- if the user does not have the itemprotected void fetch_avatarInfo(ResultSet resultSet) throws SQLException
resultSet
- database record to interpret
SQLException
- if the record can't be interpretedset(ResultSet)
protected void fetch_chatColours(ResultSet resultSet) throws SQLException
resultSet
- database record to interpret
SQLException
- if the record can't be interpretedset(ResultSet)
protected void fetch_dobInfo(ResultSet resultSet) throws SQLException
resultSet
- database record to interpret
SQLException
- if the record can't be interpretedset(ResultSet)
private void fetch_inventory() throws SQLException
set(ResultSet)
to handle
inventory load.
SQLException
- if the underlying inventory record(s) is/are
corrupted in some wayset(ResultSet)
protected void fetch_language(ResultSet resultSet) throws SQLException
resultSet
- the database record from which to be loaded
SQLException
- if the record can't be interpretedset(ResultSet)
protected void fetch_laston() throws SQLException
SQLException
- if the record can't be interpreted.set(ResultSet)
protected void fetch_mailInfo(ResultSet resultSet) throws SQLException
resultSet
- database record to interpret
SQLException
- if the record can't be interpretedset(ResultSet)
protected void fetch_more(ResultSet resultSet) throws SQLException
resultSet
- WRITEME
SQLException
- WRITEMEprotected void fetch_parentInfo(ResultSet resultSet) throws SQLException
resultSet
- database record to interpret
SQLException
- if the record can't be interpretedset(ResultSet)
protected void fetch_passwordResetInfo(ResultSet resultSet) throws SQLException
set(ResultSet)
resultSet
- the database record
SQLException
- If the records can't be found, or are in an
invalid format of some kindprotected void fetch_permissionsInfo(ResultSet resultSet) throws SQLException
resultSet
- The ResultSet being used to set the user up.
SQLException
- if the data in the record can't be
interpreted.set(ResultSet)
protected void fetch_userBasicInfo(ResultSet resultSet) throws SQLException
resultSet
- database record to interpret
SQLException
- if the record can't be interpretedset(ResultSet)
public abstract void flush()
flush
in class Person
Person.flush()
protected void flush_breakOut_chatColours(PreparedStatement update, int bgColumnNumber, int fgColumnNumber) throws SQLException
update
- WRITEMEbgColumnNumber
- WRITEMEfgColumnNumber
- WRITEME
SQLException
- WRITEMEflush()
protected void flush_breakOut_dob(PreparedStatement update) throws SQLException
update
- the prepared statement for the update
SQLException
- if the data can't be stored into the pending
updateprotected void flush_breakOut_language(PreparedStatement update) throws SQLException
update
- WRITEME
SQLException
- WRITEMEflush()
protected void flush_breakOut_loginPass(PreparedStatement update) throws SQLException
update
- WRITEME.
SQLException
- WRITEMEflush()
protected void flush_breakOut_mail(PreparedStatement update) throws SQLException
update
- The database PreparedStatement from
flush()
SQLException
- if the record can't be prepared for updateflush()
protected void flush_breakOut_nameRequest(PreparedStatement update) throws SQLException
flush()
update
- the PreparedStatement to be updated
SQLException
- if the data can't be set up for some reasonflush()
protected void flush_breakOut_parent(PreparedStatement update) throws SQLException
flush()
update
- the PreparedStatement to be updated
SQLException
- if the data can't be set up for some reasonflush()
protected void flush_breakOut_permissions(PreparedStatement update) throws SQLException
update
- the SQL statement being prepared
SQLException
- if the data can't be prepared for SQL
injectionflush()
protected void flush_breakOut_referer(PreparedStatement update, int column) throws SQLException
flush()
update
- the PreparedStatement for updatecolumn
- the referer column number in the database
SQLException
- if the SQL can't be set upflush()
public boolean forgotPassword(String forgottenPasswordQ, String forgottenPasswordA)
forgotPassword
in class Person
forgottenPasswordQ
- The question being answeredforgottenPasswordA
- The answer provided
public void generateSystemName()
public org.json.JSONObject getActiveClothing()
public Collection<org.starhope.appius.game.inventory.HomeDecorItem> getActiveDecorations(int roomNumber) throws NotFoundException
getActiveDecorations
in interface AbstractUser
roomNumber
- which room of the user's house
NotFoundException
- if the room does not existpublic org.starhope.appius.game.inventory.InventoryItem getActiveItemByType(InventoryItemType t)
t
- An Item type to match by.
InventoryItem.identifiesAs(String)
public org.starhope.appius.game.inventory.InventoryItem getActiveItemByType(String t)
t
- A string of the item type. Use Constants from
InventoryItem
InventoryItem.identifiesAs(String)
public int getAge()
getAge
in interface AbstractUser
public AgeBracket getAgeGroup()
public abstract String getApprovalCookie()
Person
getApprovalCookie
in class Person
Person.getApprovalCookie()
public Date getApprovedDate()
public String getApprovedDateString()
getApprovedDateString
in interface AbstractUser
getApprovedDate()
public AvatarClass getAvatarClass()
getAvatarClass
in interface AbstractUser
public String getAvatarLabel()
getAvatarLabel
in interface AbstractUser
AbstractUser.getAvatarLabel()
public Colour getBaseColor()
public Date getBirthDate()
public UserList getBuddyList()
UserList
)
public Collection<String> getBuddyListNames()
getBuddyList()
getBuddyListNames
in interface AbstractUser
public String[] getBuddyListNamesAsArray()
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public Colour getChatBG()
public Colour getChatFG()
public String getConfirmationTemplate()
getConfirmationTemplate
in class Person
Person.getConfirmationTemplate()
public String getConnectedFrom()
isOnline()
for the usual caveats
public String getDialect()
getDialect
in interface AbstractUser
getDialect
in class Person
public String getDisplayName()
Person
getDisplayName
in interface AbstractUser
getDisplayName
in class Person
Person.getDisplayName()
public Date getEmailPlusDate()
public String getEmailPlusDateString()
getEmailPlusDate()
public Colour getExtraColor()
public String getFacing()
AbstractUser
getFacing
in interface AbstractUser
public org.starhope.appius.game.inventory.HomeDecorItem getFurnitureBySlot(int slotNumber) throws NotFoundException
getFurnitureBySlot
in interface AbstractUser
slotNumber
- WRITEME
NotFoundException
- WRITEMEprivate org.starhope.appius.game.inventory.GameEquipItem getGameEquipItem()
public boolean getGameFlag(String name)
name
- The unique identifier for the game flag
public String getGivenName()
getGivenName
in class Person
public HashMap<Timestamp,HashMap<String,String>> getHistory(Date after, int limit)
getHistory
in class Person
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.
public UserList getIgnoreList()
protected HashSet<org.starhope.appius.game.inventory.InventoryItem> getInventory()
@Deprecated public String getIpAddress()
getIPAddress()
public String getIPAddress()
getIPAddress
in interface AbstractUser
AbstractUser.getIPAddress()
public Collection<org.starhope.appius.game.inventory.InventoryItem> getItemsByType(String typeString)
InventoryItem.identifiesAs(String)
for the canonical
list.
getItemsByType
in interface AbstractUser
typeString
- A type string specified in
InventoryItem.identifiesAs(String)
InventoryItem.identifiesAs(String)
public Collection<org.starhope.appius.game.inventory.InventoryItem> getItemsByType(String[] types)
types
- The set of types of inventory items which are wanted
InventoryItem.identifiesAs(String)
public org.starhope.appius.game.inventory.InventoryItem[] getItemsByTypeAsArray(String typeString)
InventoryItem.identifiesAs(String)
for the canonical
list.
typeString
- A type string specified in
InventoryItem.identifiesAs(String)
InventoryItem.identifiesAs(String)
public int getKickedByUserID()
getKickedByUserID
in interface AbstractUser
public String getKickedMessage()
getKickedMessage
in interface AbstractUser
public String getKickedReasonCode()
getKickedReasonCode
in interface AbstractUser
public Timestamp getKickedUntil()
AbstractUser
getKickedUntil
in interface AbstractUser
public Timestamp getLastActive()
public String getLastZone()
public RoomAndZone getLocation()
getLocation
in interface RoomListener
public String getLogin()
public int getMySerial()
public String getName()
public Timestamp getNameApprovedAt()
getNameApprovedAt
in interface AbstractUser
public long getNameApprovedByUserID()
public Timestamp getNameRequestedAt()
getNameRequestedAt
in interface AbstractUser
public Parent getParent()
public boolean getParentApprovedName()
public int getParentID()
public org.json.JSONObject getPassport_JSON() throws SQLException, org.json.JSONException
SQLException
- if the passport records can't be obtained or
interpreted
org.json.JSONException
- if the passport can't be represented in
JSON formpublic String getPotentialUserName()
getPotentialUserName
in class Person
Person.getPotentialUserName()
public org.json.JSONObject getPublicInfo()
AbstractUser
getPublicInfo
in interface AbstractUser
public String getReferer()
public Timestamp getRegisteredAt()
public Date getRegisteredDate()
registeredAt
public String getRegisteredDateString()
getRegisteredDateString
in interface AbstractUser
getRegisteredDate()
public String getRequestedName()
public String getResponsibleMail()
Get the eMail address of a responsible person: either the player, or the parent.
Currently, kids 13-17 return their own mail.
getResponsibleMail
in interface AbstractUser
getResponsibleMail
in class Person
public AbstractRoom getRoom()
RoomListener
getRoom
in interface RoomListener
public int getRoomNumber()
AbstractUser
getRoomNumber
in interface AbstractUser
public long getSerial()
public AppiusClaudiusCaecus getServerThread()
getServerThread
in interface AbstractUser
public int getStaffLevel()
AbstractUser
getStaffLevel
in interface AbstractUser
private String getSystemNameAdjective()
private String getSystemNameNoun()
public double getTargetX()
AbstractUser
getTargetX
in interface AbstractUser
public double getTargetY()
AbstractUser
getTargetY
in interface AbstractUser
public double getTravelRate()
getTravelRate
in interface AbstractUser
AbstractUser.getTravelRate()
public long getTravelStart()
getTravelStart
in interface AbstractUser
AbstractUser.getTravelStart()
public Collection<UserEnrolment> getUserEnrolments()
public UserEnrolment[] getUserEnrolmentsAsArray()
public int getUserID()
AbstractUser
getUserID
in interface AbstractUser
public String getUserName()
public String getUserNameOrRequest()
public HashMap<String,String> getUserVariables()
getUserVariables
in interface AbstractUser
public String getVariable(String string)
AbstractUser
getVariable
in interface HasVariables
getVariable
in interface AbstractUser
string
- WRITEME
public double getX()
AbstractUser
getX
in interface AbstractUser
public double getY()
AbstractUser
getY
in interface AbstractUser
public AbstractZone getZone()
getZone
in interface RoomListener
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean hasItem(int id)
id
- The item ID
public boolean hasItem(org.starhope.appius.game.inventory.InventoryItem item)
item
- the item in question
public boolean hasStaffLevel(int staffLevelNeeded)
hasStaffLevel
in interface AbstractUser
staffLevelNeeded
- The minimum staff level for which we are
testing.
public boolean hasVariable(String string)
hasVariable
in interface AbstractUser
string
- WRITEME
AbstractUser.hasVariable(java.lang.String)
public void ignore(AbstractUser otherUser)
ignore
in interface AbstractUser
otherUser
- The user, whom this user wishes to ignoreprotected abstract void insertIntoDatabase(Date birthDate1)
birthDate1
- WRITEMEpublic void invalidateCache()
public boolean isActive()
public boolean isApproved()
approvedDate
for discussion
public boolean isBanned()
isBanned
in interface AbstractUser
public boolean isBirthday()
public boolean isCanceled()
isCanceled
in interface AbstractUser
public boolean isCanContact()
Person
isCanContact
in class Person
public boolean isCanEnterChatZone()
public boolean isCanEnterMenuZone()
public boolean isCanTalk()
canTalk()
public boolean isKicked()
isKicked
in interface AbstractUser
public boolean isNeedsNaming()
public boolean isNeedsParentAttention()
public boolean isNPC()
isNPC
in interface AbstractUser
public boolean isOnline()
AbstractUser
isOnline
in interface AbstractUser
public boolean isPaidMember()
isPaidMember
in interface AbstractUser
public void kick(AbstractUser kickedBy, String kickedReason, long kickedMinutes) throws PrivilegeRequiredException
kickedBy
- The user who is kicking this user offlinekickedReason
- The reason for which s/he is being kickedkickedMinutes
- The duration for which s/he should be
kicked, in minutes. Read that again: minutes — not
msec!
PrivilegeRequiredException
- if the person trying to kick
this user off doesn't have moderator privilegespublic void kick(AbstractUser kickedBy, String kickedReason, Timestamp allowBack) throws PrivilegeRequiredException
kickedBy
- The user who is kicking this user offlinekickedReason
- The reason for which s/he is being kickedallowBack
- The time at which this user is permitted to be
online again.
PrivilegeRequiredException
- if the person trying to kick
this user off doesn't have moderator privilegespublic void liftBan(AbstractUser authority) throws PrivilegeRequiredException
liftBan
in interface AbstractUser
authority
- WRITEME
PrivilegeRequiredException
- WRITEMEAbstractUser.liftBan(org.starhope.appius.user.AbstractUser)
public abstract void local_create()
protected void local_publicInfo(org.json.JSONObject userInfo)
userInfo
- the public info JSON object to which additional
info. should be appendedpublic void loggedIn(String zoneName, AppiusClaudiusCaecus newServerThread)
zoneName
- The name of the zone too which the user has
logged innewServerThread
- The server thread in which the user is
logged in@Deprecated public void loggedIn(String zoneName, SocketChannel channel)
zoneName
- The zone name into which the user signed inchannel
- The I/O channel on which the user is connectedpublic String login(String chapSeed, String passwordGuess)
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
public boolean nameNeedsApproval()
public boolean nameNeedsParentalApproval()
public boolean needsNaming()
public boolean needsParent()
public void notifyFurnitureInventory(AbstractRoom room)
notifyFurnitureInventory
in interface AbstractUser
room
- WRITEMEAbstractUser.notifyFurnitureInventory(org.starhope.appius.game.AbstractRoom)
public void parentApprovedAccount(boolean whether)
whether
- the parent has approved the account; true =
approved; false = disapprovedpublic void parentApprovedName(boolean whether)
whether
- True if the parent has approved the name; false if
they disapprove and want a system suggested name.protected void populateByID(int id) throws NotFoundException
id
- The database ID to load
NotFoundException
- if the ID isn't found in the database.protected void populateByLogin(String loadLogin) throws NotFoundException
loadLogin
- The login name (user name)
NotFoundException
- if there is no user named that *right
now*. (There may have been one in the past. Login
names are maleable.)public void postLoginGlobal()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
in
- WRITEME
IOException
- WRITEME
ClassNotFoundException
- WRITEMEprotected void remindPassword()
remindPassword
in class Person
Person.remindPassword()
public void removeBuddy(AbstractUser otherGuy)
removeBuddy
in interface AbstractUser
otherGuy
- who?AbstractUser.removeBuddy(org.starhope.appius.user.AbstractUser)
public void rename(String newName)
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.
rename
in class Person
newName
- The new user namePerson.rename(java.lang.String)
public void reportedToModeratorBy(AbstractUser u)
reportedToModeratorBy
in interface AbstractUser
u
- WRITEMEpublic 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
userNameRequested
- The user name which the user has
requested
ForbiddenUserException
- if the user name is forbidden
(e.g. obscene or previously denied for any reason)
AlreadyUsedException
- if someone has already requested or
used itpublic void requestParentApproval()
public void sendConfirmationForPremium()
public void sendEarnings(AbstractRoom room, String string)
sendEarnings
in interface AbstractUser
room
- WRITEMEstring
- WRITEMEAbstractUser.sendEarnings(org.starhope.appius.game.AbstractRoom,
java.lang.String)
@Deprecated public void sendGameAction(User from, org.json.JSONObject data) throws org.json.JSONException
from
- The user sending the game action (to this user)data
- The game action data
org.json.JSONException
- if the data can't be sent in JSONpublic void sendMigrate(AbstractZone refugeeZone) throws UserDeadException
sendMigrate
in interface AbstractUser
refugeeZone
- the zone to which the user should migrate
UserDeadException
- WRITEMEpublic void sendOops()
AbstractUser
sendOops
in interface AbstractUser
AbstractUser.sendOops()
@Deprecated public void sendPrivateMessage(AbstractUser from, String message)
acceptPrivateMessage(AbstractUser, String)
from
- the user speakingmessage
- the words spokenacceptPrivateMessage(AbstractUser, String)
@Deprecated public void sendPublicMessage(User from, String speech)
acceptPublicMessage(AbstractUser, String)
from
- The user speakingspeech
- the words spokenacceptPublicMessage(AbstractUser, String)
public void sendResponse(org.json.JSONObject result)
sendResponse
in interface AbstractUser
result
- WRITEMEAbstractUser.sendResponse(org.json.JSONObject)
@Deprecated public void sendResponse(org.json.JSONObject result, int room)
sendResponse(JSONObject)
result
- the response datagram in JSONroom
- the room from which the response is coming (or -1 for
not-specified) (ignored)private void sendSuccessReply(String source, org.json.JSONObject reply, AbstractUser sender, int room)
source
- The method returning successreply
- additional details of the success to be returned to
the clientsender
- the user reporting successroom
- the room in which the success happened, or -1 if not
specifiedpublic void sendUserLists()
sendUserLists
in interface AbstractUser
AbstractUser.sendUserLists()
public void sendWardrobe()
sendWardrobe
in interface AbstractUser
AbstractUser.sendWardrobe()
protected void set(ResultSet resultSet) throws SQLException
set
in class SQLPeerDatum
resultSet
- The result of an SQL query, with the cursor already
pointed at the row describing this specific instance
of the object.
SQLException
- if the database fails somehowSQLPeerDatum.set(java.sql.ResultSet)
public void setActive(boolean isActive1)
isActive1
- the isActive to setpublic AgeBracket setAgeGroup()
public void setAgeGroupToSystem()
setAgeGroupToSystem
in interface AbstractUser
public void setApprovedDate(Date date)
date
- the approvedDate to setpublic void setAvatarClass(AvatarClass avatarClass1)
avatarClass1
- the avatarClass to setpublic void setBaseColor(Colour newBaseColor)
setBaseColor
in interface AbstractUser
newBaseColor
- the baseColor to setpublic void setBirthDate(Date birthDate1)
birthDate1
- the birthDate to setpublic void setCanceled(boolean isCanceled1)
isCanceled1
- the isCanceled to setpublic void setCanContact(boolean canContact1)
setCanContact
in class Person
canContact1
- the canContact to setpublic void setCanEnterChatZone(boolean canEnterChatZone1)
canEnterChatZone1
- the canEnterChatZone to setpublic void setCanEnterMenuZone(boolean canEnterMenuZone1)
canEnterMenuZone1
- the canEnterMenuZone to setpublic void setCanTalk(boolean canTalk1)
setCanTalk
in interface AbstractUser
canTalk1
- the canTalk to setpublic void setChatBG(Colour newChatBG)
newChatBG
- the new chat background colourpublic void setChatFG(Colour newChatFG)
newChatFG
- the chat foreground colour to setpublic void setEmailPlusDate(Date emailPlusDate1)
emailPlusDate1
- the emailPlusDate to setpublic void setExtraColor(Colour extraColor1)
setExtraColor
in interface AbstractUser
extraColor1
- the extraColor to setpublic void setFacing(String newFacing)
newFacing
- the facing to setpublic void setGivenName(String givenName1)
setGivenName
in class Person
givenName1
- the givenName to setpublic void setLastActive()
AbstractUser
setLastActive
in interface AbstractUser
public void setLogin(String ipAddress, String zone)
ipAddress
- The IP address (or something like it) from which
the user has logged-inzone
- The active server zone into which the User has
logged-in.public void setMail(String newMail) throws GameLogicException
setMail
in interface AbstractUser
setMail
in class Person
newMail
- the mail to set
GameLogicException
- if attempting to set an eMail address
on a kid accountpublic void setMailConfirmed(Date mailConfirmed1)
setMailConfirmed
in class Person
mailConfirmed1
- the date and time at which the user's mail
was confirmed.public void setNeedsNaming(boolean needsNaming1)
needsNaming1
- the needsNaming to setpublic void setParent(Parent parent) throws GameLogicException, ForbiddenUserException
parent
- the parent to set
GameLogicException
- if this user is an adult
ForbiddenUserException
- WRITEMEpublic void setParentByParent(Parent parent) throws GameLogicException
parent
- the parent to set
GameLogicException
- if this user is an adultpublic void setReferer(String theReferer)
theReferer
- WRITEMEpublic void setRegisteredAt(Timestamp newRegisteredAt)
newRegisteredAt
- the registeredAt to setpublic int setRoom(AbstractRoom room)
setRoom
in interface AbstractUser
room
- the room in which the user must exist
public void setServerThread(AppiusClaudiusCaecus newThread)
newThread
- The new server thread.public void setStaffLevel(int newStaffLevel)
newStaffLevel
- the staffLevel to setpublic void setStartT(long when)
setStartT
in interface AbstractUser
when
- WRITEMEAbstractUser.setStartT(long)
public void setStructure(org.starhope.appius.game.inventory.HomeDecorItem item)
setStructure
in interface AbstractUser
item
- WRITEMEprotected void setSubclassValues(ResultSet resultSet) throws SQLException
resultSet
- WRITEME
SQLException
- WRITEMEpublic void setTargetX(double newTargetX)
newTargetX
- the targetX to setpublic void setTargetY(double newTargetY)
newTargetY
- the targetY to setpublic void setTravelRate(double rate)
setTravelRate
in interface AbstractUser
rate
- WRITEMEAbstractUser.setTravelRate(double)
public void setUserName(String newLogin) throws AlreadyUsedException, ForbiddenUserException
newLogin
- the userName to set
ForbiddenUserException
- if the user name is not allowed
AlreadyUsedException
- if the user name is in-usepublic void setUserNameFromUser(String userRequestedLogin) throws AlreadyUsedException, ForbiddenUserException
Set a user name, requested by the user. (Sends to lifeguards for approval)
Clears needsNaming.
userRequestedLogin
- the userName to set
ForbiddenUserException
- if the user name isn't allowed
AlreadyUsedException
- if the user name has already been
used (or requested)public void setVariable(Map.Entry<String,String> var)
setVariable
in interface HasVariables
var
- A Hash type Entry object containing a key-value pair
to be used to set a variable.HasVariables.setVariable(java.util.Map.Entry)
public void setVariable(String varName, String varValue)
setVariable
in interface HasVariables
setVariable
in interface AbstractUser
varName
- WRITEMEvarValue
- WRITEMEpublic void setVariables(Map<String,String> map)
setVariables
in interface HasVariables
map
- WRITEMEHasVariables.setVariables(java.util.Map)
public void setX(double newX)
AbstractUser
setX
in interface AbstractUser
newX
- the x to setpublic void setY(double newY)
AbstractUser
setY
in interface AbstractUser
newY
- the y to setpublic void speak(AbstractRoom room, String string)
speak
in interface AbstractUser
room
- WRITEMEstring
- WRITEMEAbstractUser.speak(org.starhope.appius.game.AbstractRoom,
java.lang.String)
public abstract void startEnrolment(UserEnrolment userEnrolment)
userEnrolment
- the enrolment to be started for this userpublic org.json.JSONObject toJSONRef()
toSFSXML()
for the pure JSON “to
infinity and beyond” interface
public String toSFSXML()
AbstractUser
toSFSXML
in interface AbstractUser
public String toString()
toString
in class Object
Object.toString()
public void updateCache()
public void wear(org.starhope.appius.game.inventory.ClothingItem item)
wear
in interface AbstractUser
item
- The clothing item to be wornpublic void wear(org.starhope.appius.game.inventory.ClothingItem item, Colour colour)
wear
in interface AbstractUser
item
- The item to be worncolour
- The color to set for the item. If the colour is not
being overridden, set this to null.public void wear(org.starhope.appius.game.inventory.ClothingItem item, int color)
item
- WRITEMEcolor
- WRITEMEpublic void writeExternal(ObjectOutput out) throws IOException
IOException
org.starhope.appius.via.ViaAppia#writeExternal(java.io.ObjectOutput)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |