|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.core.intermud.net.Interactive
public abstract class Interactive
This class provides an implementation of the Imaginary server
interactive module. It is responsible for handling the login
of an individual user and processing its input as directed
by the server.
Created: 27 September 1996
Last modified: 27 September 1996
| Constructor Summary | |
|---|---|
Interactive()
Constructs a new interactive object and initializes its data. |
|
| Method Summary | |
|---|---|
void |
connect()
Implementation of the ServerUser connect method. |
static java.lang.String |
createKeyName(java.lang.String nom)
Given a user name, this method will build a unique key. |
void |
destruct()
Stops any running I/O threads for this interactive, closes the user socket, and marks the object for destruction according to the requirements of the ServerObject interface. |
static Interactive |
findUser(java.lang.String nom)
Given a user name, this method will find the Interactive instance associated with that user name. |
java.lang.String |
getAddressName()
Provides the address from which this user is connected. |
InteractiveBody |
getBody()
Provides the body to which this user is connected. |
java.util.Date |
getCurrentLoginTime()
Provides the time at which the user logged in for this session |
boolean |
getDestructed()
Tells whether or not the user is marked for destruction. |
java.lang.String |
getDisplayName()
Provides the user's name as they wish it to appear with mixed capitalization, spaces, hyphens, etc. |
java.lang.String |
getEmail()
Provides the user's email address |
int |
getIdle()
Provides the number of seconds which have elapsed since the user last entered a command. |
java.lang.String |
getKeyName()
Provides the key name for this user. |
java.lang.String |
getLastLoginSite()
Provides the name of the site from which the user logged in at their last login. |
java.util.Date |
getLastLoginTime()
Provides the time of the user's last login. |
java.lang.String |
getObjectId()
Gives the user object's object id. |
protected java.lang.String |
getPassword()
Allows a subclass to get the password. |
java.lang.String |
getPrompt()
Provides the user's command prompt. |
java.lang.String |
getRealName()
Provides the user's real name, or null if they never entered a real name. |
protected void |
input(java.lang.String cmd)
Called whenever a command is pulled off the incoming command stack. |
protected void |
loseLink()
This method is triggered by the input thread when it detects that the user has lost their link. |
void |
processEvent()
Does event handling for the user object. |
void |
processInput()
The server triggers this method once each server cycle to see if the user has any input waiting to be processed. |
void |
redirectInput(Input ob)
Redirects user input to the input object passed to it. |
void |
sendMessage(java.lang.String msg)
Sends a message across to the client with a newline appended to the message. |
void |
sendMessage(java.lang.String msg,
boolean nowrap)
Sends a message across to the client. |
void |
setBody(InteractiveBody ob)
Sets the body to which this interactive connection is connected. |
void |
setDisplayName(java.lang.String str)
Sets the user's display name. |
void |
setEmail(java.lang.String str)
Sets the user's email address |
protected void |
setKeyName(java.lang.String str)
Sets the key name during user creation. |
void |
setLastLoginSite(java.lang.String site)
Sets the last login site. |
void |
setLastLoginTime(java.util.Date time)
Used by the login process to set the last login time. |
void |
setObjectId(java.lang.String id)
Allows the server to set the object id. |
protected void |
setPassword(java.lang.String pass)
Sets the user's password. |
void |
setRealName(java.lang.String nom)
Sets the user's real name. |
void |
setSocket(java.net.Socket s)
Called by the server before connect() is called to assign the socket for this Interactive to it. |
boolean |
validatePassword(java.lang.String other)
Validates a user password against a random string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Interactive()
| Method Detail |
|---|
public static java.lang.String createKeyName(java.lang.String nom)
throws InvalidNameException
nom - the visual name to create a key from
InvalidNameException - thrown if the name produces an unuseable keypublic static Interactive findUser(java.lang.String nom)
nom - the name of the desired user
public void connect()
connect in interface ServerUserpublic void destruct()
destruct in interface ServerObjectServerObject.getDestructed()protected void input(java.lang.String cmd)
cmd - the command to be executedprocessInput()protected void loseLink()
public void processEvent()
processEvent in interface ServerObjectServerObject.processEvent()public final void processInput()
processInput in interface ServerUserinput(java.lang.String),
ServerUser.processInput(),
ServerThread.run()public final void redirectInput(Input ob)
ob - the instance of com.planet_ink.coffee_mud.core.intermud.net.Input to which input will be redirectedInput,
input(java.lang.String)public final void sendMessage(java.lang.String msg)
msg - the message to send to the client machine
public final void sendMessage(java.lang.String msg,
boolean nowrap)
msg - the message to send to the clientnowrap - if true, no newline is attachedpublic final boolean validatePassword(java.lang.String other)
public final java.lang.String getAddressName()
public final InteractiveBody getBody()
public void setBody(InteractiveBody ob)
ob - the body to which this interactive is being connectedInteractiveBodypublic final java.util.Date getCurrentLoginTime()
public boolean getDestructed()
getDestructed in interface ServerObjectpublic java.lang.String getDisplayName()
public final void setDisplayName(java.lang.String str)
str - the new display namepublic final java.lang.String getEmail()
public final void setEmail(java.lang.String str)
str - the new email addresspublic final int getIdle()
public final java.lang.String getKeyName()
tell descartes hi! tell deScartes hi! tell des cartes hi!The key name thus creates a common denomenator to which a name can be reduced for comparison.
createKeyName(java.lang.String)protected void setKeyName(java.lang.String str)
str - the key name being setgetKeyName()public final java.lang.String getLastLoginSite()
public void setLastLoginSite(java.lang.String site)
site - the last login sitepublic final java.util.Date getLastLoginTime()
public void setLastLoginTime(java.util.Date time)
time - the time the user last logged inpublic final java.lang.String getObjectId()
getObjectId in interface ServerObjectServerObject.getObjectId()public final void setObjectId(java.lang.String id)
setObjectId in interface ServerObjectid - the object id assigned to this objectServerObject.setObjectId(java.lang.String)protected java.lang.String getPassword()
protected void setPassword(java.lang.String pass)
pass - the new passwordpublic java.lang.String getPrompt()
public final java.lang.String getRealName()
public void setRealName(java.lang.String nom)
nom - the real name for the user
public final void setSocket(java.net.Socket s)
throws java.io.IOException
setSocket in interface ServerUsers - the socket for this connection
java.io.IOException - thrown if a problem creating I/O streams occursServerUser.setSocket(java.net.Socket)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||