Fixed always-on war.pvp permission for War admins in GroupManager/Permissions context by adding specific war.admin permission node and by removing war.pvp from the children. Also removed war.warp from the children.

This commit is contained in:
taoneill 2011-12-20 15:28:12 -05:00
parent f7e0b73465
commit b6f9afb745
4 changed files with 33 additions and 21 deletions

View File

@ -866,7 +866,7 @@ public class War extends JavaPlugin {
*/
public boolean canPlayWar(Player player) {
if (War.permissionHandler != null) {
if (War.permissionHandler.has(player, "war.player") || War.permissionHandler.has(player, "War.player")) {
if (War.permissionHandler.has(player, "war.player")) {
return true;
} else {
return false;
@ -885,7 +885,7 @@ public class War extends JavaPlugin {
*/
public boolean canWarp(Player player) {
if (War.permissionHandler != null) {
if (War.permissionHandler.has(player, "war.warp") || War.permissionHandler.has(player, "War.warp")) {
if (War.permissionHandler.has(player, "war.warp")) {
return true;
} else {
return false;
@ -906,7 +906,7 @@ public class War extends JavaPlugin {
public boolean canBuildOutsideZone(Player player) {
if (this.isBuildInZonesOnly()) {
if (War.permissionHandler != null) {
if (War.permissionHandler.has(player, "war.build") || War.permissionHandler.has(player, "War.build")) {
if (War.permissionHandler.has(player, "war.build")) {
return true;
} else {
return false;
@ -929,7 +929,7 @@ public class War extends JavaPlugin {
public boolean canPvpOutsideZones(Player player) {
if (this.isPvpInZonesOnly()) {
if (War.permissionHandler != null) {
if (War.permissionHandler.has(player, "war.pvp") || War.permissionHandler.has(player, "War.pvp")) {
if (War.permissionHandler.has(player, "war.pvp")) {
return true;
} else {
return false;
@ -962,9 +962,9 @@ public class War extends JavaPlugin {
return true;
}
}
if (War.permissionHandler != null) {
if (War.permissionHandler.has(player, "war.*") || War.permissionHandler.has(player, "War.*")
|| War.permissionHandler.has(player, "war.zonemaker") || War.permissionHandler.has(player, "War.zonemaker")) {
if (War.permissionHandler.has(player, "war.zonemaker")) {
// War admins are zonemakers
return true;
} else {
@ -984,14 +984,14 @@ public class War extends JavaPlugin {
*/
public boolean isWarAdmin(Player player) {
if (War.permissionHandler != null) {
if (War.permissionHandler.has(player, "war.*") || War.permissionHandler.has(player, "War.*")) {
if (War.permissionHandler.has(player, "war.*") || War.permissionHandler.has(player, "war.admin")) {
return true;
} else {
return false;
}
} else {
// default to op, if no permissions are found
return player.hasPermission("war.*");
return player.hasPermission("war.admin");
}
}

View File

@ -110,7 +110,7 @@ public class WarCommandHandler {
}
// we are not responsible for any other command
} catch (NotWarAdminException e) {
War.war.badMsg(sender, "You can't do this if you are not a War admin (permission war.*).");
War.war.badMsg(sender, "You can't do this if you are not a War admin (permission war.admin).");
} catch (NotZoneMakerException e) {
War.war.badMsg(sender, "You can't do this if you are not a warzone maker (permission war.zonemaker).");
} catch (Exception e) {

View File

@ -1,27 +1,33 @@
name: War
version: 1.6.1 (de Gaulle)
description: Lets you create TDM and CTF (warzones) for a more structured PVP experience.
description: Lets you create TDM and CTF arenas (warzones) for a fast-paced and structured PVP experience.
author: tommytony
website: war.tommytony.com
main: bukkit.tommytony.war.War
permissions:
war.*:
description: Create and destroy warzones. Change War configuration.
description: Full War permissions. Create and destroy warzones. Change War configuration.
default: op
children:
war.admin: true
war.zonemaker: true
war.player: true
war.warp: true
war.build: true
war.pvp: true
war.admin:
description: War admin rights. Create and destroy warzones. Change War configuration.
default: false
children:
war.zonemaker: true
war.player: true
war.build: true
war.zonemaker:
description: Create and edit warzones, but you can only edit a warzone if you are its author.
description: Warzone maker rights. Create and edit warzones, but you can only edit a warzone if you are its author.
default: false
children:
war.player: true
war.warp: true
war.build: true
war.pvp: false
war.player:
description: Lets you participate in War matches.
default: true
@ -37,7 +43,7 @@ permissions:
description:
Useful only after using /warcfg pvpinzonesonly:true. This node circumvents the pvp restriction and lets you pvp outside warzones.
To setup a pvp world, give war.pvp to players, but only as a permission specific to the pvp world. Other worlds will remain protected
by the pvpinzonesonly setting. No matter what, pvp must be turned on in your server.properties file, otherwise War won't work.
by the pvpinzonesonly setting. NOTE - No matter what, pvp must be turned on in your server.properties file, otherwise War won't work.
default: false
commands:
# Player commands

View File

@ -1,27 +1,33 @@
name: War
version: 1.6.1 (de Gaulle)
description: Lets you create TDM and CTF (warzones) for a more structured PVP experience.
description: Lets you create TDM and CTF arenas (warzones) for a fast-paced and structured PVP experience.
author: tommytony
website: war.tommytony.com
main: bukkit.tommytony.war.War
permissions:
war.*:
description: Create and destroy warzones. Change War configuration.
description: Full War permissions. Create and destroy warzones. Change War configuration.
default: op
children:
war.admin: true
war.zonemaker: true
war.player: true
war.warp: true
war.build: true
war.pvp: true
war.admin:
description: War admin rights. Create and destroy warzones. Change War configuration.
default: false
children:
war.zonemaker: true
war.player: true
war.build: true
war.zonemaker:
description: Create and edit warzones, but you can only edit a warzone if you are its author.
description: Warzone maker rights. Create and edit warzones, but you can only edit a warzone if you are its author.
default: false
children:
war.player: true
war.warp: true
war.build: true
war.pvp: false
war.player:
description: Lets you participate in War matches.
default: true
@ -37,7 +43,7 @@ permissions:
description:
Useful only after using /warcfg pvpinzonesonly:true. This node circumvents the pvp restriction and lets you pvp outside warzones.
To setup a pvp world, give war.pvp to players, but only as a permission specific to the pvp world. Other worlds will remain protected
by the pvpinzonesonly setting. No matter what, pvp must be turned on in your server.properties file, otherwise War won't work.
by the pvpinzonesonly setting. NOTE - No matter what, pvp must be turned on in your server.properties file, otherwise War won't work.
default: false
commands:
# Player commands