CMCommon
, Session
, CMObject
, Modifiable
, CMRunnable
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
, java.lang.Runnable
public class FakeSession extends java.lang.Object implements Session
Session.InputCallback, Session.SessionFilter, Session.SessionStatus, Session.TickingCallback
Modifier and Type | Field | Description |
---|---|---|
protected java.io.ByteArrayOutputStream |
bout |
|
protected static char[] |
COLOR_CRLF |
|
protected java.util.Vector<java.lang.String> |
inputV |
|
protected MOB |
mob |
|
protected boolean |
stripCRLF |
|
protected boolean |
stripSnoop |
|
protected java.lang.String |
stripStr |
|
protected java.util.Set<java.lang.Integer> |
telnet |
|
protected CMFile |
theFile |
idConverter
MAX_PREVMSGS, MSDP_ARRAY_CLOSE, MSDP_ARRAY_OPEN, MSDP_CHARSET, MSDP_TABLE_CLOSE, MSDP_TABLE_OPEN, MSDP_VAL, MSDP_VAR, TELNET_AARD, TELNET_ANSI, TELNET_ANSI16, TELNET_ATCP, TELNET_AYT, TELNET_BINARY, TELNET_COMPRESS, TELNET_COMPRESS2, TELNET_DESCS, TELNET_DO, TELNET_DONT, TELNET_EC, TELNET_ECHO, TELNET_GA, TELNET_GMCP, TELNET_IAC, TELNET_LINEMODE, TELNET_LINEMODE_MODE, TELNET_LINEMODE_MODEMASK_ACK, TELNET_LINEMODE_MODEMASK_EDIT, TELNET_LINEMODE_MODEMASK_TRAPSIG, TELNET_LINEMODE_SLC, TELNET_LINEMODE_SLC_ACK, TELNET_LINEMODE_SLC_AO, TELNET_LINEMODE_SLC_AYT, TELNET_LINEMODE_SLC_BRK, TELNET_LINEMODE_SLC_CANTCHANGE, TELNET_LINEMODE_SLC_DEFAULT, TELNET_LINEMODE_SLC_EOF, TELNET_LINEMODE_SLC_EOR, TELNET_LINEMODE_SLC_IP, TELNET_LINEMODE_SLC_NOSUPPORT, TELNET_LINEMODE_SLC_SUSP, TELNET_LINEMODE_SLC_VALUE, TELNET_LINEMODE_SLC_XOFF, TELNET_LINEMODE_SLC_XON, TELNET_LOGOUT, TELNET_MSDP, TELNET_MSP, TELNET_MSSP, TELNET_MXP, TELNET_NAWS, TELNET_NOP, TELNET_SB, TELNET_SE, TELNET_SUPRESS_GO_AHEAD, TELNET_TERMTYPE, TELNET_TOGGLE_FLOW_CONTROL, TELNET_WILL, TELNET_WONT, TELNETBYTES_END_SB, TELNETBYTES_GMCP_HEAD, TELNETGABYTES
Constructor | Description |
---|---|
FakeSession() |
Modifier and Type | Method | Description |
---|---|---|
long |
activeTimeMillis() |
Returns the number of milliseconds this runnable
has been running.
|
boolean |
addSessionFilter(Session.SessionFilter filter) |
Adds a new text filter to this session, which can
modify any text immediately before it is sent
to the user.
|
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 |
cmdExit(MOB mob,
java.util.List<java.lang.String> commands) |
|
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.
|
int |
compareTo(CMObject o) |
|
boolean |
confirm(java.lang.String Message,
java.lang.String Default) |
Prompts the user to enter Y or N, and returns what they
enter.
|
boolean |
confirm(java.lang.String Message,
java.lang.String Default,
long maxTime) |
Prompts the user to enter Y or N, and returns what they
enter.
|
int |
convertEscape(java.lang.StringBuffer str,
int index) |
|
CMObject |
copyOf() |
Similar to Cloneable.clone(), but does its best to make sure that
any internal objects to this class are also copyOfed.
|
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.
|
int |
getGroupID() |
The group identifier for this runnable, which may be used
for executor selection
|
java.lang.String |
getGroupName() |
Returns the group name to which this session belongs
|
java.util.Enumeration<java.util.List<java.lang.String>> |
getHistory() |
Returns the entire command history cached by this session.
|
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.
|
int |
getSaveStatIndex() |
Returns the index into the stat codes array where extra savable fields begins.
|
boolean |
getServerTelnetMode(int telnetCode) |
Gets a server telnet mode flag.
|
long |
getStartTime() |
Either the time this runnable did start running, or
will start running, depending on whether it's scheduled
|
java.lang.String |
getStat(java.lang.String code) |
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders.
|
java.lang.String[] |
getStatCodes() |
Returns an array of the string names of those fields which are modifiable on this object at run-time by
builders.
|
Session.SessionStatus |
getStatus() |
Gets the tick/thread status of this session object.
|
java.lang.String |
getTerminalType() |
Gets the terminal type the user has
|
long |
getTickStatus() |
|
long |
getTotalMillis() |
Gets the total milliseconds consumed by this session objects thread.
|
long |
getTotalTicks() |
Gets the total number of ticks consumed by this session object thread.
|
int |
getWrap() |
Gets the column number for engine word-wrapping.
|
char |
hotkey(long maxWait) |
Waits the given milliseconds for a key to be pressed, after which
it returns that key, or \0 if nothing pressed.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
void |
initializeClass() |
Called ONCE after all objects are loaded, but before the map is read in
during initialization.
|
void |
initializeSession(java.net.Socket s,
java.lang.String 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 |
isStat(java.lang.String code) |
An alternative means of retreiving the values of those fields on this object which are modifiable at
run-time by builders.
|
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 b1) |
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.
|
java.lang.String |
name() |
The displayable name of this object.
|
void |
negotiateTelnetMode(int code) |
Change telnet mode by negotiating the command to the clients client.
|
CMObject |
newInstance() |
Returns a new instance of this class.
|
void |
onlyPrint(java.lang.String msg) |
Low level text output method.
|
void |
onlyPrint(java.lang.String msg,
boolean noCache) |
Low level text output method.
|
ColorLibrary.ColorState |
popMarkedColor() |
Returns the marked color code.
|
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 |
pushMarkedColor(ColorLibrary.ColorState newcolor) |
Sets the marked color code.
|
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 |
rawPrint(java.lang.String msg,
int pageBreak) |
|
void |
rawPrintln(java.lang.String msg) |
Low level line-output method.
|
void |
rawPrintln(java.lang.String msg,
int pageBreak) |
|
java.lang.String |
readlineContinue() |
Blocks for a short amount of time, returning an input
string only if the user happens to have hit enter.
|
void |
run() |
|
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 |
setStat(java.lang.String code,
java.lang.String val) |
An alternative means of setting the values of those fields on this object which are modifiable at
run-time by builders.
|
void |
setStatus(Session.SessionStatus newStatus) |
Sets the tick/thread status of this session object.
|
int |
snoopSuspension(int x) |
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 t1,
boolean t2,
boolean t3) |
Force the current player to logoff, end the session, and/or kill the thread.
|
boolean |
tick(Tickable ticking,
int tickID) |
|
void |
wraplessPrint(java.lang.String msg) |
Medium-level text output method.
|
void |
wraplessPrintln(java.lang.String msg) |
Medium-level text output method.
|
protected CMFile theFile
protected java.io.ByteArrayOutputStream bout
protected MOB mob
protected boolean stripSnoop
protected boolean stripCRLF
protected java.util.Vector<java.lang.String> inputV
protected java.util.Set<java.lang.Integer> telnet
protected static final char[] COLOR_CRLF
protected java.lang.String stripStr
public boolean tick(Tickable ticking, int tickID)
public java.lang.String ID()
CMObject
public java.lang.String name()
CMObject
name
in interface CMObject
Environmental.Name()
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public CMObject copyOf()
CMObject
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
public long getTickStatus()
public void initializeSession(java.net.Socket s, java.lang.String groupName, java.lang.String introTextStr)
Session
initializeSession
in interface Session
s
- the socket the user connected fromgroupName
- the name of the thread group the session goes tointroTextStr
- introductory text string (Hello!)public java.lang.String getGroupName()
Session
getGroupName
in interface Session
public void setGroupName(java.lang.String group)
Session
setGroupName
in interface Session
group
- the thread group namepublic long getStartTime()
CMRunnable
getStartTime
in interface CMRunnable
public boolean addSessionFilter(Session.SessionFilter filter)
Session
addSessionFilter
in interface Session
filter
- the filter to addpublic int getGroupID()
CMRunnable
getGroupID
in interface CMRunnable
public boolean isLockedUpWriting()
Session
isLockedUpWriting
in interface Session
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public void run()
run
in interface java.lang.Runnable
public boolean isRunning()
Session
public boolean isPendingLogin(java.lang.String otherLoginName)
Session
isPendingLogin
in interface Session
otherLoginName
- another login name potentially matchpublic void logout(boolean b1)
Session
public java.lang.String getTerminalType()
Session
getTerminalType
in interface Session
public void negotiateTelnetMode(int code)
Session
negotiateTelnetMode
in interface Session
code
- the telnet codeSession.TELNET_ANSI
,
Session.TELNET_ANSI16
,
Session.setClientTelnetMode(int, boolean)
,
Session.setServerTelnetMode(int, boolean)
public boolean isAllowedMxp(java.lang.String tag)
Session
isAllowedMxp
in interface Session
tag
- the tag to checkpublic boolean isFake()
Session
public void setIdleTimers()
Session
setIdleTimers
in interface Session
Session.getIdleMillis()
public boolean sendGMCPEvent(java.lang.String eventName, java.lang.String json)
Session
sendGMCPEvent
in interface Session
eventName
- the event name, like comm.channeljson
- the json doc, like {"blah":"BLAH"}public void setFakeInput(java.lang.String input)
Session
setFakeInput
in interface Session
input
- text to send.public java.lang.String[] getColorCodes()
Session
getColorCodes
in interface Session
public void onlyPrint(java.lang.String msg, boolean noCache)
Session
onlyPrint
in interface Session
msg
- the string to send to the usernoCache
- true to disable line caching, false otherwiseSession.rawCharsOut(char[])
public void onlyPrint(java.lang.String msg)
Session
onlyPrint
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
public void rawOut(java.lang.String msg)
Session
rawOut
in interface Session
msg
- the string to send to the userSession.rawCharsOut(char[])
public void rawPrintln(java.lang.String msg)
Session
rawPrintln
in interface Session
msg
- the string to send to the userSession.rawPrintln(String)
public void safeRawPrintln(java.lang.String msg)
Session
safeRawPrintln
in interface Session
msg
- the string to send to the userSession.safeRawPrint(String)
public void rawPrintln(java.lang.String msg, int pageBreak)
public void rawPrint(java.lang.String msg)
Session
rawPrint
in interface Session
msg
- the string to send to the userSession.rawPrint(String)
public void safeRawPrint(java.lang.String msg)
Session
safeRawPrint
in interface Session
msg
- the string to send to the userSession.safeRawPrintln(String)
public void rawPrint(java.lang.String msg, int pageBreak)
public void stdPrint(java.lang.String msg)
Session
stdPrint
in interface Session
msg
- the string to send to the userSession.rawPrint(String)
public void stdPrint(Physical Source, Environmental Target, Environmental Tool, java.lang.String msg)
Session
stdPrint
in interface Session
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 userSession.rawPrint(String)
public void stdPrintln(java.lang.String msg)
Session
stdPrintln
in interface Session
msg
- the string to send to the userSession.rawPrintln(String)
public void stdPrintln(Physical Source, Environmental Target, Environmental Tool, java.lang.String msg)
Session
stdPrintln
in interface Session
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 userSession.rawPrintln(String)
public void rawCharsOut(char[] c)
Session
rawCharsOut
in interface Session
c
- string (as char array) to send out to the userpublic void print(java.lang.String msg)
Session
print
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
,
Session.promptPrint(String)
public void promptPrint(java.lang.String msg)
Session
promptPrint
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
public void print(Physical Source, Environmental Target, Environmental Tool, java.lang.String msg)
Session
print
in interface Session
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 userSession.onlyPrint(String, boolean)
public void println(java.lang.String msg)
Session
println
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
public void println(Physical Source, Environmental Target, Environmental Tool, java.lang.String msg)
Session
println
in interface Session
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 userSession.onlyPrint(String, boolean)
public void wraplessPrintln(java.lang.String msg)
Session
wraplessPrintln
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
public void wraplessPrint(java.lang.String msg)
Session
wraplessPrint
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
public void colorOnlyPrintln(java.lang.String msg, boolean noCache)
Session
colorOnlyPrintln
in interface Session
msg
- the string to send to the usernoCache
- true to disable line caching, false otherwiseSession.onlyPrint(String, boolean)
public void colorOnlyPrint(java.lang.String msg, boolean noCache)
Session
colorOnlyPrint
in interface Session
msg
- the string to send to the usernoCache
- true to disable line caching, false otherwiseSession.onlyPrint(String, boolean)
public void colorOnlyPrintln(java.lang.String msg)
Session
colorOnlyPrintln
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
public void colorOnlyPrint(java.lang.String msg)
Session
colorOnlyPrint
in interface Session
msg
- the string to send to the userSession.onlyPrint(String, boolean)
public void setPromptFlag(boolean truefalse)
Session
setPromptFlag
in interface Session
truefalse
- true to send another prompt, false otherwisepublic char hotkey(long maxWait)
Session
public java.lang.String prompt(java.lang.String Message, java.lang.String Default)
Session
prompt
in interface Session
Message
- the prompt message to display to the userDefault
- the default response if the user just hits enterSession.prompt(String)
,
Session.prompt(String, long)
,
Session.prompt(String, String, long)
public void prompt(Session.InputCallback callBack)
Session
prompt
in interface Session
callBack
- the callback to modify and make when doneSession.InputCallback
public java.lang.String prompt(java.lang.String Message, java.lang.String Default, long maxTime)
Session
prompt
in interface Session
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 outSession.prompt(String)
,
Session.prompt(String, String)
,
Session.prompt(String, long)
public java.lang.String prompt(java.lang.String Message)
Session
prompt
in interface Session
Message
- the prompt message to display to the userSession.prompt(String, String)
,
Session.prompt(String, long)
,
Session.prompt(String, String, long)
public java.lang.String prompt(java.lang.String Message, long maxTime)
Session
prompt
in interface Session
Message
- the prompt message to display to the usermaxTime
- max number of milliseconds to wait before timing outSession.prompt(String)
,
Session.prompt(String, String)
,
Session.prompt(String, String, long)
public boolean confirm(java.lang.String Message, java.lang.String Default)
Session
confirm
in interface Session
Message
- the prompt message to display to the userDefault
- the default response if the user just hits enterSession.confirm(String, String, long)
public boolean confirm(java.lang.String Message, java.lang.String Default, long maxTime)
Session
confirm
in interface Session
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 outSession.confirm(String, String)
public java.lang.String choose(java.lang.String Message, java.lang.String Choices, java.lang.String Default)
Session
choose
in interface Session
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 enterSession.choose(String, String, String, long)
public 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
Session
choose
in interface Session
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 outparamsOut
- an empty list to put any extra crap added to the end of the choice.java.io.IOException
- a disconnectSession.choose(String, String, String, long)
public java.lang.String choose(java.lang.String Message, java.lang.String Choices, java.lang.String Default, long maxTime)
Session
choose
in interface Session
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 outSession.choose(String, String, String)
public java.lang.String blockingIn(long timeoutMillis, boolean filter)
Session
blockingIn
in interface Session
timeoutMillis
- milliseconds before InterruptedIOException thrownfilter
- true to allow normal coffeemud input filteringpublic java.lang.String readlineContinue()
Session
readlineContinue
in interface Session
public void setBeingSnoopedBy(Session session, boolean onOff)
Session
setBeingSnoopedBy
in interface Session
session
- the session to snoop on me.onOff
- true to turn on snooping, false otherwiseSession.setBeingSnoopedBy(Session, boolean)
,
Session.isBeingSnoopedBy(Session)
,
Session.snoopSuspension(int)
public boolean isBeingSnoopedBy(Session S)
Session
isBeingSnoopedBy
in interface Session
S
- the session to check for a snoop on me.Session.setBeingSnoopedBy(Session, boolean)
,
Session.isBeingSnoopedBy(Session)
,
Session.snoopSuspension(int)
public int snoopSuspension(int x)
Session
snoopSuspension
in interface Session
x
- the amount to change the snoop suspension counter bySession.setBeingSnoopedBy(Session, boolean)
,
Session.isBeingSnoopedBy(Session)
,
Session.snoopSuspension(int)
public void cmdExit(MOB mob, java.util.List<java.lang.String> commands) throws java.lang.Exception
java.lang.Exception
public void stopSession(boolean t1, boolean t2, boolean t3)
Session
stopSession
in interface Session
t1
- true to remove the mob from the gamet2
- true to force closed sockets, and removed sessiont3
- true to force a thread death, and false to be more lenientSession.isStopped()
public boolean isStopped()
Session
isStopped
in interface Session
Session.logout(boolean)
,
Session.isStopped()
public boolean isAfk()
Session
isAfk
in interface Session
Session.setAfkFlag(boolean)
,
Session.setAFKMessage(String)
public void setAfkFlag(boolean truefalse)
Session
setAfkFlag
in interface Session
truefalse
- true if they are AFK, false otherwiseSession.isAfk()
,
Session.getAfkMessage()
public java.lang.String getAfkMessage()
Session
getAfkMessage
in interface Session
Session.setAfkFlag(boolean)
,
Session.setAFKMessage(String)
public void setAFKMessage(java.lang.String str)
Session
setAFKMessage
in interface Session
str
- the reason given by the user that they are AFK.Session.setAfkFlag(boolean)
,
Session.getAfkMessage()
public java.util.List<java.lang.String> getPreviousCMD()
Session
getPreviousCMD
in interface Session
public java.util.Enumeration<java.util.List<java.lang.String>> getHistory()
Session
getHistory
in interface Session
public MOB mob()
Session
mob
in interface Session
Session.setMob(MOB)
public void setMob(MOB newmob)
Session
setMob
in interface Session
newmob
- the player MOB attached to this session object.Session.mob()
public void setAccount(PlayerAccount account)
Session
setAccount
in interface Session
account
- the player account attached to this session object.Session.mob()
public int convertEscape(java.lang.StringBuffer str, int index)
public void setCurrentColor(ColorLibrary.ColorState newcolor)
Session
setCurrentColor
in interface Session
newcolor
- the color to change it topublic void setLastColor(ColorLibrary.ColorState newColor)
Session
setLastColor
in interface Session
newColor
- the color to change it topublic void pushMarkedColor(ColorLibrary.ColorState newcolor)
Session
pushMarkedColor
in interface Session
newcolor
- the color to change it topublic ColorLibrary.ColorState getCurrentColor()
Session
getCurrentColor
in interface Session
public ColorLibrary.ColorState popMarkedColor()
Session
popMarkedColor
in interface Session
public ColorLibrary.ColorState getLastColor()
Session
getLastColor
in interface Session
public int getWrap()
Session
public java.lang.String getAddress()
Session
getAddress
in interface Session
public Session.SessionStatus getStatus()
Session
getStatus
in interface Session
Session.SessionStatus
public void setStatus(Session.SessionStatus newStatus)
Session
setStatus
in interface Session
newStatus
- the tick statusSession.SessionStatus
public boolean isWaitingForInput()
Session
isWaitingForInput
in interface Session
public long getTotalMillis()
Session
getTotalMillis
in interface Session
public long getTotalTicks()
Session
getTotalTicks
in interface Session
public long getIdleMillis()
Session
getIdleMillis
in interface Session
Session.setIdleTimers()
public long getMillisOnline()
Session
getMillisOnline
in interface Session
public long getLastPKFight()
Session
getLastPKFight
in interface Session
Session.setLastPKFight()
,
Session.setLastNPCFight()
public void setLastPKFight()
Session
setLastPKFight
in interface Session
Session.getLastPKFight()
,
Session.getLastNPCFight()
public long getLastNPCFight()
Session
getLastNPCFight
in interface Session
Session.setLastPKFight()
,
Session.setLastNPCFight()
public void setLastNPCFight()
Session
setLastNPCFight
in interface Session
Session.getLastPKFight()
,
Session.getLastNPCFight()
public long getInputLoopTime()
Session
getInputLoopTime
in interface Session
Session.setInputLoopTime()
public void setInputLoopTime()
Session
setInputLoopTime
in interface Session
Session.getInputLoopTime()
public java.util.List<java.lang.String> getLastMsgs()
Session
getLastMsgs
in interface Session
public void setServerTelnetMode(int telnetCode, boolean onOff)
Session
setServerTelnetMode
in interface Session
telnetCode
- the telnet codeonOff
- true to turn on, false to turn off the flagSession.TELNET_ANSI
,
Session.getServerTelnetMode(int)
public boolean getServerTelnetMode(int telnetCode)
Session
getServerTelnetMode
in interface Session
telnetCode
- the telnet codeSession.TELNET_ANSI
,
Session.setServerTelnetMode(int, boolean)
public void setClientTelnetMode(int telnetCode, boolean onOff)
Session
setClientTelnetMode
in interface Session
telnetCode
- the telnet codeonOff
- true to turn on, false to turn off the flagSession.TELNET_ANSI
,
Session.getClientTelnetMode(int)
public boolean getClientTelnetMode(int telnetCode)
Session
getClientTelnetMode
in interface Session
telnetCode
- the telnet codeSession.TELNET_ANSI
,
Session.setClientTelnetMode(int, boolean)
public void changeTelnetMode(int telnetCode, boolean onOff)
Session
changeTelnetMode
in interface Session
telnetCode
- the telnet codeonOff
- true to turn on, false to turn off the flagSession.TELNET_ANSI
,
Session.TELNET_ANSI16
,
Session.setClientTelnetMode(int, boolean)
,
Session.setServerTelnetMode(int, boolean)
public void initTelnetMode(int mobbitmap)
Session
initTelnetMode
in interface Session
mobbitmap
- the mobbitmap the bitmap of mob flags to use as a guide in negotiationMOB.getAttributesBitmap()
,
MOB.Attrib
,
Session.changeTelnetMode(int, boolean)
public int getSaveStatIndex()
Modifiable
getSaveStatIndex
in interface Modifiable
Modifiable.getStatCodes()
,
Modifiable.getStat(String)
,
Modifiable.setStat(String, String)
public java.lang.String getStat(java.lang.String code)
Modifiable
getStat
in interface Modifiable
code
- the name of the field to read.Modifiable.getStatCodes()
public java.lang.String[] getStatCodes()
Modifiable
getStatCodes
in interface Modifiable
Modifiable.getStat(String)
,
Modifiable.setStat(String, String)
public boolean isStat(java.lang.String code)
Modifiable
isStat
in interface Modifiable
code
- the name of the field to read.Modifiable.getStatCodes()
public void setStat(java.lang.String code, java.lang.String val)
Modifiable
setStat
in interface Modifiable
code
- the name of the field to setval
- the value to set the field toModifiable.getStatCodes()
public long activeTimeMillis()
CMRunnable
activeTimeMillis
in interface CMRunnable
public boolean isAllowedMcp(java.lang.String packageName, float version)
Session
isAllowedMcp
in interface Session
packageName
- the package to checkversion
- the version of the package to checkpublic boolean sendMcpCommand(java.lang.String packageCommand, java.lang.String parms)
Session
sendMcpCommand
in interface Session
packageCommand
- the fully formed commandparms
- the variable parameters, already well formedpublic boolean autoLogin(java.lang.String name, java.lang.String password)
Session