PPF API
Version 0.6

net.sourceforge.ppf
Class PPF

java.lang.Object
  extended by org.jibble.pircbot.PircBot
      extended by net.sourceforge.ppf.PPF
All Implemented Interfaces:
org.jibble.pircbot.PircBotLogger, org.jibble.pircbot.ReplyConstants

public class PPF
extends org.jibble.pircbot.PircBot

PPF main class, handles startup, dis/re/connecting, core bot commands, plugin re/un/loading and dispatching to plugins.

Author:
DeadEd

Field Summary
static int AUTH_ADMIN
           
static int AUTH_ANY
           
static int AUTH_MASTER
           
static int AUTH_NONE
           
static int AUTH_TRUSTED
           
 
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_BOUNCE, RPL_CHANNELMODEIS, RPL_CLOSEEND, RPL_CLOSING, RPL_CREATED, 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_MYINFO, 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_WELCOME, RPL_VERSION, RPL_WHOISCHANNELS, RPL_WHOISCHANOP, RPL_WHOISIDLE, RPL_WHOISOPERATOR, RPL_WHOISSERVER, RPL_WHOISUSER, RPL_WHOREPLY, RPL_WHOWASUSER, RPL_YOUREOPER, RPL_YOURHOST
 
Constructor Summary
PPF()
           
 
Method Summary
 void addChannel(IrcChannel channel)
          Add a channel to join.
 void addNick(java.lang.String nick)
          Add a nick for the bot.
 void addPluginInfo(PPFPluginInfo pluginInfo)
           
 void addServer(IrcServer server)
          Add a server.
protected  void checkPublicCommand(java.lang.String sender, java.lang.String message)
           
 void configure(java.lang.String cfgFilename, boolean pluginsOnly)
          Load main configuration and set properties.
 void digestMessage(java.lang.String channel, java.lang.String sender, java.lang.String login, java.lang.String hostname, java.lang.String message)
          Simulate a channel message.
 void digestPrivateMessage(java.lang.String sender, java.lang.String login, java.lang.String hostname, java.lang.String message)
          Simulate a private message.
 void fromWeb(java.lang.String sender, java.lang.String hostname, java.util.HashMap parameters)
           
 java.lang.String getAdminPassword()
           
 java.lang.String getCfgFilename()
           
 java.util.Map getCfgPlugins()
           
 java.lang.String getCommandHelp()
           
 java.lang.String getCommandSetLang()
           
 java.util.Iterator<java.lang.String> getCommonChannelsList(java.lang.String nick)
          Get an Iterator for all the channels the user AND the bot are in.
 java.util.List getConfiguredChannels()
           
 java.util.Map getCurrentChannels()
          The channels the bot is currently on.
 java.lang.String getEncoding()
           
 java.lang.String getIdentNick()
           
 java.lang.String getLanguage()
           
 java.util.Map getLoadedPlugins()
           
 java.lang.String getMasterPassword()
           
 int getMaxConnectionAttempts()
           
 java.lang.String getOnJoinMessage()
           
 java.lang.String getPluginsDir()
           
 PPFResourceBundle getPPFResBun()
           
 long getRetryDelay()
           
 java.lang.String getTopic(java.lang.String channel)
          Returns the topic with irc codes for formatting and colors.
 java.lang.String getTrustedPassword()
           
static java.lang.String getUsage()
          Usage help message for PPF explaining the command line parameters.
 java.lang.String getUserLang(java.lang.String nick)
          If a user has set a language return that language, else return the bot's configured default language.
 java.lang.String getWebServerDocumentRoot()
           
 int getWebServerPort()
           
 boolean inCommonChannel(java.lang.String nick)
          Tests if the user is in one of the channels the bot is in as well.
 boolean isAuthed(java.lang.String nick, int authLevel)
          Test if the user is authed with at least the specified auth level.
 boolean isHidePingPong()
           
 boolean isRejoinOnKick()
           
 boolean isStartWebServer()
           
 void log(java.lang.String line)
          This one logs to the configured log file(s) - see log4j.properties.
static void main(java.lang.String[] args)
          Parse command line parameters and start the bot.
protected  void onAction(java.lang.String sender, java.lang.String login, java.lang.String hostname, java.lang.String target, java.lang.String action)
           
protected  void onAuth(java.lang.String login, java.lang.String channel)
          Dispatch "auth" events to the plugins.
protected  void onChannelInfo(java.lang.String channel, int userCount, java.lang.String topic)
           
protected  void onConnect()
           
protected  void onDeop(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String recipient)
           
protected  void onDeVoice(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String recipient)
           
protected  void onDisconnect()
           
protected  void onFileTransferFinished(org.jibble.pircbot.DccFileTransfer transfer, java.lang.Exception e)
           
protected  void onFinger(java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String target)
           
protected  void onIncomingChatRequest(org.jibble.pircbot.DccChat chat)
           
protected  void onIncomingFileTransfer(org.jibble.pircbot.DccFileTransfer transfer)
           
protected  void onInvite(java.lang.String targetNick, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String channel)
           
protected  void onJoin(java.lang.String channel, java.lang.String sender, java.lang.String login, java.lang.String hostname)
           
protected  void onKick(java.lang.String channel, java.lang.String kickerNick, java.lang.String kickerLogin, java.lang.String kickerHostname, java.lang.String recipientNick, java.lang.String reason)
           
 void onMessage(java.lang.String channel, java.lang.String sender, java.lang.String login, java.lang.String hostname, java.lang.String message)
           
protected  void onMode(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String mode)
           
protected  void onNickChange(java.lang.String oldNick, java.lang.String login, java.lang.String hostname, java.lang.String newNick)
           
protected  void onNotice(java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String target, java.lang.String notice)
           
protected  void onOp(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String recipient)
           
protected  void onPart(java.lang.String channel, java.lang.String sender, java.lang.String login, java.lang.String hostname)
           
protected  void onPing(java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String target, java.lang.String pingValue)
           
protected  void onPrivateMessage(java.lang.String sender, java.lang.String login, java.lang.String hostname, java.lang.String message)
           
protected  void onQuit(java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String reason)
           
protected  void onRemoveChannelBan(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String hostmask)
           
protected  void onRemoveChannelKey(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String key)
           
protected  void onRemoveChannelLimit(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onRemoveInviteOnly(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onRemoveModerated(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onRemoveNoExternalMessages(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onRemovePrivate(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onRemoveSecret(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onRemoveTopicProtection(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onServerPing(java.lang.String response)
           
protected  void onServerResponse(int code, java.lang.String response)
           
protected  void onSetChannelBan(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String hostmask)
           
protected  void onSetChannelKey(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String key)
           
protected  void onSetChannelLimit(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, int limit)
           
protected  void onSetInviteOnly(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onSetModerated(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onSetNoExternalMessages(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onSetPrivate(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onSetSecret(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onSetTopicProtection(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname)
           
protected  void onTime(java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String target)
           
protected  void onTopic(java.lang.String channel, java.lang.String topic, java.lang.String setBy, long date, boolean changed)
           
protected  void onUnknown(java.lang.String line)
           
protected  void onUserList(java.lang.String channel, org.jibble.pircbot.User[] users)
           
protected  void onUserMode(java.lang.String targetNick, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String mode)
           
protected  void onVersion(java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String target)
           
protected  void onVoice(java.lang.String channel, java.lang.String sourceNick, java.lang.String sourceLogin, java.lang.String sourceHostname, java.lang.String recipient)
           
 void quit()
          Exits the JVM.
 void restart()
           
 void run()
          Loads messages & plugins, starts the webserver, connects to a IRC server and joins the configured channels.
 void setAdminPassword(java.lang.String cfgAdminPassword)
           
 void setCfgFilename(java.lang.String cfgFilename)
           
 void setCommandHelp(java.lang.String cfgCommandHelp)
           
 void setCommandSetLang(java.lang.String cfgCommandSetLang)
           
 void setConsole(java.lang.String nothing)
           
 void setDccPorts(java.lang.String strDCCPorts)
           
 void setEncoding(java.lang.String cfgEncoding)
           
 void setHidePingPong(boolean hidePingPong)
           
 void setIdentNick(java.lang.String cfgIdentNick)
           
 void setLanguage(java.lang.String cfgLanguage)
           
 void setMasterPassword(java.lang.String cfgMasterPassword)
           
 void setMaxConnectionAttempts(int maxConnectionAttempts)
           
 void setOnJoinMessage(java.lang.String cfgOnJoinMessage)
           
 void setRejoinOnKick(boolean cfgRejoinOnKick)
           
 void setRetryDelay(long retryDelay)
          Set in milliseconds and multiplied by 1000 for later use.
 void setStartWebServer(boolean startWebServer)
           
 void setTrustedPassword(java.lang.String cfgTrustedPassword)
           
 void setWebServerDocumentRoot(java.lang.String webServerDocumentRoot)
           
 void setWebServerPort(int webServerPort)
           
 java.lang.String urlEncode(java.lang.String string)
           
 boolean verifyAuthentication(java.lang.String sender, java.lang.String checkPassword, java.lang.String hostname)
           
 
Methods inherited from class org.jibble.pircbot.PircBot
ban, changeNick, connect, connect, connect, createInputStreamReader, createOutputStreamReader, dccAcceptChatRequest, dccReceiveFile, dccSendChatRequest, dccSendFile, deOp, deVoice, disconnect, dispose, equals, getChannels, getCommonChannels, getDccInetAddress, getDccPorts, getFallbackEncoding, getFinger, getHighestUserPrefix, getInetAddress, getLogin, getMaxLineLength, getMessageDelay, getName, getNick, getOutgoingQueueSize, getPassword, getPort, getServer, getUser, getUserInfo, getUserPrefixesInOrder, getUsers, getVersion, handleLine, hashCode, ipToLong, isConnected, isInCommonChannel, isVerbose, joinChannel, joinChannel, kick, kick, listChannels, listChannels, longToIp, numCommonChannels, onDccChatRequest, onDccSendRequest, onTopic, op, partChannel, partChannel, quitServer, quitServer, reconnect, sendAction, sendCTCPCommand, sendInvite, sendMessage, sendNotice, sendRawLine, sendRawLineViaQueue, setAutoNickChange, setDccInetAddress, setDccPorts, setFallbackEncoding, setFinger, setLogin, setMessageDelay, setMode, setName, setTopic, setUserInfo, setVerbose, setVersion, startIdentServer, toString, unBan, voice
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AUTH_ADMIN

public static final int AUTH_ADMIN
See Also:
Constant Field Values

AUTH_MASTER

public static final int AUTH_MASTER
See Also:
Constant Field Values

AUTH_TRUSTED

public static final int AUTH_TRUSTED
See Also:
Constant Field Values

AUTH_ANY

public static final int AUTH_ANY
See Also:
Constant Field Values

AUTH_NONE

public static final int AUTH_NONE
See Also:
Constant Field Values
Constructor Detail

PPF

public PPF()
Method Detail

run

public void run()
         throws java.io.IOException
Loads messages & plugins, starts the webserver, connects to a IRC server and joins the configured channels.

Throws:
java.io.IOException

configure

public void configure(java.lang.String cfgFilename,
                      boolean pluginsOnly)
Load main configuration and set properties.

Throws:
DigesterLoadingException - if there's a problem loading the config

log

public void log(java.lang.String line)
This one logs to the configured log file(s) - see log4j.properties.

Log levels used
Type of message log level
Incoming line DEBUG (only if verbose enabled in PPFConfig.xml)
Outgoing line DEBUG (only if verbose enabled in PPFConfig.xml)
Status message DEBUG
Errors ERROR

Specified by:
log in interface org.jibble.pircbot.PircBotLogger
Overrides:
log in class org.jibble.pircbot.PircBot
Since:
0.5
See Also:
PircBot.log(java.lang.String)

onJoin

protected void onJoin(java.lang.String channel,
                      java.lang.String sender,
                      java.lang.String login,
                      java.lang.String hostname)
Overrides:
onJoin in class org.jibble.pircbot.PircBot

checkPublicCommand

protected void checkPublicCommand(java.lang.String sender,
                                  java.lang.String message)

onMessage

public void onMessage(java.lang.String channel,
                      java.lang.String sender,
                      java.lang.String login,
                      java.lang.String hostname,
                      java.lang.String message)
Overrides:
onMessage in class org.jibble.pircbot.PircBot

fromWeb

public void fromWeb(java.lang.String sender,
                    java.lang.String hostname,
                    java.util.HashMap parameters)

verifyAuthentication

public boolean verifyAuthentication(java.lang.String sender,
                                    java.lang.String checkPassword,
                                    java.lang.String hostname)

onPrivateMessage

protected void onPrivateMessage(java.lang.String sender,
                                java.lang.String login,
                                java.lang.String hostname,
                                java.lang.String message)
Overrides:
onPrivateMessage in class org.jibble.pircbot.PircBot

onAuth

protected void onAuth(java.lang.String login,
                      java.lang.String channel)
Dispatch "auth" events to the plugins. Called for once for every channel the authed user is on.

Parameters:
login - the login part of the user's hostmask
channel - the channel

onQuit

protected void onQuit(java.lang.String sourceNick,
                      java.lang.String sourceLogin,
                      java.lang.String sourceHostname,
                      java.lang.String reason)
Overrides:
onQuit in class org.jibble.pircbot.PircBot

onDisconnect

protected void onDisconnect()
Overrides:
onDisconnect in class org.jibble.pircbot.PircBot

onKick

protected void onKick(java.lang.String channel,
                      java.lang.String kickerNick,
                      java.lang.String kickerLogin,
                      java.lang.String kickerHostname,
                      java.lang.String recipientNick,
                      java.lang.String reason)
Overrides:
onKick in class org.jibble.pircbot.PircBot

onSetChannelBan

protected void onSetChannelBan(java.lang.String channel,
                               java.lang.String sourceNick,
                               java.lang.String sourceLogin,
                               java.lang.String sourceHostname,
                               java.lang.String hostmask)
Overrides:
onSetChannelBan in class org.jibble.pircbot.PircBot

onPart

protected void onPart(java.lang.String channel,
                      java.lang.String sender,
                      java.lang.String login,
                      java.lang.String hostname)
Overrides:
onPart in class org.jibble.pircbot.PircBot

isAuthed

public boolean isAuthed(java.lang.String nick,
                        int authLevel)
Test if the user is authed with at least the specified auth level.

Parameters:
nick - nick of the user who's auth status is checked.
authLevel - the min. auth level required.
Returns:
true if the user is authed with at least the specified authLevel.

inCommonChannel

public boolean inCommonChannel(java.lang.String nick)
Tests if the user is in one of the channels the bot is in as well.

Parameters:
nick - the user's nick.
Returns:
true if the user is in one of the bot's channels.

getCommonChannelsList

public java.util.Iterator<java.lang.String> getCommonChannelsList(java.lang.String nick)
Get an Iterator for all the channels the user AND the bot are in.

Parameters:
nick - the user's nick.
Returns:
Iterator for the channels the user and the bot have in common.

quit

public void quit()
Exits the JVM.


restart

public void restart()

onNickChange

protected void onNickChange(java.lang.String oldNick,
                            java.lang.String login,
                            java.lang.String hostname,
                            java.lang.String newNick)
Overrides:
onNickChange in class org.jibble.pircbot.PircBot

onAction

protected void onAction(java.lang.String sender,
                        java.lang.String login,
                        java.lang.String hostname,
                        java.lang.String target,
                        java.lang.String action)
Overrides:
onAction in class org.jibble.pircbot.PircBot

onChannelInfo

protected void onChannelInfo(java.lang.String channel,
                             int userCount,
                             java.lang.String topic)
Overrides:
onChannelInfo in class org.jibble.pircbot.PircBot

onConnect

protected void onConnect()
Overrides:
onConnect in class org.jibble.pircbot.PircBot

onDeop

protected void onDeop(java.lang.String channel,
                      java.lang.String sourceNick,
                      java.lang.String sourceLogin,
                      java.lang.String sourceHostname,
                      java.lang.String recipient)
Overrides:
onDeop in class org.jibble.pircbot.PircBot

onDeVoice

protected void onDeVoice(java.lang.String channel,
                         java.lang.String sourceNick,
                         java.lang.String sourceLogin,
                         java.lang.String sourceHostname,
                         java.lang.String recipient)
Overrides:
onDeVoice in class org.jibble.pircbot.PircBot

onFileTransferFinished

protected void onFileTransferFinished(org.jibble.pircbot.DccFileTransfer transfer,
                                      java.lang.Exception e)
Overrides:
onFileTransferFinished in class org.jibble.pircbot.PircBot

onFinger

protected void onFinger(java.lang.String sourceNick,
                        java.lang.String sourceLogin,
                        java.lang.String sourceHostname,
                        java.lang.String target)
Overrides:
onFinger in class org.jibble.pircbot.PircBot

onIncomingChatRequest

protected void onIncomingChatRequest(org.jibble.pircbot.DccChat chat)
Overrides:
onIncomingChatRequest in class org.jibble.pircbot.PircBot

onIncomingFileTransfer

protected void onIncomingFileTransfer(org.jibble.pircbot.DccFileTransfer transfer)
Overrides:
onIncomingFileTransfer in class org.jibble.pircbot.PircBot

onInvite

protected void onInvite(java.lang.String targetNick,
                        java.lang.String sourceNick,
                        java.lang.String sourceLogin,
                        java.lang.String sourceHostname,
                        java.lang.String channel)
Overrides:
onInvite in class org.jibble.pircbot.PircBot

onMode

protected void onMode(java.lang.String channel,
                      java.lang.String sourceNick,
                      java.lang.String sourceLogin,
                      java.lang.String sourceHostname,
                      java.lang.String mode)
Overrides:
onMode in class org.jibble.pircbot.PircBot

onNotice

protected void onNotice(java.lang.String sourceNick,
                        java.lang.String sourceLogin,
                        java.lang.String sourceHostname,
                        java.lang.String target,
                        java.lang.String notice)
Overrides:
onNotice in class org.jibble.pircbot.PircBot

onOp

protected void onOp(java.lang.String channel,
                    java.lang.String sourceNick,
                    java.lang.String sourceLogin,
                    java.lang.String sourceHostname,
                    java.lang.String recipient)
Overrides:
onOp in class org.jibble.pircbot.PircBot

onPing

protected void onPing(java.lang.String sourceNick,
                      java.lang.String sourceLogin,
                      java.lang.String sourceHostname,
                      java.lang.String target,
                      java.lang.String pingValue)
Overrides:
onPing in class org.jibble.pircbot.PircBot

onRemoveChannelBan

protected void onRemoveChannelBan(java.lang.String channel,
                                  java.lang.String sourceNick,
                                  java.lang.String sourceLogin,
                                  java.lang.String sourceHostname,
                                  java.lang.String hostmask)
Overrides:
onRemoveChannelBan in class org.jibble.pircbot.PircBot

onRemoveChannelKey

protected void onRemoveChannelKey(java.lang.String channel,
                                  java.lang.String sourceNick,
                                  java.lang.String sourceLogin,
                                  java.lang.String sourceHostname,
                                  java.lang.String key)
Overrides:
onRemoveChannelKey in class org.jibble.pircbot.PircBot

onRemoveChannelLimit

protected void onRemoveChannelLimit(java.lang.String channel,
                                    java.lang.String sourceNick,
                                    java.lang.String sourceLogin,
                                    java.lang.String sourceHostname)
Overrides:
onRemoveChannelLimit in class org.jibble.pircbot.PircBot

onRemoveInviteOnly

protected void onRemoveInviteOnly(java.lang.String channel,
                                  java.lang.String sourceNick,
                                  java.lang.String sourceLogin,
                                  java.lang.String sourceHostname)
Overrides:
onRemoveInviteOnly in class org.jibble.pircbot.PircBot

onRemoveModerated

protected void onRemoveModerated(java.lang.String channel,
                                 java.lang.String sourceNick,
                                 java.lang.String sourceLogin,
                                 java.lang.String sourceHostname)
Overrides:
onRemoveModerated in class org.jibble.pircbot.PircBot

onRemoveNoExternalMessages

protected void onRemoveNoExternalMessages(java.lang.String channel,
                                          java.lang.String sourceNick,
                                          java.lang.String sourceLogin,
                                          java.lang.String sourceHostname)
Overrides:
onRemoveNoExternalMessages in class org.jibble.pircbot.PircBot

onRemovePrivate

protected void onRemovePrivate(java.lang.String channel,
                               java.lang.String sourceNick,
                               java.lang.String sourceLogin,
                               java.lang.String sourceHostname)
Overrides:
onRemovePrivate in class org.jibble.pircbot.PircBot

onRemoveSecret

protected void onRemoveSecret(java.lang.String channel,
                              java.lang.String sourceNick,
                              java.lang.String sourceLogin,
                              java.lang.String sourceHostname)
Overrides:
onRemoveSecret in class org.jibble.pircbot.PircBot

onRemoveTopicProtection

protected void onRemoveTopicProtection(java.lang.String channel,
                                       java.lang.String sourceNick,
                                       java.lang.String sourceLogin,
                                       java.lang.String sourceHostname)
Overrides:
onRemoveTopicProtection in class org.jibble.pircbot.PircBot

onServerPing

protected void onServerPing(java.lang.String response)
Overrides:
onServerPing in class org.jibble.pircbot.PircBot

onServerResponse

protected void onServerResponse(int code,
                                java.lang.String response)
Overrides:
onServerResponse in class org.jibble.pircbot.PircBot

onSetChannelKey

protected void onSetChannelKey(java.lang.String channel,
                               java.lang.String sourceNick,
                               java.lang.String sourceLogin,
                               java.lang.String sourceHostname,
                               java.lang.String key)
Overrides:
onSetChannelKey in class org.jibble.pircbot.PircBot

onSetChannelLimit

protected void onSetChannelLimit(java.lang.String channel,
                                 java.lang.String sourceNick,
                                 java.lang.String sourceLogin,
                                 java.lang.String sourceHostname,
                                 int limit)
Overrides:
onSetChannelLimit in class org.jibble.pircbot.PircBot

onSetInviteOnly

protected void onSetInviteOnly(java.lang.String channel,
                               java.lang.String sourceNick,
                               java.lang.String sourceLogin,
                               java.lang.String sourceHostname)
Overrides:
onSetInviteOnly in class org.jibble.pircbot.PircBot

onSetModerated

protected void onSetModerated(java.lang.String channel,
                              java.lang.String sourceNick,
                              java.lang.String sourceLogin,
                              java.lang.String sourceHostname)
Overrides:
onSetModerated in class org.jibble.pircbot.PircBot

onSetNoExternalMessages

protected void onSetNoExternalMessages(java.lang.String channel,
                                       java.lang.String sourceNick,
                                       java.lang.String sourceLogin,
                                       java.lang.String sourceHostname)
Overrides:
onSetNoExternalMessages in class org.jibble.pircbot.PircBot

onSetPrivate

protected void onSetPrivate(java.lang.String channel,
                            java.lang.String sourceNick,
                            java.lang.String sourceLogin,
                            java.lang.String sourceHostname)
Overrides:
onSetPrivate in class org.jibble.pircbot.PircBot

onSetSecret

protected void onSetSecret(java.lang.String channel,
                           java.lang.String sourceNick,
                           java.lang.String sourceLogin,
                           java.lang.String sourceHostname)
Overrides:
onSetSecret in class org.jibble.pircbot.PircBot

onSetTopicProtection

protected void onSetTopicProtection(java.lang.String channel,
                                    java.lang.String sourceNick,
                                    java.lang.String sourceLogin,
                                    java.lang.String sourceHostname)
Overrides:
onSetTopicProtection in class org.jibble.pircbot.PircBot

onTime

protected void onTime(java.lang.String sourceNick,
                      java.lang.String sourceLogin,
                      java.lang.String sourceHostname,
                      java.lang.String target)
Overrides:
onTime in class org.jibble.pircbot.PircBot

onTopic

protected void onTopic(java.lang.String channel,
                       java.lang.String topic,
                       java.lang.String setBy,
                       long date,
                       boolean changed)
Overrides:
onTopic in class org.jibble.pircbot.PircBot

onUnknown

protected void onUnknown(java.lang.String line)
Overrides:
onUnknown in class org.jibble.pircbot.PircBot

onUserList

protected void onUserList(java.lang.String channel,
                          org.jibble.pircbot.User[] users)
Overrides:
onUserList in class org.jibble.pircbot.PircBot

onUserMode

protected void onUserMode(java.lang.String targetNick,
                          java.lang.String sourceNick,
                          java.lang.String sourceLogin,
                          java.lang.String sourceHostname,
                          java.lang.String mode)
Overrides:
onUserMode in class org.jibble.pircbot.PircBot

onVersion

protected void onVersion(java.lang.String sourceNick,
                         java.lang.String sourceLogin,
                         java.lang.String sourceHostname,
                         java.lang.String target)
Overrides:
onVersion in class org.jibble.pircbot.PircBot

onVoice

protected void onVoice(java.lang.String channel,
                       java.lang.String sourceNick,
                       java.lang.String sourceLogin,
                       java.lang.String sourceHostname,
                       java.lang.String recipient)
Overrides:
onVoice in class org.jibble.pircbot.PircBot

main

public static void main(java.lang.String[] args)
Parse command line parameters and start the bot.

Parameters:
args - command line parameters.

getUsage

public static java.lang.String getUsage()
Usage help message for PPF explaining the command line parameters.

Returns:
PPF usage

getUserLang

public java.lang.String getUserLang(java.lang.String nick)
If a user has set a language return that language, else return the bot's configured default language.

Parameters:
nick - the user's nick.
Returns:
the language ISO code (en, de, etc.)

getCurrentChannels

public java.util.Map getCurrentChannels()
The channels the bot is currently on.

Returns:
the bot's channels.

digestPrivateMessage

public void digestPrivateMessage(java.lang.String sender,
                                 java.lang.String login,
                                 java.lang.String hostname,
                                 java.lang.String message)
Simulate a private message. This makes PPF and the plugins handle the message, but does not send it to the server.

See Also:
onPrivateMessage(java.lang.String,java.lang.String,java.lang.String,java.lang.String)

digestMessage

public void digestMessage(java.lang.String channel,
                          java.lang.String sender,
                          java.lang.String login,
                          java.lang.String hostname,
                          java.lang.String message)
Simulate a channel message. This makes PPF and the plugins handle the message, but does not send it to the server.

See Also:
#onMessage(java.lang.String,java.lang.String,java.lang.String,java.lang.String)

urlEncode

public java.lang.String urlEncode(java.lang.String string)

getCfgFilename

public java.lang.String getCfgFilename()
Returns:
Returns the cfgFilename.

setCfgFilename

public void setCfgFilename(java.lang.String cfgFilename)
Parameters:
cfgFilename - The cfgFilename to set.

getAdminPassword

public java.lang.String getAdminPassword()
Returns:
Returns the cfgAdminPassword.

setAdminPassword

public void setAdminPassword(java.lang.String cfgAdminPassword)
Parameters:
cfgAdminPassword - The cfgAdminPassword to set.

getCommandHelp

public java.lang.String getCommandHelp()
Returns:
Returns the cfgCommandHelp.

setCommandHelp

public void setCommandHelp(java.lang.String cfgCommandHelp)
Parameters:
cfgCommandHelp - The cfgCommandHelp to set.

getCommandSetLang

public java.lang.String getCommandSetLang()
Returns:
Returns the cfgCommandSetLang.

setCommandSetLang

public void setCommandSetLang(java.lang.String cfgCommandSetLang)
Parameters:
cfgCommandSetLang - The cfgCommandSetLang to set.

getEncoding

public java.lang.String getEncoding()
Overrides:
getEncoding in class org.jibble.pircbot.PircBot
Returns:
Returns the cfgEncoding.

setEncoding

public void setEncoding(java.lang.String cfgEncoding)
Overrides:
setEncoding in class org.jibble.pircbot.PircBot
Parameters:
cfgEncoding - The cfgEncoding to set.

getIdentNick

public java.lang.String getIdentNick()
Returns:
Returns the cfgIdentNick.

setIdentNick

public void setIdentNick(java.lang.String cfgIdentNick)
Parameters:
cfgIdentNick - The cfgIdentNick to set.

getLanguage

public java.lang.String getLanguage()
Returns:
Returns the cfgLanguage.

setLanguage

public void setLanguage(java.lang.String cfgLanguage)
Parameters:
cfgLanguage - The cfgLanguage to set.

getMasterPassword

public java.lang.String getMasterPassword()
Returns:
Returns the cfgMasterPassword.

setMasterPassword

public void setMasterPassword(java.lang.String cfgMasterPassword)
Parameters:
cfgMasterPassword - The cfgMasterPassword to set.

getOnJoinMessage

public java.lang.String getOnJoinMessage()
Returns:
Returns the cfgOnJoinMessage.

setOnJoinMessage

public void setOnJoinMessage(java.lang.String cfgOnJoinMessage)
Parameters:
cfgOnJoinMessage - The cfgOnJoinMessage to set.

isRejoinOnKick

public boolean isRejoinOnKick()
Returns:
Returns the cfgRejoinOnKick.

setRejoinOnKick

public void setRejoinOnKick(boolean cfgRejoinOnKick)
Parameters:
cfgRejoinOnKick - The cfgRejoinOnKick to set.

getTrustedPassword

public java.lang.String getTrustedPassword()
Returns:
Returns the cfgTrustedPassword.

setTrustedPassword

public void setTrustedPassword(java.lang.String cfgTrustedPassword)
Parameters:
cfgTrustedPassword - The cfgTrustedPassword to set.

addServer

public void addServer(IrcServer server)
Add a server.
Should be called before connecting.

Parameters:
server - the server to add.

addNick

public void addNick(java.lang.String nick)
Add a nick for the bot.
Should be called before connecting.

Parameters:
nick - the nick to add.

addChannel

public void addChannel(IrcChannel channel)
Add a channel to join.
Should be called before connecting,

Parameters:
channel - the channel to add.

setDccPorts

public void setDccPorts(java.lang.String strDCCPorts)

getMaxConnectionAttempts

public int getMaxConnectionAttempts()
Returns:
Returns the maxConnectionAttempts.

setMaxConnectionAttempts

public void setMaxConnectionAttempts(int maxConnectionAttempts)
Parameters:
maxConnectionAttempts - The maxConnectionAttempts to set.

getRetryDelay

public long getRetryDelay()
Returns:
Returns the retryDelay in seconds.

setRetryDelay

public void setRetryDelay(long retryDelay)
Set in milliseconds and multiplied by 1000 for later use.

Parameters:
retryDelay - The retryDelay to set.

isStartWebServer

public boolean isStartWebServer()
Returns:
Returns the startWebServer.

setStartWebServer

public void setStartWebServer(boolean startWebServer)
Parameters:
startWebServer - The startWebServer to set.

getWebServerDocumentRoot

public java.lang.String getWebServerDocumentRoot()
Returns:
Returns the webServerDocumentRoot.

setWebServerDocumentRoot

public void setWebServerDocumentRoot(java.lang.String webServerDocumentRoot)
Parameters:
webServerDocumentRoot - The webServerDocumentRoot to set.

getWebServerPort

public int getWebServerPort()
Returns:
Returns the webServerPort.

setWebServerPort

public void setWebServerPort(int webServerPort)
Parameters:
webServerPort - The webServerPort to set.

getTopic

public java.lang.String getTopic(java.lang.String channel)
Returns the topic with irc codes for formatting and colors.

Returns:
topic

isHidePingPong

public boolean isHidePingPong()

setHidePingPong

public void setHidePingPong(boolean hidePingPong)

getPluginsDir

public java.lang.String getPluginsDir()

getPPFResBun

public PPFResourceBundle getPPFResBun()

addPluginInfo

public void addPluginInfo(PPFPluginInfo pluginInfo)

setConsole

public void setConsole(java.lang.String nothing)

getConfiguredChannels

public java.util.List getConfiguredChannels()

getCfgPlugins

public java.util.Map getCfgPlugins()

getLoadedPlugins

public java.util.Map getLoadedPlugins()

PPF API
Version 0.6

PircBot Plugin Framework API 0.6
© 2003-2004 DeadEd e.a. ppf.sourceforge.net