當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。