diff --git a/Plan/src/main/java/com/djrapitops/plan/Phrase.java b/Plan/src/main/java/com/djrapitops/plan/Phrase.java index 5c406baa9..1623c3ef1 100644 --- a/Plan/src/main/java/com/djrapitops/plan/Phrase.java +++ b/Plan/src/main/java/com/djrapitops/plan/Phrase.java @@ -73,6 +73,7 @@ public enum Phrase { ANALYSIS_FAIL_NO_DATA(ANALYSIS + "Analysis failed, no data in the database."), ANALYSIS_BEGIN_ANALYSIS(ANALYSIS + "Data Fetched, beginning Analysis of data.."), ANALYSIS_COMPLETE(ANALYSIS + "Analysis Complete."), + DATA_CORRUPTION_WARN("Some data might be corrupted: "+REPLACE0), // ERROR_PLANLITE("PlanLite not found, if you're have plugins using PlanAPI v1.6.0 download PlanLite."), ERROR_CONSOLE_PLAYER("This point of code should not be accessable on console. Inform author: "+REPLACE0+" Console: REPLACE1"), diff --git a/Plan/src/main/java/com/djrapitops/plan/Plan.java b/Plan/src/main/java/com/djrapitops/plan/Plan.java index 22381df6f..fb3efdfb1 100644 --- a/Plan/src/main/java/com/djrapitops/plan/Plan.java +++ b/Plan/src/main/java/com/djrapitops/plan/Plan.java @@ -9,7 +9,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. +* License for more details. * * You should have received a copy of the License * along with this program. @@ -51,22 +51,15 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitTask; -/* TODO 2.5.0 +/* TODO 2.6.0 Placeholder API Database cleaning Play session lenght -- Existing data -- importing - Kills & Deaths 50% - - DB saving & Alter tables Location Analysis to view meaningful locations on Dynmap (Investigate dynmap api) Integrate PlanLite features to Plan and discontinue PlanLite Seperate serverdata and userdata saving Database Cleaning of useless data Fix any bugs that come up - Localization - - Combine the two locale files - Security */ /** * diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java index d68659cd2..18842d85f 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/AnalyzeCommand.java @@ -80,7 +80,7 @@ public class AnalyzeCommand extends SubCommand { sendAnalysisMessage(sender); this.cancel(); } - if (timesrun > 45) { + if (timesrun > 10) { sender.sendMessage(Phrase.COMMAND_TIMEOUT.parse("Analysis")); this.cancel(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java index 675b160c2..3f8742b66 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/InspectCommand.java @@ -125,7 +125,7 @@ public class InspectCommand extends SubCommand { sender.sendMessage(Phrase.CMD_FOOTER+""); this.cancel(); } - if (timesrun > 45) { + if (timesrun > 10) { sender.sendMessage(Phrase.COMMAND_TIMEOUT.parse("Inspect")); this.cancel(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java b/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java index 8b13b8696..94df1ae20 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java @@ -515,7 +515,6 @@ public abstract class SQLDB extends Database { statement.setString(1, "" + userId); statement.execute(); statement.close(); - statement = connection.prepareStatement("DELETE FROM " + nicknamesName + " WHERE UPPER(" + nicknamesColumnUserID + ") LIKE UPPER(?)"); statement.setString(1, "" + userId); statement.execute(); @@ -524,7 +523,7 @@ public abstract class SQLDB extends Database { statement.setString(1, "" + userId); statement.execute(); statement.close(); - statement = connection.prepareStatement("DELETE FROM " + ipsName + " WHERE UPPER(" + ipsColumnIP + ") LIKE UPPER(?)"); + statement = connection.prepareStatement("DELETE FROM " + ipsName + " WHERE UPPER(" + ipsColumnUserID + ") LIKE UPPER(?)"); statement.setString(1, "" + userId); statement.execute(); statement.close(); diff --git a/Plan/src/main/java/com/djrapitops/plan/ui/webserver/Response.java b/Plan/src/main/java/com/djrapitops/plan/ui/webserver/Response.java index 88fd9817a..eced0d683 100644 --- a/Plan/src/main/java/com/djrapitops/plan/ui/webserver/Response.java +++ b/Plan/src/main/java/com/djrapitops/plan/ui/webserver/Response.java @@ -50,7 +50,7 @@ public class Response { } else { securityCode = requestArgs[1]; } - if (!securityCode.equals(Settings.SECURITY_CODE+"")) { + if (!securityCode.equals(Settings.SECURITY_CODE + "")) { forbidden = true; } if (forbidden) { @@ -77,12 +77,22 @@ public class Response { return; } if (requestHandler.checkIfCached(uuid)) { - String dataHtml = requestHandler.getDataHtml(uuid); - String htmlDef = "HTTP/1.1 OK\r\n" - + "Content-Type: text/html; charset=utf-8\r\n" - + "Content-Length: " + dataHtml.length() + "\r\n" - + "\r\n"; - output.write((htmlDef + dataHtml).getBytes()); + try { + String dataHtml = requestHandler.getDataHtml(uuid); + String htmlDef = "HTTP/1.1 OK\r\n" + + "Content-Type: text/html; charset=utf-8\r\n" + + "Content-Length: " + dataHtml.length() + "\r\n" + + "\r\n"; + output.write((htmlDef + dataHtml).getBytes()); + } catch (NullPointerException e) { + e.printStackTrace(); + String errorMessage = "HTTP/1.1 404 Error\r\n" + + "Content-Type: text/html;\r\n" + + "Content-Length: 30\r\n" + + "\r\n" + + "