com.tootsville.user
Class Toot

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

public class Toot
extends User

A Toot™ character as a specific user within Tootsville™. Contains Tootsville-specific methods that don't belong in the GPL core of Appius. Some of these may be changed to deprecated replacements for the GPL functionality when new ideas, such as currency possessions, are incorporated into the base class.

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

Field Summary
private static int FREE_AVATAR
          Avatar for free members
private static int HOW_MANY_ARE_BASIC_8
          which avatar ID's are for the basic 8? 1..8 (this is the 8)
private static BigInteger peanutLimiter
          Safety limiter on peanuts
private static int PREMIUM_AVATAR
          Avatar for premium members
private static long serialVersionUID
          Java® serialisation unique ID
(package private)  TootUserTrailer trailer
          Trailer record for a Toot
 
Fields inherited from class org.starhope.appius.user.User
MAX_LOGIN_LENGTH, MAX_PW_LENGTH, MIN_LOGIN_LENGTH, MIN_PW_LENGTH, positioning, STAFF_LEVEL_ACCOUNT_SERVICE, STAFF_LEVEL_DESIGNER, STAFF_LEVEL_DEVELOPER, STAFF_LEVEL_MODERATOR, STAFF_LEVEL_PUBLIC, STAFF_LEVEL_STAFF_MEMBER
 
Fields inherited from class org.starhope.appius.user.GeneralUser
baseStats, collisionBounds, currentRoom, facing, lastUserMovement, pathFinder, userRecord
 
Constructor Summary
Toot(Date playerDateOfBirth, String avatarTitle, String userNameRequested)
          Instantiate a new Toot, given the user's birthdate, chosen Basic 8 character, and the requested user name.
Toot(Date playerDateOfBirth, String avatarTitle, String userNameRequested, String passwordQuestion, String passwordAnswer, String password)
          Instantiate a new Toot, given the user's birthdate, chosen Basic 8 character, and the requested user name.
Toot(int id)
          Recall a user by ID
Toot(String newUserLogin)
          Simple constructor from login (recalls existing user)
Toot(UserRecord rec)
          instantiate a Toot from a data record WRITEME Loads the trailer record, too WRITEME
 
Method Summary
 String acceptPeanutCode(String peanutSerial)
          Take a peanut code and apply the benefits thereof to this user
private  void addDefaultFreeItems()
          Add the default free items to the user's inventory
 void addPeanuts(BigInteger add, String moniker)
          Add a number of peanuts as a gift or other event.
 void affirmFreeMember()
          This is an overriding method.
 void affirmPaidMember()
          This is an overriding method.
 void biff(AbstractZone abstractZone, Room room)
          Send a biff message to announce the number of message in a user's Inbox.
 void doffPatterns()
          Get bare
 void doffPivitz()
          Remove Pivitz
 void doTransport()
          This is an overriding method.
 Vector<GameWorldMessage> getAllMailOnWall(int numberOfMessages)
          Retrieve a number of of MailMessages starting with the most recent.
 String getApprovalCookie()
          Get a cookie object for sending mail.
 int getBasic8Choice()
           
static Toot getByApprovalCookie(String cookie)
          Find the user who is uniquely identified by the given approval cookie
 int getHouseTypeID()
          Deprecated. use UserHouse.getHouseTypeID()
 int getInboxCount()
           XXX: contains SQL
 int getLotID()
          Deprecated. use UserHouse.getLotID()
 Vector<GameWorldMessage> getMailInBox()
           
 Vector<GameWorldMessage> getMailInBox(int offset, int limit)
           XXX: Contains SQL
 Vector<GameWorldMessage> getMailOnMyWall(int numberOfMessages)
          Deprecated. use getMailOnWall(int, int)
 Vector<GameWorldMessage> getMailOnMyWall(int numberOfMessages, int start)
          Deprecated. use getMailOnWall(int, int)
 Vector<GameWorldMessage> getMailOnWall(int limit, int offset)
           XXX:contains SQL
 Vector<GameWorldMessage> getMailOnWallAndBuddyWall(int offset, int limit)
           twheys@gmail.com Jan 15, 2010
static Vector<GameWorldMessage> getMailOnWallInReplyTo(int id)
           
 BigInteger getMoney(Currency currency)
          Deprecated. 
 Vector<GameWorldMessage> getNewMailOnWall(int newerThanID)
           twheys@gmail.com Feb 12, 2010
 Vector<GameWorldMessage> getNewMailOnWallAndBuddyWall(int newerThanID)
           twheys@gmail.com Feb 12, 2010
 BigInteger getPeanuts()
           
 String getSubversionRevision()
           Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
 String getTootBookStatus()
           
 HashMap<String,String> getTootsBookThemes()
          Deprecated. 
 String getTootsBookThemeURL()
          Get the URL for the active TootBook theme folder for this user.
 int getTootTimeLeft()
           
 String getTootTimeLeft$()
           
 int getTootTimeLeftMinutes()
           
 int getTootTimeRefill()
           
 int getTotalTootTimeLeftMinuts()
           
static String[] getZ$Z()
          Z$Z
 void giftPeanuts(BigInteger numNuts, String event)
          Give a gift of peanuts.
 boolean isTootTimerDay()
           
 boolean isTootTimerMonth()
           
 void local_create()
          This is an overriding method.
 void postLoginGlobal()
          This is an overriding method.
 int postNewOnTootBookWall(int toID, String body)
          Post a new message on this users TootBook wall.
 int postReplyOnTootBookWall(String body, int replyToID)
          Post a reply to a post on a TootBook wall.
 void sendEarnings(Room room, String msg)
          Send an earnings notice to the client.
private  boolean sendMail(int to, String subject, String body)
          Send an in-game eMail message
 boolean sendMail(String to, String subject, String body)
           
 void sendPlushTootPromo(UserAddress shippingAddress, int tootSelect)
          Send a promotional plush Toot to this user, at the specified address.
 boolean sendSystemWallMail(String message, String attachment, String game)
           twheys@gmail.com Feb 18, 2010
private  int sendWallMail(int toID, String body, int inReplyTo)
          Creates a new post on a TootBook Profile.
 void setBasic8Choice(int newToot)
           
 void setReferer(String theReferer)
          This is an overriding method.
 void setTootTimerDay(boolean useDailyTimer)
           
 void setTootTimeRefill(int refillAmount)
           
 void setTootTimerMonth(boolean useMonthlyTimer)
           
private  void setWallet()
          WRITEME brpocock@star-hope.org Aug 3, 2010
 void stampPassport(String moniker)
          WRITEME: document this method (brpocock@star-hope.org, Sep 8, 2009)
 void startEnrolment(UserEnrolment userEnrolment)
          This is an overriding method.
 org.json.JSONObject toJSON()
           Sends a limited subset of data for the client to know.
 void transferPeanuts(BigInteger numNuts, Toot fromUser, String event)
          Transfer peanuts from one user to another
 void updateWallet()
          review your current wallet currency amounts, they may have changed
 
Methods inherited from class org.starhope.appius.user.User
acceptErrorReply, acceptGameAction, acceptGameStateChange, acceptMessage, acceptObjectJoinRoom, acceptObjectJoinRoom, acceptObjectPartRoom, acceptOutOfBandMessage, acceptPrivateMessage, acceptPublicMessage, acceptPublicMessage, acceptSuccessReply, acceptUserAction, acceptUserVariableUpdate, addBuddy, addDefaultFreeItem, addDefaultFreeItem, addFreeClothing, addGiftSubscription, addItem, addItem, addRoom, approveName, assertUserNameAvailable, ban, blog, canContact, canLogIn, canMakePurchase, canSeeSmartFoxServer, canTalk, changeRoom, checkPassword, configUpdated, create, deleteMail, doffClothes, enablePathFinder, equals, equals, equip, forgotPassword, generateSystemName, get, getActiveClothing, getActiveDecorations, getActiveItemByType, getActiveItemsByType, getActiveItemsByType, getAge, getAgeGroup, getApprovedDate, getApprovedDateString, getAvatarClass, getAvatarLabel, getBaseColor, getBirthDate, getBuddyListNames, getBuddyListNamesAsArray, getByID, getByLogin, getByMail, getByRequestedName, getChatBG, getChatFG, getConfirmationTemplate, getConnectedFrom, getDebugName, getDialect, getDisplayName, getEmailPlusDate, getEmailPlusDateString, getExtraColor, getFacing, getForgotPasswordAnswer, getForgotPasswordQuestion, getFurnitureBySlot, getGameFlag, getGender, getGivenName, getHistory, getIDForLiveUserName, getIDForLogin, getIDForUserName, getInventory, getIpAddress, getIPAddress, getKickedByUserID, getKickedMessage, getKickedReasonCode, getKickedUntil, getLag, getLanguage, getLastActive, getLastZone, getLocation, getLogin, getMail, getMailConfirmed, getMySerial, getName, getNameApprovedAt, getNameApprovedByUserID, getNameRequestedAt, getOnlineUserByLogin, getOutlineColourForBaseColour, getParent, getParentApprovedName, getParentID, getPassport_JSON, getPassword, getPotentialUserName, getReferer, getRev, getRoundTripLag, getSerial, getServerThread, getSystemUser, getUserEnrolments, getUserEnrolmentsAsArray, getUserNameForID, getUserNameOrRequest, getUsersAwaitingNameApproval, getUserVariables, getZone, handleWalkFail, hashCode, hasItem, hasItem, isBanned, isBirthday, isCanceled, isCanContact, isCanEnterChatZone, isCanEnterMenuZone, isCanTalk, isEphemeral, isItGood, isKicked, isNameAvailable, isNameForbidden, isNameValid, isNeedsNaming, isNeedsParentAttention, isNPC, isOnline, isPaidMember, kick, kick, kick, liftBan, loggedIn, loggedIn, login, nameNeedsApproval, nameNeedsParentalApproval, needsNaming, notifyFurnitureInventory, parentApprovedAccount, parentApprovedName, remindPassword, removeBuddy, rename, reportedToModeratorBy, reportedToModeratorBy, requestNewUserName, requestParentApproval, sendConfirmationForPremium, sendConfirmationMail, sendEarnings, sendEarnings, sendGameAction, sendMigrate, sendOops, sendPrivateMessage, sendPublicMessage, sendResponse, sendResponse, sendStaffPasswordReset, sendWardrobe, sentConfirmationMail, setActive, setAgeGroup, setAgeGroupToSystem, setApprovedDate, setAvatarClass, setBaseColor, setBirthDate, setCanceled, setCanContact, setCanEnterChatZone, setCanEnterMenuZone, setCanTalk, setChatBG, setChatFG, setEmailPlusDate, setExtraColor, setFacing, setForgotPasswordAnswer, setForgotPasswordQuestion, setGender, setGivenName, setLastActive, setLocation, setLoggedIn, setLogin, setLot, setLotID, setMail, setMailConfirmed, setMailConfirmSent, setNeedsNaming, setParent, setParentByParent, setPassword, setPasswordAndPasswordRecovery, setPasswordRecovery, setRandomPassword, setRegisteredAt, setRoom, setRoundTripLag, setServerThread, setStaffLevel, setStartT, setStructure, setSubclassValues, setTravelStart, setUserName, setUserNameFromUser, speak, toJSONRef, toSFSXML, toString
 
Methods inherited from class org.starhope.appius.user.GeneralUser
assertLocationUnlocked, assertStaffLevel, attend, canApproveSelf, canBetaTest, canEnterChatZone, canEnterMenuZone, changeBaseDefenses, compareTo, deleteVariable, getBaseDefenses, getBaseStat, getCenterOfMass, getCollisionBounds, getCurrentAction, getD, getEffectiveDefenses, getEndMovementTime, getGameEquipItems_JSON, getGameEquipItems, getHeight, getHouse, getItemsByType, getItemsByType, getItemsByTypeAsArray, getLocationForUpdate, getMass, getPathFinder, getPublicInfo, getRegisteredAt, getRegisteredDate, getRegisteredDateString, getRequestedName, getResponsibleMail, getRoom, getRoomNumber, getSizeScalar, getStaffLevel, getStartMovementTime, getStartT, getStat, getTarget, getTravelRate, getTravelStart, getUserID, getUserListIterator, getUserName, getVariable, getVariables, getVariablesJSON, getVelocity, getWallet, hasStaffLevel, hasVariable, ignore, isActive, isApproved, local_publicInfo, needsParent, purchase, resetVariables, sendBuddyList, setBackingRecord, setCenterOfMass, setCurrentAction, setTarget, setTravelRate, setVariable, setVariable, setVariables, setVelocity, takeAttack, unlockLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.starhope.appius.user.AbstractPerson
getResponsibleMail
 

Field Detail

FREE_AVATAR

private static final int FREE_AVATAR
Avatar for free members

See Also:
Constant Field Values

HOW_MANY_ARE_BASIC_8

private static final int HOW_MANY_ARE_BASIC_8
which avatar ID's are for the basic 8? 1..8 (this is the 8)

See Also:
Constant Field Values

peanutLimiter

private static final BigInteger peanutLimiter
Safety limiter on peanuts


PREMIUM_AVATAR

private static final int PREMIUM_AVATAR
Avatar for premium members

See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
Java® serialisation unique ID

See Also:
Constant Field Values

trailer

final TootUserTrailer trailer
Trailer record for a Toot

Constructor Detail

Toot

public Toot(Date playerDateOfBirth,
            String avatarTitle,
            String userNameRequested)
     throws NumberFormatException,
            AlreadyUsedException,
            ForbiddenUserException
Instantiate a new Toot, given the user's birthdate, chosen Basic 8 character, and the requested user name.

Parameters:
playerDateOfBirth - the player's birthdate
avatarTitle - the player's chosen Basic 8 character
userNameRequested - the player's requested login / avatar / user name
Throws:
AlreadyUsedException - if the user name given is already used
ForbiddenUserException - if the user account is not permitted to be created — e.g. the user name given might have been deemed obscene
NumberFormatException - if the supplied date of birth is “impossible”
See Also:
User.User(Date, String, String, String, String, String)

Toot

public Toot(Date playerDateOfBirth,
            String avatarTitle,
            String userNameRequested,
            String passwordQuestion,
            String passwordAnswer,
            String password)
     throws AlreadyUsedException,
            ForbiddenUserException,
            NumberFormatException
Instantiate a new Toot, given the user's birthdate, chosen Basic 8 character, and the requested user name.

Parameters:
playerDateOfBirth - the player's birthdate
avatarTitle - the player's chosen Basic 8 character
userNameRequested - the player's requested login / avatar / user name
Throws:
AlreadyUsedException - if the user name given is already used
ForbiddenUserException - if the user account is not permitted to be created — e.g. the user name given might have been deemed obscene
NumberFormatException - if the supplied date of birth is “impossible”
See Also:
User.User(Date, String, String, String, String, String)

Toot

public Toot(int id)
     throws NotFoundException
Recall a user by ID

Parameters:
id - the user ID
Throws:
NotFoundException - if the user can't be found
See Also:
User.User(int), Nomenclator.getUserByID(int)

Toot

public Toot(String newUserLogin)
     throws NotFoundException
Simple constructor from login (recalls existing user)

Parameters:
newUserLogin - Requested user login
Throws:
NotFoundException - If the login does not exist already
See Also:
User.User(String)

Toot

public Toot(UserRecord rec)
     throws NotFoundException
instantiate a Toot from a data record WRITEME Loads the trailer record, too WRITEME

Parameters:
rec - the user record for the Toot
Throws:
NotFoundException - if the trailer record can't be found
See Also:
User.User(UserRecord)
Method Detail

getByApprovalCookie

public static Toot getByApprovalCookie(String cookie)
                                throws IOException,
                                       NotFoundException
Find the user who is uniquely identified by the given approval cookie

Parameters:
cookie - The approval cookie used in the eMail
Returns:
the user identified by the cookie
Throws:
IOException - if the cookie can't be decoded
NotFoundException - if the user can't be identified

getMailOnWallInReplyTo

public static Vector<GameWorldMessage> getMailOnWallInReplyTo(int id)
Parameters:
id - the message ID to which replies are wanted
Returns:
mail messages posted on the user's wall in reply to the given message

getZ$Z

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

Returns:
Z$Z

acceptPeanutCode

public final String acceptPeanutCode(String peanutSerial)
                              throws NotFoundException,
                                     AlreadyUsedException
Take a peanut code and apply the benefits thereof to this user

Parameters:
peanutSerial - the serial number / code sequence in the database
Returns:
a user-visible message explaining the benefits that were applied
Throws:
NotFoundException - if the peanut code serial number is not found
AlreadyUsedException - if that peanut code has already been used

addDefaultFreeItems

private void addDefaultFreeItems()
Add the default free items to the user's inventory


addPeanuts

public final void addPeanuts(BigInteger add,
                             String moniker)
Add a number of peanuts as a gift or other event. (Gifts, use moniker “gift.” Gifts are refused if the user has already reached peanutLimiter)

Parameters:
add - additional peanuts given
moniker - reason for peanuts

affirmFreeMember

public final void affirmFreeMember()
This is an overriding method.

Overrides:
affirmFreeMember in class User
See Also:
User.affirmFreeMember()

affirmPaidMember

public final void affirmPaidMember()
This is an overriding method.

Overrides:
affirmPaidMember in class User
See Also:
User.affirmPaidMember()

biff

public void biff(AbstractZone abstractZone,
                 Room room)
          throws org.json.JSONException
Send a biff message to announce the number of message in a user's Inbox.

Parameters:
abstractZone - The zone in which the user is standing
room - The room in which the user is standing
Throws:
org.json.JSONException - If the biff can't be sent

doffPatterns

public void doffPatterns()
Get bare


doffPivitz

public void doffPivitz()
Remove Pivitz


doTransport

public void doTransport()
This is an overriding method.

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

getAllMailOnWall

public Vector<GameWorldMessage> getAllMailOnWall(int numberOfMessages)
Retrieve a number of of MailMessages starting with the most recent.

Parameters:
numberOfMessages - The number of posts needed.
Returns:
mail messages posted on the user's wall

getApprovalCookie

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

Returns:
Get a cookie to be used in creating the user's parent/self-approval eMails.
See Also:
Parent, User

getBasic8Choice

public int getBasic8Choice()
Returns:
the basic8Choice

getHouseTypeID

@Deprecated
public int getHouseTypeID()
Deprecated. use UserHouse.getHouseTypeID()

Get the type of house (exterior frame)

Returns:
the ID of the house exterior frame chosen by the user, or -1 if the user hasn't chosen one yet.

getInboxCount

public int getInboxCount()

XXX: contains SQL

Returns:
Get the number of message in the Toot's Inbox

getLotID

@Deprecated
public int getLotID()
Deprecated. use UserHouse.getLotID()

Get the ID of the type of lot (neighbourhood) for the user's house. (Usually not set)

Returns:
The lot ID

getMailInBox

public Vector<GameWorldMessage> getMailInBox()
Returns:
all messages in the user's mailbox

getMailInBox

public Vector<GameWorldMessage> getMailInBox(int offset,
                                             int limit)

XXX: Contains SQL

Parameters:
limit - the maximum number of messages to be returned
offset - the first message index to return
Returns:
mail messages in the user's inbox

getMailOnMyWall

@Deprecated
public Vector<GameWorldMessage> getMailOnMyWall(int numberOfMessages)
Deprecated. use getMailOnWall(int, int)

Retrieve a number of of MailMessages starting with the most recent.

Parameters:
numberOfMessages - The number of posts needed.
Returns:
mail messages posted on the user's wall

getMailOnMyWall

@Deprecated
public Vector<GameWorldMessage> getMailOnMyWall(int numberOfMessages,
                                                           int start)
Deprecated. use getMailOnWall(int, int)

Retrieve a number of of MailMessages starting with the most recent.

Parameters:
numberOfMessages - The number of posts needed.
start - the first message (counting backwards in time from the latest)
Returns:
mail messages posted on the user's wall

getMailOnWall

public Vector<GameWorldMessage> getMailOnWall(int limit,
                                              int offset)

XXX:contains SQL

Parameters:
offset - the first message to fetch (counting from 0 being the user's first wall message ever)
limit - the last message to fetch. If there are fewer messages than this index, you may receive less results.
Returns:
mail messages posted on the user's wall

getMailOnWallAndBuddyWall

public Vector<GameWorldMessage> getMailOnWallAndBuddyWall(int offset,
                                                          int limit)
 twheys@gmail.com Jan 15, 2010
 
TO getMailOnWallAndBuddyWall WRITEME...

Parameters:
offset - WRITEME twheys@gmail.com
limit - WRITEME twheys@gmail.com
Returns:
WRITEME twheys@gmail.com

getMoney

@Deprecated
public BigInteger getMoney(Currency currency)
Deprecated. 

Description copied from interface: AbstractUser
To be deprecated in favour of AbstractUser.getWallet()

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

getNewMailOnWall

public Vector<GameWorldMessage> getNewMailOnWall(int newerThanID)
 twheys@gmail.com Feb 12, 2010
 
TO getNewMailOnWall get mail on Wall that has an ID greater than newerThanID WRITEME

Parameters:
newerThanID - WRITEME
Returns:
new posts or an empty vector

getNewMailOnWallAndBuddyWall

public Vector<GameWorldMessage> getNewMailOnWallAndBuddyWall(int newerThanID)
 twheys@gmail.com Feb 12, 2010
 
TO getNewMailOnWallAndBuddyWall get mail on Wall or Buddy Walls that has an ID greater than newerThanID WRITEME

Parameters:
newerThanID - WRITEME
Returns:
new posts or an empty vector

getPeanuts

public BigInteger getPeanuts()
Returns:
the amount of peanuts (currency) that this user has

getSubversionRevision

public String getSubversionRevision()
Description copied from interface: HasSubversionRevision

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

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

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

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

getTootBookStatus

public String getTootBookStatus()
Returns:
The last post this user wrote on their own wall.

getTootsBookThemes

@Deprecated
public HashMap<String,String> getTootsBookThemes()
Deprecated. 

Returns:
hash map of display names and URLs of available themes that this user owns

getTootsBookThemeURL

public String getTootsBookThemeURL()
Get the URL for the active TootBook theme folder for this user.

Returns:
relative URL for the theme folder

getTootTimeLeft

public int getTootTimeLeft()
Returns:
the toot time left in hours (without minutes)

getTootTimeLeft$

public String getTootTimeLeft$()
Returns:
the toot time remaining as hours & minutes delimited by "hr " and "min"

getTootTimeLeftMinutes

public int getTootTimeLeftMinutes()
Returns:
the toot time left minutes (after removing hours)

getTootTimeRefill

public int getTootTimeRefill()
Returns:
the tootTimeRefill

getTotalTootTimeLeftMinuts

public int getTotalTootTimeLeftMinuts()
Returns:
the Toot time left in minutes, including hours

giftPeanuts

public void giftPeanuts(BigInteger numNuts,
                        String event)
                 throws AlreadyExistsException,
                        org.json.JSONException
Give a gift of peanuts. Or, take away peanuts. This sends the Earnings balloon message to the user.

Parameters:
numNuts - WRITEME
event - event string
Throws:
AlreadyExistsException - WRITEME
org.json.JSONException - WRITEME

isTootTimerDay

public boolean isTootTimerDay()
Returns:
true, if the Toot Timer resets every day for this user.

isTootTimerMonth

public boolean isTootTimerMonth()
Returns:
true, if the Toot Timer resets every week for this user.

local_create

public void local_create()
This is an overriding method.

Overrides:
local_create in class User
See Also:
User.local_create()

postLoginGlobal

public void postLoginGlobal()
This is an overriding method.

Overrides:
postLoginGlobal in class User
See Also:
User.postLoginGlobal()

postNewOnTootBookWall

public int postNewOnTootBookWall(int toID,
                                 String body)
                          throws DataException,
                                 GameLogicException
Post a new message on this users TootBook wall.

Parameters:
toID - The ID of the User who's being posted to
body - The body of the message being sent.
Returns:
The ID of the new post.
Throws:
DataException - If the replyToID does not resolve a message, or if the message fails to send.
GameLogicException - if the mail fails the filters. XXX Filter exceptions

postReplyOnTootBookWall

public int postReplyOnTootBookWall(String body,
                                   int replyToID)
                            throws DataException,
                                   GameLogicException
Post a reply to a post on a TootBook wall.

Parameters:
body - The message to post.
replyToID - the ID of the post being replied to.
Returns:
The ID of the new post.
Throws:
DataException - If the replyToID does not resolve a message, or if the message fails to send.
GameLogicException - If the mail fails the filters. XXX filter exceptions

sendEarnings

public void sendEarnings(Room room,
                         String msg)
Send an earnings notice to the client. This pops up the blue “thought bubble” just like a fountain event.

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

sendMail

private boolean sendMail(int to,
                         String subject,
                         String body)
Send an in-game eMail message

Parameters:
to - The user to receive the message
subject - The subject of the message
body - The body/contents of the message
Returns:
true, if the message was sent successfully.

sendMail

public boolean sendMail(String to,
                        String subject,
                        String body)
Parameters:
to - WRITEME
subject - WRITEME
body - WRITEME
Returns:
WRITEME

sendPlushTootPromo

public void sendPlushTootPromo(UserAddress shippingAddress,
                               int tootSelect)
                        throws SQLException,
                               GameLogicException
Send a promotional plush Toot to this user, at the specified address.

Parameters:
shippingAddress - the address to which to ship the plush Toot
tootSelect - the Toot selected
Throws:
SQLException - if the order can't be inserted into shipping
GameLogicException - if the user attempts to send the plush Toot to someone else

sendSystemWallMail

public boolean sendSystemWallMail(String message,
                                  String attachment,
                                  String game)
 twheys@gmail.com Feb 18, 2010
 
TO sendSystemWallMail send a mail from THIS user to $Quicksilver WRITEME

Parameters:
message - WRITEME
attachment - WRITEME
game - WRITEME
Returns:
true if message sent successfully.

sendWallMail

private int sendWallMail(int toID,
                         String body,
                         int inReplyTo)
                  throws DataException,
                         GameLogicException
Creates a new post on a TootBook Profile.

Parameters:
toID - The ID of the User who is receiving this post.
body - The body/contents of the message
inReplyTo - The ID of the post that is being replied to. -1 if this is not a reply.
Returns:
the ID of the new post.
Throws:
DataException - If the post fails to send.
GameLogicException - If the post fails the filters.

setBasic8Choice

public void setBasic8Choice(int newToot)
Parameters:
newToot - the basic8Choice to set

setReferer

public void setReferer(String theReferer)
This is an overriding method.

Overrides:
setReferer in class User
Parameters:
theReferer - a four-character identifier
See Also:
User.setReferer(java.lang.String)

setTootTimerDay

public void setTootTimerDay(boolean useDailyTimer)
Parameters:
useDailyTimer - the tootTimerDay to set

setTootTimeRefill

public void setTootTimeRefill(int refillAmount)
Parameters:
refillAmount - the tootTimeRefill to set

setTootTimerMonth

public void setTootTimerMonth(boolean useMonthlyTimer)
Parameters:
useMonthlyTimer - the tootTimerMonth to set

setWallet

private void setWallet()
WRITEME brpocock@star-hope.org Aug 3, 2010


stampPassport

public void stampPassport(String moniker)
WRITEME: document this method (brpocock@star-hope.org, Sep 8, 2009)

Parameters:
moniker - WRITEME

startEnrolment

public void startEnrolment(UserEnrolment userEnrolment)
This is an overriding method.

Overrides:
startEnrolment in class User
Parameters:
userEnrolment - the enrolment to be started for this user
See Also:
User.startEnrolment(org.starhope.appius.mb.UserEnrolment)

toJSON

public org.json.JSONObject toJSON()

Sends a limited subset of data for the client to know. This is the information which the client is allowed to know about their own user account; this is a superset of the information returned by GeneralUser.getPublicInfo(), which is the information which any other user can obtain about it. The information from GeneralUser.getPublicInfo() is contained in the “avatar” key of this method's return values.

Specified by:
toJSON in interface AbstractUser
Overrides:
toJSON in class User
Returns:
A subset of the user record as a JSON object:
avatar
See GeneralUser.getPublicInfo()
isBirthday
True or false: is today this user's birthday
isMember
True, if the user is a paid member
canEnterChatZone
True, if the user can enter a Zone marked for public (free-form) chat
canEnterMenuZone
True, if the user can enter a Zone marked for chat only by selections from menus or icons (no typing free-form chat)
canTalk
True, if the user is permitted to type (talk)
language_dialect
The ISO language code and dialect code. For example, “en_US”
needsParent
True, if the user needs a parent to give approval under COPPA rules
tootTimeLeft
The amount of Toot Time left on this user's account, in the form hours “:” minutes.
tootTimer
The interval between increments of Toot Time; either “day” or “week”
userID
The user's ID number
userName
The user's login name
peanuts
The count of the user's peanuts (currency). From 00,000 to 99,999
staffLevel
If the user is a staff member, their base staff level. For most users, returns 0
ipAddress
If the user is online, this key will have their IP address (or, potentially, hostname)
See Also:
AbstractUser.toJSON()

transferPeanuts

public void transferPeanuts(BigInteger numNuts,
                            Toot fromUser,
                            String event)
                     throws AlreadyExistsException,
                            org.json.JSONException
Transfer peanuts from one user to another

Parameters:
numNuts - number of peanuts
fromUser - user giving up the peanuts
event - event for which the
Throws:
AlreadyExistsException - WRITEME
org.json.JSONException - WRITEME

updateWallet

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

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