|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Common.FakeSession
public class FakeSession
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
FakeSession()
|
|
| Method Summary | |
|---|---|
boolean |
afkFlag()
Returns whether this mob/session is currently Away From Keyboard |
java.lang.String |
afkMessage()
Returns the reason given by the user that they are AFK. |
boolean |
amBeingSnoopedBy(Session S)
Checks to see if the given session is snooping on this one. |
java.lang.String |
blockingIn()
Blocks the current thread until the user attached to this session hits ENTER, returning the characters they enter. |
void |
changeTelnetMode(int telnetCode,
boolean onOff)
Change telnet mode by sending the appropriate command to the clients client. |
java.lang.String |
choose(java.lang.String Message,
java.lang.String Choices,
java.lang.String Default)
Prompts the user to enter one character responses from a set of valid choices. |
java.lang.String |
choose(java.lang.String Message,
java.lang.String Choices,
java.lang.String Default,
long maxTime)
Prompts the user to enter one character responses from a set of valid choices. |
boolean |
clientTelnetMode(int telnetCode)
Gets a client telnet mode flag. |
java.lang.String[] |
clookup()
Returns a list of telnet coded strings indexed by coffeemud color code. |
void |
cmdExit(MOB mob,
java.util.Vector commands)
Queries and executes the quit command for the mob. |
void |
colorOnlyPrint(java.lang.String msg)
Lower-Medium-level text output method. |
void |
colorOnlyPrint(java.lang.String msg,
int pageBreak,
boolean noCache)
Lower-Medium-level text output method. |
void |
colorOnlyPrintln(java.lang.String msg)
Lower-Medium-level text output method. |
void |
colorOnlyPrintln(java.lang.String msg,
int pageBreak,
boolean noCache)
Lower-Medium-level text output method. |
int |
compareTo(CMObject o)
|
boolean |
confirm(java.lang.String Message,
java.lang.String Default)
Prompts the user to enter Y or N, and returns what they enter. |
boolean |
confirm(java.lang.String Message,
java.lang.String Default,
long maxTime)
Prompts the user to enter Y or N, and returns what they enter. |
CMObject |
copyOf()
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed. |
int |
currentColor()
Returns the current color code. |
java.lang.String |
getAddress()
Gets the current telnet clients ip address. |
int |
getColor(char c)
Returns the given color code, unless it is one that translates to another, such as ? |
long |
getIdleMillis()
Gets the number of milliseconds since a user entry was registered by this session |
java.util.Vector |
getLastMsgs()
Returns a Vector of the last several message strings received by this user. |
long |
getLastNPCFight()
Gets the milliseconds timestamp since this user last registered a npc fight. |
long |
getLastPKFight()
Gets the milliseconds timestamp since this user last registered a pk fight. |
long |
getMillisOnline()
Gets the milliseconds elapsed since this user came online. |
int |
getStatus()
Gets the tick/thread status of this session object. |
java.lang.String |
getTerminalType()
Gets the terminal type the user has |
long |
getTickStatus()
|
long |
getTotalMillis()
Gets the total milliseconds consumed by this session objects thread. |
long |
getTotalTicks()
Gets the total number of ticks consumed by this session object thread. |
int |
getWrap()
Gets the column number for engine word-wrapping. |
char |
hotkey(long maxWait)
Waits the given milliseconds for a key to be pressed, after which it returns that key, or \0 if nothing pressed. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in during initialization. |
void |
initializeSession(java.net.Socket s,
java.lang.String introTextStr)
Negotiates various telnet options (or attempts to), and prints the introTextStr to the user. |
void |
initTelnetMode(int mobbitmap)
Initializes a telnet mode between this session and the connected client by negotiating certain fundamental flags, like ANSI, MXP, and MSP. |
boolean |
isLockedUpWriting()
Checks whether this session is currently over its time limit trying to write data to its socket. |
boolean |
killFlag()
Returns whether this session is done, or slated to be done. |
int |
lastColor()
Returns the previous current color code. |
long |
lastLoopTime()
Returns the last time in milliseconds that this session began its input loop. |
void |
logoff(boolean t1,
boolean t2,
boolean t3)
Force the current player to logoff. |
java.lang.String |
makeEscape(int c)
Converts a character after the ^ sign (usually a color code) into an appropriate telnet escape sequence string for output. |
MOB |
mob()
Returns the player MOB attached to this session object. |
void |
negotiateTelnetMode(int code)
Change telnet mode by negotiating the command to the clients client. |
CMObject |
newInstance()
Returns a new instance of this class. |
void |
onlyPrint(java.lang.String msg)
Low level text output method. |
void |
onlyPrint(java.lang.String msg,
int pageBreak,
boolean noCache)
Low level text output method. |
void |
out(char[] c)
Lowest level user-output method. |
java.util.Vector |
previousCMD()
Returns a pre-parsed, pre-filtered Vector of strings representing the last command entered by the user through this session. |
void |
print(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Medium-level text output method. |
void |
print(java.lang.String msg)
Medium-level text output method. |
void |
println(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Medium-level text output method. |
void |
println(java.lang.String msg)
Medium-level text output method. |
java.lang.String |
prompt(java.lang.String Message)
Prompts the user to enter a string, and then returns what the enter. |
java.lang.String |
prompt(java.lang.String Message,
long maxTime)
Prompts the user to enter a string, and then returns what the enter. |
java.lang.String |
prompt(java.lang.String Message,
java.lang.String Default)
Prompts the user to enter a string, and then returns what the enter. |
java.lang.String |
prompt(java.lang.String Message,
java.lang.String Default,
long maxTime)
Prompts the user to enter a string, and then returns what the enter. |
void |
rawOut(java.lang.String msg)
Lowest level user-output method. |
void |
rawPrint(java.lang.String msg)
Low level line-output method. |
void |
rawPrint(java.lang.String msg,
int pageBreak)
Low level line-output method. |
void |
rawPrintln(java.lang.String msg)
Low level line-output method. |
void |
rawPrintln(java.lang.String msg,
int pageBreak)
Low level line-output method. |
java.lang.String |
readlineContinue()
Blocks for a short amount of time, returning an input string only if the user happens to have hit enter. |
boolean |
serverTelnetMode(int telnetCode)
Gets a server telnet mode flag. |
void |
setAfkFlag(boolean truefalse)
Sets whether this mob/session is currently Away From Keyboard |
void |
setAFKMessage(java.lang.String str)
Returns the reason given by the user that they are AFK. |
void |
setClientTelnetMode(int telnetCode,
boolean onOff)
Sets a client telnet mode flag. |
void |
setLastNPCFight()
Sets now as the milliseconds timestamp since this user last registered a npc fight. |
void |
setLastPKFight()
Sets now as the milliseconds timestamp since this user last registered a pk fight. |
void |
setMob(MOB newmob)
Sets the player MOB attached to this session object. |
void |
setPromptFlag(boolean truefalse)
Notifies this session to output the users prompt again once it has reached a suitable lapse in text output. |
void |
setServerTelnetMode(int telnetCode,
boolean onOff)
Sets a server telnet mode flag. |
int |
snoopSuspension(int x)
Increments or decrements the snoop suspension counter by the given amount. |
void |
start()
There is no interface for Thread, so since DefaultSession implements thread, and this fact needs to be externatized, the thread start method is hereby externalized. |
void |
startBeingSnoopedBy(Session S)
Notifies this session that the given session is snooping it. |
void |
stdPrint(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Higher-level line output method. |
void |
stdPrint(java.lang.String msg)
Higher-level line output method. |
void |
stdPrintln(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Higher-level line output method. |
void |
stdPrintln(java.lang.String msg)
Higher-level line output method. |
void |
stopBeingSnoopedBy(Session S)
Notifies this session that the given session is no longer snooping it. |
boolean |
tick(Tickable ticking,
int tickID)
|
void |
wraplessPrint(java.lang.String msg)
Medium-level text output method. |
void |
wraplessPrintln(java.lang.String msg)
Medium-level text output method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FakeSession()
| Method Detail |
|---|
public boolean tick(Tickable ticking,
int tickID)
public java.lang.String ID()
CMObject
ID in interface CMObjectpublic CMObject newInstance()
CMObject
newInstance in interface CMObjectpublic CMObject copyOf()
CMObject
copyOf in interface CMObjectpublic int compareTo(CMObject o)
compareTo in interface java.lang.Comparable<CMObject>public long getTickStatus()
public void initializeSession(java.net.Socket s,
java.lang.String introTextStr)
Session
initializeSession in interface Sessions - the socket the user connected fromintroTextStr - introductory text string (Hello!)public boolean isLockedUpWriting()
Session
isLockedUpWriting in interface Sessionpublic void initializeClass()
CMObject
initializeClass in interface CMObjectpublic void start()
Session
start in interface Sessionpublic java.lang.String getTerminalType()
Session
getTerminalType in interface Sessionpublic void negotiateTelnetMode(int code)
Session
negotiateTelnetMode in interface Sessioncode - the telnet codeSession.TELNET_ANSI,
Session.setClientTelnetMode(int, boolean),
Session.setServerTelnetMode(int, boolean)public java.lang.String[] clookup()
Session
clookup in interface Session
public void onlyPrint(java.lang.String msg,
int pageBreak,
boolean noCache)
Session
onlyPrint in interface Sessionmsg - the string to send to the userpageBreak - the number of lines to break on, -1=NOnoCache - true to disable line caching, false otherwiseSession.out(char[])public void onlyPrint(java.lang.String msg)
Session
onlyPrint in interface Sessionmsg - the string to send to the userSession.onlyPrint(String, int, boolean)public void rawOut(java.lang.String msg)
Session
rawOut in interface Sessionmsg - the string to send to the userSession.out(char[])public void rawPrintln(java.lang.String msg)
Session
rawPrintln in interface Sessionmsg - the string to send to the userSession.rawPrintln(String, int)
public void rawPrintln(java.lang.String msg,
int pageBreak)
Session
rawPrintln in interface Sessionmsg - the string to send to the userpageBreak - the number of lines to break on, -1=NOSession.rawPrint(String, int)public void rawPrint(java.lang.String msg)
Session
rawPrint in interface Sessionmsg - the string to send to the userSession.rawPrint(String, int)
public void rawPrint(java.lang.String msg,
int pageBreak)
Session
rawPrint in interface Sessionmsg - the string to send to the userpageBreak - the number of lines to break on, -1=NOSession.onlyPrint(String, int, boolean)public void stdPrint(java.lang.String msg)
Session
stdPrint in interface Sessionmsg - the string to send to the userSession.rawPrint(String, int)
public void stdPrint(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Session
stdPrint in interface SessionSource - 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, int)public void stdPrintln(java.lang.String msg)
Session
stdPrintln in interface Sessionmsg - the string to send to the userSession.rawPrintln(String, int)
public void stdPrintln(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Session
stdPrintln in interface SessionSource - 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, int)public void out(char[] c)
Session
out in interface Sessionc - string (as char array) to send out to the userpublic void print(java.lang.String msg)
Session
print in interface Sessionmsg - the string to send to the userSession.onlyPrint(String, int, boolean)
public void print(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Session
print in interface SessionSource - 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, int, boolean)public void println(java.lang.String msg)
Session
println in interface Sessionmsg - the string to send to the userSession.onlyPrint(String, int, boolean)
public void println(Environmental Source,
Environmental Target,
Environmental Tool,
java.lang.String msg)
Session
println in interface SessionSource - 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, int, boolean)public void wraplessPrintln(java.lang.String msg)
Session
wraplessPrintln in interface Sessionmsg - the string to send to the userSession.onlyPrint(String, int, boolean)public void wraplessPrint(java.lang.String msg)
Session
wraplessPrint in interface Sessionmsg - the string to send to the userSession.onlyPrint(String, int, boolean)
public void colorOnlyPrintln(java.lang.String msg,
int pageBreak,
boolean noCache)
Session
colorOnlyPrintln in interface Sessionmsg - the string to send to the userpageBreak - the number of lines to break on, -1=NOnoCache - true to disable line caching, false otherwiseSession.onlyPrint(String, int, boolean)
public void colorOnlyPrint(java.lang.String msg,
int pageBreak,
boolean noCache)
Session
colorOnlyPrint in interface Sessionmsg - the string to send to the userpageBreak - the number of lines to break on, -1=NOnoCache - true to disable line caching, false otherwiseSession.onlyPrint(String, int, boolean)public void colorOnlyPrintln(java.lang.String msg)
Session
colorOnlyPrintln in interface Sessionmsg - the string to send to the userSession.onlyPrint(String, int, boolean)public void colorOnlyPrint(java.lang.String msg)
Session
colorOnlyPrint in interface Sessionmsg - the string to send to the userSession.onlyPrint(String, int, boolean)public void setPromptFlag(boolean truefalse)
Session
setPromptFlag in interface Sessiontruefalse - true to send another prompt, false otherwisepublic char hotkey(long maxWait)
Session
hotkey in interface SessionmaxWait - the maximum milliseconds to wait
public java.lang.String prompt(java.lang.String Message,
java.lang.String Default)
Session
prompt in interface SessionMessage - the prompt message to display to the userDefault - the default response if the user just hits enter
Session.prompt(String),
Session.prompt(String, long),
Session.prompt(String, String, long)
public java.lang.String prompt(java.lang.String Message,
java.lang.String Default,
long maxTime)
Session
prompt in interface SessionMessage - 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
Session.prompt(String),
Session.prompt(String, String),
Session.prompt(String, long)public java.lang.String prompt(java.lang.String Message)
Session
prompt in interface SessionMessage - the prompt message to display to the user
Session.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 SessionMessage - the prompt message to display to the usermaxTime - max number of milliseconds to wait before timing out
Session.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 SessionMessage - the prompt message to display to the userDefault - the default response if the user just hits enter
Session.confirm(String, String, long)
public boolean confirm(java.lang.String Message,
java.lang.String Default,
long maxTime)
Session
confirm in interface SessionMessage - 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
Session.confirm(String, String)
public java.lang.String choose(java.lang.String Message,
java.lang.String Choices,
java.lang.String Default)
Session
choose in interface SessionMessage - 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
Session.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 SessionMessage - 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
Session.choose(String, String, String)public java.lang.String blockingIn()
Session
blockingIn in interface Sessionpublic java.lang.String readlineContinue()
Session
readlineContinue in interface Sessionpublic void startBeingSnoopedBy(Session S)
Session
startBeingSnoopedBy in interface SessionS - the session to snoop on me.Session.startBeingSnoopedBy(Session),
Session.stopBeingSnoopedBy(Session),
Session.amBeingSnoopedBy(Session),
Session.snoopSuspension(int)public void stopBeingSnoopedBy(Session S)
Session
stopBeingSnoopedBy in interface SessionS - the session to stop snooping on me.Session.startBeingSnoopedBy(Session),
Session.stopBeingSnoopedBy(Session),
Session.amBeingSnoopedBy(Session),
Session.snoopSuspension(int)public boolean amBeingSnoopedBy(Session S)
Session
amBeingSnoopedBy in interface SessionS - the session to check for a snoop on me.
Session.startBeingSnoopedBy(Session),
Session.stopBeingSnoopedBy(Session),
Session.amBeingSnoopedBy(Session),
Session.snoopSuspension(int)public int snoopSuspension(int x)
Session
snoopSuspension in interface Sessionx - the amount to change the snoop suspension counter by
Session.startBeingSnoopedBy(Session),
Session.stopBeingSnoopedBy(Session),
Session.amBeingSnoopedBy(Session),
Session.snoopSuspension(int)
public void cmdExit(MOB mob,
java.util.Vector commands)
throws java.lang.Exception
Session
cmdExit in interface Sessionmob - the character quitting (sent in case the session went null)commands - any command-line parameters given on quit
java.lang.Exception - any exception generated from trying to quitSession.logoff(boolean, boolean, boolean),
Session.killFlag()
public void logoff(boolean t1,
boolean t2,
boolean t3)
Session
logoff in interface Sessiont1 - 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.cmdExit(MOB, Vector),
Session.killFlag()public boolean killFlag()
Session
killFlag in interface SessionSession.logoff(boolean, boolean, boolean),
Session.cmdExit(MOB, Vector),
Session.killFlag()public boolean afkFlag()
Session
afkFlag in interface SessionSession.setAfkFlag(boolean),