|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.starhope.appius.net.NetIOThread
org.starhope.appius.net.ServerThread
public class ServerThread
This is the server thread for Appius Claudius Caecus. One server thread is instantiated for each connected user.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private Set<Thread> |
adopted
threads adopted by this one |
protected boolean |
busyState
While we are processing a transaction for the user (during command processing), this flag is brought high to block idle timeouts due to overlong transactions |
protected Queue<AppiusDatagram> |
futureDatagrams
The queue of all datagrams pending for this user. |
protected long |
idleWarned
At what time was the user warned about being idle for too long? |
protected boolean |
keepRunning
This variable controls the main loop of the server thread. |
private String |
language_dialect
The user's language and dialect string for internationalization and localization |
protected long |
lastInputTime
The time at which we last received input from the remote user. |
protected boolean |
loggedIn
If the user has been logged in, this flag will be true |
protected int |
maxInputSize
The maximum number of characters (or is it bytes? I'm unclear on my own implementation there!) that can be accepted from the client in a single packet |
protected User |
myUser
The user account that is logged in on this thread |
protected int |
preloginCountdown
The number of prelogin commands that can be accepted before the user is dropped for failing to log in |
protected String |
randomKey
random key used for SHA1 sum in login |
protected float |
streamProtocolLanguage
The language variant that the session is speaking. |
protected long |
tLastNudge
Time at which users were last nudged to check their online status |
protected Zone |
zone
The Zone in which this thread is connecting |
| 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 | |
|---|---|
protected |
ServerThread(int maxSize)
constructor used sôlely for WebSocketProcessor to be
happy. |
|
ServerThread(Socket newSocket)
Create a new thread connected to a given client, in a certain zone. |
|
ServerThread(String string)
Just for uncaught exception handler faux-thread |
| Method Summary | |
|---|---|
void |
adopt(Thread t)
Adopt a thread into this one, starting it executing. |
protected void |
areYouThere()
Send a packet to the user to see if they're still there |
void |
close()
Schedule the socket to be closed and terminated ASAP |
void |
commandJSON(String cmd,
org.json.JSONObject jso,
Class<?> klass)
Process a command from a JSON source |
void |
disconnectDuplicate()
Disconnect *this* user, with a notification that they have logged in from someplace else. |
protected void |
doNudge(long t)
Nudge the user to see if they're dead yet |
protected String |
doProcessing(String theInput)
|
void |
doRealClose()
Close the socket, terminate the connection |
void |
end()
Indicate that this thread should cease to breathe. |
void |
enterZone(String zoneName)
Enter into a Zone (set the local zone indicator) |
void |
enterZone(Zone whichZone)
Enter into a Zone (set the local zone indicator) |
boolean |
equals(Object other)
This is an overriding method. |
void |
failLogin()
This method is called when login fails. |
protected void |
finalize()
|
protected void |
genRandomKey(double mode)
Generate a new random key: |
String |
getApple(String pass)
Get the “apple” (CHAP authentication string SHA1 digest encoded in hex) for the login system |
String |
getIpAddress()
Deprecated. Smart Fox Server Pro misspelling of getIPAddress() |
String |
getIPAddress()
|
String |
getLanguage()
|
String |
getRandomKey()
|
String |
getRandomKey(double mode)
Generate a new random key in the specified mode, and then return it. |
double |
getSFSVersion()
Deprecated. use getStreamProtocolLanguage() |
double |
getStreamProtocolLanguage()
get the language code used for the stream protocol |
protected Socket |
getStreamsReady()
WRITEME: Document this method brpocock@star-hope.org |
GeneralUser |
getUser()
|
Zone |
getZone()
Get the zone in which this client is acting |
protected String |
grabInput()
Get input from the client stream |
int |
hashCode()
This is an overriding method. |
boolean |
isLoggedIn()
|
protected void |
kickDuplicates(User user,
String nick)
Kick offline any duplicates of the given user as s/he logs in |
protected void |
kickDuplicates(User user,
String nick,
String password)
Deprecated. use kickDuplicates(User, String) |
protected boolean |
logIn_checkPassword(User user,
String password,
Zone z)
Check whether the supplied password (encrypted in SHA-1) is correct. |
protected boolean |
logIn_checkUserAllowed(AbstractUser user)
Check whether the user is permitted to log in. |
protected boolean |
logIn_loadTest_autoCreateFakeUser(String nick)
Automatically create a fake user in the database for load-testing purposes only. |
boolean |
logIn(Zone z,
String bigNick,
String password)
Process a login request from the user |
void |
logout()
Log out of the game |
void |
migrate(String hostName,
int portNumber,
String zoneName)
Order this user to migrate to another Appius Claudius Caecus server. |
protected void |
postLogIn(Zone z,
String password,
AbstractUser user)
Handle post-login events |
private void |
primeConnection()
WRITEME: Document this method brpocock@star-hope.org |
protected String |
processInput_Infinity(String theInput)
Process input received using the JSON-based Infinity mode |
protected String |
processInput_SmartFoxServer(String theInput)
|
protected String |
processJSONInput(String theInput)
Process a JSON string from the client |
protected String |
processJSONPreLogin(String theInput)
Process a prelogin JSON command |
protected String |
processPreLogin(String theInput)
Process a prelogin input sequence |
protected String |
processXMLInput(String theInput)
|
void |
run()
Run the server thread connected to a client |
private boolean |
send$EdenLogin(org.json.JSONObject result)
WRITEME: Document this method brpocock@star-hope.org |
void |
sendAdminDisconnect(String message,
String title,
String label,
String disconnectCause)
Send a disconnection message, and drop the user on the next client cycle. |
void |
sendAdminMessage(String message,
boolean remote)
Send an administrative message to the user. |
void |
sendAdminMessage(String message,
String title,
String hatLabel,
boolean remote)
Send an administrative message. |
void |
sendBadPassword(Zone failZone,
User user,
String password)
Send the user a notification that their password was incorrect. |
protected void |
sendDeferredDatagrams()
Deprecated. for sendFutureDatagrams() |
void |
sendErrorReply(String source,
String error,
org.json.JSONObject result,
User u,
int room)
send an error packet to the other party. |
protected boolean |
sendFutureDatagrams()
Send any future datagrams that are pending for this user |
void |
sendGameActionMessage(AbstractUser sender,
org.json.JSONObject data)
Send a game action event message to the client |
protected void |
sendLoginPacket(String zoneName,
String nick,
String password)
Send the bucketfuls of information that we force-feed the client at login... |
protected void |
sendLogKO()
Send a login failure message to the client, using the default (generic) message. |
protected void |
sendLogKO(String messageText)
Send a “KO” message to the client, informing them that they are not permitted to log in. |
protected boolean |
sendNextFutureDatagram()
Send a single datagram off the queue. |
void |
sendNoSuchUser(String nick,
String zoneName,
String password)
Tell the user to bugger off, because they don't exist. |
void |
sendPrivateMessage(AbstractUser from,
String message)
Send a private (“whisper”) message to the user |
void |
sendPublicMessage(AbstractUser from,
String message)
Send a public message |
void |
sendRawMessage(String reply,
boolean remote)
Deprecated. |
protected void |
sendRawMessageLater(String reply)
Send a message to the user in future |
void |
sendResponse(org.json.JSONObject result)
Send a response as a future (deferred remote) datagram without a room specified |
void |
sendResponse(org.json.JSONObject result,
int room,
AbstractUser u)
Deprecated. use sendResponse(JSONObject, int, boolean) |
void |
sendResponse(org.json.JSONObject result,
int room,
boolean remote)
Send a response to the other party in JSON form. |
void |
sendResponse(org.json.JSONObject result,
Integer room)
Send a response as a future (deferred remote) datagram |
void |
sendResponse(org.json.JSONObject result,
Integer room,
AbstractUser u)
Deprecated. perhaps use sendResponse(JSONObject,int,boolean)
directly with the room ID and the “remote” boolean
flag probably as “true” |
void |
sendResponseRemote(org.json.JSONObject result,
Integer room,
AbstractUser u)
Deprecated. use sendResponse(JSONObject, Integer) |
void |
sendRoomEnteredByUser(Room room,
AbstractUser user)
Send notification that an user has joined a room |
void |
sendRoomList()
Send the user a room list for their current zone |
void |
sendRoomList(AbstractZone forZone,
boolean remote)
Send the user a room list for an arbitrary zone |
void |
sendRoomPartedBy(Room room,
AbstractUser user)
Send a notification that an user has departed from a room |
void |
sendRoomUserCount(Room room)
Send the user count for the given room |
void |
sendRoomVar(int roomNum,
String varName,
String varValue)
|
void |
sendSuccessReply(String source,
org.json.JSONObject resultIn,
AbstractUser u,
int room)
Send a JSON success packet back to the client |
void |
sendUserJoin(Room room)
Send the event to the user indicated that this user has joined a room successfully. |
void |
sendUserPart(AbstractUser user,
Room room)
Deprecated. use sendRoomPartedBy(Room, AbstractUser) |
void |
sendUserVariable(AbstractUser user,
String varName,
String varValue)
Send an update to an user variable |
void |
setBusyState(boolean b)
|
void |
setLanguage(String new_language_dialect)
|
void |
setLastInputTime(long thatTime)
|
void |
setLoggedIn(boolean amILoggedInNow)
|
void |
setParallelMode(boolean newParallelMode)
|
void |
setSFSVersion(float smartFoxServerCommProtocolVersion)
|
private void |
setSocketOptionsFromConfig(Socket sock)
WRITEME: Document this method brpocock@star-hope.org |
protected void |
setup()
Set up this thread to execute |
protected String |
sha1hexify(String seed)
|
protected String |
tattlePrefix()
WRITEME: Document this method brpocock@star-hope.org |
protected boolean |
tick_checkIdleKick(long tIdle)
Check whether the user has been idle for too long, and kick them offline if so |
protected boolean |
tick_checkIdleWarnTime(long tIdle)
Check how long the user has been idle, and send a warning if the time idle has exceeded a limit |
void |
tick(long t,
long dT)
Propagate a metronome tick |
protected void |
toInfinityAndBeyond()
engage Infinity-mode protocol |
String |
toString()
This returns a plethora of debugging-useful information about this particular server thread. |
void |
uncaughtException(Thread t,
Throwable e)
This is an overriding method. |
protected String |
userDebug(String string)
Create a message string informing the user that an error has occurred, and instructing them to contact Customer Service. |
| 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 |
| Field Detail |
|---|
private final Set<Thread> adopted
protected boolean busyState
protected final Queue<AppiusDatagram> futureDatagrams
protected long idleWarned
protected boolean keepRunning
private String language_dialect
protected long lastInputTime
protected boolean loggedIn
protected final int maxInputSize
protected User myUser
protected int preloginCountdown
protected transient String randomKey
protected float streamProtocolLanguage
protected long tLastNudge
protected Zone zone
| Constructor Detail |
|---|
protected ServerThread(int maxSize)
WebSocketProcessor to be
happy.
maxSize - the maximum input buffer sizepublic ServerThread(Socket newSocket)
newSocket - The socket connected to the clientpublic ServerThread(String string)
string - thread name| Method Detail |
|---|
public void adopt(Thread t)
t - a thread to be adopted
protected void areYouThere()
throws UserDeadException
UserDeadException - if the user is disconnectedpublic void close()
public void commandJSON(String cmd,
org.json.JSONObject jso,
Class<?> klass)
cmd - The command to be processedjso - The JSON data object to be passed into the relevant
commandklass - The dispatcher class responsible for handling this
commandpublic void disconnectDuplicate()
protected void doNudge(long t)
throws UserDeadException
t - the current time
UserDeadException - if they are, in fact, deadprotected String doProcessing(String theInput)
doProcessing in class NetIOThreadtheInput - to be processed
public void doRealClose()
public void end()
public void enterZone(String zoneName)
zoneName - the name of the Zonepublic void enterZone(Zone whichZone)
whichZone - The zone being enteredpublic boolean equals(Object other)
NetIOThread
equals in class NetIOThreadNetIOThread.equals(java.lang.Object)public void failLogin()
protected void finalize()
throws Throwable
finalize in class ObjectThrowableObject.finalize()protected void genRandomKey(double mode)
Generate a new random key:
If mode is 0, avoid characters that won't work with Smart Fox Server clients;
If mode is Double.POSITIVE_INFINITY, don't worry about it
mode - the random key generation modepublic String getApple(String pass)
pass - The plaintext password to be used
@Deprecated public String getIpAddress()
getIPAddress()
public String getIPAddress()
public String getLanguage()
LocalisedThread.getLanguage()public String getRandomKey()
public String getRandomKey(double mode)
mode - the random mode for genRandomKey(double)
@Deprecated public double getSFSVersion()
getStreamProtocolLanguage()
public double getStreamProtocolLanguage()
protected Socket getStreamsReady()
throws UserDeadException,
IOException
UserDeadException - WRITEME
IOException - WRITEMEpublic GeneralUser getUser()
public Zone getZone()
protected String grabInput()
throws UserDeadException
UserDeadException - if the user disconnectspublic int hashCode()
hashCode in class NetIOThreadObject.hashCode()public boolean isLoggedIn()
protected void kickDuplicates(User user,
String nick)
user - The user logging in (whose duplicates should be
disconnected)nick - The user's nickname (login name)
@Deprecated
protected void kickDuplicates(User user,
String nick,
String password)
kickDuplicates(User, String)
user - The user logging in (whose duplicates should be
disconnected)nick - The user's nickname (login name)password - The user's password (ignored)
public boolean logIn(Zone z,
String bigNick,
String password)
z - 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 )
protected boolean logIn_checkPassword(User user,
String password,
Zone z)
user - the user attempting to log inpassword - the seeded SHA-1 hash of the passwordz - the zone into which the user is attempting to log in
protected boolean logIn_checkUserAllowed(AbstractUser user)
user - the user in question
protected boolean logIn_loadTest_autoCreateFakeUser(String nick)
nick - the new user's nickname
public void logout()
public void migrate(String hostName,
int portNumber,
String zoneName)
hostName - The alternate server's public host name or IP
address stringportNumber - The listening port on the alternate serverzoneName - The zone name to which the user should connect
protected void postLogIn(Zone z,
String password,
AbstractUser user)
z - zonepassword - user's (encrypted) password sequenceuser - user
private void primeConnection()
throws UserDeadException
UserDeadException - WRITEMEprotected String processInput_Infinity(String theInput)
NetIOThread
processInput_Infinity in class NetIOThreadtheInput - an input string from the client
handler for Infinity protocolprotected String processInput_SmartFoxServer(String theInput)
theInput - the input string from the client
handler for Smart Fox Server
compatibility protocolprotected String processJSONInput(String theInput)
theInput - The JSON string containing the command and data
protected String processJSONPreLogin(String theInput)
theInput - The input string, which must contain a
properly-formatted JSON command sequence
protected String processPreLogin(String theInput)
throws UserDeadException
theInput - the prelogin input sequence
UserDeadException - if the user disconnectsprotected String processXMLInput(String theInput)
theInput - The input stream, expected to be in Smart Fox
Server Pro XML format
public void run()
run in interface Runnablerun in class ThreadThread.run()
private boolean send$EdenLogin(org.json.JSONObject result)
throws org.json.JSONException
result - WRITEME
org.json.JSONException - WRITEME
public void sendAdminDisconnect(String message,
String title,
String label,
String disconnectCause)
message - User-visible message explaining the disconnectiontitle - Title to display in message boxlabel - Label to display in corner of message boxdisconnectCause - Cause code to return to client application
giving general cause for disconnection; e.g. "kick" or
"ban" usually
public void sendAdminMessage(String message,
boolean remote)
throws UserDeadException
message - administrative message to sendremote - if true, this is being written to another user
UserDeadException - if the user has been disconnectedsendAdminMessage(String, String, String, boolean)
public void sendAdminMessage(String message,
String title,
String hatLabel,
boolean remote)
throws UserDeadException
message - The actual message texttitle - The title, which displays in the same font above the
message, but does not scrollhatLabel - A short label which identifies the general source
of the message, for dialog box decorationremote - Whether to send this message remotely (true =
deferred delivery) or immediately (false)
UserDeadException - if the user isn't there to receive the
message
public void sendBadPassword(Zone failZone,
User user,
String password)
Send the user a notification that their password was incorrect.
Note that the user will actually just get a logKO, we don't give them any further information — this routine sends some more logging information, though.
failZone - The failed zoneuser - The user attempting to log inpassword - The attempted password
@Deprecated
protected void sendDeferredDatagrams()
throws UserDeadException
sendFutureDatagrams()
UserDeadException - if the user has disconnected
public void sendErrorReply(String source,
String error,
org.json.JSONObject result,
User u,
int room)
throws org.json.JSONException,
UserDeadException
send an error packet to the other party.
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 - if the packet can't be created
UserDeadException - if the user is not thereprotected boolean sendFutureDatagrams()
public void sendGameActionMessage(AbstractUser sender,
org.json.JSONObject data)
throws org.json.JSONException,
UserDeadException
sender - The user sending the game actiondata - Arbitrary data associated with the game action
org.json.JSONException - if the data can't be represented as JSON
UserDeadException - if the user has been disconnected
protected void sendLoginPacket(String zoneName,
String nick,
String password)
zoneName - The name of the zone into which the user has
logged innick - The user's nicknamepassword - The user's password (SHA1 encoded with the local
random key)protected void sendLogKO()
protected void sendLogKO(String messageText)
messageText - The user-visible message given to the userprotected boolean sendNextFutureDatagram()
public void sendNoSuchUser(String nick,
String zoneName,
String password)
nick - the user nickname (login name) attemptedzoneName - the zone into which they attempted to log inpassword - the password attempted
public void sendPrivateMessage(AbstractUser from,
String message)
throws UserDeadException
from - The user sending the messagemessage - The message being whispered
UserDeadException - if the user has been disconnected
public void sendPublicMessage(AbstractUser from,
String message)
throws UserDeadException
from - sender of the message (speaker)message - The public message
UserDeadException - if the user has been disconnected
@Deprecated
public void sendRawMessage(String reply,
boolean remote)
throws UserDeadException
sendRawMessageLater(String) or
NetIOThread.sendRawMessageNow(String)
reply - The string to be transmitted to this thread's userremote - True, if being written to another user (if being
written as a deferred future datagram)
UserDeadException - if the user has been disconnected
protected void sendRawMessageLater(String reply)
throws UserDeadException
NetIOThread
sendRawMessageLater in class NetIOThreadreply - The message to be sent in future
UserDeadException - if the user is already goneNetIOThread.sendRawMessageLater(java.lang.String)
public void sendResponse(org.json.JSONObject result)
throws UserDeadException
sendResponse in interface CanProcessCommandssendResponse in class NetIOThreadresult - a JSON-encoded response
UserDeadException - if the user disconnectssendResponse(JSONObject, int, boolean),
CanProcessCommands.sendResponse(org.json.JSONObject)
@Deprecated
public void sendResponse(org.json.JSONObject result,
int room,
AbstractUser u)
throws UserDeadException
sendResponse(JSONObject, int, boolean)
result - result setroom - room of eventu - user to notify
UserDeadException - if the user is detected to have been
disconnected
public void sendResponse(org.json.JSONObject result,
int room,
boolean remote)
throws UserDeadException
result - the JSON object to be returned to the other partyroom - The room number from which the response is being
sent.remote - Whether to send the message as a remote (deferred
future datagram) message
UserDeadException - if the user has been disconnected
public void sendResponse(org.json.JSONObject result,
Integer room)
throws UserDeadException
result - the JSON result object to be sent (“extension
response”)room - The room in which the event occurred.
UserDeadException - if the user has disconnectedsendResponse(JSONObject, int, boolean)
@Deprecated
public void sendResponse(org.json.JSONObject result,
Integer room,
AbstractUser u)
throws UserDeadException
sendResponse(JSONObject,int,boolean)
directly with the room ID and the “remote” boolean
flag probably as “true”
result - the JSON result object to be sent (“extension
response”)room - The room in which the event occurred.u - The user to whom the message is being sent
UserDeadException - if the user has disconnected
@Deprecated
public void sendResponseRemote(org.json.JSONObject result,
Integer room,
AbstractUser u)
throws UserDeadException
sendResponse(JSONObject, Integer)
result - the JSON object to send to the clientroom - the room number in which the event occurredu - ignored…
UserDeadException - if the user has already disconnected
public void sendRoomEnteredByUser(Room room,
AbstractUser user)
throws UserDeadException
room - the room that has been joined by an useruser - the user joining the room
UserDeadException - if the user has been disconnected
public void sendRoomList()
throws UserDeadException
UserDeadException - if the user has been disconnected
public void sendRoomList(AbstractZone forZone,
boolean remote)
throws UserDeadException
forZone - The zone for which the user will receive a room
listremote - If true, writing to a remote user
UserDeadException - if the user has been disconnected
public void sendRoomPartedBy(Room room,
AbstractUser user)
throws UserDeadException
room - The room from which someone has departeduser - The user who has departed from the room
UserDeadException - if the user has been disconnected
public void sendRoomUserCount(Room room)
throws UserDeadException
room - The room whose user count is being updated
UserDeadException - if the user has been disconnected
public void sendRoomVar(int roomNum,
String varName,
String varValue)
throws UserDeadException
roomNum - The room number for which the variable is being
setvarName - The name of the room variablevarValue - The new value of the variable
UserDeadException - if the user has been disconnected
public void sendSuccessReply(String source,
org.json.JSONObject resultIn,
AbstractUser u,
int room)
throws org.json.JSONException
source - the method returning successresultIn - additional information to be returned to the
clientu - the user responsible for the successful reply (ignored)room - the room in which the user is standing (ignored)
org.json.JSONException - if the success reply can't be encoded in
JSON form
public void sendUserJoin(Room room)
throws UserDeadException
room - the room joined
UserDeadException - if the user has disconnected
@Deprecated
public void sendUserPart(AbstractUser user,
Room room)
throws UserDeadException
sendRoomPartedBy(Room, AbstractUser)
user - The user departing from the roomroom - The room from which the user has departed
UserDeadException - if the user has been disconnected
public void sendUserVariable(AbstractUser user,
String varName,
String varValue)
throws UserDeadException
user - The user whose variable has been updatedvarName - The name of the user variablevarValue - The new value of the user variable
UserDeadException - if the user has been disconnectedpublic void setBusyState(boolean b)
setBusyState in interface CanProcessCommandsb - true, if the thread is in a busy state and should not be
interrupted for idle timeoutpublic void setLanguage(String new_language_dialect)
new_language_dialect - the language and dialect to be used
for internationalisation and localisationpublic void setLastInputTime(long thatTime)
setLastInputTime in interface CanProcessCommandsthatTime - the time of last input from the clientpublic void setLoggedIn(boolean amILoggedInNow)
amILoggedInNow - True, if the thread represents a logged-in
userpublic void setParallelMode(boolean newParallelMode)
newParallelMode - the parallelMode to setpublic void setSFSVersion(float smartFoxServerCommProtocolVersion)
smartFoxServerCommProtocolVersion - The protocol version to
be used. This version of the server supports Smart Fox
Server Pro version 1.58, or Cubist JSON form using the
value Double.POSITIVE_INFINITY
private void setSocketOptionsFromConfig(Socket sock)
throws SocketException
sock - WRITEME
SocketException - WRITEME
protected void setup()
throws IOException,
UserDeadException
IOException - if the I/O streams can't be initialised
UserDeadException - if the user disconnects before setup is
completeprotected String sha1hexify(String seed)
seed - a string to be hashed
protected String tattlePrefix()
NetIOThread
tattlePrefix in class NetIOThreadNetIOThread.tattlePrefix()
public void tick(long t,
long dT)
throws UserDeadException
tick in interface AcceptsMetronomeTickst - The value of System.currentTimeMillis at the start of
this tickdT - The delta-T since the prior tick
UserDeadException - if the user has been disconnected
protected boolean tick_checkIdleKick(long tIdle)
throws UserDeadException
tIdle - Time that the user has been idle (milliseconds)
UserDeadException - if the user is disconnected
protected boolean tick_checkIdleWarnTime(long tIdle)
throws UserDeadException
tIdle - The time that this connection or user has been idle
UserDeadException - if the user went awayprotected void toInfinityAndBeyond()
toInfinityAndBeyond in class NetIOThreadpublic String toString()
toString in class ThreadThread.toString()
public void uncaughtException(Thread t,
Throwable e)
uncaughtException in interface Thread.UncaughtExceptionHandlerThread.UncaughtExceptionHandler.uncaughtException(java.lang.Thread,
java.lang.Throwable)protected String userDebug(String string)
string - The debugging code to append to the message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||