| Class | Account |
| In: |
lib/core/account.rb
|
| Parent: | Root |
The Account class handles connection login and passes them to character.
| character | [RW] | |
| conn | [RW] | |
| echo | [RW] | |
| mode | [RW] | |
| terminal | [RW] | |
| termsize | [RW] |
If echo hasn’t been negotiated, we want to leave the cursor after the message prompt, so we prepend linefeeds in front of messages. This is hackish.
Handles message while in the login menu - called by parse_messages. This was refactored out of Account#parse_messages for length reasons.
@mode tracks the state changes, This routine is entered by any @modes staring with :menu.
The following state transition diagram illustrates the possible transitions.
:menu -> :menucr Create a character
-> :menupl Play a character
:menucr -> :playing Get character name, create character and play
Handles String messages from Connection - called by update. This was refactored out of Account#update for length reasons.
@mode tracks the state changes, The Account is created with the initial state of :initialize. The following state transition diagram illustrates the possible transitions.
:intialize -> :name Set when Account:update receives :initdone msg :name -> :password Sets @login_name and finds @account
:playing Creates a new character if Guest account
:password -> :newacct Sets @login_passwd
-> :menu Good passwd, switches account, if account_system
option on goes to menu
-> :playing Good passwd, switches account, loads character
-> :name Bad passwd
-> disconnect Bad passwd, exceeds @check attempts
(see Account#disconnect)
:newacct -> :menu If account_system option on goes to menu
-> :playing Creates new character, adds account
:menu -> parse_menu Redirect message (see Account#parse_menu) :playing -> @character Redirect message (see Character#parse)
Receives messages from a Connection being observed and handles login state.
This supports the following:
is done setting up and done negotiating an initial state. It triggers us to start sending output and parsing input.
send it to parse_messages.