From fc96cb69e533aaedeb93b2457768e41de3587c4a Mon Sep 17 00:00:00 2001 From: Checkium Date: Mon, 12 Mar 2018 16:24:27 +0000 Subject: [PATCH 1/4] Brutefore retry --- .../vhackos/api/entities/impl/BruteForceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/net/olympiccode/vhackos/api/entities/impl/BruteForceImpl.java b/src/main/java/net/olympiccode/vhackos/api/entities/impl/BruteForceImpl.java index f0b9c44..5b6367b 100644 --- a/src/main/java/net/olympiccode/vhackos/api/entities/impl/BruteForceImpl.java +++ b/src/main/java/net/olympiccode/vhackos/api/entities/impl/BruteForceImpl.java @@ -42,4 +42,13 @@ public boolean remove() { } return false; } + + public boolean retry() { + JSONObject obj = Route.Tasks.REMOVE_BRUTE.compile(api, "10005", String.valueOf(id)).getResponse().getJSON(); + if (obj.optInt("bruteretry", 0) == 1) { + api.getTaskManager().reloadTasks(); + return true; + } + return false; + } } From 2a472057f9e9ea43cfafdd14ce65f031b06c16cd Mon Sep 17 00:00:00 2001 From: Checkium Date: Mon, 12 Mar 2018 20:35:38 +0000 Subject: [PATCH 2/4] Fixed 404 error problems --- .../java/net/olympiccode/vhackos/api/requests/Requester.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/olympiccode/vhackos/api/requests/Requester.java b/src/main/java/net/olympiccode/vhackos/api/requests/Requester.java index 79e302d..b49b837 100644 --- a/src/main/java/net/olympiccode/vhackos/api/requests/Requester.java +++ b/src/main/java/net/olympiccode/vhackos/api/requests/Requester.java @@ -49,7 +49,7 @@ public OkHttpClient getHttpClient() { public Response getResponse(Route.CompiledRoute route) { if (lastRequest >= System.currentTimeMillis() - 1000) { try { - Thread.sleep(100); + Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); } From 406322c647783062eb90be9648f009b57b8f9e34 Mon Sep 17 00:00:00 2001 From: Checkium Date: Mon, 12 Mar 2018 20:38:41 +0000 Subject: [PATCH 3/4] Forgot an interface grr --- .../java/net/olympiccode/vhackos/api/network/BruteForce.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/olympiccode/vhackos/api/network/BruteForce.java b/src/main/java/net/olympiccode/vhackos/api/network/BruteForce.java index 75e5489..aae81ec 100644 --- a/src/main/java/net/olympiccode/vhackos/api/network/BruteForce.java +++ b/src/main/java/net/olympiccode/vhackos/api/network/BruteForce.java @@ -14,4 +14,5 @@ public interface BruteForce { long getEndTimestamp(); long getId(); BruteForceState getState(); + boolean retry(); } From 46d895dc6167c278a8b63c9b7aeb311d468387e7 Mon Sep 17 00:00:00 2001 From: Checkium Date: Tue, 13 Mar 2018 13:27:18 +0000 Subject: [PATCH 4/4] Update for v10 --- src/main/java/net/olympiccode/vhackos/api/vHackOSInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/olympiccode/vhackos/api/vHackOSInfo.java b/src/main/java/net/olympiccode/vhackos/api/vHackOSInfo.java index 13265a4..03d54ac 100644 --- a/src/main/java/net/olympiccode/vhackos/api/vHackOSInfo.java +++ b/src/main/java/net/olympiccode/vhackos/api/vHackOSInfo.java @@ -1,6 +1,6 @@ package net.olympiccode.vhackos.api; public class vHackOSInfo { - private static final int REST_VERSION = 8; + private static final int REST_VERSION = 10; public static final String API_PREFIX = String.format("https://api.vhack.cc/mobile/%d/", REST_VERSION); }