本文整理匯總了Java中net.acomputerdog.ircbot.plugin.IrcPlugin類的典型用法代碼示例。如果您正苦於以下問題:Java IrcPlugin類的具體用法?Java IrcPlugin怎麽用?Java IrcPlugin使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IrcPlugin類屬於net.acomputerdog.ircbot.plugin包,在下文中一共展示了IrcPlugin類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processCommand
import net.acomputerdog.ircbot.plugin.IrcPlugin; //導入依賴的package包/類
@Override
public boolean processCommand(Channel channel, User sender, Chattable target, CommandLine command) {
target.send(bot.getVersionString() + " status:");
target.send(" " + bot.getCommandManager().getCommandNameMap().size() + " loaded commands with " + bot.getCommandManager().getCommandMap().size() + " registered aliases.");
target.send(" Memory: " + (Runtime.getRuntime().freeMemory() / 1000000) + "mb used / " + (Runtime.getRuntime().totalMemory() / 1000000) + "mb allocated / " + (Runtime.getRuntime().maxMemory() / 1000000) + "mb available.");
PluginList plugins = bot.getPluginList();
StringBuilder builder = new StringBuilder(plugins.size() * 2);
int count = 0;
for (IrcPlugin plugin : plugins.getPlugins()) {
if (count > 0) {
builder.append(", ");
}
builder.append(plugin.getID());
count++;
}
target.send(" Plugins (" + plugins.size() + "): " + builder.toString());
target.send(" Uptime: " + calcUptime());
return true;
}
示例2: processCommand
import net.acomputerdog.ircbot.plugin.IrcPlugin; //導入依賴的package包/類
@Override
public boolean processCommand(Channel channel, User user, Chattable chattable, CommandLine commandLine) {
PluginList plugins = bot.getPluginList();
chattable.send(plugins.size() + " loaded plugins:");
for (IrcPlugin plugin : plugins.getPlugins()) {
chattable.send(plugin.getName() + ' ' + plugin.getVersion() + " (" + plugin.getID() + " / " + plugin.getClass().getName() + ')');
}
return true;
}
示例3: end
import net.acomputerdog.ircbot.plugin.IrcPlugin; //導入依賴的package包/類
private void end(int code) {
buffer.free();
waitForCommandComplete();
if (code == 0) {
LOGGER.logInfo("Shutting down normally.");
} else {
LOGGER.logWarning("Shutting down unexpectedly with code " + code + "!");
}
if (shutdownReason != null) {
LOGGER.logInfo("Shutdown reason: " + shutdownReason);
}
try {
if (connection != null) {
if (reloading) {
connection.disconnect("Bot reloading.");
} else {
connection.disconnect(shutdownReason == null ? "Bot shutting down." : shutdownReason);
}
}
for (IrcPlugin plugin : pluginList.getPlugins()) {
try {
plugin.onUnload();
} catch (Throwable t) {
LOGGER.logError("Exception unloading plugin " + plugin.getName() + "!", t);
}
}
LOGGER.logInfo("Unloaded " + pluginList.size() + " plugins.");
blacklist.save();
autoJoinList.save();
admins.save();
Config.save();
IrcConnection.ABOUT_ADDITIONAL = "";
logManager.onShutdown();
properShutdown = true;
} catch (Throwable ignored) {}
if (!reloading) {
System.exit(code);
}
}