本文整理汇总了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);
}
}