All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class key.ConnectingPlayer

java.lang.Object
   |
   +----key.Atom
           |
           +----key.AnimatedAtom
                   |
                   +----key.ConnectingPlayer

public class ConnectingPlayer
extends AnimatedAtom
implements LatentlyCached
Is the main instance of a player on the program. The authenticate() routine has been changed in player to attempt to stop a player being swapped out while they connect, but no guarantee's... we should probably be using tags in here somewhere. It is the responsibility of this class to send the opening logo, and retrieve a player from the name entered. (Authenticating the player or creating a suitable player as necessary). No further action need be taken.


Constructor Index

 o ConnectingPlayer(InteractiveConnection)

Method Index

 o connectGuest(InteractiveConnection, String)
If a players name is not matched to a character on the program, this routine leads them through the operations in creating a character of their own.
 o connectResident(InteractiveConnection, Player)
 o connectToProgram(InteractiveConnection, Player)
 o deallocate()
 o getInteractiveConnection()
 o getPlayerFromName(InteractiveConnection, String)
Retrieves a player structure from the entered name.
 o getPlayersName(InteractiveConnection)
This function returns the player's name, as entered at the 'Please enter your name:' prompt.
 o guestConfirmName(InteractiveConnection, String)
This function outputs the 'are you sure you want to use this name' prompt, when someone starts to create a new player.
 o loadFrom(DataInput)
 o modified()
 o outputLogo()
Puts the initial logo on the players screen.
 o resetModify()
 o run()
 o writeTo(DataOutput)

Constructors

 o ConnectingPlayer
 public ConnectingPlayer(InteractiveConnection connection)

Methods

 o run
 public void run()
Overrides:
run in class AnimatedAtom
 o connectGuest
 protected Player connectGuest(InteractiveConnection ic,
                               String name) throws IOException
If a players name is not matched to a character on the program, this routine leads them through the operations in creating a character of their own.

Returns:
null if an error or cancellation occurs
 o connectResident
 public Player connectResident(InteractiveConnection ic,
                               Player p) throws IOException
 o connectToProgram
 public void connectToProgram(InteractiveConnection ic,
                              Player p) throws IOException
 o getPlayerFromName
 protected Player getPlayerFromName(InteractiveConnection ic,
                                    String name) throws IOException
Retrieves a player structure from the entered name. Should the name not be acceptable for some reason, null is returned. Should a serious error occur, the connection will be closed, also.

Returns:
null on failure
 o outputLogo
 protected void outputLogo()
Puts the initial logo on the players screen.

 o getPlayersName
 protected String getPlayersName(InteractiveConnection ic) throws IOException
This function returns the player's name, as entered at the 'Please enter your name:' prompt.

 o guestConfirmName
 protected boolean guestConfirmName(InteractiveConnection ic,
                                    String name) throws IOException
This function outputs the 'are you sure you want to use this name' prompt, when someone starts to create a new player.

Parameters:
ic - the connection
name - the name the player originally typed
Returns:
true if the person replied 'yes'
 o getInteractiveConnection
 public InteractiveConnection getInteractiveConnection()
 o modified
 public boolean modified()
 o resetModify
 public void resetModify()
 o deallocate
 public synchronized void deallocate()
 o writeTo
 public void writeTo(DataOutput to) throws IOException
Overrides:
writeTo in class Atom
 o loadFrom
 public void loadFrom(DataInput from) throws IOException
Overrides:
loadFrom in class Atom

All Packages  Class Hierarchy  This Package  Previous  Next  Index