More paste data

Former-commit-id: 00b135f9fb4a71f1bdccd0e2c1726c0798552b96 [formerly 0d55087cd3dfc982306b7f996f43085c336d34f2]
Former-commit-id: 1ee18bf5b1710ee25edef50f62b2cf88ed71a68b
This commit is contained in:
Ghost_chu committed 2019-11-23 13:56:53 +08:00
1 parent b87e13a649
commit eabaf53ca4
3 files changed
+18 -10

No files matched your search

@@ -1,8 +1,7 @@
package org.maxgamer.quickshop.Shop;
import com.google.gson.JsonSyntaxException;
import lombok.Getter;
import lombok.Setter;
import lombok.*;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -34,6 +33,7 @@ public class ShopLoader {
private int totalLoaded = 0;
/* This may contains broken shop, must use null check before load it. */
@Getter private List<Shop> shopsInDatabase = new ArrayList<>();
@Getter private List<ShopDatabaseInfoOrigin> originShopsInDatabase = new ArrayList<>();
/**
* The shop load allow plugin load shops fast and simply.
@@ -97,6 +97,7 @@ public class ShopLoader {
Timer singleShopLoadTimer = new Timer(true);
ShopDatabaseInfoOrigin origin = new ShopDatabaseInfoOrigin(rs);
originShopsInDatabase.add(origin);
if (worldName != null && !origin.getWorld().equals(worldName)) {
singleShopLoaded(singleShopLoadTimer);
continue;
@@ -198,9 +199,8 @@ public class ShopLoader {
Util.debugLog("Loaded shop used time " + singleShopLoadTime + "ms");
}
@Getter
@Setter
class ShopDatabaseInfo {
@Data
public class ShopDatabaseInfo {
private ItemStack item;
private Location location;
private ShopModerator moderators;
@@ -258,9 +258,8 @@ public class ShopLoader {
}
}
@Getter
@Setter
class ShopDatabaseInfoOrigin {
@Data
public class ShopDatabaseInfoOrigin {
private String item;
private String moderators;
private double price;
@@ -179,11 +179,20 @@ public class Paste {
finalReport.append("\t\t\n").append("Read failed.").append("\n");
finalReport.append("\t*********************************\n");
}
} catch (Throwable th) {
finalReport.append("\tFailed to get data\n");
}
finalReport.append("================================================\n");
finalReport.append("Shops in DB:\n");
plugin.getShopLoader().getOriginShopsInDatabase().forEach((shopDatabaseInfoOrigin -> {
finalReport.append("\t").append(shopDatabaseInfoOrigin.toString()).append("\n");
}));
finalReport.append("================================================\n");
finalReport.append("Shops in Mem:\n");
plugin.getShopLoader().getShopsInDatabase().forEach((shop -> {
finalReport.append("\t").append(shop.toString()).append("\n");
}));
finalReport.append("================================================\n");
//Process the data to protect passwords.
String report = finalReport.toString();
@@ -198,7 +198,7 @@ public class Util {
for (String log : logs) {
String text = "[DEBUG] [" + className + "]" + " [" + methodName + "] (" + codeLine + ") " + log;
debugLogs.add(text);
if (debugLogs.size() > 5000) /* Keep debugLogs max can have 5k lines. */ {
if (debugLogs.size() > 500000) /* Keep debugLogs max can have 500k lines. */ {
debugLogs.remove(0);
}
if (devMode) {