Package de.bananaco.permissions.oldschool

Examples of de.bananaco.permissions.oldschool.Configuration


      PermissionSet ps = wpm.getPermissionSet(world);
      File users = new File("plugins/GroupManager/worlds/"
          + world.getName() + "/users.yml");
      File groups = new File("plugins/GroupManager/worlds/"
          + world.getName() + "/groups.yml");
      Configuration uConfig = new Configuration(users);
      Configuration gConfig = new Configuration(groups);
      uConfig.load();
      gConfig.load();
      List<String> usersList = uConfig.getKeys("users");
      List<String> groupsList = gConfig.getKeys("groups");

      if (usersList != null)
        for (String player : usersList) {
          String mainGroup = uConfig.getString("users." + player
              + ".group");
          ps.addGroup(player, mainGroup);
          for (String group : uConfig.getStringList("users." + player
              + ".subgroups", null)) {
            ps.addGroup(player, group);
          }
        }
      if (groupsList != null)
        for (String group : groupsList) {
          for (String node : gConfig.getStringList("groups." + group
              + ".permissions", null)) {
            ps.addNode(node, group);
          }
        }
    }
View Full Code Here


  public void importPermissionsBukkit() {
    WorldPermissionsManager wpm = Permissions.getWorldPermissionsManager();
    for (World world : plugin.getServer().getWorlds()) {
      PermissionSet ps = wpm.getPermissionSet(world);
      File perms = new File("plugins/PermissionsBukkit/config.yml");
      Configuration pConfig = new Configuration(perms);
      pConfig.load();
      List<String> usersList = pConfig.getKeys("users");
      List<String> groupsList = pConfig.getKeys("groups");
      if (usersList != null)
        for (String player : usersList) {
          List<String> groups = pConfig.getStringList("users."
              + player + "groups", null);
          for (String group : groups)
            ps.addGroup(player, group);
        }
      if (groupsList != null)
        for (String group : groupsList) {
          List<String> nodes = pConfig.getKeys("groups." + group
              + ".permissions");
          List<String> wnodes = pConfig.getKeys("groups." + group
              + ".worlds." + world.getName());
          if (nodes != null)
            for (String node : nodes)
              ps.addNode(!pConfig.getBoolean("groups." + group
                  + ".permissions." + node, false) ? node
                  : "^" + node, group);
          if (wnodes != null)
            for (String node : wnodes)
              ps.addNode(
                  !pConfig.getBoolean("groups." + group
                      + ".worlds." + world.getName()
                      + "." + node, false) ? node : "^"
                      + node, group);

        }
View Full Code Here

    WorldPermissionsManager wpm = Permissions.getWorldPermissionsManager();
    for (World world : plugin.getServer().getWorlds()) {
      PermissionSet ps = wpm.getPermissionSet(world);
      File users = new File("plugins/PermissionsEx/permissions.yml");

      Configuration pConfig = new Configuration(users);
      pConfig.load();
      List<String> usersList = pConfig.getKeys("users");
      List<String> groupsList = pConfig.getKeys("groups");
      if (usersList != null)
        for (String player : usersList) {
          for (String group : pConfig.getStringList("users." + player
              + ".group", null)) {
            ps.addGroup(player, group);
          }
        }
      if (groupsList != null)
        for (String group : groupsList) {
          for (String node : pConfig.getStringList("groups." + group
              + ".permissions", null)) {
            String prefix = pConfig.getString("groups." + group
                + ".prefix", null);
            String suffix = pConfig.getString("groups." + group
                + ".suffix", null);
            if (prefix != null)
              ps.addNode("prefix.0." + prefix, group);
            if (suffix != null)
              ps.addNode("suffix.0." + suffix, group);
View Full Code Here

    WorldPermissionsManager wpm = Permissions.getWorldPermissionsManager();
    for (World world : plugin.getServer().getWorlds()) {
      PermissionSet ps = wpm.getPermissionSet(world);
      File perms = new File("plugins/bPermissions/worlds/"
          + world.getName() + ".yml");
      Configuration pConfig = new Configuration(perms);
      pConfig.load();
      List<String> usersList = pConfig.getKeys("players");
      List<String> groupsList = pConfig.getKeys("groups");
      if (usersList != null)
        for (String player : usersList) {
          for (String group : pConfig.getStringList("players."
              + player, null)) {
            ps.addGroup(player, group);
          }
        }
      if (groupsList != null)
        for (String group : groupsList) {
          for (String node : pConfig.getStringList("groups." + group,
              null)) {
            ps.addNode(node, group);
          }
        }
View Full Code Here

    this.worldExec = new WorldCommands(this);
    this.permissionsExec = new PermissionsExec(this);
  }

  public void setupConfig() {
    c = new Configuration(this);

    List<String> mirrors = c.getKeys("mirrors");
    if (mirrors != null)
      for (String world : mirrors)
        mirror.put(world, c.getString("mirrors." + world));
View Full Code Here

TOP

Related Classes of de.bananaco.permissions.oldschool.Configuration

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.