Commit c123fa72 authored by Giant's avatar Giant
Browse files

Implement experimental setting of group.

parent 79ebdf3e
......@@ -102,6 +102,29 @@ public class bpEngine implements Permission {
return this.inGroup(p.getName(), group, p.getWorld().getName());
}
@Override
public void setGroup(String p, String group) {
Player pl = plugin.getServer().getPlayer(p);
if(pl != null) {
this.setGroup(pl, group);
}
}
@Override
public void setGroup(Player p, String group) {
this.setGroup(p, group, p.getWorld().getName());
}
@Override
public void setGroup(String p, String group, String world) {
ApiLayer.addGroup(world, CalculableType.USER, p, group);
}
@Override
public void setGroup(Player p, String group, String world) {
this.setGroup(p.getName(), group, world);
}
@Override
public String getGroup(String p) {
Player pl = plugin.getServer().getPlayer(p);
......
......@@ -144,6 +144,22 @@ public class gmEngine implements Permission {
return this.inGroup(p.getName(), group, world);
}
@Override
public void setGroup(String p, String group) {
}
@Override
public void setGroup(Player p, String group) {
}
@Override
public void setGroup(String p, String group, String world) {
}
@Override
public void setGroup(Player p, String group, String world) {
}
@Override
public String getGroup(String p) {
AnjoPermissionsHandler h = permission.getWorldsHolder().getWorldPermissionsByPlayerName(p);
......
......@@ -89,6 +89,22 @@ public class npEngine implements Permission {
return this.inGroup(p.getName(), group, world);
}
@Override
public void setGroup(String p, String group) {
}
@Override
public void setGroup(Player p, String group) {
}
@Override
public void setGroup(String p, String group, String world) {
}
@Override
public void setGroup(Player p, String group, String world) {
}
@Override
public String getGroup(String p) {
return null;
......
......@@ -108,6 +108,26 @@ public class pexEngine implements Permission {
return this.inGroup(p.getName(), group, world);
}
@Override
public void setGroup(String p, String group) {
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), "pex user " + p + " group set " + group);
}
@Override
public void setGroup(Player p, String group) {
this.setGroup(p.getName(), group);
}
@Override
public void setGroup(String p, String group, String world) {
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), "pex user " + p + " group set " + group + " " + world);
}
@Override
public void setGroup(Player p, String group, String world) {
this.setGroup(p.getName(), group, world);
}
@Override
public String getGroup(String p) {
String[] groups = PermissionsEx.getPermissionManager().getUser(p).getGroupsNames();
......
......@@ -93,6 +93,22 @@ public class spermEngine implements Permission {
return this.inGroup(p.getName(), group, world);
}
@Override
public void setGroup(String p, String group) {
}
@Override
public void setGroup(Player p, String group) {
}
@Override
public void setGroup(String p, String group, String world) {
}
@Override
public void setGroup(Player p, String group, String world) {
}
@Override
public String getGroup(String p) {
return null;
......
......@@ -121,6 +121,26 @@ public class zpEngine implements Permission {
return this.inGroup(p.getName(), group);
}
@Override
public void setGroup(String p, String group) {
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), "permissions group " + group + " add " + p);
}
@Override
public void setGroup(Player p, String group) {
this.setGroup(p.getName(), group);
}
@Override
public void setGroup(String p, String group, String world) {
this.setGroup(p, group);
}
@Override
public void setGroup(Player p, String group, String world) {
this.setGroup(p.getName(), group, world);
}
@Override
public String getGroup(String p) {
List<String> groups = permission.getPlayerAssignedGroups(p);
......
......@@ -21,6 +21,11 @@ public interface Permission {
public String getGroup(Player p);
public String getGroup(String p, String world);
public String getGroup(Player p, String world);
public void setGroup(String p, String group);
public void setGroup(Player p, String group);
public void setGroup(String p, String group, String world);
public void setGroup(Player p, String group, String world);
public String[] getGroups(String p);
public String[] getGroups(Player p);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment