com.planet_ink.coffee_mud.Common.interfaces
Interface Session

All Superinterfaces:
java.lang.Cloneable, CMCommon, CMObject, java.lang.Comparable<CMObject>
All Known Implementing Classes:
DefaultSession, FakeSession

public interface Session
extends CMCommon

A Session object is the key interface between the internet user and their player MOB. In fact, the presence of an attached session object to a MOB is the only difference between an NPC MOB and a player MOB. This object handles input, output, and related processes.


Field Summary
static int MAX_PREVMSGS
          for REPLY command, constant for maximum number of saved strings
static int STATUS_LOGIN
          Status value constant possibly returned by getStatus method
static int STATUS_LOGIN1
          Status value constant possibly returned by getStatus method
static int STATUS_LOGIN2
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT1
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT10
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT11
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT12
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT2
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT3
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT4
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT5
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT6
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT7
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT8
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUT9
          Status value constant possibly returned by getStatus method
static int STATUS_LOGOUTFINAL
          Status value constant possibly returned by getStatus method
static int STATUS_OK
          Status value constant possibly returned by getStatus method
static java.lang.String[] STATUS_STR
          Status strings indexed by the various STATUS_ constants.
static int TELNET_ANSI
          TELNET CODE: 253 doubles as fake ansi telnet code
static int TELNET_AYT
          TELNET CODE: Are You There
static int TELNET_BINARY
          TELNET CODE: transmit binary
static int TELNET_COMPRESS
          TELNET CODE: text compression, protocol 1
static int TELNET_COMPRESS2
          TELNET CODE: text compression, protocol 2
static java.lang.String[] TELNET_DESCS
          Array String-friendly descriptions of the various telnet codes.
static int TELNET_DO
          TELNET CODE: Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option
static int TELNET_DONT
          TELNET CODE: Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option.
static int TELNET_EC
          TELNET CODE: Erase character
static int TELNET_ECHO
          TELNET CODE: echo
static int TELNET_IAC
          TELNET CODE: IAC
static int TELNET_LINEMODE
          TELNET CODE: Linemode
static int TELNET_LINEMODE_MODE
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_MODEMASK_ACK
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_MODEMASK_EDIT
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_MODEMASK_TRAPSIG
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_ACK
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_AO
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_AYT
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_BRK
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_CANTCHANGE
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_DEFAULT
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_EOF
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_EOR
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_IP
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_NOSUPPORT
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_SUSP
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_VALUE
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_XOFF
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_LINEMODE_SLC_XON
          Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does
static int TELNET_MSP
          TELNET CODE: MSP SOund protocol
static int TELNET_MXP
          TELNET CODE: MXP Extended protocol
static int TELNET_NAWS
          TELNET CODE: Negotiate About Window Size.
static int TELNET_SB
          TELNET CODE: Indicates that what follows is subnegotiation of the indicated option
static int TELNET_SE
          TELNET CODE: End of subnegotiation parameters
static int TELNET_SUPRESS_GO_AHEAD
          TELNET CODE: supress go ahead
static int TELNET_TERMTYPE
          TELNET CODE: sending terminal type
static int TELNET_TOGGLE_FLOW_CONTROL
          TELNET CODE: Remote Flow Control.
static int TELNET_WILL
          TELNET CODE: Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option
static int TELNET_WONT
          TELNET CODE: Indicates the refusal to perform, or continue performing, the indicated option
 
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.
 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.
 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 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.
 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.
 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 change)
          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.
 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 interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

TELNET_BINARY

static final int TELNET_BINARY
TELNET CODE: transmit binary

See Also:
Constant Field Values

TELNET_ECHO

static final int TELNET_ECHO
TELNET CODE: echo

See Also:
Constant Field Values

TELNET_SUPRESS_GO_AHEAD

static final int TELNET_SUPRESS_GO_AHEAD
TELNET CODE: supress go ahead

See Also:
Constant Field Values

TELNET_TERMTYPE

static final int TELNET_TERMTYPE
TELNET CODE: sending terminal type

See Also:
Constant Field Values

TELNET_NAWS

static final int TELNET_NAWS
TELNET CODE: Negotiate About Window Size.

See Also:
Constant Field Values

TELNET_TOGGLE_FLOW_CONTROL

static final int TELNET_TOGGLE_FLOW_CONTROL
TELNET CODE: Remote Flow Control.

See Also:
Constant Field Values

TELNET_LINEMODE

static final int TELNET_LINEMODE
TELNET CODE: Linemode

See Also:
Constant Field Values

TELNET_COMPRESS

static final int TELNET_COMPRESS
TELNET CODE: text compression, protocol 1

See Also:
Constant Field Values

TELNET_COMPRESS2

static final int TELNET_COMPRESS2
TELNET CODE: text compression, protocol 2

See Also:
Constant Field Values

TELNET_MSP

static final int TELNET_MSP
TELNET CODE: MSP SOund protocol

See Also:
Constant Field Values

TELNET_MXP

static final int TELNET_MXP
TELNET CODE: MXP Extended protocol

See Also:
Constant Field Values

TELNET_SE

static final int TELNET_SE
TELNET CODE: End of subnegotiation parameters

See Also:
Constant Field Values

TELNET_AYT

static final int TELNET_AYT
TELNET CODE: Are You There

See Also:
Constant Field Values

TELNET_EC

static final int TELNET_EC
TELNET CODE: Erase character

See Also:
Constant Field Values

TELNET_SB

static final int TELNET_SB
TELNET CODE: Indicates that what follows is subnegotiation of the indicated option

See Also:
Constant Field Values

TELNET_WILL

static final int TELNET_WILL
TELNET CODE: Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option

See Also:
Constant Field Values

TELNET_WONT

static final int TELNET_WONT
TELNET CODE: Indicates the refusal to perform, or continue performing, the indicated option

See Also:
Constant Field Values

TELNET_DO

static final int TELNET_DO
TELNET CODE: Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option

See Also:
Constant Field Values

TELNET_ANSI

static final int TELNET_ANSI
TELNET CODE: 253 doubles as fake ansi telnet code

See Also:
Constant Field Values

TELNET_DONT

static final int TELNET_DONT
TELNET CODE: Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option.

See Also:
Constant Field Values

TELNET_IAC

static final int TELNET_IAC
TELNET CODE: IAC

See Also:
Constant Field Values

TELNET_DESCS

static final java.lang.String[] TELNET_DESCS
Array String-friendly descriptions of the various telnet codes. Indexed by code id 0-255


MAX_PREVMSGS

static final int MAX_PREVMSGS
for REPLY command, constant for maximum number of saved strings

See Also:
Constant Field Values

TELNET_LINEMODE_MODE

static final int TELNET_LINEMODE_MODE
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_MODEMASK_EDIT

static final int TELNET_LINEMODE_MODEMASK_EDIT
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_MODEMASK_TRAPSIG

static final int TELNET_LINEMODE_MODEMASK_TRAPSIG
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_MODEMASK_ACK

static final int TELNET_LINEMODE_MODEMASK_ACK
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC

static final int TELNET_LINEMODE_SLC
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_DEFAULT

static final int TELNET_LINEMODE_SLC_DEFAULT
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_VALUE

static final int TELNET_LINEMODE_SLC_VALUE
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_CANTCHANGE

static final int TELNET_LINEMODE_SLC_CANTCHANGE
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_NOSUPPORT

static final int TELNET_LINEMODE_SLC_NOSUPPORT
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_ACK

static final int TELNET_LINEMODE_SLC_ACK
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_XON

static final int TELNET_LINEMODE_SLC_XON
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_XOFF

static final int TELNET_LINEMODE_SLC_XOFF
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_EOF

static final int TELNET_LINEMODE_SLC_EOF
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_SUSP

static final int TELNET_LINEMODE_SLC_SUSP
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_BRK

static final int TELNET_LINEMODE_SLC_BRK
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_IP

static final int TELNET_LINEMODE_SLC_IP
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_AO

static final int TELNET_LINEMODE_SLC_AO
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_AYT

static final int TELNET_LINEMODE_SLC_AYT
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

TELNET_LINEMODE_SLC_EOR

static final int TELNET_LINEMODE_SLC_EOR
Some sort of TELNET protocol constant related to LINEMODE -- I've no idea what it does

See Also:
Constant Field Values

STATUS_OK

static final int STATUS_OK
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGIN

static final int STATUS_LOGIN
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGIN1

static final int STATUS_LOGIN1
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGIN2

static final int STATUS_LOGIN2
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT

static final int STATUS_LOGOUT
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT1

static final int STATUS_LOGOUT1
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT2

static final int STATUS_LOGOUT2
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT3

static final int STATUS_LOGOUT3
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT4

static final int STATUS_LOGOUT4
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT5

static final int STATUS_LOGOUT5
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT6

static final int STATUS_LOGOUT6
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT7

static final int STATUS_LOGOUT7
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT8

static final int STATUS_LOGOUT8
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT9

static final int STATUS_LOGOUT9
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT10

static final int STATUS_LOGOUT10
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT11

static final int STATUS_LOGOUT11
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUT12

static final int STATUS_LOGOUT12
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_LOGOUTFINAL

static final int STATUS_LOGOUTFINAL
Status value constant possibly returned by getStatus method

See Also:
Constant Field Values

STATUS_STR

static final java.lang.String[] STATUS_STR
Status strings indexed by the various STATUS_ constants. Descriptive strings

Method Detail

initializeSession

void initializeSession(java.net.Socket s,
                       java.lang.String introTextStr)
Negotiates various telnet options (or attempts to), and prints the introTextStr to the user.

Parameters:
s - the socket the user connected from
introTextStr - introductory text string (Hello!)

start

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. Not required for most sessions, only for those acting as Threads.


clookup

java.lang.String[] clookup()
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.

Returns:
telnet coded color strings.

onlyPrint

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

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:
out(char[])

onlyPrint

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

Parameters:
msg - the string to send to the user
See Also:
onlyPrint(String, int, boolean)

rawOut

void rawOut(java.lang.String msg)
Lowest level user-output method. Does nothing but send the string to the user, period.

Parameters:
msg - the string to send to the user
See Also:
out(char[])

rawPrintln

void rawPrintln(java.lang.String msg)
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.

Parameters:
msg - the string to send to the user
See Also:
rawPrintln(String, int)

rawPrintln

void rawPrintln(java.lang.String msg,
                int pageBreak)
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.

Parameters:
msg - the string to send to the user
pageBreak - the number of lines to break on, -1=NO
See Also:
rawPrint(String, int)

rawPrint

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

Parameters:
msg - the string to send to the user
See Also:
rawPrint(String, int)

rawPrint

void rawPrint(java.lang.String msg,
              int pageBreak)
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.

Parameters:
msg - the string to send to the user
pageBreak - the number of lines to break on, -1=NO
See Also:
onlyPrint(String, int, boolean)

stdPrint

void stdPrint(java.lang.String msg)
Higher-level line output method. Does full filtering of special characters and codes.

Parameters:
msg - the string to send to the user
See Also:
rawPrint(String, int)

stdPrint

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

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:
rawPrint(String, int)

stdPrintln

void stdPrintln(java.lang.String msg)
Higher-level line output method. Does full filtering of special characters and codes.

Parameters:
msg - the string to send to the user
See Also:
rawPrintln(String, int)

stdPrintln

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

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:
rawPrintln(String, int)

out

void out(char[] c)
Lowest level user-output method. Does nothing but send the string to the user, period.

Parameters:
c - string (as char array) to send out to the user

isLockedUpWriting

boolean isLockedUpWriting()
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.

Returns:
true if something bas happened, false otherwise

print

void print(java.lang.String msg)
Medium-level text output method. Does full filtering of special characters and codes. Does not manage the prompt.

Parameters:
msg - the string to send to the user
See Also:
onlyPrint(String, int, boolean)

print

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

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:
onlyPrint(String, int, boolean)

println

void println(java.lang.String msg)
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.

Parameters:
msg - the string to send to the user
See Also:
onlyPrint(String, int, boolean)

println

void println(Environmental Source,
             Environmental Target,
             Environmental Tool,
             java.lang.String msg)
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.

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:
onlyPrint(String, int, boolean)

setPromptFlag

void setPromptFlag(boolean truefalse)
Notifies this session to output the users prompt again once it has reached a suitable lapse in text output.

Parameters:
truefalse - true to send another prompt, false otherwise

wraplessPrintln

void wraplessPrintln(java.lang.String msg)
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.

Parameters:
msg - the string to send to the user
See Also:
onlyPrint(String, int, boolean)

wraplessPrint

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

Parameters:
msg - the string to send to the user
See Also:
onlyPrint(String, int, boolean)

colorOnlyPrintln

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

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:
onlyPrint(String, int, boolean)

colorOnlyPrint

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

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:
onlyPrint(String, int, boolean)

colorOnlyPrintln

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

Parameters:
msg - the string to send to the user
See Also:
onlyPrint(String, int, boolean)

colorOnlyPrint

void colorOnlyPrint(java.lang.String msg)
Lower-Medium-level text output method. Does only the parsing of color codes, no word wrapping, no codes.

Parameters:
msg - the string to send to the user
See Also:
onlyPrint(String, int, boolean)

hotkey

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.

Parameters:
maxWait - the maximum milliseconds to wait
Returns:
the key pressed, or \0

prompt

java.lang.String prompt(java.lang.String Message,
                        java.lang.String Default)
                        throws java.io.IOException
Prompts the user to enter a string, and then returns what the enter. Does not time out, but may throw an exception on disconnnect.

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
Throws:
java.io.IOException - a disconnect
See Also:
prompt(String), prompt(String, long), prompt(String, String, long)

prompt

java.lang.String prompt(java.lang.String Message,
                        java.lang.String Default,
                        long maxTime)
                        throws java.io.IOException
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.

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
Throws:
java.io.IOException - a disconnect or time out
See Also:
prompt(String), prompt(String, String), prompt(String, long)

prompt

java.lang.String prompt(java.lang.String Message)
                        throws java.io.IOException
Prompts the user to enter a string, and then returns what the enter. Does not time out, but may throw an exception on disconnnect.

Parameters:
Message - the prompt message to display to the user
Returns:
the string entered by the user
Throws:
java.io.IOException - a disconnect
See Also:
prompt(String, String), prompt(String, long), prompt(String, String, long)

prompt

java.lang.String prompt(java.lang.String Message,
                        long maxTime)
                        throws java.io.IOException
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.

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
Throws:
java.io.IOException - a disconnect or time out
See Also:
prompt(String), prompt(String, String), prompt(String, String, long)

confirm

boolean confirm(java.lang.String Message,
                java.lang.String Default)
                throws java.io.IOException
Prompts the user to enter Y or N, and returns what they enter. Will not time out, but may throw an exception on disconnect.

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
Throws:
java.io.IOException - a disconnect
See Also:
confirm(String, String, long)

confirm

boolean confirm(java.lang.String Message,
                java.lang.String Default,
                long maxTime)
                throws java.io.IOException
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.

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
Throws:
java.io.IOException - a disconnect or time out
See Also:
confirm(String, String)

choose

java.lang.String choose(java.lang.String Message,
                        java.lang.String Choices,
                        java.lang.String Default)
                        throws java.io.IOException
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.

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
Throws:
java.io.IOException - a disconnect
See Also:
choose(String, String, String, long)

choose

java.lang.String choose(java.lang.String Message,
                        java.lang.String Choices,
                        java.lang.String Default,
                        long maxTime)
                        throws java.io.IOException
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.

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
Throws:
java.io.IOException - a disconnect or time out
See Also:
choose(String, String, String)

startBeingSnoopedBy

void startBeingSnoopedBy(Session S)
Notifies this session that the given session is snooping it. This session will manage said snooping.

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

stopBeingSnoopedBy

void stopBeingSnoopedBy(