From 68e363ce66a4c154bbb0243f59a81c643bf17a56 Mon Sep 17 00:00:00 2001 From: David Berdik Date: Wed, 3 Jan 2018 19:15:55 -0500 Subject: [PATCH] *Fixed issue that caused Internal Bug Reporting to not work properly *Removed telemetry collection since we are not using it anymore *Updated plugin.yml version number from 1.7.2 to 1.7.3 *Changed plugin internal version number from 21 to 22 --- .../herobrine/AI/BugReport.java | 4 +- .../herobrine/Herobrine.java | 7 -- .../herobrine/Telemetry.java | 68 ------------------- .../herobrine/UpdateScanner.java | 2 +- src/plugin.yml | 2 +- 5 files changed, 4 insertions(+), 79 deletions(-) delete mode 100644 src/net/theprogrammersworld/herobrine/Telemetry.java diff --git a/src/net/theprogrammersworld/herobrine/AI/BugReport.java b/src/net/theprogrammersworld/herobrine/AI/BugReport.java index 328955a..427a928 100644 --- a/src/net/theprogrammersworld/herobrine/AI/BugReport.java +++ b/src/net/theprogrammersworld/herobrine/AI/BugReport.java @@ -64,7 +64,7 @@ public class BugReport { "&" + URLEncoder.encode("checksum", "UTF-8") + "=" + URLEncoder.encode(checksum, "UTF-8") + "&" + URLEncoder.encode("ip", "UTF-8") + "=" + URLEncoder.encode(serverIP, "UTF-8") + "&" + URLEncoder.encode("uuid", "UTF-8") + "=" + URLEncoder.encode(playerUUID, "UTF-8"); - URL submitURL = new URL("https://theprogrammersworld.net/Herobrine/pluginBugReporter.php"); + URL submitURL = new URL("https://www.theprogrammersworld.net/Herobrine/pluginBugReporter.php"); URLConnection urlConn = submitURL.openConnection(); urlConn.setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(urlConn.getOutputStream()); @@ -86,7 +86,7 @@ public class BugReport { // Get the IP address of the server by calling a page on the website that will return the IP. URL ipFetchURL; try { - ipFetchURL = new URL("https://theprogrammersworld.net/Herobrine/pluginIPFetcher.php"); + ipFetchURL = new URL("https://www.theprogrammersworld.net/Herobrine/pluginIPFetcher.php"); InputStreamReader ipFetchISR = new InputStreamReader(ipFetchURL.openStream()); BufferedReader ipFetchBR = new BufferedReader(ipFetchISR); String ipAddress = ipFetchBR.readLine(); diff --git a/src/net/theprogrammersworld/herobrine/Herobrine.java b/src/net/theprogrammersworld/herobrine/Herobrine.java index 296cf27..e24c49e 100644 --- a/src/net/theprogrammersworld/herobrine/Herobrine.java +++ b/src/net/theprogrammersworld/herobrine/Herobrine.java @@ -78,13 +78,6 @@ public class Herobrine extends JavaPlugin implements Listener { getServer().getPluginManager().registerEvents(new WorldListener(), this); getServer().getPluginManager().registerEvents(this, this); initHerobrine(); - - // Start the telemetry collection. - if(!configdb.config.contains("config.6747427ca72be763854b9960a309be46115b8331cffd5c7" + - "da953760a7ecc7b818e0084a42d019c42aae91ae406fb86448cbabb85fd8ef6ad692d5ad4087bb517")) - { - new Thread(new Telemetry()).start(); - } // If the user has update checking turned on, start the thread responsible for performing // the check. diff --git a/src/net/theprogrammersworld/herobrine/Telemetry.java b/src/net/theprogrammersworld/herobrine/Telemetry.java deleted file mode 100644 index 9111417..0000000 --- a/src/net/theprogrammersworld/herobrine/Telemetry.java +++ /dev/null @@ -1,68 +0,0 @@ -package net.theprogrammersworld.herobrine; - -import java.io.File; -import java.io.FileInputStream; -import java.io.OutputStreamWriter; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; - -import org.bukkit.Bukkit; - -import net.theprogrammersworld.herobrine.ConfigDB; - -public class Telemetry implements Runnable { - - @Override - public void run() { - // In order to collect more information about who is using Herobrine, we are going - // to start collecting data about the servers that are running it. This is going to - // be done as part of an effort to build more specific promotional material. - - // Put the thread to sleep for one minute before we run initial telemetry collection. - // After the initial run, telemetry collection will only occur once every hour. - try { - Thread.sleep(60000); - } catch (Exception e) {} - - while(true) { - // Telemetry collection time! - try { - // Get the version number of the Minecraft server. - String serverVersion = Bukkit.getServer().getVersion(); - - // Get the port on which the Minecraft server is running. - String serverPortNumber = Integer.toString(Bukkit.getServer().getPort()); - - // Get the plugin's version number. - String pluginVersionNumber = ConfigDB.pluginVersionNumber; - - // Get the Herobrine configuration file and get a string from it that we can POST - // to the server. - File configFile = new File("plugins" + File.separator + "Herobrine" + File.separator + "config.yml"); - FileInputStream configFileInputStream = new FileInputStream(configFile); - byte[] configFileBytes = new byte[(int) configFile.length()]; - configFileInputStream.read(configFileBytes); - configFileInputStream.close(); - String configFileString = new String(configFileBytes, "UTF-8"); - - // POST the collected data to the server. - String postData = URLEncoder.encode("serverVersion", "UTF-8") + "=" + URLEncoder.encode(serverVersion, "UTF-8") + - "&" + URLEncoder.encode("serverPortNumber", "UTF-8") + "=" + URLEncoder.encode(serverPortNumber, "UTF-8") + - "&" + URLEncoder.encode("pluginVersionNumber", "UTF-8") + "=" + URLEncoder.encode(pluginVersionNumber, "UTF-8") + - "&" + URLEncoder.encode("configFile", "UTF-8") + "=" + URLEncoder.encode(configFileString, "UTF-8"); - URL telemetryURL = new URL("https://theprogrammersworld.net/Herobrine/pluginTelemetry.php"); - URLConnection urlConn = telemetryURL.openConnection(); - urlConn.setDoOutput(true); - OutputStreamWriter wr = new OutputStreamWriter(urlConn.getOutputStream()); - wr.write(postData); - wr.flush(); - urlConn.getInputStream(); - - // Wait one hour before we do this again. - Thread.sleep(86400000); - } catch (Exception e) {} - } - } - -} diff --git a/src/net/theprogrammersworld/herobrine/UpdateScanner.java b/src/net/theprogrammersworld/herobrine/UpdateScanner.java index eabed49..1e23a52 100644 --- a/src/net/theprogrammersworld/herobrine/UpdateScanner.java +++ b/src/net/theprogrammersworld/herobrine/UpdateScanner.java @@ -15,7 +15,7 @@ public class UpdateScanner implements Runnable { // Check for a newer version of the plugin, and put the thread to sleep for 24 hours // before the check is performed again. If a newer version is found, begin reporting // the discovery of a newer version once every hour. - final String pluginVersionCount = "21"; + final String pluginVersionCount = "22"; ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); while(!Herobrine.getPluginCore().getConfigDB().newVersionFound) { diff --git a/src/plugin.yml b/src/plugin.yml index cf9f834..ad0a98c 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Herobrine main: net.theprogrammersworld.herobrine.Herobrine -version: 1.7.2 +version: 1.7.3 website: https://www.theprogrammersworld.net commands: herobrine: