|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.gotoandplay.smartfoxserver.extensions.AbstractExtension
org.starhope.appius.server.OsirisSFSExtension
public class OsirisSFSExtension
This is the part of Osiris which lives as a Smart Fox Server extension.
Field Summary | |
---|---|
private Set<String> |
cullRooms
|
private static String |
EAVESDROP_PASSWORD
The password for $Eaves is the medieval Tuscan interpretation of the inscription upon the Black Gates, as read by Virgil to Dante Alligheri in The Divine Comedy. |
(package private) Set<Zone> |
emptyZones
List of empty zones |
private static long |
lastCheckedZonesForSpawn
|
(package private) Set<String> |
myEmptyZones
Names of empty zones |
private static int |
NPC_TICK_INTERVAL
Time between updates for NPC's |
private boolean |
serverReady
A flag set once the server has indicated that it's ready to go, to avoid issues with events firing off too soon (e.g. |
private static God |
systemUser
The system “God” user account |
private static int |
USER_ROOM_MAX_USERS
Max users allowed into one room of an user's house at a time |
private static float |
ZONE_FULL_RATIO
Get the percentage of "full" at which we consider a zone to be full enough to warrant spawning new ones. |
private static float |
ZONE_LIGHT_RATIO
Get the percentage of "full" at which we consider a zone to be light enough that it's almost empty |
private static int |
ZONE_MAX_USERS
The max. |
private static int |
ZONE_SPAWN_SECONDS
Time (in seconds) between spawning new zones |
Fields inherited from class it.gotoandplay.smartfoxserver.extensions.AbstractExtension |
---|
__isActive, __roomName, __zoneName, adminExtension |
Constructor Summary | |
---|---|
OsirisSFSExtension()
Default constructor |
Method Summary | |
---|---|
private void |
assertStaffLevel(User u,
int staffLevelRequired)
Assert that the given user must have a given level of staff privileges |
void |
biff(User u,
User user,
Integer room)
Async mail notification: { from: "postman", status: true, newMail: NNN } |
private void |
checkZonesForSpawn()
See if enough zones are full to warrant spawning a new one; or, if zones are empty and can be deallocated. |
void |
destroy()
This is an overriding method. |
void |
do_addFurniture(org.json.JSONObject jso,
User u,
Integer room)
|
void |
do_addToList(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
do_createUserHouse(org.json.JSONObject jso,
User u,
Integer room)
Response from the first run screen for the user's house |
void |
do_doff(org.json.JSONObject jso,
User u,
Integer room)
JSON object contains "type" = either "clothes" or "pivitz". |
void |
do_don(org.json.JSONObject jso,
User u,
Integer room)
JSON object has the item ID to be worn (clothes, patterns, pivitz) and optionally set the color (for patterns) |
void |
do_echo(org.json.JSONObject jso,
User u,
Integer room)
Echoes back the supplied ActionScript object to the client. |
void |
do_endEvent(org.json.JSONObject jso,
User u,
Integer room)
This method terminates an event (probably a minigame, but possibly a fountain) which was initiated by startEvent. |
void |
do_getAvatars(org.json.JSONObject jso,
User u,
Integer room)
Get avatar data for a list of (other) users. |
void |
do_getColorPalettes(org.json.JSONObject jso,
User u,
Integer room)
returns palettes in "extraColors", "baseColors", "patternColors" in the JSON result object (from: "getColorPalettes") |
void |
do_getInventoryByType(org.json.JSONObject jso,
User u,
Integer room)
JSON object has the type of item from the following list of strings: "clothes" "patterns" "pivitz" "furniture" "structure" "music" |
void |
do_getMailInBox(org.json.JSONObject jso,
User u,
Integer room)
Response: mail: { 0: { id: number, from: userName, to: userName, subject: "", sentTime: date & time string, readTime: date & time string, body: "" }, ... |
void |
do_getMailMessage(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 28, 2009) Response: message: { id: number, from: userName, to: userName, subject: "", sentTime: date & time string, readTime: date & time string, body: "" } |
void |
do_getOnlineUsers(org.json.JSONObject jso,
User u,
Integer room)
Get a list of users in a Zone, or in a Room. |
void |
do_getPassport(org.json.JSONObject jso,
User u,
Integer room)
Get the list of places that the user has already been to. |
void |
do_getStoreItems(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 26, 2009) |
void |
do_getUserLists(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
do_getUserMailboxes(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 28, 2009) Response: boxes: { 0: "INBOX" , ... |
void |
do_getZoneList(org.json.JSONObject jso,
User u,
Integer room)
Get a list of all Zones currently active/visible. |
void |
do_initUserRoom(org.json.JSONObject jso,
User u,
Integer room)
Creates room named user/user's name/room — room is the number given in the JSON data as "room," it will always be zero right now as all users have single-room houses. |
void |
do_markMailMessageAsRead(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 28, 2009) |
void |
do_ping(org.json.JSONObject jso,
User u,
Integer room)
TODO: document this method (brpocock, Sep 8, 2009) |
void |
do_purchase(org.json.JSONObject jso,
User u,
Integer room)
Execute a purchase of an item by an user. |
void |
do_removeFromList(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
do_reportBug(org.json.JSONObject jso,
User u,
Integer room)
This method allows the client to “phone home” |
void |
do_reportUser(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Aug 31, 2009) |
void |
do_sendMailMessage(org.json.JSONObject jso,
User u,
Integer room)
TODO: document this method (brpocock, Sep 8, 2009) |
void |
do_sendOutOfBandMessage(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Sep 2, 2009) { sender: sender, from: outOfBand, status: true, body: {JSON} } Adds "roomTitle" to body if body contains "room" and title can be determined |
void |
do_setAvatarColor(org.json.JSONObject jso,
User u,
Integer room)
Params: "base" and "extra" are color numbers |
void |
do_setFurniture(org.json.JSONObject jso,
User u,
Integer room)
Set or change a furniture item. |
void |
do_spawnZone(org.json.JSONObject jso,
User u,
Integer room)
Spawn an additional zone. |
void |
do_stampPassport(org.json.JSONObject jso,
User u,
Integer room)
TODO: document this method (brpocock, Sep 8, 2009) |
void |
do_startEvent(org.json.JSONObject jso,
User u,
Integer room)
Attempt to begin an event. |
private void |
dropUser(User user)
WRITEME: document this method (brpocock, Sep 2, 2009) |
private String |
getApple(SocketChannel channel,
String pass)
Get the “apple” (CHAP authentication string SHA1 digest encoded in hex) for the login system |
void |
getMedalRankings(org.json.JSONObject jso,
User u,
Integer room)
WRITEME: document this method (brpocock, Sep 1, 2009) |
User |
getSFSSystemUser()
WRITEME: document this method (brpocock, Aug 18, 2009) |
private org.json.JSONObject |
getZoneList_JSON()
|
private void |
handleFileUpload(InternalEventObject ieo)
Handle a file upload event — which we don't do, so I don't handle it, but let's kick the requesting user just for safety? (TODO) |
void |
handleInternalEvent(InternalEventObject ieo)
This is an overriding method. |
private void |
handleJoin(String zoneName,
User user,
Room room)
Handle (log only) an user joining a new room. |
private void |
handleLogin(String zoneName,
String bigNick,
String password,
SocketChannel channel)
Process a login request from the user |
void |
handleNewRoom(InternalEventObject ieo)
WRITEME: document this method (brpocock, Jul 14, 2009) |
void |
handleRequest(String cmd,
ActionscriptObject ao,
User u,
int fromRoom)
This is an overriding method. |
void |
handleRequest(String cmd,
org.json.JSONObject jso,
User u,
int fromRoom)
This is an overriding method. |
void |
handleRequest(String cmd,
String[] params,
User u,
int fromRoom)
This is an overriding method. |
void |
handleRoomLost(InternalEventObject ieo)
WRITEME: document this method (brpocock, Jul 14, 2009) |
private void |
handleServerReady()
Once the server indicates its readiness, begin spawning auto-spawning Zones |
private void |
handleSpeak(InternalEventObject ieo)
WRITEME: document this method (brpocock, Jul 14, 2009) |
void |
handleSpectatorSwitched(InternalEventObject ieo)
WRITEME: document this method (brpocock, Jul 14, 2009) |
void |
handleUserLost(InternalEventObject ieo)
WRITEME: document this method (brpocock, Jul 14, 2009) |
void |
handleUserPart(String zone,
Room room,
String uid,
User user,
String oldPlayerIndex)
WRITEME: document this method (brpocock, Jul 14, 2009) |
private void |
handleWhisper(InternalEventObject ieo)
WRITEME: document this method (brpocock, Jul 14, 2009) |
void |
init()
This is an overriding method. |
protected void |
sendBuddyNotice(String buddyName,
boolean isOnline,
String roomMoniker,
String roomTitle,
User u,
int room)
Sends a buddy notice message to the client |
private void |
sendError_RAW(String xtnName,
String message,
SocketChannel channel)
WRITEME: document this method (brpocock, Aug 19, 2009) |
private void |
sendErrorReply(String source,
String error,
org.json.JSONObject result,
User u,
int room)
WRITEME: document this method (brpocock, Aug 20, 2009) |
private void |
sendSuccessReply(String source,
org.json.JSONObject resultIn,
User u,
int room)
WRITEME: document this method (brpocock, Aug 20, 2009) |
private void |
sendSuccessReply(String source,
org.json.JSONObject resultIn,
User u,
int room,
LinkedList<SocketChannel> recipients)
|
private void |
sendUserLists(User u)
|
private void |
sendUserLists(User u,
User user)
|
private void |
sendWardrobe(User user,
User u,
int room)
Send a "from:wardrobe" message to the user |
void |
spawnNewZone()
Create a new zone if one is needed |
private void |
spawnZone(String zoneName,
String image)
Create a new, empty zone, and attach the default properties to it. |
void |
uncaughtException(Thread t,
Throwable e)
This is an overriding method. |
Methods inherited from class it.gotoandplay.smartfoxserver.extensions.AbstractExtension |
---|
getOwnerRoom, getOwnerZone, handleInternalRequest, isActive, loadConfig, registerForEvents, sendResponse, sendResponse, sendResponse, sendResponse, setActive, setOwner, trace, unRegister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String EAVESDROP_PASSWORD
The password for $Eaves is the medieval Tuscan interpretation of the inscription upon the Black Gates, as read by Virgil to Dante Alligheri in The Divine Comedy.
Perhaps the best English translation thereof is:
private static long lastCheckedZonesForSpawn
private static final int NPC_TICK_INTERVAL
private static God systemUser
private static final int USER_ROOM_MAX_USERS
private static final float ZONE_FULL_RATIO
private static final float ZONE_LIGHT_RATIO
private static final int ZONE_MAX_USERS
private static final int ZONE_SPAWN_SECONDS
private final Set<String> cullRooms
Set<Zone> emptyZones
Set<String> myEmptyZones
private boolean serverReady
Constructor Detail |
---|
public OsirisSFSExtension()
Method Detail |
---|
private void assertStaffLevel(User u, int staffLevelRequired) throws PrivilegeRequiredException
u
- The Smart Fox user objectstaffLevelRequired
- The staff level required to perform the
action
PrivilegeRequiredException
- if the userpublic void biff(User u, User user, Integer room) throws org.json.JSONException
Async mail notification: { from: "postman", status: true, newMail: NNN }
Call this method to send an asynchronous mail notification for the given user.
u
- the Smartfox useruser
- the Braque userroom
- the user's room
org.json.JSONException
private void checkZonesForSpawn()
public void destroy()
destroy
in interface ISmartFoxExtension
destroy
in class AbstractExtension
AbstractExtension.destroy()
public void do_addFurniture(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, NotFoundException
jso
- u
- room
-
org.json.JSONException
NotFoundException
#do_setFurniture(JSONObject, User, Integer)34
public void do_addToList(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- { buddy: (name) } or { ignore: (name) } or { buddy:
(name), confirm: (boolean), sign: (signature) } oru
- room
-
org.json.JSONException
public void do_createUserHouse(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
Response from the first run screen for the user's house
jso
- Data describing the user's lot { lot: lot-ID, house:
house-ID }u
- The user buying the lotroom
- The room in which the user is found — for
communications purposes, at least.
org.json.JSONException
public void do_doff(org.json.JSONObject jso, User u, Integer 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
- u
- room
-
org.json.JSONException
public void do_don(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
JSON object has the item ID to be worn (clothes, patterns, pivitz) and optionally set the color (for patterns)
Response with total avatar info from "wardrobe"
jso
- { item = (itemID) }u
- room
-
org.json.JSONException
public void do_echo(org.json.JSONObject jso, User u, Integer room)
Echoes back the supplied ActionScript object to the client. This method exists solely for testing purposes.
Sends response containing:
jso
- Any JSON object, the contents of which will be
returned to the caller.u
- The user calling (to whom the response is sent)room
- The room in which the user calls us (ignored)public void do_endEvent(org.json.JSONObject jso, User u, Integer 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 happenspublic void do_getAvatars(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- JSON object, with (ignored) keys tied to values which
must be the names of users.u
- The calling user. The calling user's avatar data will
not be returned.room
- the (ignored) room in which the method is being
called
org.json.JSONException
public void do_getColorPalettes(org.json.JSONObject jso, User u, Integer room) throws SQLException, org.json.JSONException
jso
- JSON parameters: ignoredu
- calling userroom
- calling user's room
SQLException
- if something squirrelly happens
org.json.JSONException
- if something squirrelly happenspublic void do_getInventoryByType(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
JSON object has the type of item from the following list of strings: "clothes" "patterns" "pivitz" "furniture" "structure" "music"
Returns a set of items as inv: { 0: { id: 123, isActive: boolean }, ... } — furniture with placement data will also have x, y, and facing vars. Other attributes are "from":"inventory", "type": matching the type of the question
jso
- u
- room
-
org.json.JSONException
public void do_getMailInBox(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
Response: mail: { 0: { id: number, from: userName, to: userName, subject: "", sentTime: date & time string, readTime: date & time string, body: "" }, ... }
jso
- { box: "INBOX" }u
- room
-
org.json.JSONException
public void do_getMailMessage(org.json.JSONObject jso, User u, Integer room) throws NotFoundException, org.json.JSONException
jso
- { id: mailboxID }u
- room
-
org.json.JSONException
NotFoundException
public void do_getOnlineUsers(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, PrivilegeRequiredException
jso
- The JSON data provided by the caller. If this contains
an attribute of "inRoom" with a room moniker, we'll only
return the users in that room. Otherwise, all users in the
Zone will be returned.u
- The caller's ID. Must have staff privileges.room
- The room from which the caller is making the
extension call: ignored.
org.json.JSONException
- if the JSON data can't be processed, in or
out.
PrivilegeRequiredException
- if the user doesn't have
STAFF_LEVEL_STAFF_MEMBERpublic void do_getPassport(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, SQLException
jso
- u
- room
-
org.json.JSONException
SQLException
public void do_getStoreItems(org.json.JSONObject jso, User u, Integer room) throws NumberFormatException, org.json.JSONException
Results: totalPeanuts, stores...
jso
- u
- room
-
NumberFormatException
org.json.JSONException
public void do_getUserLists(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
{ buddyList: { 0: { buddy-notice... } , 1: { buddy-notice... } , ... } , ignoreList: { 0: ignoredUserName, 1: ignoredUserName, ... } }
jso
- no parameters neededu
- room
-
org.json.JSONException
public void do_getUserMailboxes(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- ( no input )u
- room
-
org.json.JSONException
public void do_getZoneList(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
getZoneList_JSON()
)
jso
- Ignoredu
- The user requesting the data.room
- Ignored
org.json.JSONException
- If something untoward happenspublic void do_initUserRoom(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, it.gotoandplay.smartfoxserver.exceptions.CreateRoomException
Creates room named user/user's name/room — room is the number given in the JSON data as "room," it will always be zero right now as all users have single-room houses. This will populate all furniture-type items for that room onto a set of room variables owned by the user. The user calling this method must be the owner of the room. If the user has not visited his/her house before, this will return an asynchronous "make a new house" notification to do the "first run" screen, by sending a message of type { "from": "initUserRoom", "status": false, "err": "showFirstRun" }.
Success: responds with true, and "moniker": the room's moniker (user/WHOEVER/123)
jso
- { room: (roomnumber), autoJoin: (boolean) }u
- room
-
org.json.JSONException
it.gotoandplay.smartfoxserver.exceptions.CreateRoomException
AlreadyExistsException
public void do_markMailMessageAsRead(org.json.JSONObject jso, User u, Integer room) throws NumberFormatException, org.json.JSONException, NotFoundException
jso
- { id: message ID # }u
- room
-
org.json.JSONException
NumberFormatException
NotFoundException
public void do_ping(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- u
- room
-
org.json.JSONException
public void do_purchase(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, NotFoundException
Execute a purchase of an item by an user. Deducts peanuts, registers (and ends) an event, and adds the appropriate item to the user's inventory.
Returns a success reply to the caller with "bought": (itemID) , "title": (item title), and "totalPeanuts": (the user's new personal balance of peanuts to spend, with this transaction already deducted) (status:true, from:purchase)
Error reply of err="nsf" = not-sufficient-funds, or err="dupe" = duplicate item
jso
- { "itemID": itemID }
u
- The buyerroom
- The buyer's room
org.json.JSONException
- if the data can't be put in or out of
JSON-land.
NotFoundException
- if the item was bought and didn't existpublic void do_removeFromList(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- { buddy: (name) } or { ignore: (name) }u
- room
-
org.json.JSONException
public void do_reportBug(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- Must contain a single string attribute named "bug."
Other attributes will be ignored.u
- The user reporting the bug.room
- The user's current room.
org.json.JSONException
- JSON encoding errorpublic void do_reportUser(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- { userName = user to be reported }u
- room
-
org.json.JSONException
public void do_sendMailMessage(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- u
- room
-
org.json.JSONException
public void do_sendOutOfBandMessage(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
jso
- { to: userName, body: {JSON} }u
- room
-
org.json.JSONException
public void do_setAvatarColor(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException
Params: "base" and "extra" are color numbers
WRITEME: document this method (brpocock, Aug 27, 2009)
jso
- u
- room
-
org.json.JSONException
public void do_setFurniture(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, NotFoundException
Set or change a furniture item. To add a structural item to the room, put item: 123 without anything else. To place furniture on the floor, also add attributes x, y, and facing.
To change furniture, replace item: with slot: (to avoid ambiguities about “which chair”)
To remove an item from the room, send { slot: 123, remove: true }
jso
- u
- room
-
org.json.JSONException
NotFoundException
public void do_spawnZone(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, PrivilegeRequiredException
jso
- JSON object, containing an associative array whose
values are zones to be spawnedu
- The caller responsibleroom
- Where is the caller?
org.json.JSONException
- if something goes awry
PrivilegeRequiredException
- if the user isn't a Developerpublic void do_stampPassport(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, SQLException
jso
- { room: (MONIKER) }u
- room
-
org.json.JSONException
SQLException
public void do_startEvent(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, SQLException
Attempt to begin an event. Might return an error. Uses
User.startEvent(String)
for the
heavy lifting.
Note that for all fountains, use the magic moniker “fountain”
Calls back the user with either of:
do_endEvent(JSONObject, User, Integer)
jso
- JSON payload from the caller. Data: moniker = event
moniker.u
- The caller = the user performing the eventroom
- The caller's room. For fountains, we'll use this
room's moniker to figure out which fountain is which
org.json.JSONException
- if JSON data can't be put into a response,
or gotten out of a command.
SQLException
- probably means that the moniker is bad, but
I'm not really doing much to validate it hereprivate void dropUser(User user)
user
- private String getApple(SocketChannel channel, String pass)
channel
- The SocketChannel to the relevant userpass
- The plaintext password to be used
public void getMedalRankings(org.json.JSONObject jso, User u, Integer room) throws org.json.JSONException, NotFoundException, SQLException
returns ranks {1: {name:"name", gold:int, silver:int, bronze:int} ...}
jso
- { count=10, type=tootlympics }u
- room
-
org.json.JSONException
NotFoundException
SQLException
public User getSFSSystemUser()
private org.json.JSONObject getZoneList_JSON() throws org.json.JSONException
org.json.JSONException
- JSON encoding errorprivate void handleFileUpload(InternalEventObject ieo)
ieo
- Internal Event Objectpublic void handleInternalEvent(InternalEventObject ieo)
handleInternalEvent
in interface IEventListener
IEventListener.handleInternalEvent(it.gotoandplay.smartfoxserver.events.InternalEventObject)
private void handleJoin(String zoneName, User user, Room room)
zoneName
- user
- room
- private void handleLogin(String zoneName, String bigNick, String password, SocketChannel channel)
zoneName
- The name of the zone into which the user is
trying to log inbigNick
- The user's requested nickname (attempted user
name)password
- This is a bit of a misnomer. We actually are
checking for the secret key (CHAP cookie) for the current
channel, to which has been appended the user's actual
password, as presented as a hex-coded SHA1 digest. (In
brief: pseudocode of sha1( cookie + password ).toHex )channel
- This is the socket over which we are communicating
with the prospective userpublic void handleNewRoom(InternalEventObject ieo)
ieo
- public void handleRequest(String cmd, ActionscriptObject ao, User u, int fromRoom)
handleRequest
in interface ISmartFoxExtension
ISmartFoxExtension.handleRequest(java.lang.String,
it.gotoandplay.smartfoxserver.lib.ActionscriptObject,
it.gotoandplay.smartfoxserver.data.User, int)
public void handleRequest(String cmd, org.json.JSONObject jso, User u, int fromRoom)
handleRequest
in interface ISmartFoxExtension
handleRequest
in class AbstractExtension
AbstractExtension.handleRequest(java.lang.String,
org.json.JSONObject,
it.gotoandplay.smartfoxserver.data.User, int)
public void handleRequest(String cmd, String[] params, User u, int fromRoom)
handleRequest
in interface ISmartFoxExtension
ISmartFoxExtension.handleRequest(java.lang.String,
java.lang.String[], it.gotoandplay.smartfoxserver.data.User,
int)
public void handleRoomLost(InternalEventObject ieo)
ieo
- private void handleServerReady()
private void handleSpeak(InternalEventObject ieo)
ieo
-
org.json.JSONException
public void handleSpectatorSwitched(InternalEventObject ieo)
ieo
- public void handleUserLost(InternalEventObject ieo)
ieo
- public void handleUserPart(String zone, Room room, String uid, User user, String oldPlayerIndex)
zone
- room
- uid
- user
- oldPlayerIndex
- private void handleWhisper(InternalEventObject ieo)
ieo
- public void init()
init
in interface ISmartFoxExtension
init
in class AbstractExtension
AbstractExtension.init()
protected void sendBuddyNotice(String buddyName, boolean isOnline, String roomMoniker, String roomTitle, User u, int room) throws org.json.JSONException
Sends a buddy notice message to the client
{ from: buddyNotice, status: true,
notice: { buddy: name, online: boolean,
room: moniker, roomName: title } }
buddyName
- isOnline
- roomMoniker
- roomTitle
- u
- room
-
org.json.JSONException
private void sendError_RAW(String xtnName, String message, SocketChannel channel)
xtnName
- message
- channel
- private void sendErrorReply(String source, String error, org.json.JSONObject result, User u, int room) throws org.json.JSONException
source
- The method returning the error messageerror
- The error messageresult
- The payload, if any. May be altered.u
- The user to whom to send the success replyroom
- The room in which the user is standing
org.json.JSONException
private void sendSuccessReply(String source, org.json.JSONObject resultIn, User u, int room) throws org.json.JSONException
source
- The method returning the success messageresultIn
- The payload, if any. May be altered.u
- The user to whom to send the success replyroom
- The room in which the user is standing
org.json.JSONException
private void sendSuccessReply(String source, org.json.JSONObject resultIn, User u, int room, LinkedList<SocketChannel> recipients) throws org.json.JSONException
org.json.JSONException
private void sendUserLists(User u) throws org.json.JSONException
org.json.JSONException
private void sendUserLists(User u, User user) throws org.json.JSONException
org.json.JSONException
private void sendWardrobe(User user, User u, int room) throws org.json.JSONException
user
- u
- room
-
org.json.JSONException
public void spawnNewZone()
private void spawnZone(String zoneName, String image)
zoneName
- the name of the new zoneimage
- the background nugget iconpublic void uncaughtException(Thread t, Throwable e)
uncaughtException
in interface Thread.UncaughtExceptionHandler
Thread.UncaughtExceptionHandler.uncaughtException(java.lang.Thread,
java.lang.Throwable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |