|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jibble.pircbot.PircBot paolomind.multitalk.irc.SenderIrcClient
public class SenderIrcClient
Prima classe che implementa il protocollo di comunicazione. si preoccupa di ricevere ed inviare i messaggi, e delegare gli eventi IRC
Field Summary |
---|
Fields inherited from class org.jibble.pircbot.PircBot |
---|
VERSION |
Fields inherited from interface org.jibble.pircbot.ReplyConstants |
---|
ERR_ALREADYREGISTRED, ERR_BADCHANMASK, ERR_BADCHANNELKEY, ERR_BANNEDFROMCHAN, ERR_CANNOTSENDTOCHAN, ERR_CANTKILLSERVER, ERR_CHANNELISFULL, ERR_CHANOPRIVSNEEDED, ERR_ERRONEUSNICKNAME, ERR_FILEERROR, ERR_INVITEONLYCHAN, ERR_KEYSET, ERR_NEEDMOREPARAMS, ERR_NICKCOLLISION, ERR_NICKNAMEINUSE, ERR_NOADMININFO, ERR_NOLOGIN, ERR_NOMOTD, ERR_NONICKNAMEGIVEN, ERR_NOOPERHOST, ERR_NOORIGIN, ERR_NOPERMFORHOST, ERR_NOPRIVILEGES, ERR_NORECIPIENT, ERR_NOSERVICEHOST, ERR_NOSUCHCHANNEL, ERR_NOSUCHNICK, ERR_NOSUCHSERVER, ERR_NOTEXTTOSEND, ERR_NOTONCHANNEL, ERR_NOTOPLEVEL, ERR_NOTREGISTERED, ERR_PASSWDMISMATCH, ERR_SUMMONDISABLED, ERR_TOOMANYCHANNELS, ERR_TOOMANYTARGETS, ERR_UMODEUNKNOWNFLAG, ERR_UNKNOWNCOMMAND, ERR_UNKNOWNMODE, ERR_USERNOTINCHANNEL, ERR_USERONCHANNEL, ERR_USERSDISABLED, ERR_USERSDONTMATCH, ERR_WASNOSUCHNICK, ERR_WILDTOPLEVEL, ERR_YOUREBANNEDCREEP, ERR_YOUWILLBEBANNED, RPL_ADMINEMAIL, RPL_ADMINLOC1, RPL_ADMINLOC2, RPL_ADMINME, RPL_AWAY, RPL_BANLIST, RPL_CHANNELMODEIS, RPL_CLOSEEND, RPL_CLOSING, RPL_ENDOFBANLIST, RPL_ENDOFINFO, RPL_ENDOFLINKS, RPL_ENDOFMOTD, RPL_ENDOFNAMES, RPL_ENDOFSERVICES, RPL_ENDOFSTATS, RPL_ENDOFUSERS, RPL_ENDOFWHO, RPL_ENDOFWHOIS, RPL_ENDOFWHOWAS, RPL_INFO, RPL_INFOSTART, RPL_INVITING, RPL_ISON, RPL_KILLDONE, RPL_LINKS, RPL_LIST, RPL_LISTEND, RPL_LISTSTART, RPL_LUSERCHANNELS, RPL_LUSERCLIENT, RPL_LUSERME, RPL_LUSEROP, RPL_LUSERUNKNOWN, RPL_MOTD, RPL_MOTDSTART, RPL_MYPORTIS, RPL_NAMREPLY, RPL_NONE, RPL_NOTOPIC, RPL_NOUSERS, RPL_NOWAWAY, RPL_REHASHING, RPL_SERVICE, RPL_SERVICEINFO, RPL_SERVLIST, RPL_SERVLISTEND, RPL_STATSCLINE, RPL_STATSCOMMANDS, RPL_STATSHLINE, RPL_STATSILINE, RPL_STATSKLINE, RPL_STATSLINKINFO, RPL_STATSLLINE, RPL_STATSNLINE, RPL_STATSOLINE, RPL_STATSQLINE, RPL_STATSUPTIME, RPL_STATSYLINE, RPL_SUMMONING, RPL_TIME, RPL_TOPIC, RPL_TOPICINFO, RPL_TRACECLASS, RPL_TRACECONNECTING, RPL_TRACEHANDSHAKE, RPL_TRACELINK, RPL_TRACELOG, RPL_TRACENEWTYPE, RPL_TRACEOPERATOR, RPL_TRACESERVER, RPL_TRACEUNKNOWN, RPL_TRACEUSER, RPL_UMODEIS, RPL_UNAWAY, RPL_USERHOST, RPL_USERS, RPL_USERSSTART, RPL_VERSION, RPL_WHOISCHANNELS, RPL_WHOISCHANOP, RPL_WHOISIDLE, RPL_WHOISOPERATOR, RPL_WHOISSERVER, RPL_WHOISUSER, RPL_WHOREPLY, RPL_WHOWASUSER, RPL_YOUREOPER |
Constructor Summary | |
---|---|
SenderIrcClient(IrcListener pirclistener)
|
Method Summary | |
---|---|
protected IrcListener |
getIrclistener()
ritorna il listener. |
protected IMessageFactory |
getMessageFactory()
ritorna il MessageFactory. |
protected Receiver |
getReceiver()
ritorna il receiver. |
protected void |
onChannelInfo(java.lang.String channel,
int userCount,
java.lang.String topic)
After calling the listChannels() method in PircBot, the server will start to send us information about each channel on the server. |
protected void |
onConnect()
This method is called once the PircBot has successfully connected to the IRC server. |
protected void |
onMessage(java.lang.String channel,
java.lang.String sender,
java.lang.String login,
java.lang.String hostname,
java.lang.String message)
This method is called whenever a message is sent to a channel. |
protected void |
onServerPing(java.lang.String response)
The actions to perform when a PING request comes from the server. |
protected void |
onServerResponse(int code,
java.lang.String response)
This method is called when we receive a numeric response from the IRC server. |
protected void |
onUnknown(java.lang.String line)
This method is called whenever we receive a line from the server that the PircBot has not been programmed to recognise. |
void |
send(IMessage m)
metodo di invio messaggi. |
void |
setIrcframe(IrcListener pirclistener)
setta il listener che riceverà ogni messaggio. |
protected void |
setIrclistener(IrcListener pirclistener)
setta il listener. |
void |
setMessageFactory(IMessageFactory pfactory)
setta il message factory per creare i messaggi dalle stringhe ricevute. |
void |
setMyName(java.lang.String name)
Sets the name of the bot, which will be used as its nick when it tries to join an IRC server. |
void |
setReceiver(Receiver preceiver)
setta il receiver che riceverà ogni messaggio. |
Methods inherited from class org.jibble.pircbot.PircBot |
---|
ban, changeNick, connect, connect, connect, dccAcceptChatRequest, dccReceiveFile, dccSendChatRequest, dccSendFile, deOp, deVoice, disconnect, dispose, equals, getChannels, getEncoding, getFinger, getInetAddress, getLogin, getMaxLineLength, getMessageDelay, getName, getNick, getOutgoingQueueSize, getPassword, getPort, getServer, getUsers, getVersion, handleLine, hashCode, ipToLong, isConnected, joinChannel, joinChannel, kick, kick, listChannels, listChannels, log, longToIp, onAction, onDccChatRequest, onDccSendRequest, onDeop, onDeVoice, onDisconnect, onFileTransferFinished, onFinger, onIncomingChatRequest, onIncomingFileTransfer, onInvite, onJoin, onKick, onMode, onNickChange, onNotice, onOp, onPart, onPing, onPrivateMessage, onQuit, onRemoveChannelBan, onRemoveChannelKey, onRemoveChannelLimit, onRemoveInviteOnly, onRemoveModerated, onRemoveNoExternalMessages, onRemovePrivate, onRemoveSecret, onRemoveTopicProtection, onSetChannelBan, onSetChannelKey, onSetChannelLimit, onSetInviteOnly, onSetModerated, onSetNoExternalMessages, onSetPrivate, onSetSecret, onSetTopicProtection, onTime, onTopic, onTopic, onUserList, onUserMode, onVersion, onVoice, op, partChannel, partChannel, quitServer, quitServer, reconnect, sendAction, sendCTCPCommand, sendInvite, sendMessage, sendNotice, sendRawLine, sendRawLineViaQueue, setAutoNickChange, setEncoding, setFinger, setLogin, setMessageDelay, setMode, setName, setTopic, setVerbose, setVersion, startIdentServer, toString, unBan, voice |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SenderIrcClient(IrcListener pirclistener)
pirclistener
- il listener IRC che riceve gli eventi IRCMethod Detail |
---|
protected final void onMessage(java.lang.String channel, java.lang.String sender, java.lang.String login, java.lang.String hostname, java.lang.String message)
onMessage
in class org.jibble.pircbot.PircBot
channel
- The channel to which the message was sent.sender
- The nick of the person who sent the message.login
- The login of the person who sent the message.hostname
- The hostname of the person who sent the message.message
- The actual message sent to the channel.public final void send(IMessage m)
send
in interface Sender
m
- messaggio da inviare da questo oggettopublic final void setReceiver(Receiver preceiver)
preceiver
- parametro receiverpublic final void setIrcframe(IrcListener pirclistener)
pirclistener
- parametro listenerprotected final void onChannelInfo(java.lang.String channel, int userCount, java.lang.String topic)
onChannelInfo
in class org.jibble.pircbot.PircBot
channel
- The name of the channel.userCount
- The number of users visible in this channel.topic
- The topic for this channel.listChannels
public final void setMyName(java.lang.String name)
name
- The new name of the Bot.protected final void onConnect()
onConnect
in class org.jibble.pircbot.PircBot
protected final void onServerPing(java.lang.String response)
onServerPing
in class org.jibble.pircbot.PircBot
response
- The response that should be given back in your PONG.protected final void onServerResponse(int code, java.lang.String response)
PircBot #test :I Am King of Test
"
with a code of 332 to signify that this is a topic.
(This is just an example - note that overriding the
onTopic
method is an easier way of finding the
topic for a channel). Check the IRC RFC for the full list of other
command response codes.
PircBot implements the interface ReplyConstants, which contains
contstants that you may find useful here.
The implementation of this method in the PircBot abstract class
performs no actions and may be overridden as required.
onServerResponse
in class org.jibble.pircbot.PircBot
code
- The three-digit numerical code for the response.response
- The full response from the IRC server.ReplyConstants
protected final void onUnknown(java.lang.String line)
onUnknown
in class org.jibble.pircbot.PircBot
line
- The raw line that was received from the server.public final void setMessageFactory(IMessageFactory pfactory)
pfactory
- il MessageFactoryprotected final IrcListener getIrclistener()
protected final void setIrclistener(IrcListener pirclistener)
pirclistener
- il listener da associareprotected final Receiver getReceiver()
protected final IMessageFactory getMessageFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |