Add small note to config yml & corrected a check

This commit is contained in:
libraryaddict 2019-11-14 00:38:58 +13:00
parent 92a85194fb
commit aad7001cbd
4 changed files with 24 additions and 6 deletions

View File

@ -56,8 +56,7 @@ public class LibsDisguises extends JavaPlugin {
LibsPremium.check(getDescription().getVersion(), getFile()); LibsPremium.check(getDescription().getVersion(), getFile());
if (!LibsPremium.isPremium()) { if (!LibsPremium.isPremium()) {
getLogger() getLogger().info("You are running the free version, commands limited to non-players (Console, Command " +
.info("You are running the free version, commands limited to non-players (Console, Command " +
"Blocks)"); "Blocks)");
} }
@ -242,8 +241,7 @@ public class LibsDisguises extends JavaPlugin {
// Invalidate invalid distribution // Invalidate invalid distribution
if (LibsPremium.isPremium() && LibsPremium.getPaidInformation() != null && if (LibsPremium.isPremium() && LibsPremium.getPaidInformation() != null &&
(!LibsPremium.getPaidInformation().isLegit() || !LibsPremium.getPaidInformation().isLegit()) {
LibsPremium.getPaidInformation().getDownloadID().equals("-1895736039"))) {
throw new IllegalStateException( throw new IllegalStateException(
"Error while checking pi rate on startup! Please re-download the jar from SpigotMC before " + "Error while checking pi rate on startup! Please re-download the jar from SpigotMC before " +
"reporting this error!"); "reporting this error!");

View File

@ -11,6 +11,8 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.util.Date;
import java.util.concurrent.TimeUnit;
/** /**
* Created by libraryaddict on 2/06/2017. * Created by libraryaddict on 2/06/2017.
@ -194,7 +196,11 @@ public class LibsPremium {
if (plugin.isPremium()) { if (plugin.isPremium()) {
if (!isValidVersion(version, plugin.getVersion()) || plugin.getUserID() == null || if (!isValidVersion(version, plugin.getVersion()) || plugin.getUserID() == null ||
plugin.getDownloadID() == null) { plugin.getDownloadID() == null || plugin.getUserID().equals("666666") ||
plugin.getParsedBuildDate().before(getPluginInformation().getParsedBuildDate()) ||
plugin.getParsedBuildDate().after(new Date(
getPluginInformation().getParsedBuildDate().getTime() +
TimeUnit.DAYS.toMillis(365 * 2)))) {
DisguiseUtilities.getLogger().warning( DisguiseUtilities.getLogger().warning(
"You have an old Lib's Disguises jar (" + file.getName() + " " + fileInfo + "You have an old Lib's Disguises jar (" + file.getName() + " " + fileInfo +
") in the LibsDisguises folder! For security purposes, please replace this with a" + ") in the LibsDisguises folder! For security purposes, please replace this with a" +

View File

@ -2,6 +2,9 @@ package me.libraryaddict.disguise.utilities.plugin;
import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.LibsPremium;
import java.text.SimpleDateFormat;
import java.util.Date;
/** /**
* Created by libraryaddict on 20/06/2019. * Created by libraryaddict on 20/06/2019.
*/ */
@ -53,6 +56,16 @@ public class PluginInformation {
return buildDate; return buildDate;
} }
public Date getParsedBuildDate() {
try {
return new SimpleDateFormat("dd/MM/yyyy HH:mm").parse(getBuildDate());
}
catch (Exception ex) {
}
return null;
}
public boolean isLegit() { public boolean isLegit() {
return getUserID().matches("[0-9]+") && getResourceID().equals("32453") && getDownloadID().matches("-?[0-9]+"); return getUserID().matches("[0-9]+") && getResourceID().equals("32453") && getDownloadID().matches("-?[0-9]+");
} }

View File

@ -16,6 +16,7 @@ Permissions:
# Disables commands with the exception of /libsdisguises. Useful if you don't want the plugin to be used by anything # Disables commands with the exception of /libsdisguises. Useful if you don't want the plugin to be used by anything
# but a plugin # but a plugin
# Useful if you didn't purchase the plugin.
DisableCommands: false DisableCommands: false
# The disguise plugin stores all GameProfiles inside a folder called "GameProfiles" as a local cache # The disguise plugin stores all GameProfiles inside a folder called "GameProfiles" as a local cache