com.planet_ink.coffee_mud.Common.interfaces
Interface Session

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

public interface Session
extends CMCommon, Modifiable, CMRunnable

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.


Nested Class Summary
static class Session.InputCallback
          The internal class to managing asynchronous user input.
static class Session.SessionStatus
          The status of the session, from opening handshake, to final goodbyes
static class Session.TickingCallback
           
 
Field Summary
static int MAX_PREVMSGS
          for REPLY command, constant for maximum number of saved strings
static char MSDP_ARRAY_CLOSE
          For MSDP protocol, denotes array done
static char MSDP_ARRAY_OPEN
          For MSDP protocol, denotes array start
static java.lang.String MSDP_CHARSET
           
static char MSDP_TABLE_CLOSE
          For MSDP protocol, denotes table done
static char MSDP_TABLE_OPEN
          For MSDP protocol, denotes table open
static char MSDP_VAL
          For MSDP protocol, denotes value start
static char MSDP_VAR
          For MSDP protocol, denotes variable start
static int TELNET_AARD
          TELNET CODE: AARD protocol
static int TELNET_ANSI
          TELNET CODE: 253 doubles as fake ansi telnet code
static int TELNET_ATCP
          TELNET CODE: ATCP protocol
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_GA
          TELNET CODE: Indicates that the other party can go ahead and transmit -- I'm done.
static int TELNET_GMCP
          TELNET CODE: GMCP protocol
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_LOGOUT
          TELNET CODE: echo
static int TELNET_MSDP
          TELNET CODE: MSDP protocol
static int TELNET_MSP
          TELNET CODE: MSP SOund protocol
static int TELNET_MSSP
          TELNET CODE: MSSP Server Status protocol
static int TELNET_MXP
          TELNET CODE: MXP Extended protocol
static int TELNET_NAWS
          TELNET CODE: Negotiate About Window Size.
static int TELNET_NOP
          TELNET CODE: Indicates that there is nothing to do?
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
static byte[] TELNETBYTES_END_SB
          How to end a telnet subnegotiation
static byte[] TELNETBYTES_GMCP_HEAD
          How to start a GMCP subnegotiation
static byte[] TELNETGABYTES
          Go ahead bytes
 
Method Summary
 boolean autoLogin(java.lang.String name, java.lang.String password)
          If the session is in a non-logged in state (or even if it is), this will automatically login the user with the given name and password, and switch the session to the main loop.
 java.lang.String blockingIn(long timeoutMillis, boolean filter)
          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.
 java.lang.String choose(java.lang.String Message, java.lang.String Choices, java.lang.String Default, long maxTime, java.util.List<java.lang.String> paramsOut)
          Prompts the user to enter one character responses from a set of valid choices.
 void colorOnlyPrint(java.lang.String msg)
          Lower-Medium-level text output method.
 void colorOnlyPrint(java.lang.String msg, 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, 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.
 java.lang.String getAddress()
          Gets the current telnet clients ip address.
 java.lang.String getAfkMessage()
          Returns the reason given by the user that they are AFK.
 boolean getClientTelnetMode(int telnetCode)
          Gets a client telnet mode flag.
 java.lang.String[] getColorCodes()
          Returns a list of standard/foreground telnet coded strings indexed by coffeemud color code.
 ColorLibrary.ColorState getCurrentColor()
          Returns the current color code.
 java.lang.String getGroupName()
          Returns the group name to which this session belongs
 long getIdleMillis()
          Gets the number of milliseconds since a user entry was registered by this session
 long getInputLoopTime()
          Returns the last time in milliseconds that this session began its input loop.
 ColorLibrary.ColorState getLastColor()
          Returns the previous current color code.
 java.util.List<java.lang.String> getLastMsgs()
          Returns a list 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.
 java.util.List<java.lang.String> getPreviousCMD()
          Returns a pre-parsed, pre-filtered list of strings representing the last command entered by the user through this session.
 boolean getServerTelnetMode(int telnetCode)
          Gets a server telnet mode flag.
 Session.SessionStatus 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 groupName, 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 isAfk()
          Returns whether this mob/session is currently Away From Keyboard
 boolean isAllowedMcp(java.lang.String packageName, float version)
          Returns true if this client supports the given package at the given version.
 boolean isAllowedMxp(java.lang.String tag)
          Returns true if the given max tag will be accepted by the client.
 boolean isBeingSnoopedBy(Session S)
          Checks to see if the given session is snooping on this one.
 boolean isFake()
          Returns true if this session is merely a placeholder, and does not represent an actual user connection.
 boolean isLockedUpWriting()
          Checks whether this session is currently over its time limit trying to write data to its socket.
 boolean isPendingLogin(java.lang.String otherLoginName)
          Returns whether this session is engaged in a login/account menu transaction.
 boolean isRunning()
          Whether this session is currently actively interacting with the user in some way -- whether this session currently has "thread time".
 boolean isStopped()
          Returns whether this session is done, or slated to be done.
 boolean isWaitingForInput()
          Returns whether this session is waiting for input
 void logout(boolean removeMOB)
          Allows the user to select a different character, taking them back to the login prompt, or to the account character listing screen, whichever is appropriate.
 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, boolean noCache)
          Low level text output method.
 void print(Physical 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(Physical 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.
 void prompt(Session.InputCallback callBack)
          Puts the session into an input state, returning immediately.
 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 promptPrint(java.lang.String msg)
          Medium-level text output method.
 void rawCharsOut(char[] c)
          Lowest level user-output method.
 void rawOut(java.lang.String msg)
          Lowest level user-output method.
 void rawPrint(java.lang.String msg)
          Low level line-output method.
 void rawPrintln(java.lang.String msg)
          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.
 void safeRawPrint(java.lang.String msg)
          Low level line-output method.
 void safeRawPrintln(java.lang.String msg)
          Low level line-output method.
 boolean sendGMCPEvent(java.lang.String eventName, java.lang.String json)
          Potentially sends the GMCP event of the given name with the given json doc.
 boolean sendMcpCommand(java.lang.String packageCommand, java.lang.String parms)
          Sends a properly formatted MCP command to the session, if it or its package is supported.
 void setAccount(PlayerAccount account)
          Sets the player acount attached to this session object.
 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 setBeingSnoopedBy(Session session, boolean onOff)
          Notifies this session that the given session is snooping it.
 void setClientTelnetMode(int telnetCode, boolean onOff)
          Sets a client telnet mode flag.
 void setCurrentColor(ColorLibrary.ColorState newcolor)
          Sets the current color code.
 void setFakeInput(java.lang.String input)
          Send this session fake input as if the user had typed it in.
 void setGroupName(java.lang.String group)
          Sets the group name to which this session belongs
 void setIdleTimers()
          Resets the internal idle timers.
 void setInputLoopTime()
          Sets the last time in milliseconds that this session began its input loop.
 void setLastColor(ColorLibrary.ColorState newColor)
          Returns the previous current color code.
 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.
 void setStatus(Session.SessionStatus newStatus)
          Sets the tick/thread status of this session object.
 int snoopSuspension(int change)
          Increments or decrements the snoop suspension counter by the given amount.
 void stdPrint(Physical 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(Physical 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 stopSession(boolean removeMOB, boolean dropSession, boolean killThread)
          Force the current player to logoff, end the session, and/or kill the thread.
 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, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.threads.CMRunnable
activeTimeMillis, getGroupID, getStartTime
 
Methods inherited from interface java.lang.Runnable
run
 

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_LOGOUT

static final int TELNET_LOGOUT
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_MSDP

static final int TELNET_MSDP
TELNET CODE: MSDP protocol

See Also:
Constant Field Values

TELNET_MSSP

static final int TELNET_MSSP
TELNET CODE: MSSP Server Status protocol

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_AARD

static final int TELNET_AARD
TELNET CODE: AARD 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_ATCP

static final int TELNET_ATCP
TELNET CODE: ATCP protocol

See Also:
Constant Field Values

TELNET_GMCP

static final int TELNET_GMCP
TELNET CODE: GMCP protocol

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_GA

static final int TELNET_GA
TELNET CODE: Indicates that the other party can go ahead and transmit -- I'm done.

See Also:
Constant Field Values

TELNET_NOP

static final int TELNET_NOP
TELNET CODE: Indicates that there is nothing to do?

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


MSDP_CHARSET

static final java.lang.String MSDP_CHARSET
See Also:
Constant Field Values

TELNETBYTES_GMCP_HEAD

static final byte[] TELNETBYTES_GMCP_HEAD
How to start a GMCP subnegotiation


TELNETBYTES_END_SB

static final byte[] TELNETBYTES_END_SB
How to end a telnet subnegotiation


TELNETGABYTES

static final byte[] TELNETGABYTES
Go ahead bytes


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

MSDP_VAR

static final char MSDP_VAR
For MSDP protocol, denotes variable start

See Also:
Constant Field Values

MSDP_VAL

static final char MSDP_VAL
For MSDP protocol, denotes value start

See Also:
Constant Field Values

MSDP_TABLE_OPEN

static final char MSDP_TABLE_OPEN
For MSDP protocol, denotes table open

See Also:
Constant Field Values

MSDP_TABLE_CLOSE

static final char MSDP_TABLE_CLOSE
For MSDP protocol, denotes table done

See Also:
Constant Field Values

MSDP_ARRAY_OPEN

static final char MSDP_ARRAY_OPEN
For MSDP protocol, denotes array start

See Also:
Constant Field Values

MSDP_ARRAY_CLOSE

static final char MSDP_ARRAY_CLOSE
For MSDP protocol, denotes array done

See Also:
Constant Field Values
Method Detail

initializeSession

void initializeSession(java.net.Socket s,
                       java.lang.String groupName,
                       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
groupName - the name of the thread group the session goes to
introTextStr - introductory text string (Hello!)

getGroupName

java.lang.String getGroupName()
Returns the group name to which this session belongs

Returns:
the thread group name

setGroupName

void setGroupName(java.lang.String group)
Sets the group name to which this session belongs

Parameters:
group - the thread group name

getColorCodes

java.lang.String[] getColorCodes()
Returns a list of standard/foreground 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,
               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
noCache - true to disable line caching, false otherwise
See Also:
rawCharsOut(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, 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:
rawCharsOut(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)

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)

safeRawPrintln

void safeRawPrintln(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, or color, but does protect mxp clients.

Parameters:
msg - the string to send to the user
See Also:
safeRawPrint(String)

safeRawPrint

void safeRawPrint(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. Does not do color, but does protect mxp clients.

Parameters:
msg - the string to send to the user
See Also:
safeRawPrintln(String)

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)

stdPrint

void stdPrint(Physical 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)

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)

stdPrintln

void stdPrintln(Physical 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)

rawCharsOut

void rawCharsOut(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

isFake

boolean isFake()
Returns true if this session is merely a placeholder, and does not represent an actual user connection. Will ensure that the system continues to treat the user as a mob.

Returns:
true if this session is not a connection

isPendingLogin

boolean isPendingLogin(java.lang.String otherLoginName)
Returns whether this session is engaged in a login/account menu transaction. If a loginsession is passed it, it will return true only if the two sessions are engaging the same login name.

Parameters:
otherLoginName - another login name potentially match
Returns:
true if it is pending, false otherwise

autoLogin

boolean autoLogin(java.lang.String name,
                  java.lang.String password)
If the session is in a non-logged in state (or even if it is), this will automatically login the user with the given name and password, and switch the session to the main loop. Sending null for name/password will reset the login session.

Parameters:
name - the username
password - the password
Returns:
true if the login succeeded

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, and should NOT be used for prompts.

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

promptPrint

void promptPrint(java.lang.String msg)
Medium-level text output method. Does full filtering of special characters and codes. Does not manage the prompt. Should be used for prompts!

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

print

void print(Physical 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, 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, boolean)

println

void println(Physical 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, 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, 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, boolean)

colorOnlyPrintln

void colorOnlyPrintln(java.lang.String msg,
                      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
noCache - true to disable line caching, false otherwise
See Also:
onlyPrint(String, boolean)

colorOnlyPrint

void colorOnlyPrint(java.lang.String msg,
                    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
noCache - true to disable line caching, false otherwise
See Also:
onlyPrint(String, 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, 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, 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

void prompt(Session.InputCallback callBack)
Puts the session into an input state, returning immediately. The given callback will be made when the ENTER key has been hit, and the session will go back into a prompt state. This is basically for non-blocking input.

Parameters:
callBack - the callback to modify and make when done
See Also:
Session.InputCallback

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,
                        java.util.List<java.lang.String> paramsOut)
                        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
maxTime - max number of milliseconds to wait before timing out
paramsOut - an empty list to put any extra crap added to the end of the choice.
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)

setBeingSnoopedBy

void setBeingSnoopedBy(Session session,
                       boolean onOff)
Notifies this session that the given session is snooping it. This session will manage said snooping.

Parameters:
session - the session to snoop on me.
onOff - true to turn on snooping, false otherwise
See Also:
setBeingSnoopedBy(Session, boolean), isBeingSnoopedBy(Session), snoopSuspension(int)

isBeingSnoopedBy

boolean isBeingSnoopedBy(Session S)
Checks to see if the given session is snooping on this one.

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:
setBeingSnoopedBy(Session, boolean), isBeingSnoopedBy(Session), snoopSuspension(int)

snoopSuspension

int snoopSuspension(int change)
Increments or decrements the snoop suspension counter by the given amount. Only when the counter is 0 does snooping of this session actually occur.

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:
setBeingSnoopedBy(Session, boolean), isBeingSnoopedBy(Session), snoopSuspension(int)

stopSession

void stopSession(boolean removeMOB,
                 boolean dropSession,
                 boolean killThread)
Force the current player to logoff, end the session, and/or kill the thread.

Parameters:
removeMOB - true to remove the mob from the game
dropSession - true to force closed sockets, and removed session
killThread - true to force a thread death, and false to be more lenient
See Also:
isStopped()

isStopped

boolean isStopped()
Returns whether this session is done, or slated to be done.

Returns:
true if this session needs to go, false otherwise
See Also:
logout(boolean), isStopped()

logout

void logout(boolean removeMOB)
Allows the user to select a different character, taking them back to the login prompt, or to the account character listing screen, whichever is appropriate.

Parameters:
removeMOB - true to remove the mob from the game

isAfk

boolean isAfk()
Returns whether this mob/session is currently Away From Keyboard

Returns:
true if they are AFK, false otherwise
See Also:
setAfkFlag(boolean), setAFKMessage(String)

setAfkFlag

void setAfkFlag(boolean truefalse)
Sets whether this mob/session is currently Away From Keyboard

Parameters:
truefalse - true if they are AFK, false otherwise
See Also:
isAfk(), getAfkMessage()

getAfkMessage

java.lang.String getAfkMessage()
Returns the reason given by the user that they are AFK.

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

setAFKMessage

void setAFKMessage(java.lang.String str)
Returns the reason given by the user that they are AFK.

Parameters:
str - the reason given by the user that they are AFK.
See Also:
setAfkFlag(boolean), getAfkMessage()

blockingIn

java.lang.String blockingIn(long timeoutMillis,
                            boolean filter)
                            throws java.io.IOException
Blocks the current thread until the user attached to this session hits ENTER, returning the characters they enter. Completely filtered input.

Parameters:
timeoutMillis - milliseconds before InterruptedIOException thrown
filter - true to allow normal coffeemud input filtering
Returns:
the string entered by the user
Throws:
java.io.IOException - any exception generated during input

readlineContinue

java.lang.String readlineContinue()
                                  throws java.io.IOException,
                                         java.net.SocketException
Blocks for a short amount of time, returning an input string only if the user happens to have hit enter.

Returns:
a string entered by the user
Throws:
java.io.IOException - exceptions thrown, typically a timeout
java.net.SocketException - exceptions thrown, typically socket error

getPreviousCMD

java.util.List<java.lang.String> getPreviousCMD()
Returns a pre-parsed, pre-filtered list of strings representing the last command entered by the user through this session.

Returns:
a list of strings

mob

MOB mob()
Returns the player MOB attached to this session object.

Returns:
the player MOB attached to this session object.
See Also:
setMob(MOB)

setMob

void setMob(MOB newmob)
Sets the player MOB attached to this session object.

Parameters:
newmob - the player MOB attached to this session object.
See Also:
mob()

setAccount

void setAccount(PlayerAccount account)
Sets the player acount attached to this session object.

Parameters:
account - the player account attached to this session object.
See Also:
mob()

getCurrentColor

ColorLibrary.ColorState getCurrentColor()
Returns the current color code.

Returns:
the current color code.

setCurrentColor

void setCurrentColor(ColorLibrary.ColorState newcolor)
Sets the current color code.

Parameters:
newcolor - the color to change it to

getLastColor

ColorLibrary.ColorState getLastColor()
Returns the previous current color code.

Returns:
the previous current color code.

setLastColor

void setLastColor(ColorLibrary.ColorState newColor)
Returns the previous current color code.

Parameters:
newColor - the color to change it to

getWrap

int getWrap()
Gets the column number for engine word-wrapping. 0 Means disabled.

Returns:
the wrap column

getAddress

java.lang.String getAddress()
Gets the current telnet clients ip address.

Returns:
the ip address

getStatus

Session.SessionStatus getStatus()
Gets the tick/thread status of this session object.

Returns:
the tick status
See Also:
Session.SessionStatus

setStatus

void setStatus(Session.SessionStatus newStatus)
Sets the tick/thread status of this session object.

Parameters:
newStatus - the tick status
See Also:
Session.SessionStatus

isWaitingForInput

boolean isWaitingForInput()
Returns whether this session is waiting for input

Returns:
true if it is, false otherwise

getTotalMillis

long getTotalMillis()
Gets the total milliseconds consumed by this session objects thread.

Returns:
the total milliseconds consumed

getTotalTicks

long getTotalTicks()
Gets the total number of ticks consumed by this session object thread.

Returns:
the total ticks consumed

getIdleMillis

long getIdleMillis()
Gets the number of milliseconds since a user entry was registered by this session

Returns:
the idle milliseconds passed
See Also:
setIdleTimers()

setIdleTimers

void setIdleTimers()
Resets the internal idle timers.

See Also:
getIdleMillis()

getMillisOnline

long getMillisOnline()
Gets the milliseconds elapsed since this user came online.

Returns:
the milliseconds online

getLastPKFight

long getLastPKFight()
Gets the milliseconds timestamp since this user last registered a pk fight.

Returns:
the last pk fight timestamp
See Also:
setLastPKFight(), setLastNPCFight()

setLastPKFight

void setLastPKFight()
Sets now as the milliseconds timestamp since this user last registered a pk fight.

See Also:
getLastPKFight(), getLastNPCFight()

getLastNPCFight

long getLastNPCFight()
Gets the milliseconds timestamp since this user last registered a npc fight.

Returns:
the last npc fight timestamp
See Also:
setLastPKFight(), setLastNPCFight()

setLastNPCFight

void setLastNPCFight()
Sets now as the milliseconds timestamp since this user last registered a npc fight.

See Also:
getLastPKFight(), getLastNPCFight()

getInputLoopTime

long getInputLoopTime()
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.

Returns:
the last time in milliseconds that this session began its input loop
See Also:
setInputLoopTime()

setInputLoopTime

void setInputLoopTime()
Sets 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.

See Also:
getInputLoopTime()

isRunning

boolean isRunning()
Whether this session is currently actively interacting with the user in some way -- whether this session currently has "thread time".

Returns:
true if its active and running, false otherwise

getLastMsgs

java.util.List<java.lang.String> getLastMsgs()
Returns a list of the last several message strings received by this user. All are already previously filtered and parsed and ready to display.

Returns:
a list of string message strings

getTerminalType

java.lang.String getTerminalType()
Gets the terminal type the user has

Returns:
the terminal type

setServerTelnetMode

void setServerTelnetMode(int telnetCode,
                         boolean onOff)
Sets a server telnet mode flag.

Parameters:
telnetCode - the telnet code
onOff - true to turn on, false to turn off the flag
See Also:
TELNET_ANSI, getServerTelnetMode(int)

getServerTelnetMode

boolean getServerTelnetMode(int telnetCode)
Gets a server telnet mode flag.

Parameters:
telnetCode - the telnet code
Returns:
true, if server telnet mode is on, false otherwise
See Also:
TELNET_ANSI, setServerTelnetMode(int, boolean)

setClientTelnetMode

void setClientTelnetMode(int telnetCode,
                         boolean onOff)
Sets a client telnet mode flag.

Parameters:
telnetCode - the telnet code
onOff - true to turn on, false to turn off the flag
See Also:
TELNET_ANSI, getClientTelnetMode(int)

getClientTelnetMode

boolean getClientTelnetMode(int telnetCode)
Gets a client telnet mode flag.

Parameters:
telnetCode - the telnet code
Returns:
true, if client telnet mode is on, false otherwise
See Also:
TELNET_ANSI, setClientTelnetMode(int, boolean)

changeTelnetMode

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

Parameters:
telnetCode - the telnet code
onOff - true to turn on, false to turn off the flag
See Also:
TELNET_ANSI, setClientTelnetMode(int, boolean), setServerTelnetMode(int, boolean)

negotiateTelnetMode

void negotiateTelnetMode(int telnetCode)
Change telnet mode by negotiating the command to the clients client.

Parameters:
telnetCode - the telnet code
See Also:
TELNET_ANSI, setClientTelnetMode(int, boolean), setServerTelnetMode(int, boolean)

initTelnetMode

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. It will use a bitmap of MOB flags passed in as a guide.

Parameters:
mobbitmap - the mobbitmap the bitmap of mob flags to use as a guide in negotiation
See Also:
MOB.getAttributesBitmap(), MOB.Attrib, changeTelnetMode(int, boolean)

isAllowedMxp

boolean isAllowedMxp(java.lang.String tag)
Returns true if the given max tag will be accepted by the client.

Parameters:
tag - the tag to check
Returns:
true if allowed, false otherwise

isAllowedMcp

boolean isAllowedMcp(java.lang.String packageName,
                     float version)
Returns true if this client supports the given package at the given version.

Parameters:
packageName - the package to check
version - the version of the package to check
Returns:
true if there's support, false otherwise

sendMcpCommand

boolean sendMcpCommand(java.lang.String packageCommand,
                       java.lang.String parms)
Sends a properly formatted MCP command to the session, if it or its package is supported.

Parameters:
packageCommand - the fully formed command
parms - the variable parameters, already well formed
Returns:
true if it was sent, false otherwise

sendGMCPEvent

boolean sendGMCPEvent(java.lang.String eventName,
                      java.lang.String json)
Potentially sends the GMCP event of the given name with the given json doc.

Parameters:
eventName - the event name, like comm.channel
json - the json doc, like {"blah":"BLAH"}
Returns:
true if GMCP was enabled for this session, false otherwise

setFakeInput

void setFakeInput(java.lang.String input)
Send this session fake input as if the user had typed it in.

Parameters:
input - text to send.