|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.user.Person
org.starhope.appius.user.User
public class User
User objects refer only to actual users, who may or may not be signed into the game right now. This is the persistent information pertinent to an actual human being or to a software agent which acts as a user under certain circumstances, such as a payment gateway.
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 int |
basic8Choice
The Toot from the Basic 8 that they originally chose. |
private Date |
birthDate
The user's date of birth. |
private com.tootsville.braque.UserList |
buddyList
|
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 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 int |
houseTypeID
House type ID |
private com.tootsville.braque.UserList |
ignoreList
|
private HashSet<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 int |
lotID
Lot (neighborhood) ID |
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 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 |
private Timestamp |
nameRequestedAt
The time at which this user entered his/her request for a new name. |
private 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" |
private BigDecimal |
peanuts
The number of peanuts (currency) that this user has. |
private String |
requestedName
The user name which the user has requested, but has not yet been approved. |
private HashSet<Integer> |
rooms
|
private static it.gotoandplay.smartfoxserver.SmartFoxServer |
sfs
The Smart Fox Server that we might be able to talk to. |
static int |
STAFF_LEVEL_ACCOUNT_SERVICE
Staff level for users able to view account (subscription) data |
static int |
STAFF_LEVEL_DESIGNER
Staff level for users able to edit the game world |
static int |
STAFF_LEVEL_DEVELOPER
Staff level for software developers |
static int |
STAFF_LEVEL_MODERATOR
Staff level for moderators (including life guards and tour guides) |
static int |
STAFF_LEVEL_PUBLIC
Staff level for public users (free or paid users) |
static int |
STAFF_LEVEL_STAFF_MEMBER
Staff level for all members of the staff (Sidereal employees) |
private int |
staffLevel
The level of staff authority possessed by this user. |
private int |
tootTimeLeft
The number of hours remaining of this user's Toot Timer |
private int |
tootTimeLeftMinutes
The number of minutes (beyond the hour) remaining of this user's Toot Timer |
private boolean |
tootTimerDay
If true, the user's Toot Timer will refill every day CV tootTimerMonth |
private int |
tootTimeRefill
The number of hours which are added to the Toot Timer on each refill. |
private boolean |
tootTimerMonth
If true, the user's Toot Timer will refill every month. |
private int |
userID
The user's numeric ID, for database purposes. |
private String |
userName
The user's current, active login name. |
Fields inherited from class org.starhope.appius.user.Person |
---|
canContact, dialect, forgotPasswordAnswer, forgotPasswordQuestion, givenName, language, mail, mailConfirmed, password |
Constructor Summary | |
---|---|
|
User(Date birthDate,
String avatarTitle,
String userNameRequest)
Create a new user account |
|
User(int id)
Instantiate a user object from an existing user account ID |
private |
User(ResultSet rs)
Instantiate a User object based upon the contents of a ResultSet. |
|
User(String login)
Instantiate a user object from an existing user account ID |
Method Summary | |
---|---|
String |
acceptPeanutCode(String peanut)
WRITEM: document this method (brpocock, Aug 31, 2009) |
void |
addBuddy(User newBuddy)
Adds a user to this user's buddy list. |
void |
addDefaultFreeItem(int id)
TODO: document this method (brpocock, Sep 8, 2009) |
protected void |
addFreeClothing(ClothingItem clothingItem)
|
void |
addItem(int itemID)
|
void |
addItem(InventoryItem item)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
addRoom(int roomNumber)
|
void |
approveName(User nameApprovedBy)
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(User otherGuy)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
ban(User bannedBy,
String bannedReason)
Ban a user, preventing any future access to the server. |
boolean |
canApproveSelf()
If the user is a teen (13+) or adult, they are allowed to approve their own account. |
void |
cancelEvent(int eventID)
|
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()
Check whether the SmartFox Server is available and visible to us (sharing this VM). |
static void |
dangerous__removeTestUsers()
Delete test users: test???? accounts with email of testing@tootsville.com will be DESTROYED from the database. |
void |
doff(ClothingItem item)
|
void |
doffClothes()
Get naked |
void |
doffPivitz()
Remove Pivitz |
org.json.JSONObject |
endEvent(int eventID,
String moniker,
BigDecimal rawScore,
String medalMoniker)
Close out an event started with startEvent(String) . |
void |
endEventPurchaseRaw(int eventID,
int itemID)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
endEventPurchaseRaw(int eventID,
com.tootsville.braque.StoreItem item)
WRITEME: document this method (brpocock, Aug 24, 2009) |
void |
flush()
Write any changes to database |
void |
generateSystemName()
Generate a new "anonymous user name" for the user. |
static User |
get(org.json.JSONObject object)
|
org.json.JSONObject |
getActiveClothing()
|
HomeDecorItem[] |
getActiveDecorations(int roomNumber)
WRITEME: document this method (brpocock, Aug 28, 2009) |
int |
getAge()
Get the current age of the user. |
AgeBracket |
getAgeGroup()
|
String |
getApprovalCookie()
|
Date |
getApprovedDate()
|
String |
getApprovedDateString()
|
AvatarClass |
getAvatarClass()
|
Colour |
getBaseColor()
|
int |
getBasic8Choice()
|
Date |
getBirthDate()
|
com.tootsville.braque.UserList |
getBuddyList()
Get the user's buddy list (a UserList ) |
Set<String> |
getBuddyListNames()
Get the names of everyone on the user's buddy list. |
User |
getByApprovalCookie(String cookie)
|
static User |
getByID(int id)
Instantiate a user object from an existing user account ID |
static User |
getByLogin(String login)
|
static User[] |
getByMail(String mail)
Returns an array of all users associated with a given eMail address. |
static User |
getByPeer(User u)
Get a Braque User object for the respective Smart Fox Server user object |
static User |
getByRequestedName(String userNameRequested)
Get the user who has requested a certain name, if any. |
protected String |
getCacheUniqueID()
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()
|
HomeDecorItem |
getFurnitureBySlot(int slotNumber)
|
String |
getGivenName()
|
HashMap<Timestamp,HashMap<String,String>> |
getHistory(Date after,
int limit)
Returns the historical contents of this user's record. |
int |
getHouseTypeID()
|
com.tootsville.braque.UserList |
getIgnoreList()
WRITEME: document this method (brpocock, Aug 31, 2009) |
int |
getInboxCount()
|
InventoryItem[] |
getItemsByType(String typeString)
WRITEME: document this method (brpocock, Aug 28, 2009) |
InventoryItem[] |
getItemsByType(String[] types)
WRITEME: document this method (brpocock, Aug 28, 2009) |
long |
getKickedByUserID()
|
String |
getKickedMessage()
|
String |
getKickedReasonCode()
|
Timestamp |
getKickedUntil()
|
Timestamp |
getLastActive()
|
String |
getLastZone()
|
int |
getLotID()
|
private com.tootsville.braque.mail.MailBox |
getMailBox(String title)
|
com.tootsville.braque.mail.MailBox[] |
getMailboxes()
|
com.tootsville.braque.mail.MailMessage[] |
getMailInBox(String boxName)
|
Timestamp |
getNameApprovedAt()
|
long |
getNameApprovedByUserID()
|
static String |
getNameForID(int id)
|
Timestamp |
getNameRequestedAt()
|
Parent |
getParent()
|
boolean |
getParentApprovedName()
|
int |
getParentID()
|
org.json.JSONObject |
getPassport_JSON()
|
BigDecimal |
getPeanuts()
|
org.json.JSONObject |
getPublicInfo()
|
String |
getRequestedName()
|
String |
getResponsibleMail()
Get the eMail address of a responsible person: either the player, or the parent. |
private User |
getSFSPeer()
If we can see the SmartFox Server, and if this user has a peer "User" signed in to that server now, then get that peer user object so that we can do things to them in real time (in the game). |
int |
getStaffLevel()
|
private String |
getSystemNameAdjective()
|
private String |
getSystemNameNoun()
|
static User |
getSystemUser()
Get the System user object (the user which represents the system program itself). |
int |
getTootTimeLeft()
|
String |
getTootTimeLeft$()
|
int |
getTootTimeLeftMinutes()
|
int |
getTootTimeRefill()
|
UserEnrolment[] |
getUserEnrolments()
|
int |
getUserID()
|
String |
getUserName()
|
String |
getUserNameOrRequest()
WRITEME: document this method (brpocock, Sep 2, 2009) |
static User[] |
getUsersAwaitingNameApproval()
Get up to 20 users who are awaiting approval of their names. |
boolean |
hasItem(int id)
|
boolean |
hasItem(InventoryItem item)
|
boolean |
hasStaffLevel(int staffLevelNeeded)
|
void |
ignore(User otherUser)
Calling this method indicates that this user wants to ignore the other specified user. |
boolean |
isActive()
|
boolean |
isApproved()
See approvedDate for discussion |
boolean |
isBanned()
|
boolean |
isBirthday()
|
boolean |
isCanceled()
|
boolean |
isCanContact()
|
boolean |
isCanEnterChatZone()
|
boolean |
isCanEnterMenuZone()
|
boolean |
isCanTalk()
|
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 |
isOnline()
|
boolean |
isPaidMember()
|
boolean |
isTootTimerDay()
|
boolean |
isTootTimerMonth()
|
void |
kick(User kickedBy,
String kickedReason,
long kickedMinutes)
Kick a user offline for a number of minutes. |
void |
kick(User kickedBy,
String kickedReason,
Timestamp allowBack)
Kick the user offline, until a certain date & time. |
private void |
loadHouseFromDB()
|
private void |
loadInventoryFromDB()
WRITEME: document this method (brpocock, Sep 4, 2009) |
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 |
parentApprovedAccount(boolean whether)
Call this method when the parent determines whether to approve or disapprove this account. |
void |
parentApprovedName(boolean whether)
|
private void |
populateByID(int id)
Private method used to look up User in the database and fill in the attributes |
private void |
populateByLogin(String login)
Fetch a user record out of the database based upon its login name |
void |
purchase(com.tootsville.braque.StoreItem item)
WRITEME: document this method (brpocock, Aug 28, 2009) |
protected void |
remindPassword()
WRITEME: document this method (brpocock, Aug 12, 2009) method to send e-mail to account owner (parent account or user account) with a reset password. |
void |
removeBuddy(User 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(User u)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
requestNewUserName(String userNameRequested)
WRITEME: document this method (brpocock, Jul 14, 2009) |
void |
requestParentApproval()
WRITEME: document this method (brpocock, Jul 8, 2009) |
(package private) void |
sendConfirmationMail()
Send the parental- or self- confirmation message, depending upon the user's age |
boolean |
sendMail(String to,
String subject,
String body)
|
private boolean |
sendMail(User to,
String subject,
String body)
|
protected void |
set(ResultSet resultSet)
|
void |
setActive(boolean isActive)
|
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 avatarClass)
|
void |
setBaseColor(Colour newBaseColor)
|
void |
setBasic8Choice(int basic8Choice)
|
void |
setBirthDate(Date birthDate)
|
void |
setCanceled(boolean isCanceled)
|
void |
setCanContact(boolean canContact)
|
void |
setCanEnterChatZone(boolean canEnterChatZone)
|
void |
setCanEnterMenuZone(boolean canEnterMenuZone)
|
void |
setCanTalk(boolean canTalk)
|
void |
setEmailPlusDate(Date emailPlusDate)
|
void |
setExtraColor(Colour extraColor)
|
void |
setGivenName(String givenName)
|
void |
setHouseTypeID(int houseTypeID)
|
void |
setLot(int newLotID)
|
void |
setLotID(int lotID)
|
void |
setMail(String mail)
|
void |
setMailConfirmed(Timestamp mailConfirmed)
|
void |
setNeedsNaming(boolean needsNaming)
|
void |
setParent(Parent parent)
Set this to be a child account with the specified parent. |
void |
setPassport(String moniker)
|
private void |
setPeanuts(BigDecimal add)
WRITEME: document this method (brpocock, Sep 2, 2009) |
void |
setStaffLevel(int staffLevel)
|
void |
setTootTimerDay(boolean tootTimerDay)
|
void |
setTootTimeRefill(int tootTimeRefill)
|
void |
setTootTimerMonth(boolean tootTimerMonth)
|
void |
setUserID(int userID)
|
void |
setUserName(String userName)
|
void |
setUserNameFromUser(String userName)
Set a user name, requested by the user. |
void |
stampPassport(String moniker)
TODO: document this method (brpocock, Sep 8, 2009) |
org.json.JSONObject |
startEvent(String moniker)
Start an event, and return the results as a partial JSON Object. |
int |
startEventRaw(String moniker)
Register a new event. |
org.json.JSONObject |
toJSON()
Sends a limited subset of data for the client to know. |
String |
toString()
|
void |
wear(ClothingItem item)
|
void |
wear(ClothingItem item,
int color)
|
Methods inherited from class org.starhope.appius.user.Person |
---|
checkPassword, forgotPassword, getForgotPasswordAnswer, getForgotPasswordQuestion, getLanguage, getMail, getMailConfirmed, getPassword, getResponsiblePerson, setPassword, setPasswordRecovery |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, prepare, prepare, saveInCache, set |
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
---|
deref, setRef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 it.gotoandplay.smartfoxserver.SmartFoxServer sfs
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 AgeBracket ageGroup
private Date approvedDate
private AvatarClass avatarClass
private Colour baseColor
private int basic8Choice
private Date birthDate
private com.tootsville.braque.UserList buddyList
private boolean canEnterChatZone
private boolean canEnterMenuZone
private boolean canTalk
private Date emailPlusDate
private Colour extraColor
private int houseTypeID
private com.tootsville.braque.UserList ignoreList
private final HashSet<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 int lotID
private Timestamp nameApprovedAt
private long nameApprovedByUserID
private Timestamp nameRequestedAt
private boolean needsNaming
private boolean parentApprovedName
private int parentID
private BigDecimal peanuts
private String requestedName
private final HashSet<Integer> rooms
private int staffLevel
private int tootTimeLeft
private int tootTimeLeftMinutes
private boolean tootTimerDay
tootTimerMonth
private int tootTimeRefill
private boolean tootTimerMonth
tootTimerDay
private int userID
private String userName
Constructor Detail |
---|
public User(Date birthDate, String avatarTitle, String userNameRequest) throws AlreadyUsedException, ForbiddenUserException
birthDate
- The player's date of birthavatarTitle
- The name of the avatar (class) which the
player wants to use.userNameRequest
-
ForbiddenUserException
AlreadyUsedException
public User(int id) throws NotFoundException
id
- user ID value
NotFoundException
- if the user can't be found in the
database.private 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 login) throws NotFoundException
login
- user login name
NotFoundException
- if the user can't be found in the
database.Method Detail |
---|
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)
public static boolean canSeeSmartFoxServer()
public static void dangerous__removeTestUsers() throws SQLException
SQLException
- if it can't be done.public static User get(org.json.JSONObject object)
object
-
public static User getByID(int id)
id
- The user ID to instantiate
public static User getByLogin(String login)
login
- the user login name
public static User[] getByMail(String mail)
mail
- The eMail address for which we are searching
public static User getByPeer(User u)
u
- The Smart Fox Server user object
public static User getByRequestedName(String userNameRequested)
userNameRequested
- the user name for which we're searching
public static String getNameForID(int id)
id
-
public static User getSystemUser()
public static User[] getUsersAwaitingNameApproval()
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
public String acceptPeanutCode(String peanut) throws NotFoundException, AlreadyUsedException
peanut
-
NotFoundException
AlreadyUsedException
public void addBuddy(User newBuddy)
newBuddy
- the user to be the new buddypublic void addDefaultFreeItem(int id)
id
- protected void addFreeClothing(ClothingItem clothingItem)
clothingItem
- The item to be added to the user's inventory
as a free gift (or prize)public void addItem(int itemID)
public void addItem(InventoryItem item)
item
- public void addRoom(int roomNumber)
roomNumber
- public void approveName(User nameApprovedBy) throws PrivilegeRequiredException
nameApprovedBy
- 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
staffLevelNeeded
- The minimum staff level which is being
asserted
PrivilegeRequiredException
- if the minimum staff level is
not met.public void attend(User otherGuy)
otherGuy
- public void ban(User bannedBy, String bannedReason) throws PrivilegeRequiredException
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 boolean canApproveSelf()
public void cancelEvent(int eventID)
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 void doff(ClothingItem item)
item
- wear(ClothingItem)
public void doffClothes()
public void doffPivitz()
public org.json.JSONObject endEvent(int eventID, String moniker, BigDecimal rawScore, String medalMoniker) throws org.json.JSONException
startEvent(String)
.
Handles "fountain" events specially by giving a random score from
1..100.
eventID
- The ID of the eventmoniker
- rawScore
- The earned score (points, not peanuts). Ignored
for fountains.medalMoniker
- The moniker of the medal earned, if any
org.json.JSONException
- if the JSON data can't be represented
correctly.public void endEventPurchaseRaw(int eventID, int itemID) throws NotFoundException, NonSufficientFundsException, AlreadyExistsException
eventID
- itemID
-
NotFoundException
NonSufficientFundsException
AlreadyExistsException
public void endEventPurchaseRaw(int eventID, com.tootsville.braque.StoreItem item) throws NotFoundException, NonSufficientFundsException, AlreadyExistsException
eventID
- item
-
NotFoundException
NonSufficientFundsException
AlreadyExistsException
public void flush()
flush
in class Person
SQLPeerDatum.flush()
public void generateSystemName()
public org.json.JSONObject getActiveClothing()
public HomeDecorItem[] getActiveDecorations(int roomNumber) throws NotFoundException
roomNumber
- which room of the user's house
NotFoundException
public int getAge()
public AgeBracket getAgeGroup()
public String getApprovalCookie()
public Date getApprovedDate()
public String getApprovedDateString()
getApprovedDate()
public AvatarClass getAvatarClass()
public Colour getBaseColor()
public int getBasic8Choice()
public Date getBirthDate()
public com.tootsville.braque.UserList getBuddyList()
UserList
)
public Set<String> getBuddyListNames()
getBuddyList()
public User getByApprovalCookie(String cookie) throws IOException, NotFoundException
cookie
-
IOException
NotFoundException
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public String getConnectedFrom()
isOnline()
for the usual caveats
(also getSFSPeer()
public String getDialect()
getDialect
in class Person
public String getDisplayName()
Person
getDisplayName
in class Person
Person.getDisplayName()
public Date getEmailPlusDate()
public String getEmailPlusDateString()
getEmailPlusDate()
public Colour getExtraColor()
public HomeDecorItem getFurnitureBySlot(int slotNumber) throws NotFoundException
slotNumber
-
NotFoundException
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 int getHouseTypeID()
public com.tootsville.braque.UserList getIgnoreList()
public int getInboxCount()
public InventoryItem[] getItemsByType(String typeString)
typeString
- @see InventoryItem.identifiesAs(String)
public InventoryItem[] getItemsByType(String[] types)
types
- @see InventoryItem.identifiesAs(String)
public long getKickedByUserID()
public String getKickedMessage()
public String getKickedReasonCode()
public Timestamp getKickedUntil()
public Timestamp getLastActive()
public String getLastZone()
public int getLotID()
private com.tootsville.braque.mail.MailBox getMailBox(String title)
title
-
public com.tootsville.braque.mail.MailBox[] getMailboxes()
public com.tootsville.braque.mail.MailMessage[] getMailInBox(String boxName)
boxName
-
public Timestamp getNameApprovedAt()
public long getNameApprovedByUserID()
public Timestamp getNameRequestedAt()
public Parent getParent()
public boolean getParentApprovedName()
public int getParentID()
public org.json.JSONObject getPassport_JSON() throws SQLException, org.json.JSONException
SQLException
org.json.JSONException
public BigDecimal getPeanuts()
public org.json.JSONObject getPublicInfo()
public String getRequestedName()
public String getResponsibleMail()
getResponsibleMail
in class Person
private User getSFSPeer()
public int getStaffLevel()
private String getSystemNameAdjective()
private String getSystemNameNoun()
public int getTootTimeLeft()
public String getTootTimeLeft$()
public int getTootTimeLeftMinutes()
public int getTootTimeRefill()
public UserEnrolment[] getUserEnrolments()
public int getUserID()
public String getUserName()
public String getUserNameOrRequest()
public boolean hasItem(int id)
public boolean hasItem(InventoryItem item)
public boolean hasStaffLevel(int staffLevelNeeded)
public void ignore(User otherUser)
otherUser
- The user, whom this user wishes to ignorepublic boolean isActive()
public boolean isApproved()
approvedDate
for discussion
public boolean isBanned()
public boolean isBirthday()
public boolean isCanceled()
public boolean isCanContact()
public boolean isCanEnterChatZone()
public boolean isCanEnterMenuZone()
public boolean isCanTalk()
public boolean isKicked()
public boolean isNeedsNaming()
public boolean isNeedsParentAttention()
public boolean isOnline()
public boolean isPaidMember()
public boolean isTootTimerDay()
public boolean isTootTimerMonth()
public void kick(User 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(User 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 privilegesprivate void loadHouseFromDB() throws SQLException
SQLException
private void loadInventoryFromDB() throws SQLException
SQLException
public 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 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.private void populateByID(int id) throws NotFoundException
id
- The database ID to load
NotFoundException
- if the ID isn't found in the database.private void populateByLogin(String login) throws NotFoundException
login
- 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 purchase(com.tootsville.braque.StoreItem item) throws AlreadyExistsException, NotFoundException, NonSufficientFundsException
item
-
AlreadyExistsException
NotFoundException
NonSufficientFundsException
protected void remindPassword()
Person
remindPassword
in class Person
Person.remindPassword()
public void removeBuddy(User otherGuy)
otherGuy
- who?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(User u)
u
- public void requestNewUserName(String userNameRequested) throws AlreadyUsedException, ForbiddenUserException
Post a request to the lifeguards to get approval of a user name
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()
void sendConfirmationMail()
public boolean sendMail(String to, String subject, String body)
to
- subject
- body
-
private boolean sendMail(User to, String subject, String body)
to
- subject
- body
-
protected void set(ResultSet resultSet) throws SQLException
set
in class SQLPeerDatum
SQLException
- if the database fails somehowSQLPeerDatum.set(java.sql.ResultSet)
public void setActive(boolean isActive)
isActive
- the isActive to setpublic AgeBracket setAgeGroup()
public void setAgeGroupToSystem()
public void setApprovedDate(Date date)
date
- the approvedDate to setpublic void setAvatarClass(AvatarClass avatarClass)
avatarClass
- the avatarClass to setpublic void setBaseColor(Colour newBaseColor)
newBaseColor
- the baseColor to setpublic void setBasic8Choice(int basic8Choice)
basic8Choice
- the basic8Choice to setpublic void setBirthDate(Date birthDate)
birthDate
- the birthDate to setpublic void setCanceled(boolean isCanceled)
isCanceled
- the isCanceled to setpublic void setCanContact(boolean canContact)
setCanContact
in class Person
canContact
- the canContact to setpublic void setCanEnterChatZone(boolean canEnterChatZone)
canEnterChatZone
- the canEnterChatZone to setpublic void setCanEnterMenuZone(boolean canEnterMenuZone)
canEnterMenuZone
- the canEnterMenuZone to setpublic void setCanTalk(boolean canTalk)
canTalk
- the canTalk to setpublic void setEmailPlusDate(Date emailPlusDate)
emailPlusDate
- the emailPlusDate to setpublic void setExtraColor(Colour extraColor)
extraColor
- the extraColor to setpublic void setGivenName(String givenName)
setGivenName
in class Person
givenName
- the givenName to setpublic void setHouseTypeID(int houseTypeID)
public void setLot(int newLotID)
newLotID
- public void setLotID(int lotID)
public void setMail(String mail) throws GameLogicException
setMail
in class Person
mail
- the mail to set
GameLogicException
public void setMailConfirmed(Timestamp mailConfirmed)
setMailConfirmed
in class Person
mailConfirmed
- the mailConfirmed to setpublic void setNeedsNaming(boolean needsNaming)
needsNaming
- the needsNaming to setpublic void setParent(Parent parent) throws GameLogicException
parent
- the parent to set
GameLogicException
- if this user is an adultpublic void setPassport(String moniker)
private void setPeanuts(BigDecimal add)
add
- public void setStaffLevel(int staffLevel)
staffLevel
- the staffLevel to setpublic void setTootTimerDay(boolean tootTimerDay)
tootTimerDay
- the tootTimerDay to setpublic void setTootTimeRefill(int tootTimeRefill)
tootTimeRefill
- the tootTimeRefill to setpublic void setTootTimerMonth(boolean tootTimerMonth)
tootTimerMonth
- the tootTimerMonth to setpublic void setUserID(int userID)
userID
- the userID to setpublic void setUserName(String userName) throws AlreadyUsedException, ForbiddenUserException
userName
- the userName to set
ForbiddenUserException
- if the user name is not allowed
AlreadyUsedException
- if the user name is in-usepublic void setUserNameFromUser(String userName) throws AlreadyUsedException, ForbiddenUserException
Set a user name, requested by the user. (Sends to lifeguards for approval)
Clears needsNaming.
userName
- 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 stampPassport(String moniker)
moniker
- public org.json.JSONObject startEvent(String moniker) throws SQLException
Start an event, and return the results as a partial JSON Object.
If the event has already been completed, then there will be an element "alreadyDone" set to "true". This currently only applies to wishing fountains, which can only be visited once per day.
If the event is started successfully, this will return the event ID in "eventID".
Java-native callers who aren't trying to talk JSON with strangers
can use startEventRaw(String)
, which this routine is
syntactic sugar around.
moniker
- The event moniker to be created
SQLException
- generally meaning that the moniker was
probably invalidpublic int startEventRaw(String moniker) throws AlreadyExistsException
moniker
- The event moniker to registeritem
- The item being purchased, or null.
AlreadyExistsException
- if this is a fountain that has
already been visited today, and can't be revisited until
midnight.public org.json.JSONObject toJSON()
toJSON
in class SQLPeerDatum
public String toString()
toString
in class Object
Object.toString()
public void wear(ClothingItem item)
item
- The clothing item to be wornpublic void wear(ClothingItem item, int color)
item
- color
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |