org.starhope.appius.net
Class BatchProcessor

java.lang.Object
  extended by java.lang.Thread
      extended by org.starhope.appius.net.NetIOThread
          extended by org.starhope.appius.net.ServerThread
              extended by org.starhope.appius.net.BatchProcessor
All Implemented Interfaces:
Comparable<Thread>, Runnable, Thread.UncaughtExceptionHandler, NetIOHandlerPeer, ServerProcessor, AcceptsMetronomeTicks, HasName, CanProcessCommands

public class BatchProcessor
extends ServerThread

Process JSON interactions in bulk

Author:
brpocock@star-hope.org

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class org.starhope.appius.net.ServerThread
busyState, futureDatagrams, idleWarned, keepRunning, lastInputTime, loggedIn, maxInputSize, myUser, preloginCountdown, randomKey, streamProtocolLanguage, tLastNudge, zone
 
Fields inherited from class org.starhope.appius.net.NetIOThread
debug, dialect, in, isDone, language, letsPlayWithFlash, out, parallelMode, socket, state
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BatchProcessor(Socket newSocket)
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
 org.json.JSONObject getBatchReplies()
          WRITEME: Document this method brpocock@star-hope.org
 String getSessionApple(User user)
          WRITEME: Document this method brpocock@star-hope.org
 String initSession()
          WRITEME: Document this method brpocock@star-hope.org
 boolean isBatchAuth(String auth, String userName, org.json.JSONObject d)
          WRITEME: Document this method brpocock@star-hope.org
protected  boolean logIn_checkPassword(User user, String password, Zone z)
          Check whether the supplied password (encrypted in SHA-1) is correct.
protected  String tattlePrefix()
          WRITEME: Document this method brpocock@star-hope.org
 String toString()
          This returns a plethora of debugging-useful information about this particular server thread.
 
Methods inherited from class org.starhope.appius.net.ServerThread
adopt, areYouThere, close, commandJSON, disconnectDuplicate, doNudge, doProcessing, doRealClose, end, enterZone, enterZone, equals, failLogin, finalize, genRandomKey, getApple, getIpAddress, getIPAddress, getLanguage, getRandomKey, getRandomKey, getSFSVersion, getStreamProtocolLanguage, getStreamsReady, getUser, getZone, grabInput, hashCode, isLoggedIn, kickDuplicates, kickDuplicates, logIn_checkUserAllowed, logIn_loadTest_autoCreateFakeUser, logIn, logout, migrate, postLogIn, processInput_Infinity, processInput_SmartFoxServer, processJSONInput, processJSONPreLogin, processPreLogin, processXMLInput, run, sendAdminDisconnect, sendAdminMessage, sendAdminMessage, sendBadPassword, sendDeferredDatagrams, sendErrorReply, sendFutureDatagrams, sendGameActionMessage, sendLoginPacket, sendLogKO, sendLogKO, sendNextFutureDatagram, sendNoSuchUser, sendPrivateMessage, sendPublicMessage, sendRawMessage, sendRawMessageLater, sendResponse, sendResponse, sendResponse, sendResponse, sendResponse, sendResponseRemote, sendRoomEnteredByUser, sendRoomList, sendRoomList, sendRoomPartedBy, sendRoomUserCount, sendRoomVar, sendSuccessReply, sendUserJoin, sendUserPart, sendUserVariable, setBusyState, setLanguage, setLastInputTime, setLoggedIn, setParallelMode, setSFSVersion, setup, sha1hexify, tick_checkIdleKick, tick_checkIdleWarnTime, tick, toInfinityAndBeyond, uncaughtException, userDebug
 
Methods inherited from class org.starhope.appius.net.NetIOThread
checkInputStream, compareTo, dropSocket_socketCore, dropSocketConnection, equals, getLanguage_dialect, getRemoteAddress, getSocket, getVerboseBugReplies, isDebug, isParallelMode, processInput, sendError_RAW, sendRawMessageNow, setDebug, setLanguage, setVerboseBugReplies, superVerbose, tattle, tattle
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.starhope.appius.net.ServerProcessor
start
 
Methods inherited from interface org.starhope.appius.util.HasName
getName
 
Methods inherited from interface org.starhope.util.types.CanProcessCommands
getName
 

Constructor Detail

BatchProcessor

public BatchProcessor(Socket newSocket)
WRITEME: Document this constructor brpocock@star-hope.org

Parameters:
newSocket - WRITEME
Method Detail

getBatchReplies

public org.json.JSONObject getBatchReplies()
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME

getSessionApple

public String getSessionApple(User user)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
user - WRITEME
Returns:
WRITEME

initSession

public String initSession()
WRITEME: Document this method brpocock@star-hope.org

Returns:
session key string

isBatchAuth

public boolean isBatchAuth(String auth,
                           String userName,
                           org.json.JSONObject d)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
auth - WRITEME
userName - WRITEME
d - WRITEME
Returns:
true, if the batch is authenticated

logIn_checkPassword

protected boolean logIn_checkPassword(User user,
                                      String password,
                                      Zone z)
Description copied from class: ServerThread
Check whether the supplied password (encrypted in SHA-1) is correct. If it's incorrect, send a norification to that effect.

Overrides:
logIn_checkPassword in class ServerThread
Parameters:
user - the user attempting to log in
password - the seeded SHA-1 hash of the password
z - the zone into which the user is attempting to log in
Returns:
true, if the password was correct, else false.
See Also:
ServerThread.logIn_checkPassword(org.starhope.appius.user.User, java.lang.String, org.starhope.appius.game.Zone)

tattlePrefix

protected String tattlePrefix()
Description copied from class: NetIOThread
WRITEME: Document this method brpocock@star-hope.org

Overrides:
tattlePrefix in class ServerThread
Returns:
WRITEME
See Also:
NetIOThread.tattlePrefix()

toString

public String toString()
This returns a plethora of debugging-useful information about this particular server thread.

Overrides:
toString in class ServerThread
See Also:
Thread.toString()