All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class key.InteractiveConnection

java.lang.Object
   |
   +----key.Atom
           |
           +----key.InteractiveConnection

public abstract class InteractiveConnection
extends Atom
all output from the program is classified into one of the 'types' of data that is being fed back. This not only allows a great flexibility in the output method used on a telnet connection, but it allows for the easy expansion of connections to support applet clients or other frontends that require code support. This class supports several 'codes' within the strings you pass to output to the program.


Variable Index

 o site

Constructor Index

 o InteractiveConnection(Socket)
The constructor must take a socket as its sole argument

Method Index

 o blankLine()
leave some blank space (usually the height of the characters
 o check()
This function will be called every 'now and again', as a 'check' function when no input is required (we're not waiting), but some is allowed.
 o close()
 o discard()
 o evalReadOnlyProperty(ReadOnlyProperty)
override to return the correct value for the supplied property make sure you call super.evalReadOnlyProperty if you don't understand it before returning null
 o getFullSiteName()
 o getSite()
 o getSiteName()
 o hiddenInput(String)
This function is very similar to input(), above, except that it should be used to *not* echo text as it's entered, mainly for passwords
 o input(String)
This function should block until it can return a complete string of the player's input.
 o isAlive()
return true if the socket is still open
 o isPaging()
returns true if we need to output a 'paging' prompt
 o send(char, String)
 o send(Paragraph)
 o send(Paragraph, boolean)
 o send(String)
 o sendBlankLine()
 o sendError(String)
This function is used when the user makes some sort of error in typing - *not* if a command can't be executed because of a failure.
 o sendFailure(String)
 o sendFeedback(String)
This function is used to output direct, *successful* feedback of a players command.
 o sendLine()
draw a line across the screen
 o sendParagraph(Paragraph)
 o sendRaw(String)
 o sendSubliminal(String, int, int)
 o sendSystem(String)
 o sendText(String)
Meant to be used to send part of what would normally be a paragraph.
 o sendUnqualified(String)
This function sends this raw text to the players screen.
 o startUnIdling(Player)
 o stopUnIdling()
 o unIdle()
The sub-classes should call this routine everytime the player puts some input into the program
 o verbose()
Specifies that this ic is in 'verbose' mode - that is, it will recieve newbie help instrctions and so on.

Variables

 o site
 protected Site site

Constructors

 o InteractiveConnection
 public InteractiveConnection(Socket s)
The constructor must take a socket as its sole argument

Parameters:
s - The socket that the connection is on

Methods

 o getSiteName
 public final String getSiteName()
 o getFullSiteName
 public final String getFullSiteName()
 o startUnIdling
 public final void startUnIdling(Player p)
 o stopUnIdling
 public final void stopUnIdling()
 o getSite
 public final Site getSite()
 o discard
 public final void discard() throws IOException
 o evalReadOnlyProperty
 public Object evalReadOnlyProperty(ReadOnlyProperty p)
override to return the correct value for the supplied property make sure you call super.evalReadOnlyProperty if you don't understand it before returning null

Overrides:
evalReadOnlyProperty in class Atom
 o verbose
 public boolean verbose()
Specifies that this ic is in 'verbose' mode - that is, it will recieve newbie help instrctions and so on.

 o unIdle
 protected final void unIdle()
The sub-classes should call this routine everytime the player puts some input into the program

 o close
 public void close()
 o isAlive
 public boolean isAlive()
return true if the socket is still open

 o check
 public abstract void check() throws IOException
This function will be called every 'now and again', as a 'check' function when no input is required (we're not waiting), but some is allowed. This is useful for the telnet protocol in particular, which can recieve IAC's before the login prompt. This function should be harmless, no matter when its called

 o sendLine
 public abstract void sendLine()
draw a line across the screen

 o input
 public abstract String input(String prompt) throws IOException
This function should block until it can return a complete string of the player's input. It can then be used in sequential code without complications with loops.

Parameters:
prompt - The prompt that the player sees (eg "-> ")
Returns:
the string that the player entered. This string is not \n terminated
 o hiddenInput
 public abstract String hiddenInput(String prompt) throws IOException
This function is very similar to input(), above, except that it should be used to *not* echo text as it's entered, mainly for passwords

 o blankLine
 public abstract void blankLine()
leave some blank space (usually the height of the characters

 o sendSubliminal
 public abstract void sendSubliminal(String message,
                                     int duration,
                                     int frequency)
 o send
 public abstract void send(String message)
 o send
 public abstract void send(char qualifier,
                           String message)
 o send
 public abstract void send(Paragraph para)
 o send
 public abstract void send(Paragraph para,
                           boolean okayToPage)
 o sendUnqualified
 public void sendUnqualified(String message)
This function sends this raw text to the players screen. It shouldn't really be used very often - far better to classify data better (from a future expansion pov).

This command does not start a new line

Parameters:
message - the text to be displayed
 o sendSystem
 public final void sendSystem(String message)
 o sendRaw
 public void sendRaw(String message)
 o sendFeedback
 public void sendFeedback(String message)
This function is used to output direct, *successful* feedback of a players command. It is important that this feedback is normal and expected by the player, since it generally won't be hilited in any way. Please try to restrict this output to a single line.

this command does start a new line

Examples:

You tell name 'hi'

Parameters:
message - the text to be displayed
 o sendText
 public void sendText(String message)
Meant to be used to send part of what would normally be a paragraph.

 o sendError
 public void sendError(String message)
This function is used when the user makes some sort of error in typing - *not* if a command can't be executed because of a failure. So, Command not found would go here, but 'Not enough privs to nuke snapper' wouldn't.

this command does start a new line

 o sendFailure
 public void sendFailure(String message)
 o sendParagraph
 public void sendParagraph(Paragraph para)
 o sendBlankLine
 public void sendBlankLine()
 o isPaging
 public abstract boolean isPaging()
returns true if we need to output a 'paging' prompt


All Packages  Class Hierarchy  This Package  Previous  Next  Index