当前位置: 首页>>代码示例>>Java>>正文


Java IrcPlugin类代码示例

本文整理汇总了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;
}
 
开发者ID:warriordog,项目名称:acomputerbot_corelib,代码行数:20,代码来源:CommandStatus.java

示例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;
}
 
开发者ID:warriordog,项目名称:acomputerbot_corelib,代码行数:10,代码来源:CommandPlugins.java

示例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);
    }
}
 
开发者ID:warriordog,项目名称:acomputerbot,代码行数:42,代码来源:IrcBot.java


注:本文中的net.acomputerdog.ircbot.plugin.IrcPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。