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.
-
ConnectingPlayer(InteractiveConnection)
-
-
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.
-
connectResident(InteractiveConnection, Player)
-
-
connectToProgram(InteractiveConnection, Player)
-
-
deallocate()
-
-
getInteractiveConnection()
-
-
getPlayerFromName(InteractiveConnection, String)
- Retrieves a player structure from the entered name.
-
getPlayersName(InteractiveConnection)
- This function returns the player's name, as entered at
the 'Please enter your name:' prompt.
-
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.
-
loadFrom(DataInput)
-
-
modified()
-
-
outputLogo()
- Puts the initial logo on the players screen.
-
resetModify()
-
-
run()
-
-
writeTo(DataOutput)
-
ConnectingPlayer
public ConnectingPlayer(InteractiveConnection connection)
run
public void run()
- Overrides:
- run in class AnimatedAtom
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
connectResident
public Player connectResident(InteractiveConnection ic,
Player p) throws IOException
connectToProgram
public void connectToProgram(InteractiveConnection ic,
Player p) throws IOException
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
outputLogo
protected void outputLogo()
- Puts the initial logo on the players screen.
getPlayersName
protected String getPlayersName(InteractiveConnection ic) throws IOException
- This function returns the player's name, as entered at
the 'Please enter your name:' prompt.
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'
getInteractiveConnection
public InteractiveConnection getInteractiveConnection()
modified
public boolean modified()
resetModify
public void resetModify()
deallocate
public synchronized void deallocate()
writeTo
public void writeTo(DataOutput to) throws IOException
- Overrides:
- writeTo in class Atom
loadFrom
public void loadFrom(DataInput from) throws IOException
- Overrides:
- loadFrom in class Atom
All Packages Class Hierarchy This Package Previous Next Index