com.planet_ink.coffee_mud.Common
Class FakeSession

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

public class FakeSession
extends java.lang.Object
implements Session


Field Summary
 
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
FakeSession()
           
 
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.
 void changeTelnetMode(int telnetCode, boolean onOff)
          Change telnet mode by sending the appropriate command to the clients client.
 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.
 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.
 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 getTickStatus()
           
 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.
 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 t1, boolean t2, boolean t3)
          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 code)
          Change telnet mode by negotiating the command to the clients client.
 CMObject newInstance()
          Returns a new instance of this class.
 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)
          Lowest level user-output method.
 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 Source, Environmental Target, Environmental Tool, java.lang.String msg)
          Medium-level text output method.
 void print(java.lang.String msg)
          Medium-level text output method.
 void println(Environmental Source, Environmental Target, Environmental Tool, 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.
 java.lang.String readlineContinue()
          Blocks for a short amount of time, returning an input string only if the user happens to have hit enter.
 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 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 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.
 int snoopSuspension(int x)
          Increments or decrements the snoop suspension counter by the given amount.
 void start()
          There is no interface for Thread, so since DefaultSession implements thread, and this fact needs to be externatized, the thread start method is hereby externalized.
 void startBeingSnoopedBy(Session S)
          Notifies this session that the given session is snooping it.
 void stdPrint(Environmental Source, Environmental Target, Environmental Tool, java.lang.String msg)
          Higher-level line output method.
 void stdPrint(java.lang.String msg)
          Higher-level line output method.
 void stdPrintln(Environmental Source, Environmental Target, Environmental Tool, 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.
 boolean tick(Tickable ticking, int tickID)
           
 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeSession

public FakeSession()
Method Detail

tick

public boolean tick(Tickable ticking,
                    int tickID)

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

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>

getTickStatus

public long getTickStatus()

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!)

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 interface Session
Returns:
true if something bas happened, false otherwise

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

start

public void start()
Description copied from interface: Session
There is no interface for Thread, so since DefaultSession implements thread, and this fact needs to be externatized, the thread start method is hereby externalized. Not required for most sessions, only for those acting as Threads.

Specified by:
start in interface Session

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

negotiateTelnetMode

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

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

clookup

public java.lang.String[] clookup()
Description copied from interface: Session
Returns a list of telnet coded strings indexed by coffeemud color code. May be from the standard list, or read from player records for a customized list.

Specified by:
clookup in interface Session
Returns:
telnet coded color strings.

onlyPrint

public void onlyPrint(java.lang.String msg,
                      int pageBreak,
                      boolean noCache)
Description copied from interface: Session
Low level text output method. Implements such features as snoops, spam-stacking, page breaks, and line caching

Specified by:
onlyPrint in interface Session
Parameters:
msg - the string to send to the user
pageBreak - the number of lines to break on, -1=NO
noCache - true to disable line caching, false otherwise
See Also:
Session.out(char[])

onlyPrint

public void onlyPrint(java.lang.String msg)
Description copied from interface: Session
Low level text output method. Implements such features as snoops, spam-stacking. No page breaking, and Always line caching

Specified by:
onlyPrint in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

rawOut

public void rawOut(java.lang.String msg)
Description copied from interface: Session
Lowest level user-output method. Does nothing but send the string to the user, period.

Specified by:
rawOut in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.out(char[])

rawPrintln

public void rawPrintln(java.lang.String msg)
Description copied from interface: Session
Low level line-output method. Sets the prompt flag after write, and inserts additional pre-linefeed if currently at the prompt. Adds post linefeed of course. Does not do a page break.

Specified by:
rawPrintln in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.rawPrintln(String, int)

rawPrintln

public void rawPrintln(java.lang.String msg,
                       int pageBreak)
Description copied from interface: Session
Low level line-output method. Sets the prompt flag after write, and inserts additional pre-linefeed if currently at the prompt. Adds post linefeed of course. Does a page break of given value.

Specified by:
rawPrintln in interface Session
Parameters:
msg - the string to send to the user
pageBreak - the number of lines to break on, -1=NO
See Also:
Session.rawPrint(String, int)

rawPrint

public void rawPrint(java.lang.String msg)
Description copied from interface: Session
Low level line-output method. Sets the prompt flag after write, and inserts additional pre-linefeed if currently at the prompt.

Specified by:
rawPrint in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.rawPrint(String, int)

rawPrint

public void rawPrint(java.lang.String msg,
                     int pageBreak)
Description copied from interface: Session
Low level line-output method. Sets the prompt flag after write, and inserts additional pre-linefeed if currently at the prompt. Does a page break of given value.

Specified by:
rawPrint in interface Session
Parameters:
msg - the string to send to the user
pageBreak - the number of lines to break on, -1=NO
See Also:
Session.onlyPrint(String, int, boolean)

stdPrint

public void stdPrint(java.lang.String msg)
Description copied from interface: Session
Higher-level line output method. Does full filtering of special characters and codes.

Specified by:
stdPrint in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.rawPrint(String, int)

stdPrint

public void stdPrint(Environmental Source,
                     Environmental Target,
                     Environmental Tool,
                     java.lang.String msg)
Description copied from interface: Session
Higher-level line output method. Does full filtering of special characters and codes using given variable values.

Specified by:
stdPrint in interface Session
Parameters:
Source - variable for special code parsing: Source
Target - variable for special code parsing: Target
Tool - variable for special code parsing: Tool
msg - the string to send to the user
See Also:
Session.rawPrint(String, int)

stdPrintln

public void stdPrintln(java.lang.String msg)
Description copied from interface: Session
Higher-level line output method. Does full filtering of special characters and codes.

Specified by:
stdPrintln in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.rawPrintln(String, int)

stdPrintln

public void stdPrintln(Environmental Source,
                       Environmental Target,
                       Environmental Tool,
                       java.lang.String msg)
Description copied from interface: Session
Higher-level line output method. Does full filtering of special characters and codes using given variable values.

Specified by:
stdPrintln in interface Session
Parameters:
Source - variable for special code parsing: Source
Target - variable for special code parsing: Target
Tool - variable for special code parsing: Tool
msg - the string to send to the user
See Also:
Session.rawPrintln(String, int)

out

public void out(char[] c)
Description copied from interface: Session
Lowest level user-output method. Does nothing but send the string to the user, period.

Specified by:
out in interface Session
Parameters:
c - string (as char array) to send out to the user

print

public void print(java.lang.String msg)
Description copied from interface: Session
Medium-level text output method. Does full filtering of special characters and codes. Does not manage the prompt.

Specified by:
print in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

print

public void print(Environmental Source,
                  Environmental Target,
                  Environmental Tool,
                  java.lang.String msg)
Description copied from interface: Session
Medium-level text output method. Does full filtering of special characters and codes using given variable values. Does not manage the prompt.

Specified by:
print in interface Session
Parameters:
Source - variable for special code parsing: Source
Target - variable for special code parsing: Target
Tool - variable for special code parsing: Tool
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

println

public void println(java.lang.String msg)
Description copied from interface: Session
Medium-level text output method. Does full filtering of special characters and codes. Does not manage the prompt. Adds a linefeed at the end though.

Specified by:
println in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

println

public void println(Environmental Source,
                    Environmental Target,
                    Environmental Tool,
                    java.lang.String msg)
Description copied from interface: Session
Medium-level text output method. Does full filtering of special characters and codes using given variable values. Does not manage the prompt. Adds a linefeed at the end though.

Specified by:
println in interface Session
Parameters:
Source - variable for special code parsing: Source
Target - variable for special code parsing: Target
Tool - variable for special code parsing: Tool
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

wraplessPrintln

public void wraplessPrintln(java.lang.String msg)
Description copied from interface: Session
Medium-level text output method. Does full filtering of special characters and codes. DOES manage the prompt, but turns OFF word wrap! Adds a linefeed at the end.

Specified by:
wraplessPrintln in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

wraplessPrint

public void wraplessPrint(java.lang.String msg)
Description copied from interface: Session
Medium-level text output method. Does full filtering of special characters and codes. DOES manage the prompt, but turns OFF word wrap!

Specified by:
wraplessPrint in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

colorOnlyPrintln

public void colorOnlyPrintln(java.lang.String msg,
                             int pageBreak,
                             boolean noCache)
Description copied from interface: Session
Lower-Medium-level text output method. Does only the parsing of color codes, no word wrapping, no codes. Adds a linefeed at the end.

Specified by:
colorOnlyPrintln in interface Session
Parameters:
msg - the string to send to the user
pageBreak - the number of lines to break on, -1=NO
noCache - true to disable line caching, false otherwise
See Also:
Session.onlyPrint(String, int, boolean)

colorOnlyPrint

public void colorOnlyPrint(java.lang.String msg,
                           int pageBreak,
                           boolean noCache)
Description copied from interface: Session
Lower-Medium-level text output method. Does only the parsing of color codes, no word wrapping, no codes.

Specified by:
colorOnlyPrint in interface Session
Parameters:
msg - the string to send to the user
pageBreak - the number of lines to break on, -1=NO
noCache - true to disable line caching, false otherwise
See Also:
Session.onlyPrint(String, int, boolean)

colorOnlyPrintln

public void colorOnlyPrintln(java.lang.String msg)
Description copied from interface: Session
Lower-Medium-level text output method. Does only the parsing of color codes, no word wrapping, no codes. Adds a linefeed at the end.

Specified by:
colorOnlyPrintln in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

colorOnlyPrint

public void colorOnlyPrint(java.lang.String msg)
Description copied from interface: Session
Lower-Medium-level text output method. Does only the parsing of color codes, no word wrapping, no codes.

Specified by:
colorOnlyPrint in interface Session
Parameters:
msg - the string to send to the user
See Also:
Session.onlyPrint(String, int, boolean)

setPromptFlag

public void setPromptFlag(boolean truefalse)
Description copied from interface: Session
Notifies this session to output the users prompt again once it has reached a suitable lapse in text output.

Specified by:
setPromptFlag in interface Session
Parameters:
truefalse - true to send another prompt, false otherwise

hotkey

public char hotkey(long maxWait)
Description copied from interface: Session
Waits the given milliseconds for a key to be pressed, after which it returns that key, or \0 if nothing pressed.

Specified by:
hotkey in interface Session
Parameters:
maxWait - the maximum milliseconds to wait
Returns:
the key pressed, or \0

prompt

public java.lang.String prompt(java.lang.String Message,
                               java.lang.String Default)
Description copied from interface: Session
Prompts the user to enter a string, and then returns what the enter. Does not time out, but may throw an exception on disconnnect.

Specified by:
prompt in interface Session
Parameters:
Message - the prompt message to display to the user
Default - the default response if the user just hits enter
Returns:
the string entered by the user, or the Default
See Also:
Session.prompt(String), Session.prompt(String, long), Session.prompt(String, String, long)

prompt

public java.lang.String prompt(java.lang.String Message,
                               java.lang.String Default,
                               long maxTime)
Description copied from interface: Session
Prompts the user to enter a string, and then returns what the enter. Possibly times out, and may throw an exception on disconnnect or time out.

Specified by:
prompt in interface Session
Parameters:
Message - the prompt message to display to the user
Default - the default response if the user just hits enter
maxTime - max number of milliseconds to wait before timing out
Returns:
the string entered by the user, or the Default
See Also:
Session.prompt(String), Session.prompt(String, String), Session.prompt(String, long)

prompt

public java.lang.String prompt(java.lang.String Message)
Description copied from interface: Session
Prompts the user to enter a string, and then returns what the enter. Does not time out, but may throw an exception on disconnnect.

Specified by:
prompt in interface Session
Parameters:
Message - the prompt message to display to the user
Returns:
the string entered by the user
See Also:
Session.prompt(String, String), Session.prompt(String, long), Session.prompt(String, String, long)

prompt

public java.lang.String prompt(java.lang.String Message,
                               long maxTime)
Description copied from interface: Session
Prompts the user to enter a string, and then returns what the enter. Possibly times out, and may throw an exception on disconnnect or time out.

Specified by:
prompt in interface Session
Parameters:
Message - the prompt message to display to the user
maxTime - max number of milliseconds to wait before timing out
Returns:
the string entered by the user
See Also:
Session.prompt(String), Session.prompt(String, String), Session.prompt(String, String, long)

confirm

public boolean confirm(java.lang.String Message,
                       java.lang.String Default)
Description copied from interface: Session
Prompts the user to enter Y or N, and returns what they enter. Will not time out, but may throw an exception on disconnect.

Specified by:
confirm in interface Session
Parameters:
Message - the prompt message to display to the user
Default - the default response if the user just hits enter
Returns:
true if they entered Y, false otherwise
See Also:
Session.confirm(String, String, long)

confirm

public boolean confirm(java.lang.String Message,
                       java.lang.String Default,
                       long maxTime)
Description copied from interface: Session
Prompts the user to enter Y or N, and returns what they enter. Possibly times out, and may throw an exception on disconnnect or time out.

Specified by:
confirm in interface Session
Parameters:
Message - the prompt message to display to the user
Default - the default response if the user just hits enter
maxTime - max number of milliseconds to wait before timing out
Returns:
true if they entered Y, false otherwise
See Also:
Session.confirm(String, String)

choose

public java.lang.String choose(java.lang.String Message,
                               java.lang.String Choices,
                               java.lang.String Default)
Description copied from interface: Session
Prompts the user to enter one character responses from a set of valid choices. Repeats the prompt if the user does not enter a valid choice. ENTER is a valid choice for Default. Does not time out, but may throw an exception on disconnnect.

Specified by:
choose in interface Session
Parameters:
Message - the prompt message to display to the user
Choices - a list of uppercase characters that may be entered
Default - the default response if the user just hits enter
Returns:
the character entered from the choices
See Also:
Session.choose(String, String, String, long)

choose

public java.lang.String choose(java.lang.String Message,
                               java.lang.String Choices,
                               java.lang.String Default,
                               long maxTime)
Description copied from interface: Session
Prompts the user to enter one character responses from a set of valid choices. Repeats the prompt if the user does not enter a valid choice. ENTER is a valid choice for Default. May time out, and may throw an exception on disconnnect.

Specified by:
choose in interface Session
Parameters:
Message - the prompt message to display to the user
Choices - a list of uppercase characters that may be entered
Default - the default response if the user just hits enter
maxTime - max number of milliseconds to wait before timing out
Returns:
the character entered from the choices
See Also:
Session.choose(String, String, String)

blockingIn

public java.lang.String blockingIn()
Description copied from interface: Session
Blocks the current thread until the user attached to this session hits ENTER, returning the characters they enter. Completely filtered input.

Specified by:
blockingIn in interface Session
Returns:
the string entered by the user

readlineContinue

public java.lang.String readlineContinue()
Description copied from interface: Session
Blocks for a short amount of time, returning an input string only if the user happens to have hit enter.

Specified by:
readlineContinue in interface Session
Returns:
a string entered by the user

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 x)
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:
x - 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)

cmdExit

public void cmdExit(MOB mob,
                    java.util.Vector commands)
             throws java.lang.Exception
Description copied from interface: Session
Queries and executes the quit command for the mob.

Specified by:
cmdExit in interface Session
Parameters:
mob - the character quitting (sent in case the session went null)
commands - any command-line parameters given on quit
Throws:
java.lang.Exception - any exception generated from trying to quit
See Also:
Session.logoff(boolean, boolean, boolean), Session.killFlag()

logoff

public void logoff(boolean t1,
                   boolean t2,
                   boolean t3)
Description copied from interface: Session
Force the current player to logoff.

Specified by:
logoff in interface Session
Parameters:
t1 - true to remove the mob from the game
t2 - true to force closed sockets, and removed session
t3 - true to force a thread death, and false to be more lenient
See Also:
Session.cmdExit(MOB, Vector), Session.killFlag()

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()

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),