From 2dbde4b801ba7fa9dd2c5ea022fe51a20b4613df Mon Sep 17 00:00:00 2001 From: "Noah Clarkson (Unprotesting)" Date: Sun, 27 Dec 2020 11:33:20 +0000 Subject: [PATCH] Fixed some critical bugs and added favicon.io image to web folder + Fixed max-buys/sells not working properly + Fixed HTTP requests not sending properly + Fixed some null errors when tasks concurrently edited the map such as price calculation and inflation + Updated to 0.12.1 --- Auto-Tune/dependency-reduced-pom.xml | 3 +- Auto-Tune/pom.xml | 3 +- Auto-Tune/src/resources/web/favicon.ico | Bin 0 -> 270398 bytes .../Commands/AutoTuneGUIShopUserCommand.java | 23 +++++++++--- .../src/unprotesting/com/github/Main.java | 9 ++++- .../com/github/util/HttpPostRequestor.java | 33 ++++++++++++++---- .../github/util/PriceCalculationHandler.java | 1 + 7 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 Auto-Tune/src/resources/web/favicon.ico diff --git a/Auto-Tune/dependency-reduced-pom.xml b/Auto-Tune/dependency-reduced-pom.xml index fe9382d..9abf0b9 100644 --- a/Auto-Tune/dependency-reduced-pom.xml +++ b/Auto-Tune/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ unprotesting.com.github Auto-Tune Auto-Tune - 0.12.0 + 0.12.1 The automatic pricing plugin for minecraft https://github.com/Unprotesting/Auto-Tune @@ -29,6 +29,7 @@ enchantments.yml web/trade.html web/trade-short.html + web/favicon.ico diff --git a/Auto-Tune/pom.xml b/Auto-Tune/pom.xml index 7b13496..fceb86c 100644 --- a/Auto-Tune/pom.xml +++ b/Auto-Tune/pom.xml @@ -9,7 +9,7 @@ unprotesting.com.github Auto-Tune - 0.12.0 + 0.12.1 Auto-Tune https://github.com/Unprotesting/Auto-Tune @@ -116,6 +116,7 @@ enchantments.yml web/trade.html web/trade-short.html + web/favicon.ico diff --git a/Auto-Tune/src/resources/web/favicon.ico b/Auto-Tune/src/resources/web/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..48f6ebc6fc3f71f85a47b61b8044f159ce62cc28 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^Ovg6Q~u|A z#oLr;l#eRsy_9eAp5KrBCrqwlQ2RU);0cgld7J0^l@`{?SD#QhNrK1ouK69>d|rPw zpO?k0d9?Zb+^uJ}0JYHix}<-fzAMA9H!W zgY!Sf^Sy5QP^73%Uh^L(aJJ&e@5jv@%=!13!p{@L6`g!4vm@W7vUtcklQRhK`Djd& z=6PyB$IW=YANjqSOO%gSI{y06S^9nC_qyd%`LxedKCUH*7vfzm@HT;S;hT;}dUf(a zV6XWECUgo%z6sCcla4w_{IIm{|xz7&f$4~Ro`8bP01;=*SmT)w((wGR zQBPA|qTrR%%{sgAsXU118T_(PAJ!WWYAMz;QuGk^SrC^ zZh)h-16xW{5=7}auR=z=YP>rKP7v{jDA#} zYK|P`U-b@=-|PIcZoUEeL?hH(H=jyIZIIxaPnE%+0SWLzAv<*Q`;m{5p^_+;a*h-H zDbIfn4-!ou(?=-Z0dOV%i)udO89MoRF_oN|@DZKo9et*s8qV{1-X}YdMaE)yAP|f(CUj7$*dG)>Kf3DvN zIhW^&aP()ThEx8iN{;gNQzrh_@app$T=Gpk7fi#+^0fK%E&lgy#~Y~=INmQlKjRCI z>bd0iD^KGAC*rivn?(MM*VNMUPAJ~*_&o2o>K)XV)Y543XF8tmcjl|DOCNE5zgIWk zSwBs_=KW6knVip4R}+5;q5yP3yluwkM7E=S`8x%*ObXATo5UqvX7Qsp!6aTF8i map = Main.map.get(item); + output = map.get(map.size()-1)[0]; + return output; + } } else { - return Main.getItemPrices().get(item).sellPrice; + Double output = Main.getItemPrices().get(item).sellPrice; + if (output != null){ + return output; + } + else{ + ConcurrentHashMap map = Main.map.get(item); + output = map.get(map.size()-1)[0]; + output = output - output*0.01*getSellDifference(item); + return output; + } } } diff --git a/Auto-Tune/src/unprotesting/com/github/Main.java b/Auto-Tune/src/unprotesting/com/github/Main.java index 62304f1..f8cd4d0 100644 --- a/Auto-Tune/src/unprotesting/com/github/Main.java +++ b/Auto-Tune/src/unprotesting/com/github/Main.java @@ -133,7 +133,7 @@ public final class Main extends JavaPlugin implements Listener { private File configf; @Getter - public static File shopf, tradef, tradeShortf, enchf; + public static File shopf, tradef, tradeShortf, enchf, faviconf; public static String basicVolatilityAlgorithim; public static String priceModel; @@ -223,6 +223,8 @@ public void onEnable() { e.printStackTrace(); } } + Main.log("Please leave a positive review for Auto-Tune on our spigot page: https://spigotmc.org/resources/auto-tune.85715"); + Main.log("Please donate here if you enjoy the plugin: https://www.patreon.com/Unprotesting"); int pluginId = 9687; Metrics metrics = new Metrics(getINSTANCE(), pluginId); setupDataFiles(); @@ -379,6 +381,7 @@ public void createFiles() { enchf = new File(getDataFolder(), "enchantments.yml"); tradef = new File("plugins/Auto-Tune/web/", "trade.html"); tradeShortf = new File("plugins/Auto-Tune/web/", "trade-short.html"); + faviconf = new File("plugins/Auto-Tune/web/", "favicon.ico"); if (!configf.exists()) { configf.getParentFile().mkdirs(); @@ -405,6 +408,10 @@ public void createFiles() { saveResource("enchantments.yml", false); } + if (!faviconf.exists()) { + faviconf.getParentFile().mkdirs(); + saveResource("web/favicon.ico", false); + } mainConfig = new YamlConfiguration(); shopConfig = new YamlConfiguration(); diff --git a/Auto-Tune/src/unprotesting/com/github/util/HttpPostRequestor.java b/Auto-Tune/src/unprotesting/com/github/util/HttpPostRequestor.java index 7c1a556..0334f1c 100644 --- a/Auto-Tune/src/unprotesting/com/github/util/HttpPostRequestor.java +++ b/Auto-Tune/src/unprotesting/com/github/util/HttpPostRequestor.java @@ -1,6 +1,7 @@ package unprotesting.com.github.util; import java.io.IOException; +import java.net.SocketException; import java.util.concurrent.ConcurrentHashMap; import com.google.gson.JsonArray; @@ -22,16 +23,28 @@ public class HttpPostRequestor { + public static CloseableHttpClient client = HttpClients.createDefault(); + public static void updatePricesforItems(JSONObject json) throws ClientProtocolException, IOException { HttpEntity entityResponse = sendPostRequest(json); if (entityResponse != null) { JsonParser parser = new JsonParser(); - String result = EntityUtils.toString(entityResponse); + String result = null; + try { + result = EntityUtils.toString(entityResponse); + } catch (SocketException ex) { + Main.debugLog("Socket Exception: Socket Closed. Reloading HttpClient.."); + client = HttpClients.createDefault(); + entityResponse = sendPostRequest(json); + } + if (result == null) { + return; + } JsonElement jsonElement = parser.parse(result); JsonObject jsonObject = jsonElement.getAsJsonObject(); JsonElement jsonArrayElement = jsonObject.get("returnData"); JsonArray jsonArray = jsonArrayElement.getAsJsonArray(); - for (JsonElement element : jsonArray){ + for (JsonElement element : jsonArray) { JsonObject obj = element.getAsJsonObject(); JsonElement priceElement = obj.get("newPrice"); JsonElement nameElement = obj.get("itemName"); @@ -39,22 +52,28 @@ public static void updatePricesforItems(JSONObject json) throws ClientProtocolEx String name = nameElement.getAsString(); Double price = Double.parseDouble(priceString); ConcurrentHashMap map = Main.map.get(name); - Double[] arr = {price, 0.0, 0.0}; + Double[] arr = { price, 0.0, 0.0 }; map.put((map.size()), arr); - Main.map.put(name, map); + Main.map.put(name, map); } } } public static HttpEntity sendPostRequest(JSONObject json) throws IOException { - CloseableHttpClient client = HttpClients.createDefault(); HttpPost httpPost = new HttpPost("https://economy-api.herokuapp.com/"); StringEntity entity = new StringEntity(json.toJSONString()); httpPost.setEntity(entity); httpPost.setHeader("content-type", "application/json"); httpPost.setHeader("apikey", Config.getApiKey()); - httpPost.setHeader("email", Config.getEmail()); - CloseableHttpResponse response = client.execute(httpPost); + httpPost.setHeader("email", Config.getEmail()); + CloseableHttpResponse response = null; + try{ + response = client.execute(httpPost); + } + catch (IllegalStateException ex){ + client = HttpClients.createDefault(); + response = client.execute(httpPost); + } int statusCode = response.getStatusLine().getStatusCode(); HttpEntity entityResponse = null; if (statusCode == 200) { diff --git a/Auto-Tune/src/unprotesting/com/github/util/PriceCalculationHandler.java b/Auto-Tune/src/unprotesting/com/github/util/PriceCalculationHandler.java index 7f10c06..2404c07 100644 --- a/Auto-Tune/src/unprotesting/com/github/util/PriceCalculationHandler.java +++ b/Auto-Tune/src/unprotesting/com/github/util/PriceCalculationHandler.java @@ -41,6 +41,7 @@ public static void loadItemPriceData() { public static void loadItemPricesAndCalculate() throws ParseException, ClientProtocolException, IOException { Integer playerCount = Bukkit.getServer().getOnlinePlayers().size(); if (Config.isUpdatePricesWhenInactive() || (!Config.isUpdatePricesWhenInactive() && playerCount > 0)){ + Main.setupMaxBuySell(); Main.log("Loading Item Price Update Algorithm"); JSONObject obj = new JSONObject(); JSONArray itemData = new JSONArray();