com.planet_ink.coffee_mud.Common
Class DefaultSession

java.lang.Object
  extended by java.lang.Thread
      extended by com.planet_ink.coffee_mud.Common.DefaultSession
All Implemented Interfaces:
CMCommon, Session, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>, java.lang.Runnable

public class DefaultSession
extends java.lang.Thread
implements Session


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean afkFlag
           
protected  java.lang.String afkMessage
           
protected  java.lang.String[] clookup
           
protected  java.lang.StringBuffer curPrevMsg
           
protected  java.io.BufferedReader in
           
protected  java.lang.StringBuffer input
           
protected  boolean killFlag
           
protected  java.lang.String lastColorStr
           
protected  java.lang.String lastStr
           
protected  boolean lastWasCR
           
protected  boolean lastWasLF
           
protected  MOB mob
           
protected  boolean needPrompt
           
protected  java.io.PrintWriter out
           
protected  java.util.Vector previousCmd
           
protected  java.util.Vector prevMsgs
           
protected  java.io.OutputStream rawout
           
protected static int sessionCounter
           
protected  java.util.Vector snoops
           
protected  int snoopSuspensionStack
           
protected  java.net.Socket sock
           
protected static int SOTIMEOUT
           
protected  int spamStack
           
protected  int status
           
protected  boolean suspendCommandLine
           
protected  int terminalHeight
           
protected  java.lang.String terminalType
           
protected  int terminalWidth
           
protected  boolean waiting
           
protected  long writeStartTime
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Session
MAX_PREVMSGS, STATUS_LOGIN, STATUS_LOGIN1, STATUS_LOGIN2, STATUS_LOGOUT, STATUS_LOGOUT1, STATUS_LOGOUT10, STATUS_LOGOUT11, STATUS_LOGOUT12, STATUS_LOGOUT2, STATUS_LOGOUT3, STATUS_LOGOUT4, STATUS_LOGOUT5, STATUS_LOGOUT6, STATUS_LOGOUT7, STATUS_LOGOUT8, STATUS_LOGOUT9, STATUS_LOGOUTFINAL, STATUS_OK, STATUS_STR, TELNET_ANSI, TELNET_AYT, TELNET_BINARY, TELNET_COMPRESS, TELNET_COMPRESS2, TELNET_DESCS, TELNET_DO, TELNET_DONT, TELNET_EC, TELNET_ECHO, TELNET_IAC, TELNET_LINEMODE, TELNET_LINEMODE_MODE, TELNET_LINEMODE_MODEMASK_ACK, TELNET_LINEMODE_MODEMASK_EDIT, TELNET_LINEMODE_MODEMASK_TRAPSIG, TELNET_LINEMODE_SLC, TELNET_LINEMODE_SLC_ACK, TELNET_LINEMODE_SLC_AO, TELNET_LINEMODE_SLC_AYT, TELNET_LINEMODE_SLC_BRK, TELNET_LINEMODE_SLC_CANTCHANGE, TELNET_LINEMODE_SLC_DEFAULT, TELNET_LINEMODE_SLC_EOF, TELNET_LINEMODE_SLC_EOR, TELNET_LINEMODE_SLC_IP, TELNET_LINEMODE_SLC_NOSUPPORT, TELNET_LINEMODE_SLC_SUSP, TELNET_LINEMODE_SLC_VALUE, TELNET_LINEMODE_SLC_XOFF, TELNET_LINEMODE_SLC_XON, TELNET_MSP, TELNET_MXP, TELNET_NAWS, TELNET_SB, TELNET_SE, TELNET_SUPRESS_GO_AHEAD, TELNET_TERMTYPE, TELNET_TOGGLE_FLOW_CONTROL, TELNET_WILL, TELNET_WONT
 
Constructor Summary
DefaultSession()
           
 
Method Summary
 boolean afkFlag()
          Returns whether this mob/session is currently Away From Keyboard
 java.lang.String afkMessage()
          Returns the reason given by the user that they are AFK.
 boolean amBeingSnoopedBy(Session S)
          Checks to see if the given session is snooping on this one.
 java.lang.String blockingIn()
          Blocks the current thread until the user attached to this session hits ENTER, returning the characters they enter.
 java.lang.String blockingIn(long maxTime)
           
 void changeTelnetMode(int telnetCode, boolean onOff)
          Change telnet mode by sending the appropriate command to the clients client.
 void changeTelnetModeBackwards(int telnetCode, boolean onOff)
           
 void changeTelnetModeBackwards(java.io.OutputStream out, int telnetCode, boolean onOff)
           
 java.lang.String choose(java.lang.String Message, java.lang.String Choices, java.lang.String Default)
          Prompts the user to enter one character responses from a set of valid choices.
 java.lang.String choose(java.lang.String Message, java.lang.String Choices, java.lang.String Default, long maxTime)
          Prompts the user to enter one character responses from a set of valid choices.
 boolean clientTelnetMode(int telnetCode)
          Gets a client telnet mode flag.
 java.lang.String[] clookup()
          Returns a list of telnet coded strings indexed by coffeemud color code.
protected  void closeSocks()
           
 void cmdExit(MOB mob, java.util.Vector commands)
          Queries and executes the quit command for the mob.
 void colorOnlyPrint(java.lang.String msg)
          Lower-Medium-level text output method.
 void colorOnlyPrint(java.lang.String msg, int pageBreak, boolean noCache)
          Lower-Medium-level text output method.
 void colorOnlyPrintln(java.lang.String msg)
          Lower-Medium-level text output method.
 void colorOnlyPrintln(java.lang.String msg, int pageBreak, boolean noCache)
          Lower-Medium-level text output method.
 int compareTo(CMObject o)
           
 boolean confirm(java.lang.String Message, java.lang.String Default)
          Prompts the user to enter Y or N, and returns what they enter.
 boolean confirm(java.lang.String Message, java.lang.String Default, long maxTime)
          Prompts the user to enter Y or N, and returns what they enter.
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 int currentColor()
          Returns the current color code.
protected  void errorOut(java.lang.Exception t)
           
 java.lang.String getAddress()
          Gets the current telnet clients ip address.
 int getColor(char c)
          Returns the given color code, unless it is one that translates to another, such as ?
 long getIdleMillis()
          Gets the number of milliseconds since a user entry was registered by this session
 java.util.Vector getLastMsgs()
          Returns a Vector of the last several message strings received by this user.
 long getLastNPCFight()
          Gets the milliseconds timestamp since this user last registered a npc fight.
 long getLastPKFight()
          Gets the milliseconds timestamp since this user last registered a pk fight.
 long getMillisOnline()
          Gets the milliseconds elapsed since this user came online.
 int getStatus()
          Gets the tick/thread status of this session object.
 java.lang.String getTerminalType()
          Gets the terminal type the user has
 long getTotalMillis()
          Gets the total milliseconds consumed by this session objects thread.
 long getTotalTicks()
          Gets the total number of ticks consumed by this session object thread.
 int getWrap()
          Gets the column number for engine word-wrapping.
 long getWriteStartTime()
           
 void handleEscape()
           
 void handleIAC()
           
 void handleSubOption(int optionCode, char[] suboptionData, int dataSize)
           
 char hotkey(long maxWait)
          Waits the given milliseconds for a key to be pressed, after which it returns that key, or \0 if nothing pressed.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 void initializeSession(java.net.Socket s, java.lang.String introTextStr)
          Negotiates various telnet options (or attempts to), and prints the introTextStr to the user.
 void initTelnetMode(int mobbitmap)
          Initializes a telnet mode between this session and the connected client by negotiating certain fundamental flags, like ANSI, MXP, and MSP.
 boolean isLockedUpWriting()
          Checks whether this session is currently over its time limit trying to write data to its socket.
 boolean killFlag()
          Returns whether this session is done, or slated to be done.
 int lastColor()
          Returns the previous current color code.
 long lastLoopTime()
          Returns the last time in milliseconds that this session began its input loop.
 void logoff(boolean removeMOB, boolean dropSession, boolean killThread)
          Force the current player to logoff.
 java.lang.String makeEscape(int c)
          Converts a character after the ^ sign (usually a color code) into an appropriate telnet escape sequence string for output.
 MOB mob()
          Returns the player MOB attached to this session object.
 void negotiateTelnetMode(int telnetCode)
          Change telnet mode by negotiating the command to the clients client.
 CMObject newInstance()
          Returns a new instance of this class.
 int nonBlockingIn(boolean appendInputFlag)
           
 void onlyPrint(java.lang.String msg)
          Low level text output method.
 void onlyPrint(java.lang.String msg, int pageBreak, boolean noCache)
          Low level text output method.
 void out(char c)
           
 void out(char[] c)
          Lowest level user-output method.
 void out(java.lang.String c)
           
 java.util.Vector previousCMD()
          Returns a pre-parsed, pre-filtered Vector of strings representing the last command entered by the user through this session.
 void print(Environmental src, Environmental trg, Environmental tol, java.lang.String msg)
          Medium-level text output method.
 void print(java.lang.String msg)
          Medium-level text output method.
 void println(Environmental src, Environmental trg, Environmental tol, java.lang.String msg)
          Medium-level text output method.
 void println(java.lang.String msg)
          Medium-level text output method.
 java.lang.String prompt(java.lang.String Message)
          Prompts the user to enter a string, and then returns what the enter.
 java.lang.String prompt(java.lang.String Message, long maxTime)
          Prompts the user to enter a string, and then returns what the enter.
 java.lang.String prompt(java.lang.String Message, java.lang.String Default)
          Prompts the user to enter a string, and then returns what the enter.
 java.lang.String prompt(java.lang.String Message, java.lang.String Default, long maxTime)
          Prompts the user to enter a string, and then returns what the enter.
 void rawOut(java.lang.String msg)
          Lowest level user-output method.
 void rawPrint(java.lang.String msg)
          Low level line-output method.
 void rawPrint(java.lang.String msg, int pageBreak)
          Low level line-output method.
 void rawPrintln(java.lang.String msg)
          Low level line-output method.
 void rawPrintln(java.lang.String msg, int pageBreak)
          Low level line-output method.
 int read()
           
 java.lang.String readlineContinue()
          Blocks for a short amount of time, returning an input string only if the user happens to have hit enter.
 void run()
           
 boolean serverTelnetMode(int telnetCode)
          Gets a server telnet mode flag.
 void setAfkFlag(boolean truefalse)
          Sets whether this mob/session is currently Away From Keyboard
 void setAFKMessage(java.lang.String str)
          Returns the reason given by the user that they are AFK.
 void setClientTelnetMode(int telnetCode, boolean onOff)
          Sets a client telnet mode flag.
 void setKillFlag(boolean truefalse)
           
 void setLastNPCFight()
          Sets now as the milliseconds timestamp since this user last registered a npc fight.
 void setLastPKFight()
          Sets now as the milliseconds timestamp since this user last registered a pk fight.
 void setMob(MOB newmob)
          Sets the player MOB attached to this session object.
 void setPreviousCmd(java.util.Vector cmds)
           
 void setPromptFlag(boolean truefalse)
          Notifies this session to output the users prompt again once it has reached a suitable lapse in text output.
 void setServerTelnetMode(int telnetCode, boolean onOff)
          Sets a server telnet mode flag.
 void showPrompt()
           
 int snoopSuspension(int change)
          Increments or decrements the snoop suspension counter by the given amount.
 void startBeingSnoopedBy(Session S)
          Notifies this session that the given session is snooping it.
 void stdPrint(Environmental src, Environmental trg, Environmental tol, java.lang.String msg)
          Higher-level line output method.
 void stdPrint(java.lang.String msg)
          Higher-level line output method.
 void stdPrintln(Environmental src, Environmental trg, Environmental tol, java.lang.String msg)
          Higher-level line output method.
 void stdPrintln(java.lang.String msg)
          Higher-level line output method.
 void stopBeingSnoopedBy(Session S)
          Notifies this session that the given session is no longer snooping it.
 void wraplessPrint(java.lang.String msg)
          Medium-level text output method.
 void wraplessPrintln(java.lang.String msg)
          Medium-level text output method.
 
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, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Session
start
 

Field Detail

status

protected int status

snoopSuspensionStack

protected int snoopSuspensionStack

sock

protected java.net.Socket sock

in

protected java.io.BufferedReader in

out

protected java.io.PrintWriter out

rawout

protected java.io.OutputStream rawout

mob

protected MOB mob

killFlag

protected boolean killFlag

needPrompt

protected boolean needPrompt

afkFlag

protected boolean afkFlag

afkMessage

protected java.lang.String afkMessage

input

protected java.lang.StringBuffer input

waiting

protected boolean waiting

SOTIMEOUT

protected static final int SOTIMEOUT
See Also:
Constant Field Values

previousCmd

protected java.util.Vector previousCmd

clookup

protected java.lang.String[] clookup

lastColorStr

protected java.lang.String lastColorStr

lastStr

protected java.lang.String lastStr

spamStack

protected int spamStack

snoops

protected java.util.Vector snoops

prevMsgs

protected java.util.Vector prevMsgs

curPrevMsg

protected java.lang.StringBuffer curPrevMsg

lastWasCR

protected boolean lastWasCR

lastWasLF

protected boolean lastWasLF

suspendCommandLine

protected boolean suspendCommandLine

terminalType

protected java.lang.String terminalType

terminalWidth

protected int terminalWidth

terminalHeight

protected int terminalHeight

writeStartTime

protected long writeStartTime

sessionCounter

protected static int sessionCounter
Constructor Detail

DefaultSession

public DefaultSession()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, MiscTech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

initializeSession

public void initializeSession(java.net.Socket s,
                              java.lang.String introTextStr)
Description copied from interface: Session
Negotiates various telnet options (or attempts to), and prints the introTextStr to the user.

Specified by:
initializeSession in interface Session
Parameters:
s - the socket the user connected from
introTextStr - introductory text string (Hello!)

setServerTelnetMode

public void setServerTelnetMode(int telnetCode,
                                boolean onOff)
Description copied from interface: Session
Sets a server telnet mode flag.

Specified by:
setServerTelnetMode in interface Session
Parameters:
telnetCode - the telnet code
onOff - true to turn on, false to turn off the flag
See Also:
Session.TELNET_ANSI, Session.serverTelnetMode(int)

serverTelnetMode

public boolean serverTelnetMode(int telnetCode)
Description copied from interface: Session
Gets a server telnet mode flag.

Specified by:
serverTelnetMode in interface Session
Parameters:
telnetCode - the telnet code
Returns:
true, if server telnet mode is on, false otherwise
See Also:
Session.TELNET_ANSI, Session.setServerTelnetMode(int, boolean)

setClientTelnetMode

public void setClientTelnetMode(int telnetCode,
                                boolean onOff)
Description copied from interface: Session
Sets a client telnet mode flag.

Specified by:
setClientTelnetMode in interface Session
Parameters:
telnetCode - the telnet code
onOff - true to turn on, false to turn off the flag
See Also:
Session.TELNET_ANSI, Session.clientTelnetMode(int)

clientTelnetMode

public boolean clientTelnetMode(int telnetCode)
Description copied from interface: Session
Gets a client telnet mode flag.

Specified by:
clientTelnetMode in interface Session
Parameters:
telnetCode - the telnet code
Returns:
true, if client telnet mode is on, false otherwise
See Also:
Session.TELNET_ANSI, Session.setClientTelnetMode(int, boolean)

changeTelnetMode

public void changeTelnetMode(int telnetCode,
                             boolean onOff)
Description copied from interface: Session
Change telnet mode by sending the appropriate command to the clients client. A response received later will trigger mode changed.

Specified by:
changeTelnetMode in interface Session
Parameters:
telnetCode - the telnet code
onOff - true to turn on, false to turn off the flag
See Also:
Session.TELNET_ANSI, Session.setClientTelnetMode(int, boolean), Session.setServerTelnetMode(int, boolean)

changeTelnetModeBackwards

public void changeTelnetModeBackwards(int telnetCode,
                                      boolean onOff)

changeTelnetModeBackwards

public void changeTelnetModeBackwards(java.io.OutputStream out,
                                      int telnetCode,
                                      boolean onOff)
                               throws java.io.IOException
Throws:
java.io.IOException

negotiateTelnetMode

public void negotiateTelnetMode(int telnetCode)
Description copied from interface: Session
Change telnet mode by negotiating the command to the clients client.

Specified by:
negotiateTelnetMode in interface Session
Parameters:
telnetCode - the telnet code
See Also:
Session.TELNET_ANSI, Session.setClientTelnetMode(int, boolean), Session.setServerTelnetMode(int, boolean)

initTelnetMode

public void initTelnetMode(int mobbitmap)
Description copied from interface: Session
Initializes a telnet mode between this session and the connected client by negotiating certain fundamental flags, like ANSI, MXP, and MSP. It will use a bitmap of MOB flags passed in as a guide.

Specified by:
initTelnetMode in interface Session
Parameters:
mobbitmap - the mobbitmap the bitmap of mob flags to use as a guide in negotiation
See Also:
MOB.getBitmap(), MOB.ATT_MXP, Session.changeTelnetMode(int, boolean)

currentColor

public int currentColor()
Description copied from interface: Session
Returns the current color code.

Specified by:
currentColor in interface Session
Returns:
the current color code.
See Also:
Session.getColor(char), Session.makeEscape(int), Session.lastColor()

lastColor

public int lastColor()
Description copied from interface: Session
Returns the previous current color code.

Specified by:
lastColor in interface Session
Returns:
the previous current color code.
See Also:
Session.getColor(char), Session.currentColor(), Session.makeEscape(int)

getTotalMillis

public long getTotalMillis()
Description copied from interface: Session
Gets the total milliseconds consumed by this session objects thread.

Specified by:
getTotalMillis in interface Session
Returns:
the total milliseconds consumed

getIdleMillis

public long getIdleMillis()
Description copied from interface: Session
Gets the number of milliseconds since a user entry was registered by this session

Specified by:
getIdleMillis in interface Session
Returns:
the idle milliseconds passed

getTotalTicks

public long getTotalTicks()
Description copied from interface: Session
Gets the total number of ticks consumed by this session object thread.

Specified by:
getTotalTicks in interface Session
Returns:
the total ticks consumed

getMillisOnline

public long getMillisOnline()
Description copied from interface: Session
Gets the milliseconds elapsed since this user came online.

Specified by:
getMillisOnline in interface Session
Returns:
the milliseconds online

lastLoopTime

public long lastLoopTime()
Description copied from interface: Session
Returns the last time in milliseconds that this session began its input loop. Is typically only held up by executing a user command, so it is an accurate gauge of a locked up user command.

Specified by:
lastLoopTime in interface Session
Returns:
the last time in milliseconds that this session began its input loop

getLastPKFight

public long getLastPKFight()
Description copied from interface: Session
Gets the milliseconds timestamp since this user last registered a pk fight.

Specified by:
getLastPKFight in interface Session
Returns:
the last pk fight timestamp
See Also:
Session.setLastPKFight(), Session.setLastNPCFight()

setLastPKFight

public void setLastPKFight()
Description copied from interface: Session
Sets now as the milliseconds timestamp since this user last registered a pk fight.

Specified by:
setLastPKFight in interface Session
See Also:
Session.getLastPKFight(), Session.getLastNPCFight()

getLastNPCFight

public long getLastNPCFight()
Description copied from interface: Session
Gets the milliseconds timestamp since this user last registered a npc fight.

Specified by:
getLastNPCFight in interface Session
Returns:
the last npc fight timestamp
See Also:
Session.setLastPKFight(), Session.setLastNPCFight()

setLastNPCFight

public void setLastNPCFight()
Description copied from interface: Session
Sets now as the milliseconds timestamp since this user last registered a npc fight.

Specified by:
setLastNPCFight in interface Session
See Also:
Session.getLastPKFight(), Session.getLastNPCFight()

getLastMsgs

public java.util.Vector getLastMsgs()
Description copied from interface: Session
Returns a Vector of the last several message strings received by this user. All are already previously filtered and parsed and ready to display.

Specified by:
getLastMsgs in interface Session
Returns:
a vector of string message strings

getTerminalType

public java.lang.String getTerminalType()
Description copied from interface: Session
Gets the terminal type the user has

Specified by:
getTerminalType in interface Session
Returns:
the terminal type

mob

public MOB mob()
Description copied from interface: Session
Returns the player MOB attached to this session object.

Specified by:
mob in interface Session
Returns:
the player MOB attached to this session object.
See Also:
Session.setMob(MOB)

setMob

public void setMob(MOB newmob)
Description copied from interface: Session
Sets the player MOB attached to this session object.

Specified by:
setMob in interface Session
Parameters:
newmob - the player MOB attached to this session object.
See Also:
Session.mob()

getWrap

public int getWrap()
Description copied from interface: Session
Gets the column number for engine word-wrapping. 0 Means disabled.

Specified by:
getWrap in interface Session
Returns:
the wrap column

killFlag

public boolean killFlag()
Description copied from interface: Session
Returns whether this session is done, or slated to be done.

Specified by:
killFlag in interface Session
Returns:
true if this session needs to go, false otherwise
See Also:
Session.logoff(boolean, boolean, boolean), Session.cmdExit(MOB, Vector), Session.killFlag()

setKillFlag

public void setKillFlag(boolean truefalse)

previousCMD

public java.util.Vector previousCMD()
Description copied from interface: Session
Returns a pre-parsed, pre-filtered Vector of strings representing the last command entered by the user through this session.

Specified by:
previousCMD in interface Session
Returns:
a vector of strings

startBeingSnoopedBy

public void startBeingSnoopedBy(Session S)
Description copied from interface: Session
Notifies this session that the given session is snooping it. This session will manage said snooping.

Specified by:
startBeingSnoopedBy in interface Session
Parameters:
S - the session to snoop on me.
See Also:
Session.startBeingSnoopedBy(Session), Session.stopBeingSnoopedBy(Session), Session.amBeingSnoopedBy(Session), Session.snoopSuspension(int)

stopBeingSnoopedBy

public void stopBeingSnoopedBy(Session S)
Description copied from interface: Session
Notifies this session that the given session is no longer snooping it. This session will remove said snooping.

Specified by:
stopBeingSnoopedBy in interface Session
Parameters:
S - the session to stop snooping on me.
See Also:
Session.startBeingSnoopedBy(Session), Session.stopBeingSnoopedBy(Session), Session.amBeingSnoopedBy(Session), Session.snoopSuspension(int)

amBeingSnoopedBy

public boolean amBeingSnoopedBy(Session S)
Description copied from interface: Session
Checks to see if the given session is snooping on this one.

Specified by:
amBeingSnoopedBy in interface Session
Parameters:
S - the session to check for a snoop on me.
Returns:
true if the given session is snooping on me, false otherwise
See Also:
Session.startBeingSnoopedBy(Session), Session.stopBeingSnoopedBy(Session), Session.amBeingSnoopedBy(Session), Session.snoopSuspension(int)

snoopSuspension

public int snoopSuspension(int change)
Description copied from interface: Session
Increments or decrements the snoop suspension counter by the given amount. Only when the counter is 0 does snooping of this session actually occur.

Specified by:
snoopSuspension in interface Session
Parameters:
change - the amount to change the snoop suspension counter by
Returns:
the current value of the snoop suspension counter after the change
See Also:
Session.startBeingSnoopedBy(Session), Session.stopBeingSnoopedBy(Session), Session.amBeingSnoopedBy(Session), Session.snoopSuspension(int)

setPreviousCmd

public void setPreviousCmd(java.util.Vector cmds)

afkFlag

public boolean afkFlag()
Description copied from interface: Session
Returns whether this mob/session is currently Away From Keyboard

Specified by:
afkFlag in interface Session
Returns:
true if they are AFK, false otherwise
See Also:
Session.setAfkFlag(boolean), Session.setAFKMessage(String)

setAfkFlag

public void setAfkFlag(boolean truefalse)
Description copied from interface: Session
Sets whether this mob/session is currently Away From Keyboard

Specified by:
setAfkFlag in interface Session
Parameters:
truefalse - true if they are AFK, false otherwise
See Also:
Session.afkFlag(), Session.afkMessage()

afkMessage

public java.lang.String afkMessage()
Description copied from interface: Session
Returns the reason given by the user that they are AFK.

Specified by:
afkMessage in interface Session
Returns:
the reason given by the user that they are AFK.
See Also:
Session.setAfkFlag(boolean), Session.setAFKMessage(String)

setAFKMessage

public void setAFKMessage(java.lang.String str)
Description copied from interface: Session
Returns the reason given by the user that they are AFK.

Specified by:
setAFKMessage in interface Session
Parameters:
str - the reason given by the user that they are AFK.
See Also:
Session.setAfkFlag(boolean), Session.afkMessage()

errorOut

protected void errorOut(java.lang.Exception t)

getWriteStartTime

public long getWriteStartTime()

isLockedUpWriting

public boolean isLockedUpWriting()
Description copied from interface: Session
Checks whether this session is currently over its time limit trying to write data to its socket. For some reason this happens, and this method detects it.

Specified by:
isLockedUpWriting in int