com.planet_ink.coffee_mud.Libraries.interfaces
Interface CharCreationLibrary.LoginSession

Enclosing interface:
CharCreationLibrary

public static interface CharCreationLibrary.LoginSession

This is the main login state machine transaction object. It allows the telnet session getting thread and i/o time to repeatedly call into the LoginSession object it creates until the object reports that it is completely done. A login session includes initial telnet negotiation, login prompts, the account menu, and all of character creation.


Method Summary
 java.lang.String acceptInput(Session session)
          This strange method calls back into the given session for input from the user, if any is available.
 java.lang.String login()
          The login name received in the first prompt after connection.
 CharCreationLibrary.LoginResult loginSystem(Session session)
          Continues through the login state machine for the given session.
 void logoutLoginSession()
          Puts the session into a "logged out" state, which means either back to the initial prompt, or back to the account menu, depending.
 boolean reset()
          Set to true whenever the loginsystem needs the session to basically start the whole state machine over by re-creating the LoginSession object and calling in again.
 boolean skipInputThisTime()
          Returns true if the loginsystem needs the session to skip any input it was previously asked for and simply call right back into the state machine.
 

Method Detail

login

java.lang.String login()
The login name received in the first prompt after connection.

Returns:
the login name previously received.

loginSystem

CharCreationLibrary.LoginResult loginSystem(Session session)
                                            throws java.io.IOException
Continues through the login state machine for the given session. What the session should do next depends on the result object sent back.

Parameters:
session - the session trying to login
Returns:
the results of the latest state
Throws:
java.io.IOException - any I/O errors that occur
See Also:
CharCreationLibrary.LoginResult

logoutLoginSession

void logoutLoginSession()
Puts the session into a "logged out" state, which means either back to the initial prompt, or back to the account menu, depending.


reset

boolean reset()
Set to true whenever the loginsystem needs the session to basically start the whole state machine over by re-creating the LoginSession object and calling in again. It is an "I give up!" flag from this session.

Returns:
true if its time for a new LoginSession

skipInputThisTime

boolean skipInputThisTime()
Returns true if the loginsystem needs the session to skip any input it was previously asked for and simply call right back into the state machine. The is usually done with when one non-input state needs to force proceed to another non-input state.

Returns:
true to skip user input

acceptInput

java.lang.String acceptInput(Session session)
                             throws java.net.SocketException,
                                    java.io.IOException
This strange method calls back into the given session for input from the user, if any is available. In a stateless I/O system, usually there isn't, so null is returned.

Parameters:
session - the session to ask for input
Returns:
null if none yet available, or the fully ENTEREd user input.
Throws:
java.net.SocketException - a socket error that occurs
java.io.IOException - some other I/O error that occurred