diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-30 13:27:57 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-30 13:27:57 +0100 |
commit | 88bcb862b872ad36906f58bedc07465e5e80d12b (patch) | |
tree | 7f991ebd9540c58933e86279d96c7086253462d4 | |
parent | e77cfed3faadf086b3b46f26b65c52ea2b588f59 (diff) | |
download | Essentials-88bcb862b872ad36906f58bedc07465e5e80d12b.tar Essentials-88bcb862b872ad36906f58bedc07465e5e80d12b.tar.gz Essentials-88bcb862b872ad36906f58bedc07465e5e80d12b.tar.lz Essentials-88bcb862b872ad36906f58bedc07465e5e80d12b.tar.xz Essentials-88bcb862b872ad36906f58bedc07465e5e80d12b.zip |
Don't push vault version to metrics.
10 files changed, 70 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java index 11f42e701..2ec8538ca 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java @@ -24,7 +24,7 @@ public class EssentialsPluginListener implements Listener, IConf ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin()); if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager())) { - ess.getLogger().log(Level.INFO, "Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")"); + ess.getLogger().log(Level.INFO, "Payment method found (" + ess.getPaymentMethod().getMethod().getLongName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")"); } } diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 6380b7f6c..93db9b05c 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -4,6 +4,7 @@ import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.metrics.Metrics.Graph; import com.earth2me.essentials.metrics.Metrics.Plotter; import com.earth2me.essentials.register.payment.Method; +import com.earth2me.essentials.register.payment.methods.VaultEco; import java.util.Locale; import java.util.logging.Level; @@ -150,11 +151,18 @@ public class MetricsStarter implements Runnable final Method method = ess.getPaymentMethod().getMethod(); if (method != null) { - String version = method.getVersion(); - final int dashPosition = version.indexOf('-'); - if (dashPosition > 0) - { - version = version.substring(0, dashPosition); + String version; + if (method instanceof VaultEco) { + + version = ((VaultEco)method).getEconomy(); + } + else { + version = method.getVersion(); + final int dashPosition = version.indexOf('-'); + if (dashPosition > 0) + { + version = version.substring(0, dashPosition); + } } depGraph.addPlotter(new SimplePlotter(method.getName() + " " + version)); } diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Method.java b/Essentials/src/com/earth2me/essentials/register/payment/Method.java index a942667e8..c4c9d401a 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/Method.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/Method.java @@ -33,6 +33,13 @@ public interface Method * @return <code>String</code> Plugin name. */ public String getName(); + + /** + * Returns the reported name of this method. + * + * @return <code>String</code> Plugin name. + */ + public String getLongName(); /** * Returns the actual version of this method. diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java index c3b71d4e3..91537caed 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java @@ -28,6 +28,12 @@ public class BOSE6 implements Method { return "BOSEconomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java index d21ea6244..b112e2a30 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java @@ -28,6 +28,12 @@ public class BOSE7 implements Method { return "BOSEconomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java index 87d633b5c..612b07150 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java @@ -28,6 +28,12 @@ public class MCUR implements Method { return "MultiCurrency"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java index 84ce816cf..f0a8171f3 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java @@ -34,8 +34,18 @@ public class VaultEco implements Method @Override public String getName() { - - return this.vault.getDescription().getName().concat(" - Economy: ").concat(economy == null ? "NoEco" : economy.getName()); + return this.vault.getDescription().getName(); + } + + public String getEconomy() + { + return economy == null ? "NoEco" : economy.getName(); + } + + @Override + public String getLongName() + { + return getName().concat(" - Economy: ").concat(getEconomy()); } @Override diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java index 52fb36e15..e505d4484 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java @@ -28,7 +28,13 @@ public class iCo4 implements Method { return "iConomy"; } - + + @Override + public String getLongName() + { + return getName(); + } + @Override public String getVersion() { diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java index 3b2fb2f6d..38e749d07 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java @@ -31,6 +31,12 @@ public class iCo5 implements Method { return "iConomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java index 1a2950847..b3791eef1 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java @@ -30,6 +30,12 @@ public class iCo6 implements Method { return "iConomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() |