|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Session
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 |
|---|
static final int TELNET_BINARY
static final int TELNET_ECHO
static final int TELNET_SUPRESS_GO_AHEAD
static final int TELNET_TERMTYPE
static final int TELNET_NAWS
static final int TELNET_TOGGLE_FLOW_CONTROL
static final int TELNET_LINEMODE
static final int TELNET_COMPRESS
static final int TELNET_COMPRESS2
static final int TELNET_MSP
static final int TELNET_MXP
static final int TELNET_SE
static final int TELNET_AYT
static final int TELNET_EC
static final int TELNET_SB
static final int TELNET_WILL
static final int TELNET_WONT
static final int TELNET_DO
static final int TELNET_ANSI
static final int TELNET_DONT
static final int TELNET_IAC
static final java.lang.String[] TELNET_DESCS
static final int MAX_PREVMSGS
static final int TELNET_LINEMODE_MODE
static final int TELNET_LINEMODE_MODEMASK_EDIT
static final int TELNET_LINEMODE_MODEMASK_TRAPSIG
static final int TELNET_LINEMODE_MODEMASK_ACK
static final int TELNET_LINEMODE_SLC
static final int TELNET_LINEMODE_SLC_DEFAULT
static final int TELNET_LINEMODE_SLC_VALUE
static final int TELNET_LINEMODE_SLC_CANTCHANGE
static final int TELNET_LINEMODE_SLC_NOSUPPORT
static final int TELNET_LINEMODE_SLC_ACK
static final int TELNET_LINEMODE_SLC_XON
static final int TELNET_LINEMODE_SLC_XOFF
static final int TELNET_LINEMODE_SLC_EOF
static final int TELNET_LINEMODE_SLC_SUSP
static final int TELNET_LINEMODE_SLC_BRK
static final int TELNET_LINEMODE_SLC_IP
static final int TELNET_LINEMODE_SLC_AO
static final int TELNET_LINEMODE_SLC_AYT
static final int TELNET_LINEMODE_SLC_EOR
static final int STATUS_OK
static final int STATUS_LOGIN
static final int STATUS_LOGIN1
static final int STATUS_LOGIN2
static final int STATUS_LOGOUT
static final int STATUS_LOGOUT1
static final int STATUS_LOGOUT2
static final int STATUS_LOGOUT3
static final int STATUS_LOGOUT4
static final int STATUS_LOGOUT5
static final int STATUS_LOGOUT6
static final int STATUS_LOGOUT7
static final int STATUS_LOGOUT8
static final int STATUS_LOGOUT9
static final int STATUS_LOGOUT10
static final int STATUS_LOGOUT11
static final int STATUS_LOGOUT12
static final int STATUS_LOGOUTFINAL
static final java.lang.String[] STATUS_STR
| Method Detail |
|---|
void initializeSession(java.net.Socket s,
java.lang.String introTextStr)
s - the socket the user connected fromintroTextStr - introductory text string (Hello!)void start()
java.lang.String[] clookup()
void onlyPrint(java.lang.String msg,
int pageBreak,
boolean noCache)
msg - the string to send to the userpageBreak - the number of lines to break on, -1=NOnoCache - true to disable line caching, false otherwiseout(char[])void onlyPrint(java.lang.String msg)
msg - the string to send to the useronlyPrint(String, int, boolean)void rawOut(java.lang.String msg)
msg - the string to send to the userout(char[])void rawPrintln(java.lang.String msg)
msg - the string to send to the userrawPrintln(String, int)
void rawPrintln(java.lang.String msg,
int pageBreak)
msg - the string to send to the userpageBreak - the number of lines to break on, -1=NOrawPrint(String, int)void rawPrint(java.lang.String msg)
msg - the string to send to the userrawPrint(String, int)
void rawPrint(java.lang.String msg,
int pageBreak)
msg - the string to send to the userpageBreak - the number of lines to break on, -1=NOonlyPrint(String, int, boolean)void stdPrint(java.lang.String msg)
msg - the string to send to the userrawPrint(String, int)
void stdPrint(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Source - variable for special code parsing: SourceTarget - variable for special code parsing: TargetTool - variable for special code parsing: Toolmsg - the string to send to the userrawPrint(String, int)void stdPrintln(java.lang.String msg)
msg - the string to send to the userrawPrintln(String, int)
void stdPrintln(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Source - variable for special code parsing: SourceTarget - variable for special code parsing: TargetTool - variable for special code parsing: Toolmsg - the string to send to the userrawPrintln(String, int)void out(char[] c)
c - string (as char array) to send out to the userboolean isLockedUpWriting()
void print(java.lang.String msg)
msg - the string to send to the useronlyPrint(String, int, boolean)
void print(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Source - variable for special code parsing: SourceTarget - variable for special code parsing: TargetTool - variable for special code parsing: Toolmsg - the string to send to the useronlyPrint(String, int, boolean)void println(java.lang.String msg)
msg - the string to send to the useronlyPrint(String, int, boolean)
void println(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Source - variable for special code parsing: SourceTarget - variable for special code parsing: TargetTool - variable for special code parsing: Toolmsg - the string to send to the useronlyPrint(String, int, boolean)void setPromptFlag(boolean truefalse)
truefalse - true to send another prompt, false otherwisevoid wraplessPrintln(java.lang.String msg)
msg - the string to send to the useronlyPrint(String, int, boolean)void wraplessPrint(java.lang.String msg)
msg - the string to send to the useronlyPrint(String, int, boolean)
void colorOnlyPrintln(java.lang.String msg,
int pageBreak,
boolean noCache)
msg - the string to send to the userpageBreak - the number of lines to break on, -1=NOnoCache - true to disable line caching, false otherwiseonlyPrint(String, int, boolean)
void colorOnlyPrint(java.lang.String msg,
int pageBreak,
boolean noCache)
msg - the string to send to the userpageBreak - the number of lines to break on, -1=NOnoCache - true to disable line caching, false otherwiseonlyPrint(String, int, boolean)void colorOnlyPrintln(java.lang.String msg)
msg - the string to send to the useronlyPrint(String, int, boolean)void colorOnlyPrint(java.lang.String msg)
msg - the string to send to the useronlyPrint(String, int, boolean)char hotkey(long maxWait)
maxWait - the maximum milliseconds to wait
java.lang.String prompt(java.lang.String Message,
java.lang.String Default)
throws java.io.IOException
Message - the prompt message to display to the userDefault - the default response if the user just hits enter
java.io.IOException - a disconnectprompt(String),
prompt(String, long),
prompt(String, String, long)
java.lang.String prompt(java.lang.String Message,
java.lang.String Default,
long maxTime)
throws java.io.IOException
Message - the prompt message to display to the userDefault - the default response if the user just hits entermaxTime - max number of milliseconds to wait before timing out
java.io.IOException - a disconnect or time outprompt(String),
prompt(String, String),
prompt(String, long)
java.lang.String prompt(java.lang.String Message)
throws java.io.IOException
Message - the prompt message to display to the user
java.io.IOException - a disconnectprompt(String, String),
prompt(String, long),
prompt(String, String, long)
java.lang.String prompt(java.lang.String Message,
long maxTime)
throws java.io.IOException
Message - the prompt message to display to the usermaxTime - max number of milliseconds to wait before timing out
java.io.IOException - a disconnect or time outprompt(String),
prompt(String, String),
prompt(String, String, long)
boolean confirm(java.lang.String Message,
java.lang.String Default)
throws java.io.IOException
Message - the prompt message to display to the userDefault - the default response if the user just hits enter
java.io.IOException - a disconnectconfirm(String, String, long)
boolean confirm(java.lang.String Message,
java.lang.String Default,
long maxTime)
throws java.io.IOException
Message - the prompt message to display to the userDefault - the default response if the user just hits entermaxTime - max number of milliseconds to wait before timing out
java.io.IOException - a disconnect or time outconfirm(String, String)
java.lang.String choose(java.lang.String Message,
java.lang.String Choices,
java.lang.String Default)
throws java.io.IOException
Message - the prompt message to display to the userChoices - a list of uppercase characters that may be enteredDefault - the default response if the user just hits enter
java.io.IOException - a disconnectchoose(String, String, String, long)
java.lang.String choose(java.lang.String Message,
java.lang.String Choices,
java.lang.String Default,
long maxTime)
throws java.io.IOException
Message - the prompt message to display to the userChoices - a list of uppercase characters that may be enteredDefault - the default response if the user just hits entermaxTime - max number of milliseconds to wait before timing out
java.io.IOException - a disconnect or time outchoose(String, String, String)void startBeingSnoopedBy(Session S)
S - the session to snoop on me.startBeingSnoopedBy(Session),
stopBeingSnoopedBy(Session),
amBeingSnoopedBy(Session),
snoopSuspension(int)void stopBeingSnoopedBy(