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.
- \n: To mean 'start a new line'
-
site
-
-
InteractiveConnection(Socket)
- The constructor must take a socket as its sole
argument
-
blankLine()
- leave some blank space (usually the height of the characters
-
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.
-
close()
-
-
discard()
-
-
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
-
getFullSiteName()
-
-
getSite()
-
-
getSiteName()
-
-
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
-
input(String)
- This function should block until it can
return a complete string of the player's
input.
-
isAlive()
- return true if the socket is still open
-
isPaging()
- returns true if we need to output a 'paging' prompt
-
send(char, String)
-
-
send(Paragraph)
-
-
send(Paragraph, boolean)
-
-
send(String)
-
-
sendBlankLine()
-
-
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.
-
sendFailure(String)
-
-
sendFeedback(String)
- This function is used to output direct,
*successful* feedback of a players command.
-
sendLine()
- draw a line across the screen
-
sendParagraph(Paragraph)
-
-
sendRaw(String)
-
-
sendSubliminal(String, int, int)
-
-
sendSystem(String)
-
-
sendText(String)
- Meant to be used to send part of what would
normally be a paragraph.
-
sendUnqualified(String)
- This function sends this raw text to the
players screen.
-
startUnIdling(Player)
-
-
stopUnIdling()
-
-
unIdle()
- The sub-classes should call this routine everytime
the player puts some input into the program
-
verbose()
- Specifies that this ic is in 'verbose'
mode - that is, it will recieve newbie
help instrctions and so on.
site
protected Site site
InteractiveConnection
public InteractiveConnection(Socket s)
- The constructor must take a socket as its sole
argument
- Parameters:
- s - The socket that the connection is on
getSiteName
public final String getSiteName()
getFullSiteName
public final String getFullSiteName()
startUnIdling
public final void startUnIdling(Player p)
stopUnIdling
public final void stopUnIdling()
getSite
public final Site getSite()
discard
public final void discard() throws IOException
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
verbose
public boolean verbose()
- Specifies that this ic is in 'verbose'
mode - that is, it will recieve newbie
help instrctions and so on.
unIdle
protected final void unIdle()
- The sub-classes should call this routine everytime
the player puts some input into the program
close
public void close()
isAlive
public boolean isAlive()
- return true if the socket is still open
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
sendLine
public abstract void sendLine()
- draw a line across the screen
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
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
blankLine
public abstract void blankLine()
- leave some blank space (usually the height of the characters
sendSubliminal
public abstract void sendSubliminal(String message,
int duration,
int frequency)
send
public abstract void send(String message)
send
public abstract void send(char qualifier,
String message)
send
public abstract void send(Paragraph para)
send
public abstract void send(Paragraph para,
boolean okayToPage)
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
sendSystem
public final void sendSystem(String message)
sendRaw
public void sendRaw(String message)
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
sendText
public void sendText(String message)
- Meant to be used to send part of what would
normally be a paragraph.
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
sendFailure
public void sendFailure(String message)
sendParagraph
public void sendParagraph(Paragraph para)
sendBlankLine
public void sendBlankLine()
isPaging
public abstract boolean isPaging()
- returns true if we need to output a 'paging' prompt
All Packages Class Hierarchy This Package Previous Next Index