|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lyrisoft.chat.client.DumbClient | +--com.lyrisoft.chat.client.Client
The heart of the NFC client program. Notice that this is just a subclass of DumbClient, with a whole lot of functionality added in
Field Summary | |
protected java.applet.Applet |
_applet
|
protected IChatGUIFactory |
_factory
|
protected ChatGUI |
_gui
|
protected java.lang.String |
_initialRoom
|
protected java.lang.String |
_myName
|
protected IChatServer |
_serverInterface
|
protected UserCommands |
_userCommands
|
Fields inherited from class com.lyrisoft.chat.client.DumbClient |
_attributes |
Fields inherited from interface com.lyrisoft.chat.Constants |
SERVER_NAME |
Fields inherited from interface com.lyrisoft.chat.ICommands |
ACCESS_DENIED, ACK_KILL, ALREADY_SIGNED_ON, DELIMITER, EMOTE_TO_ROOM, EMOTE_TO_USER, ERROR, GET_ROOMS, GET_USERS_IN_ROOM, GET_USERS_ON_SERVER, HELP, HYPERLINK, IGNORE, INVALID_CHARACTER, INVITE, JOIN_ROOM, JOIN_ROOM_ACK, KICK, KILL, NO_INVITE, NO_SUCH_USER, OP, PART_ROOM, PART_ROOM_ACK, PING, PONG, REMOTE_CLIENT_MESSAGE, ROOM_ACCESS_DENIED, ROOM_DIFF, ROOM_MSG, ROOM_USER_DIFF, SAY_TO_ROOM, SAY_TO_USER, SHUTDOWN, SIGNOFF, SIGNON, SIGNON_ACK, STATS, UNIGNORE, UNINVITE, USER_DIFF, VERSION, WHOIS |
Constructor Summary | |
protected |
Client()
Exists so subclasses can completely override the construction. |
|
Client(java.lang.String host,
int port)
Construct a Client that will connect to the given host and port |
|
Client(java.lang.String host,
int port,
java.lang.String readUrl,
java.lang.String writeUrl)
Construct a Client that will connect to the given host and port and fallback to tunneling mode using the readUrl and writeUrl. |
|
Client(java.lang.String readUrl,
java.lang.String writeUrl)
Construct a Client that will connect to the server in tunnel mode only. |
Method Summary | |
void |
ackJoinRoom(java.lang.String room)
The server has acknowledged our room join |
void |
ackKill(java.lang.String victim)
Acknowledgement that we successfully killed somebody |
void |
ackPartRoom(java.lang.String room)
The server has acknowledged our room part |
void |
ackSignon(java.lang.String myName)
The server has authenticated us and acknowledged our sign on |
void |
connectionLost()
The connection is lost. |
void |
emote(java.lang.String from,
java.lang.String room,
java.lang.String message)
Indicates that somebody is emoting |
void |
emoteFromUserPrivate(java.lang.String user,
java.lang.String msg)
The server is indicating that someone is privately emoting something to us. |
void |
emoteToUserPrivate(java.lang.String rcpt,
java.lang.String msg)
|
void |
generalError(java.lang.String message)
The server is giving us an error message to display |
void |
generalMessage(java.lang.String message)
The server is giving us a general message to display. |
void |
generalRoomMessage(java.lang.String room,
java.lang.String message)
The server is giving us a message to display in the context of a particular room. |
ChatGUI |
getGUI()
get the ChatGUI object |
java.lang.String |
getMyName()
|
IChatServer |
getServerInterface()
Get's the 'local view' of the server |
java.lang.String |
getVersion()
|
void |
globalUserList(java.lang.String[] users)
The server is sending us the global user list |
void |
init()
Call after all attributes have been set |
void |
inputEvent(java.lang.String room,
java.lang.String txt)
From the IChatClientInputReceiver interface... |
void |
killed(java.lang.String killer,
java.lang.String msg)
Indicates that we have been killed. |
void |
loginCancelEvent()
|
void |
loginEvent(java.lang.String username,
java.lang.String password)
from the IChatClientInputReceiver interface... |
void |
messageFromUser(java.lang.String user,
java.lang.String room,
java.lang.String msg)
The server is indicating that someone is saying something in a room |
void |
messageFromUserPrivate(java.lang.String user,
java.lang.String msg)
The server is indicating that someone is saying something to us, privately |
void |
messageToUserPrivate(java.lang.String rcpt,
java.lang.String msg)
|
void |
ping(java.lang.String user,
java.lang.String arg)
The server is indicating that somebody ping'ed us. |
void |
pong(java.lang.String user,
java.lang.String arg)
The server is giving us the reply to a ping that we already sent out. |
void |
reset()
|
void |
roomCreated(java.lang.String room)
Indicates that a room has been created |
void |
roomDestroyed(java.lang.String room)
Indicates that a room has been destroyed |
void |
roomList(java.lang.String[] roomList)
The server is sending us a list of rooms |
void |
roomUserList(java.lang.String room,
java.lang.String[] users)
The server is sending us the user list for a particular room |
boolean |
runningAsApplet()
|
void |
setApplet(java.applet.Applet a)
If the client is running as an Applet, the Applet should call this method after instantiating |
void |
setInitialRoom(java.lang.String room)
|
void |
showLink(java.lang.String link)
Display the given link in a new browser window (if we're running as an applet) |
void |
showLogin()
|
void |
userDoubleClick(java.lang.String user)
Callback when a user is double-clicked |
void |
userJoinedRoom(java.lang.String user,
java.lang.String room)
The server is indicating that someone just joined a room we're in. |
void |
userPartedRoom(java.lang.String user,
java.lang.String room,
boolean signOff)
The server is indicating that someone just parted a room we're in. |
void |
userSignOff(java.lang.String userId)
Indicates that a user has signed off |
void |
userSignOn(java.lang.String userId)
Indicates that a user has signed on |
Methods inherited from class com.lyrisoft.chat.client.DumbClient |
getAttribute, getProperties, setAttribute |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.lyrisoft.chat.client.IChatClient |
getAttribute, setAttribute |
Field Detail |
protected IChatServer _serverInterface
protected ChatGUI _gui
protected java.lang.String _initialRoom
protected java.applet.Applet _applet
protected java.lang.String _myName
protected UserCommands _userCommands
protected IChatGUIFactory _factory
Constructor Detail |
public Client(java.lang.String host, int port)
public Client(java.lang.String host, int port, java.lang.String readUrl, java.lang.String writeUrl)
public Client(java.lang.String readUrl, java.lang.String writeUrl)
protected Client()
Method Detail |
public ChatGUI getGUI()
public void init()
init
in interface IChatClient
public java.lang.String getMyName()
public void messageToUserPrivate(java.lang.String rcpt, java.lang.String msg)
public void emoteToUserPrivate(java.lang.String rcpt, java.lang.String msg)
public void setInitialRoom(java.lang.String room)
setInitialRoom
in interface IChatClient
public boolean runningAsApplet()
public void setApplet(java.applet.Applet a)
setApplet
in interface IChatClient
public IChatServer getServerInterface()
getServerInterface
in interface IChatClient
public void showLink(java.lang.String link)
link
- a URL to displaypublic void inputEvent(java.lang.String room, java.lang.String txt)
Delegated to UserCommands.process()
inputEvent
in interface IChatClientInputReceiver
room
- the room the message was typed intxt
- the text that the user typed. if this is null, the method immediately returnsUserCommands.process(java.lang.String, java.lang.String, com.lyrisoft.chat.client.Client)
public void loginEvent(java.lang.String username, java.lang.String password)
Delegated to ChatServerLocal.signOn()
loginEvent
in interface IChatClientInputReceiver
ChatServerLocal.signOn(java.lang.String, java.lang.String)
public void loginCancelEvent()
loginCancelEvent
in interface IChatClientInputReceiver
public void ackSignon(java.lang.String myName)
IChatClient
ackSignon
in interface IChatClient
ackSignon
in class DumbClient
public java.lang.String getVersion()
public void connectionLost()
If we're running as an Applet, then show the login dialog. Otherwise, print a message and exit.
connectionLost
in interface IChatClient
connectionLost
in class DumbClient
public void showLogin()
showLogin
in interface IChatClient
public void reset()
public void ackJoinRoom(java.lang.String room)
IChatClient
ackJoinRoom
in interface IChatClient
ackJoinRoom
in class DumbClient
public void ackPartRoom(java.lang.String room)
IChatClient
ackPartRoom
in interface IChatClient
ackPartRoom
in class DumbClient
public void messageFromUser(java.lang.String user, java.lang.String room, java.lang.String msg)
IChatClient
messageFromUser
in interface IChatClient
messageFromUser
in class DumbClient
public void messageFromUserPrivate(java.lang.String user, java.lang.String msg)
IChatClient
messageFromUserPrivate
in interface IChatClient
messageFromUserPrivate
in class DumbClient
public void emoteFromUserPrivate(java.lang.String user, java.lang.String msg)
IChatClient
emoteFromUserPrivate
in interface IChatClient
emoteFromUserPrivate
in class DumbClient
com.lyrisoft.chat.client.IChatClient
IChatClient.generalRoomMessage(java.lang.String, java.lang.String)
public void roomList(java.lang.String[] roomList)
IChatClient
roomList
in interface IChatClient
roomList
in class DumbClient
public void globalUserList(java.lang.String[] users)
IChatClient
globalUserList
in interface IChatClient
globalUserList
in class DumbClient
public void roomUserList(java.lang.String room, java.lang.String[] users)
IChatClient
roomUserList
in interface IChatClient
roomUserList
in class DumbClient
public void userJoinedRoom(java.lang.String user, java.lang.String room)
IChatClient
userJoinedRoom
in interface IChatClient
userJoinedRoom
in class DumbClient
public void userPartedRoom(java.lang.String user, java.lang.String room, boolean signOff)
IChatClient
userPartedRoom
in interface IChatClient
userPartedRoom
in class DumbClient
public void generalError(java.lang.String message)
IChatClient
generalError
in interface IChatClient
generalError
in class DumbClient
public void generalMessage(java.lang.String message)
IChatClient
generalMessage
in interface IChatClient
generalMessage
in class DumbClient
public void generalRoomMessage(java.lang.String room, java.lang.String message)
IChatClient
generalRoomMessage
in interface IChatClient
generalRoomMessage
in class DumbClient
public void ping(java.lang.String user, java.lang.String arg)
IChatClient
ping
in interface IChatClient
ping
in class DumbClient
public void pong(java.lang.String user, java.lang.String arg)
IChatClient
pong
in interface IChatClient
pong
in class DumbClient
public void killed(java.lang.String killer, java.lang.String msg)
DumbClient
killed
in interface IChatClient
killed
in class DumbClient
com.lyrisoft.chat.client.DumbClient
killer
- the use who killed usmsg
- an explanation of why were have been killedpublic void ackKill(java.lang.String victim)
DumbClient
ackKill
in interface IChatClient
ackKill
in class DumbClient
public void emote(java.lang.String from, java.lang.String room, java.lang.String message)
DumbClient
emote
in interface IChatClient
emote
in class DumbClient
public void userSignOn(java.lang.String userId)
DumbClient
userSignOn
in interface IChatClient
userSignOn
in class DumbClient
public void userSignOff(java.lang.String userId)
DumbClient
userSignOff
in interface IChatClient
userSignOff
in class DumbClient
public void roomCreated(java.lang.String room)
DumbClient
roomCreated
in interface IChatClient
roomCreated
in class DumbClient
public void roomDestroyed(java.lang.String room)
DumbClient
roomDestroyed
in interface IChatClient
roomDestroyed
in class DumbClient
public void userDoubleClick(java.lang.String user)
IChatClientInputReceiver
userDoubleClick
in interface IChatClientInputReceiver
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |