Package de.kilobyte22.app.kibibyte.plugin

Examples of de.kilobyte22.app.kibibyte.plugin.Plugin


        System.gc(); // Make sure the plugin gets eaten by the GC
    }

    public void enable(String name) throws PluginNotFoundException {
        if (plugins.get(name) == null)
            throw new PluginNotFoundException();
        plugins.get(name).enable();
    }
View Full Code Here


        plugins.get(name).enable();
    }

    public void disable(String name) throws PluginNotFoundException {
        if (plugins.get(name) == null)
            throw new PluginNotFoundException();
        plugins.get(name).disable();
    }
View Full Code Here

            perms.remove(perm);
            perms.put(perm, false);
        } else if (mode.equalsIgnoreCase("reset")) {
            perms.remove(perm);
        } else {
            throw new UsageException();
        }
        bot.permissionSystem.setPermissions(name, perms);
    }
View Full Code Here

    HashMap<Object, String> args;

    public String getOrError(int param) {
        String ret = args.get(param);
        if (ret == null)
            throw new UsageException();
        return ret;
    }
View Full Code Here

    public int getIntOrError(int param) {
        try {
            return Integer.valueOf(getOrError(param));
        } catch (Exception ex) {
            throw new UsageException();
        }
    }
View Full Code Here

                try {
                    argstring = msg.substring(cmdname.length() + 1);
                } catch (Exception ex) {
                    argstring = "";
                }
                Args args_ = Utils.parseArgs(argstring);

                //logger.log(LogLevel.DEBUG, args_.toString());
                CommandHandler handler = handlerClass.newInstance();
                if (botAccess == null)
                    handler.setData(bot, channel, sender, args_, cmd.getAnnotation(Command.class).name());
View Full Code Here

            nick = "Console";
        else
            nick = user.getNick();
        logger.log(nick + " is rehashing config...");
        config.load();
        RehashResult res = new RehashResult();
        try {
            database = new Database(
                    config.get("Database", "driver", "", "The driver to use. For MySql use 'com.mysql.jdbc.Driver'").value,
                    config.get("Database", "conectionstring", "", "The database to connect to. For a MySql connection use 'jdbc:mysql://<host>[:<port]/<database>?user=<user>&password=<pass>'").value
            );
View Full Code Here

            if (!f.exists())
                f.mkdir();
        }
        eventBus.register(this);
        Logger.setEventBus(eventBus);
        pluginManager = new PluginManager(this);
        config = new Configuration(new File("kibibyte.conf"));
        rehash(null);
        if (crash) {
            logger.log("Crash Option enabled, stopping");
            System.exit(-1);
View Full Code Here

                f.mkdir();
        }
        eventBus.register(this);
        Logger.setEventBus(eventBus);
        pluginManager = new PluginManager(this);
        config = new Configuration(new File("kibibyte.conf"));
        rehash(null);
        if (crash) {
            logger.log("Crash Option enabled, stopping");
            System.exit(-1);
        }
View Full Code Here

        permissionSystem = bot.permissionSystem;
        nickservSystem = bot.nickservSystem;
        commandManager = new CommandManager(bot.commandManager);
        commandManager.setEnabled(false);

        config = new Configuration(new File("config/" + plugin.getName() + ".cfg"));
        logger = new Logger("PLUGIN/" + plugin.getName());
    }
View Full Code Here

TOP

Related Classes of de.kilobyte22.app.kibibyte.plugin.Plugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.