mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Don't push vault version to metrics.
This commit is contained in:
parent
f3345247ed
commit
e795c6ed0b
10 changed files with 70 additions and 9 deletions
|
@ -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() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,12 +151,19 @@ public class MetricsStarter implements Runnable
|
|||
final Method method = ess.getPaymentMethod().getMethod();
|
||||
if (method != null)
|
||||
{
|
||||
String version = method.getVersion();
|
||||
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));
|
||||
}
|
||||
depGraph.addPlotter(new SimplePlotter(ess.getPermissionsHandler().getName()));
|
||||
|
|
|
@ -34,6 +34,13 @@ public interface Method
|
|||
*/
|
||||
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.
|
||||
*
|
||||
|
|
|
@ -29,6 +29,12 @@ public class BOSE6 implements Method
|
|||
return "BOSEconomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion()
|
||||
{
|
||||
|
|
|
@ -29,6 +29,12 @@ public class BOSE7 implements Method
|
|||
return "BOSEconomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion()
|
||||
{
|
||||
|
|
|
@ -29,6 +29,12 @@ public class MCUR implements Method
|
|||
return "MultiCurrency";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion()
|
||||
{
|
||||
|
|
|
@ -34,8 +34,18 @@ public class VaultEco implements Method
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.vault.getDescription().getName();
|
||||
}
|
||||
|
||||
return this.vault.getDescription().getName().concat(" - Economy: ").concat(economy == null ? "NoEco" : economy.getName());
|
||||
public String getEconomy()
|
||||
{
|
||||
return economy == null ? "NoEco" : economy.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName()
|
||||
{
|
||||
return getName().concat(" - Economy: ").concat(getEconomy());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,6 +29,12 @@ public class iCo4 implements Method
|
|||
return "iConomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion()
|
||||
{
|
||||
|
|
|
@ -32,6 +32,12 @@ public class iCo5 implements Method
|
|||
return "iConomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion()
|
||||
{
|
||||
|
|
|
@ -31,6 +31,12 @@ public class iCo6 implements Method
|
|||
return "iConomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue