Package de.kilobyte22.app.kibibyte

Examples of de.kilobyte22.app.kibibyte.Kibibyte


    public void unload() {
        try {
            bot.pluginManager.unload(args.getOrError(1));
            print("Done.");
        } catch (PluginNotFoundException e) {
            throw new CommandException("Plugin not found");
        }
    }
View Full Code Here


    public void perm() {
        String name = args.getOrError(1);
        if (args.getNamedParam("account") != null || args.getNamedParam('a') != null) {
            name = bot.nickservSystem.getAccount(name);
            if (name == null)
                throw new CommandException("Invalid account");
        }
        HashMap<String, Boolean> perms = bot.permissionSystem.getPermissions(name);
        String mode = args.getOrError(2);
        String perm = args.getOrError(3);
        if (mode.equalsIgnoreCase("set")) {
View Full Code Here

            print("Avaible commands: " + tmp);
        } else{
            Method m = bot.commandManager.getCommand(cmd);
            Command c = ((Command)m.getAnnotation(Command.class));
            if (!bot.permissionSystem.hasParsedPermission(c.permission(), sender.getNick(), channel))
                throw new CommandException("You have no permissions for that command");
            print("Usage: " + c.name() + " " + c.usage());
            print("Aliases: " + c.aliases().toString());
            print(c.help());
        }
    }
View Full Code Here

            if (plugins.get(as) != null)
                throw new PluginAlreadyLoadedException(as);
            Plugin plugin = new Plugin(name, bot, as);
            plugins.put(as, plugin);
        } catch (ClassCastException ex) {
            throw new InvalidPluginException("Plugin class doesn't implement IPlugin");
        }
        /*} catch (ClassCastException ex) {
            // No Plugin
        } catch (ClassNotFoundException e) {
            // No Such Class/broken Manifest
View Full Code Here

            this.plugin = pclass.newInstance();
            botAccess = new BotAccess(this.bot, this);
            this.plugin.onLoad(botAccess);
            this.name = name;
        } catch (ClassCastException ex) {
            throw new InvalidPluginException("Main class not found");
        }
    }
View Full Code Here

            plugin = pclass.newInstance();
            botAccess = new BotAccess(this.bot, this);
            plugin.onLoad(botAccess);
            this.name = name;
        } catch (ClassCastException ex) {
            throw new InvalidPluginException("Main class not found");
        }
    }
View Full Code Here

        }
    }

    public void load(String name) throws PluginNotFoundException, InvalidPluginException, ClassNotFoundException, IOException, InstantiationException, IllegalAccessException, PluginAlreadyLoadedException {
        if (plugins.get(name) != null)
            throw new PluginAlreadyLoadedException(name);
        File plugin = allPlugins.get(name);
        if (plugin == null)
            throw new PluginNotFoundException();
        Plugin p = new Plugin(plugin, bot);
        plugins.put(name, p);
View Full Code Here

     * @param as The Plugin name
     */
    public void loadInternal(String name, String as) throws IllegalAccessException, InstantiationException, ClassNotFoundException, PluginAlreadyLoadedException, InvalidPluginException {
        try {
            if (plugins.get(as) != null)
                throw new PluginAlreadyLoadedException(as);
            Plugin plugin = new Plugin(name, bot, as);
            plugins.put(as, plugin);
        } catch (ClassCastException ex) {
            throw new InvalidPluginException("Plugin class doesn't implement IPlugin");
        }
View Full Code Here

    public void load(String name) throws PluginNotFoundException, InvalidPluginException, ClassNotFoundException, IOException, InstantiationException, IllegalAccessException, PluginAlreadyLoadedException {
        if (plugins.get(name) != null)
            throw new PluginAlreadyLoadedException(name);
        File plugin = allPlugins.get(name);
        if (plugin == null)
            throw new PluginNotFoundException();
        Plugin p = new Plugin(plugin, bot);
        plugins.put(name, p);
    }
View Full Code Here

        plugins.put(name, p);
    }

    public void unload(String name) throws PluginNotFoundException {
        if (plugins.get(name) == null)
            throw new PluginNotFoundException();
        plugins.get(name).unload();
        plugins.remove(name);
        System.gc(); // Make sure the plugin gets eaten by the GC
    }
View Full Code Here

TOP

Related Classes of de.kilobyte22.app.kibibyte.Kibibyte

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.