Move the Bungee check to after gate layout check

This commit is contained in:
Steven Scott 2013-03-03 21:19:04 -08:00
parent 30fe7f4414
commit 202c7f3d55
3 changed files with 18 additions and 15 deletions

2
README
View File

@ -215,6 +215,8 @@ Bukkit Issue: Stargate will randomly NPE when drawing a sign. Long-standing Bukk
============= =============
Changes Changes
============= =============
[Version 0.7.9.7]
- Do the Bungee check after the gate layout check.
[Version 0.7.9.6] [Version 0.7.9.6]
- Actually remove the player from the BungeeQueue when they connect. Oops :) - Actually remove the player from the BungeeQueue when they connect. Oops :)
- Implement stargate.server nodes - Implement stargate.server nodes

View File

@ -923,20 +923,6 @@ public class Portal {
if (noNetwork && !Stargate.canOption(player, "nonetwork")) noNetwork = false; if (noNetwork && !Stargate.canOption(player, "nonetwork")) noNetwork = false;
if (random && !Stargate.canOption(player, "random")) random = false; if (random && !Stargate.canOption(player, "random")) random = false;
// If the player is trying to create a Bungee gate without permissions, drop out here
if (bungee) {
if (!Stargate.enableBungee) {
Stargate.sendMessage(player, Stargate.getString("bungeeDisabled"));
return null;
} else if (!Stargate.hasPerm(player, "stargate.admin.bungee")) {
Stargate.sendMessage(player, Stargate.getString("bungeeDeny"));
return null;
} else if (destName.isEmpty() || network.isEmpty()) {
Stargate.sendMessage(player, Stargate.getString("bungeeEmpty"));
return null;
}
}
// Can not create a non-fixed always-on gate. // Can not create a non-fixed always-on gate.
if (alwaysOn && destName.length() == 0) { if (alwaysOn && destName.length() == 0) {
alwaysOn = false; alwaysOn = false;
@ -1018,6 +1004,21 @@ public class Portal {
return null; return null;
} }
// If the player is trying to create a Bungee gate without permissions, drop out here
// Do this after the gate layout check, in the least
if (bungee) {
if (!Stargate.enableBungee) {
Stargate.sendMessage(player, Stargate.getString("bungeeDisabled"));
return null;
} else if (!Stargate.hasPerm(player, "stargate.admin.bungee")) {
Stargate.sendMessage(player, Stargate.getString("bungeeDeny"));
return null;
} else if (destName.isEmpty() || network.isEmpty()) {
Stargate.sendMessage(player, Stargate.getString("bungeeEmpty"));
return null;
}
}
// Debug // Debug
Stargate.debug("createPortal", "h = " + hidden + " a = " + alwaysOn + " p = " + priv + " f = " + free + " b = " + backwards + " s = " + show + " n = " + noNetwork + " r = " + random + " u = " + bungee); Stargate.debug("createPortal", "h = " + hidden + " a = " + alwaysOn + " p = " + priv + " f = " + free + " b = " + backwards + " s = " + show + " n = " + noNetwork + " r = " + random + " u = " + bungee);

View File

@ -1,6 +1,6 @@
name: Stargate name: Stargate
main: net.TheDgtl.Stargate.Stargate main: net.TheDgtl.Stargate.Stargate
version: 0.7.9.6 version: 0.7.9.7
description: Stargate mod for Bukkit description: Stargate mod for Bukkit
author: Drakia author: Drakia
website: http://www.thedgtl.net website: http://www.thedgtl.net