1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

Option to show duplicate user messages. Disabled by default.

This commit is contained in:
Zrips 2021-10-26 12:58:52 +03:00
parent 52547b94a5
commit 7f7003ca5f
3 changed files with 124 additions and 113 deletions

View File

@ -125,8 +125,9 @@ public class PlayerManager {
// Checking duplicated UUID's which usually is a cause of previous bugs
if (playerUUIDMap.containsKey(info.getUuid()) && playerUUIDMap.get(info.getUuid()).getID() != info.getID()) {
int id = playerUUIDMap.get(info.getUuid()).getID();
CMIMessages.consoleMessage("&7Duplicate! &5" + info.getName() + " &7same UUID for 2 entries in database. Please remove of one them from users table id1: &2" + id + " &7id2: &2" + info.getID());
if (Jobs.getGCManager().isInformDuplicates())
CMIMessages.consoleMessage("&7Duplicate! &5" + info.getName() + " &7same UUID for 2 entries in database. Please remove of one them from users table id1: &2" + id + " &7id2: &2" + info
.getID());
if (id < info.getID()) {
return;
}
@ -135,6 +136,7 @@ public class PlayerManager {
// Checking duplicated names which usually is a cause of previous bugs
if (playerNameMap.containsKey(info.getName().toLowerCase()) && playerNameMap.get(info.getName().toLowerCase()).getID() != info.getID()) {
int id = playerNameMap.get(info.getName().toLowerCase()).getID();
if (Jobs.getGCManager().isInformDuplicates())
CMIMessages.consoleMessage("&7Name Duplicate! &5" + info.getName() + " &7same UUID for 2 entries in database. Please remove of one them from users table id1: &2" + id + " &7id2: &2" + info
.getID());
if (id < info.getID()) {

View File

@ -82,6 +82,7 @@ public class GeneralConfigManager {
public float maxPaymentCurveFactor;
private boolean FurnacesReassign, BrewingStandsReassign, useTnTFinder = false, ShowNewVersion;
private boolean InformDuplicates;
private FireworkEffect fireworkEffect;
@ -342,6 +343,10 @@ public class GeneralConfigManager {
"When set to true staff will be informed about new Jobs plugin version", "You need to have jobs.versioncheck permission node");
ShowNewVersion = c.get("Optimizations.NewVersion", true);
c.addComment("Optimizations.InformDuplicates",
"Can be used to check if your database contains any duplicated user entries.");
InformDuplicates = c.get("Optimizations.InformDuplicates", false);
c.addComment("Optimizations.DecimalPlaces.Money",
"Decimal places to be shown");
DecimalPlacesMoney = "%." + c.get("Optimizations.DecimalPlaces.Money", 2) + "f";
@ -1154,4 +1159,8 @@ public class GeneralConfigManager {
public FireworkEffect getFireworkEffect() {
return fireworkEffect;
}
public boolean isInformDuplicates() {
return InformDuplicates;
}
}