|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tootsville.ExtensionCommands
public class ExtensionCommands
Extension commands for JSON commands and operator commands specific to Tootsville™
| Constructor Summary | |
|---|---|
ExtensionCommands()
|
|
| Method Summary | |
|---|---|
static void |
do_addJournalEntry(org.json.JSONObject jso,
AbstractUser u,
Room room)
Deprecated. |
static void |
do_createUserHouse(org.json.JSONObject jso,
AbstractUser u,
Room room)
Response from the first run screen for the user's house |
static void |
do_deleteMailMessage(org.json.JSONObject jso,
AbstractUser u,
Room room)
Delete a message from the user's mailbox |
static void |
do_doff(org.json.JSONObject jso,
AbstractUser u,
Room room)
JSON object contains "type" = either "clothes" or "pivitz". |
static void |
do_endEvent(org.json.JSONObject jso,
AbstractUser u,
Room room)
This method terminates an event (probably a minigame, but possibly a fountain) which was initiated by startEvent. |
static void |
do_getMailInBox(org.json.JSONObject jso,
AbstractUser u,
Room room)
Get the contents of the user's inbox as mail envelopes. |
static void |
do_getMailMessage(org.json.JSONObject jso,
AbstractUser u,
Room room)
Get a message out of the user's mailbox |
static void |
do_getMedalRankings(org.json.JSONObject jso,
AbstractUser u,
Room room)
Deprecated. |
static void |
do_getPassport(org.json.JSONObject jso,
AbstractUser u,
Room room)
Get the list of places that the user has already been to. |
static void |
do_getShopItems(org.json.JSONObject jso,
AbstractUser u,
Room room)
replies as per do_getStoreItems(JSONObject, AbstractUser, Room) , but
gives also "order" with the order of the
categories/shelves/stores in the shop |
static void |
do_getStoreItems(org.json.JSONObject jso,
AbstractUser u,
Room room)
Get the information about items found in a logical store (or store-category / shelf) |
static void |
do_markMailMessageAsRead(org.json.JSONObject jso,
AbstractUser u,
Room room)
WRITEME: document this method (brpocock@star-hope.org, Aug 28, 2009) |
static void |
do_sendMailMessage(org.json.JSONObject jso,
AbstractUser u,
Room room)
Send an in-game eMail message |
static void |
do_stampPassport(org.json.JSONObject jso,
AbstractUser u,
Room room)
Deprecated. |
static String |
getRev()
Get the revision level of this file |
static void |
op_addtokicklist(String[] words,
AbstractUser u,
Room room)
Add a regular expression pattern to the list of patterns which will cause a user to be immediately kicked out of the game for a period of time. |
static void |
op_addtowarnlist(String[] words,
AbstractUser u,
Room room)
Add a regular expression pattern to the list of patterns which cannot be spoken in the game world. |
static void |
op_addtowhitelist(String[] words,
AbstractUser u,
Room room)
Add a regular expression pattern to the set of regular expressions which are whitelisted against being blocked in speech. |
static void |
op_checklists(String[] words,
AbstractUser u,
Room room)
Return an administrative message with the number of regular expression patterns found on the warnings list, kick list, and whitelist. |
static void |
op_givenuts(String[] words,
AbstractUser u,
Room room)
Give (or take) peanuts to (from) a named user |
static void |
op_killegg(String[] words,
AbstractUser u,
Room room)
Remove the KaTootel egg Super Toot Bot from the game |
static void |
op_layegg(String[] words,
AbstractUser u,
Room room)
Deprecated. |
static void |
op_scores(String[] words,
AbstractUser u,
Room room)
get scores for a game for Ricky's High Score Contest. |
static void |
op_setmovie(String[] words,
AbstractUser u,
Room room)
Set the movie in the Theatre to the correct (latest) movie, immediately. |
static void |
op_zagame(String[] words,
AbstractUser u,
Room room)
Send a command into the operator command interpreter for a running game (if that game provides one) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExtensionCommands()
| Method Detail |
|---|
@Deprecated
public static void do_addJournalEntry(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException,
PrivilegeRequiredException
This command has never been implemented and simply returns an error of "not-implemented"
Add a staff journal entry.
Staff members can create a journal entry which is stored for review in a customer service application such as Joshua. Creating a ModeratorJournal object will parse for certain values such as [@username].
jso - { "entry": TEXT }u - Operator making journal entryroom - unused
org.json.JSONException - WRITEME twheys@gmail.com
PrivilegeRequiredException - if the user attempting to add
a journal entry isn't a staff member
public static void do_createUserHouse(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException
Response from the first run screen for the user's house
Either create the user's house and lot, or add a room to their house.
jso - Data describing the user's lot { lot: lot-ID, house:
house-ID }, or adding a room, { index: roomIndex }u - The user buying the lotroom - The room in which the user is found — for
communications purposes, at least.
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
public static void do_deleteMailMessage(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException
jso - { "id": MESSAGE-ID }u - user deleting the messageroom - room in which the user is standing
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
public static void do_doff(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException
JSON object contains "type" = either "clothes" or "pivitz". Does not affect patterns.
Response with total avatar info from "wardrobe"
jso - { "type": "pivitz" } or { "type": "clothes" } or {
"slot": SLOT-NUMBER }u - The user calling this methodroom - The room in which this user is standing
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
public static void do_endEvent(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException
This method terminates an event (probably a minigame, but possibly a fountain) which was initiated by startEvent.
For fountains, the score is ignored, and a random number from 1..100 is used as the effective score. Since fountains (should) have a 1:1 points:peanuts ratio, this will earn the player 1..100 peanuts randomly per fountain visit.
Response: JSON sent to user: { ended: event ID; peanuts: number of peanuts earned; highScores: array of scores, indexed by position on the high score list (1..24), each of which contains: { points: number of points scored by the high-scoring user; userName: the name of the user }, totalPeanuts: user's new total peanut balance }
Additionally, if this user earned a high score on this event, s/he will get the attribute in the top level of the response as "gotHighScore": with the value being the position number which was earned. For example, earning no high score omits the "gotHighScore" attribute altogether; earning the third highest score will return instead "gotHighScore" == 3.
jso - JSON parameters. { moniker = the event's moniker; id =
the event ID to be ended; score = the earned score, in
points (not peanuts); status = one of "cxl" to cancel
an event (in which case, score should be 0), or "cmp"
to complete an event (score may be zero or more). }u - The calling userroom - The room in which the user is found (for replies)
org.json.JSONException - if something nasty happens
public static void do_getMailInBox(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException
Get the contents of the user's inbox as mail envelopes. Message bodies are not returned.
Response: mail: { 0: { id: number, from: userName, to: userName, subject: "", sentTime: date & time string, readTime: date & time string, body: "" }, ... }
“limit” defaults to 100 messages
jso - { } for all messages; { from: X limit: Y } for a
subsetu - the user requesting the inbox contentsroom - the room in which the user is standing. Not
particularly important.
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
public static void do_getMailMessage(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws NotFoundException,
org.json.JSONException
Get a message out of the user's mailbox
Response: message: { id: number, from: userName , to: userName, subject: "", sentTime: date & time string , readTime: date & time string, body: "" }
jso - { id: mailboxID }u - user invoking the command (whose mailbox to check)room - room in which the user is standing at the time
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
NotFoundException - WRITEME
@Deprecated
public static void do_getMedalRankings(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException,
NotFoundException,
SQLException
This is a deprecated method that used to be needed for Tootlympics. It should no longer be called and will be removed.
returns ranks {1: {name:"name", gold:int, silver:int, bronze:int} ...}
jso - { count=10, type=tootlympics }u - the user requesting the resultsroom - the room in which the user is standing
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
NotFoundException - WRITEME
SQLException - WRITEME
public static void do_getPassport(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException,
SQLException
{ "passport": ... } from
User.getPassport_JSON()
jso - unusedu - user asking for their passportroom - room in which the user is standing
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
SQLException - WRITEME
public static void do_getShopItems(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws NumberFormatException,
org.json.JSONException
do_getStoreItems(JSONObject, AbstractUser, Room) , but
gives also "order" with the order of the
categories/shelves/stores in the shop
jso - { shop: MONIKER }u - the user askingroom - user's room
org.json.JSONException - if bad things happen
NumberFormatException - if bad things happen
public static void do_getStoreItems(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws NumberFormatException,
org.json.JSONException
Results: totalPeanuts (XXX Tootsville®-specific), stores...
jso - An array of store ID's for which you want to get the
items. The keys are ignored: typically, they'll be
ascending numbers, but that can be any unique values,
which will be discarded. The value of each key must be
the integer store (category) ID number.u - The user requesting the information. XXX Special case:
if the user is a Toot, gives back the totalPeanuts of
the userroom - The room in which the user is standing. Ignored.
NumberFormatException - If a store ID is not a valid
integer
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
public static void do_markMailMessageAsRead(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws NumberFormatException,
org.json.JSONException,
NotFoundException
jso - { id: message ID # }u - WRITEMEroom - WRITEME
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
NumberFormatException - WRITEME
NotFoundException - WRITEME
public static void do_sendMailMessage(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException
jso - { to: USERNAME, subject: "...", body: "..." }u - user sending mail messageroom - room user is in
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
@Deprecated
public static void do_stampPassport(org.json.JSONObject jso,
AbstractUser u,
Room room)
throws org.json.JSONException,
SQLException
jso - { room: (MONIKER) }u - user having passport stampedroom - room they're in now
org.json.JSONException - Thrown if the data cannot be interpreted
from the JSON objects passed in, or conversely, if we
can't encode a response into a JSON form
SQLException - if it can't be savedpublic static String getRev()
public static void op_addtokicklist(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
public static void op_addtowarnlist(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
public static void op_addtowhitelist(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
public static void op_checklists(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
public static void op_givenuts(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
public static void op_killegg(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
@Deprecated
public static void op_layegg(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
public static void op_scores(String[] words,
AbstractUser u,
Room room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
public static void op_setmovie(String[] words,
AbstractUser u,
Room room)
words - ignoredu - operator accountroom - any room in the zone in which the theatre should be updated
public static void op_zagame(String[] words,
AbstractUser u,
Room room)
Send a command into the operator command interpreter for a running game (if that game provides one)
Usage: #game gameIdentifier (strings...)
Special-cased for Zap Attack
SeeOpCommands.op_game(java.lang.String[], org.starhope.appius.user.AbstractUser, org.starhope.appius.game.Room)
words - The command parameters (whitespace-delimited list)
provided after the # command nameu - The user invoking the operator commandroom - The room in which the user is standing (as a room
number). This can be -1 under certain circumstances.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||