From 7a22f119236ce6c76ff008918b131cc1a137b940 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 5 Jun 2016 00:58:20 +0200 Subject: [PATCH 01/13] [FEATURE] Added ability to append query to URI --- .../environment/api/utils/WebUtil.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/parabot/environment/api/utils/WebUtil.java b/src/main/java/org/parabot/environment/api/utils/WebUtil.java index 249bfe7..731e7de 100644 --- a/src/main/java/org/parabot/environment/api/utils/WebUtil.java +++ b/src/main/java/org/parabot/environment/api/utils/WebUtil.java @@ -5,10 +5,7 @@ import org.parabot.core.io.ProgressListener; import org.parabot.core.io.SizeInputStream; import java.io.*; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; +import java.net.*; /** * @@ -308,4 +305,18 @@ public class WebUtil { } return jsonParser; } + + public static URI appendUri(String uri, String appendQuery) throws URISyntaxException { + URI oldUri = new URI(uri); + + String newQuery = oldUri.getQuery(); + if (newQuery == null) { + newQuery = appendQuery; + } else { + newQuery += "&" + appendQuery; + } + + return new URI(oldUri.getScheme(), oldUri.getAuthority(), + oldUri.getPath(), newQuery, oldUri.getFragment()); + } } From 2076802fa2a0488a89503e9def38f5a91c063412 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 5 Jun 2016 01:44:34 +0200 Subject: [PATCH 02/13] [FEATURE] Added nightly build support --- .../java/org/parabot/core/Configuration.java | 5 +- src/main/java/org/parabot/core/Core.java | 81 ++- .../environment/api/utils/Version.java | 4 + .../environment/api/utils/WebUtil.java | 551 +++++++++--------- 4 files changed, 323 insertions(+), 318 deletions(-) diff --git a/src/main/java/org/parabot/core/Configuration.java b/src/main/java/org/parabot/core/Configuration.java index 249efb1..b9c9871 100644 --- a/src/main/java/org/parabot/core/Configuration.java +++ b/src/main/java/org/parabot/core/Configuration.java @@ -15,16 +15,19 @@ public class Configuration { public static final String GET_SERVER_PROVIDER = "http://bdn.parabot.org/api/get.php?action=server_provider&name="; public static final String GET_SERVER_PROVIDER_INFO = "http://bdn.parabot.org/api/get.php?action=server_information&name="; public static final String GET_SERVER_SETTINGS = "http://bdn.parabot.org/api/get.php?action=get_settings"; - public static final String GET_BOT_VERSION = "http://v3.bdn.parabot.org/api/bot/list/client?latest=true"; + public static final String GET_BOT_VERSION = "http://bdn.parabot.org/api/v2/bot/version"; public static final String API_DOWNLOAD_BOT = "http://bdn.parabot.org/api/v2/bot/download/client/"; public static final String DOWNLOAD_BOT = "http://bdn.parabot.org/versions/"; public static final String REGISTRATION_PAGE = "https://www.parabot.org/community/register/"; public static final String GET_RANDOMS = "http://v3.bdn.parabot.org/api/bot/download/randoms"; public static final String DATA_API = "http://bdn.parabot.org/api/v2/data/"; public static final String ITEM_API = DATA_API + "items/"; + public static final String COMPARE_VERSION_URL = "http://v3.bdn.parabot.org/api/bot/compare/%s/%s"; public static final Version BOT_VERSION = ProjectProperties.getProjectVersion(); public static final String BOT_TITLE = "Parabot"; public static final String BOT_SLOGAN = "The best RuneScape private server bot"; + + public static final String NIGHTLY_APPEND = "nightly=true"; } diff --git a/src/main/java/org/parabot/core/Core.java b/src/main/java/org/parabot/core/Core.java index ef565cb..c391960 100644 --- a/src/main/java/org/parabot/core/Core.java +++ b/src/main/java/org/parabot/core/Core.java @@ -24,7 +24,7 @@ import java.security.NoSuchAlgorithmException; */ @SuppressWarnings("Duplicates") public class Core { - public static boolean mDebug; + private static boolean debug; private static boolean verbose; private static boolean dump; @@ -75,21 +75,21 @@ public class Core { * @param dump */ public static void setDump(final boolean dump) { - Core.dump = dump; + Core.dump = dump; } - - public static void disableSec(){ - UILog.log( - "Security Warning", - "Disabling the securty manager is ill advised.\n" - + " Only do so if the client fails to load, or functions incorrectly (freezes,crashes, etc.)\n" - + "The security manager protects you from malicous code within the client, without it you are exposed!\n" - + "\nPlease contact Parabot staff to resolve whatever problem you are having!"); - Core.secure = false; + + public static void disableSec() { + UILog.log( + "Security Warning", + "Disabling the securty manager is ill advised.\n" + + " Only do so if the client fails to load, or functions incorrectly (freezes,crashes, etc.)\n" + + "The security manager protects you from malicous code within the client, without it you are exposed!\n" + + "\nPlease contact Parabot staff to resolve whatever problem you are having!"); + Core.secure = false; } - - public static boolean isSecure(){ - return secure; + + public static boolean isSecure() { + return secure; } /** @@ -110,7 +110,7 @@ public class Core { * @return if parabot should dump injected jar */ public static boolean shouldDump() { - return dump; + return dump; } /** @@ -130,9 +130,10 @@ public class Core { /** * Checks the version of the bot using a checksum of the jar comparison against checksum given by the website + * * @return true if no new version is found, otherwise false. */ - private static boolean checksumValid(){ + private static boolean checksumValid() { File f = new File(Landing.class.getProtectionDomain().getCodeSource().getLocation().getFile()); if (f.isFile()) { try { @@ -158,7 +159,7 @@ public class Core { String result; if ((result = WebUtil.getContents("http://bdn.parabot.org/api/v2/bot/checksum", "checksum=" + URLEncoder.encode(sb.toString(), "UTF-8"))) != null) { JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(result); - if (!(boolean) object.get("result")){ + if (!(boolean) object.get("result")) { Core.verbose("Latest checksum: " + sb.toString()); Core.verbose("Latest checksum: " + object.get("current")); return false; @@ -173,13 +174,12 @@ public class Core { } /** - * @Deprecated use #validVersion instead - * - * Checks the version of the bot using a variable comparison from the bot code and the Parabot website - * * @return true if no new version is found, otherwise false. + * @Deprecated use #validVersion instead + *

+ * Checks the version of the bot using a variable comparison from the bot code and the Parabot website */ - private static boolean versionValid(){ + private static boolean versionValid() { BufferedReader br = WebUtil.getReader(Configuration.GET_BOT_VERSION); try { String version = null; @@ -215,21 +215,20 @@ public class Core { * @return True if the current version is equal or higher than the latest version, false if lower than the latest version */ public static boolean validVersion() { - BufferedReader br = WebUtil.getReader(Configuration.GET_BOT_VERSION); + String url = String.format(Configuration.COMPARE_VERSION_URL, "client", currentVersion.get()); + + BufferedReader br = WebUtil.getReader(url); try { latestVersion = null; if (br != null) { JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(br); - latestVersion = new Version((String) object.get("version")); - } - if (latestVersion != null) { - if (Configuration.BOT_VERSION.compareTo(latestVersion) < 0) { - Core.verbose("Our version: " + Configuration.BOT_VERSION.get()); - Core.verbose("Latest version: " + latestVersion.get()); - return false; + boolean latest = Boolean.parseBoolean((String) object.get("result")); + if (!latest){ + Directories.clearCache(); } + return latest; } - } catch (NumberFormatException | IOException | ParseException e) { + } catch (IOException | ParseException e) { e.printStackTrace(); } finally { try { @@ -247,13 +246,13 @@ public class Core { /** * Validates the cache and removes the cache contents if required */ - private static void validateCache(){ + private static void validateCache() { File[] cache = Directories.getCachePath().listFiles(); Integer lowest = null; if (cache != null) { for (File f : cache) { - int date = (int) (f.lastModified()/ 1000); - if (lowest == null || date < lowest){ + int date = (int) (f.lastModified() / 1000); + if (lowest == null || date < lowest) { lowest = date; } } @@ -261,10 +260,10 @@ public class Core { try { JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(WebUtil.getContents("http://bdn.parabot.org/api/v2/bot/cache", "date=" + lowest)); - if ((boolean) object.get("result")){ + if ((boolean) object.get("result")) { Core.verbose("Making space for the latest cache files"); Directories.clearCache(); - }else{ + } else { Core.verbose("Cache is up to date"); } } catch (MalformedURLException | ParseException e) { @@ -281,18 +280,12 @@ public class Core { Core.verbose("Checking for updates..."); validateCache(); - if ((validVersion() && checksumValid()) || (!checksumValid() && currentVersion.compareTo(latestVersion) >= 0)){ + if (validVersion() && checksumValid()) { Core.verbose("No updates available."); return true; - }else{ + } else { Core.verbose("Updates available..."); return false; } } - - public static void debug(int i) { - if(mDebug) { - System.out.println("DEBUG: " + i); - } - } } \ No newline at end of file diff --git a/src/main/java/org/parabot/environment/api/utils/Version.java b/src/main/java/org/parabot/environment/api/utils/Version.java index 172e182..d585171 100644 --- a/src/main/java/org/parabot/environment/api/utils/Version.java +++ b/src/main/java/org/parabot/environment/api/utils/Version.java @@ -22,6 +22,10 @@ public class Version implements Comparable { return this.version; } + public boolean isNightly(){ + return this.version.contains("RC"); + } + @Override public int compareTo(Version that) { if (that == null) { diff --git a/src/main/java/org/parabot/environment/api/utils/WebUtil.java b/src/main/java/org/parabot/environment/api/utils/WebUtil.java index 731e7de..3164679 100644 --- a/src/main/java/org/parabot/environment/api/utils/WebUtil.java +++ b/src/main/java/org/parabot/environment/api/utils/WebUtil.java @@ -8,315 +8,320 @@ import java.io.*; import java.net.*; /** - * * A WebUtil class fetches data from an URL - * + * * @author Everel - * */ public class WebUtil { - private static JSONParser jsonParser; + private static JSONParser jsonParser; - private static String agent = "Mozilla/5.0 (Wind0ws NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"; + private static String agent = "Mozilla/5.0 (Wind0ws NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"; - /** - * Agent to set at a URL connection - * - * @param userAgent - */ - public static void setUserAgent(final String userAgent) { - agent = userAgent; - } + /** + * Agent to set at a URL connection + * + * @param userAgent + */ + public static void setUserAgent(final String userAgent) { + agent = userAgent; + } - /** - * Gets useragent - * - * @return useragent - */ - public static String getUserAgent() { - return agent; - } + /** + * Gets useragent + * + * @return useragent + */ + public static String getUserAgent() { + return agent; + } - /** - * Fetches content of a page - * - * @param location - * @return contents of page - * @throws MalformedURLException - */ - public static String getContents(final String location) - throws MalformedURLException { - return getContents(new URL(location)); - } + /** + * Fetches content of a page + * + * @param location + * @return contents of page + * @throws MalformedURLException + */ + public static String getContents(final String location) + throws MalformedURLException { + return getContents(new URL(location)); + } - public static String getContents(final String location, String parameters) throws MalformedURLException { - return getContents(new URL(location), parameters); - } + public static String getContents(final String location, String parameters) throws MalformedURLException { + return getContents(new URL(location), parameters); + } - /** - * Get contents from URL - * - * @param url - * @return page contents - */ - public static String getContents(final URL url) { - return getContents(getConnection(url)); - } + /** + * Get contents from URL + * + * @param url + * @return page contents + */ + public static String getContents(final URL url) { + return getContents(getConnection(url)); + } - public static String getContents(final URL url, final String parameters) { - return getContents(getConnection(url), parameters); - } + public static String getContents(final URL url, final String parameters) { + return getContents(getConnection(url), parameters); + } - /** - * Gets contents from URLConnection - * - * @param urlConnection - * @return page contents - */ - public static String getContents(URLConnection urlConnection) { - try { - final BufferedReader in = getReader(urlConnection); - final StringBuilder builder = new StringBuilder(); - String line; - if (in != null) { - while ((line = in.readLine()) != null) { + /** + * Gets contents from URLConnection + * + * @param urlConnection + * @return page contents + */ + public static String getContents(URLConnection urlConnection) { + try { + final BufferedReader in = getReader(urlConnection); + final StringBuilder builder = new StringBuilder(); + String line; + if (in != null) { + while ((line = in.readLine()) != null) { builder.append(line); } - in.close(); - } - return builder.toString(); - } catch (Throwable t) { - t.printStackTrace(); - } - return null; - } + in.close(); + } + return builder.toString(); + } catch (Throwable t) { + t.printStackTrace(); + } + return null; + } - public static String getContents(URLConnection urlConnection, String parameters) { - try { - urlConnection.setDoOutput(true); - OutputStreamWriter wr = new OutputStreamWriter(urlConnection.getOutputStream()); - wr.write(parameters); - wr.flush(); - wr.close(); + public static String getContents(URLConnection urlConnection, String parameters) { + try { + urlConnection.setDoOutput(true); + OutputStreamWriter wr = new OutputStreamWriter(urlConnection.getOutputStream()); + wr.write(parameters); + wr.flush(); + wr.close(); - final BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); - final StringBuilder builder = new StringBuilder(); - String line; - while ((line = in.readLine()) != null) { - builder.append(line); - } - return builder.toString(); - } catch (Throwable t) { - t.printStackTrace(); - } - return null; - } + final BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); + final StringBuilder builder = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) { + builder.append(line); + } + return builder.toString(); + } catch (Throwable t) { + t.printStackTrace(); + } + return null; + } - /** - * Gets buffered reader from string url - * - * @param url - * @return bufferedreader - */ - public static BufferedReader getReader(final String url) { - try { - return getReader(new URL(url)); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - return null; - } + /** + * Gets buffered reader from string url + * + * @param url + * @return bufferedreader + */ + public static BufferedReader getReader(final String url) { + try { + return getReader(new URL(url)); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + return null; + } - /** - * Gets BufferedReader from URL - * - * @param url - * @return BufferedReader from URL - */ - public static BufferedReader getReader(final URL url) { - return getReader(getConnection(url)); - } + /** + * Gets BufferedReader from URL + * + * @param url + * @return BufferedReader from URL + */ + public static BufferedReader getReader(final URL url) { + return getReader(getConnection(url)); + } - public static BufferedReader getReader(final URLConnection urlConnection) { - try { - return new BufferedReader(new InputStreamReader( - urlConnection.getInputStream())); - } catch (Throwable t) { - t.printStackTrace(); - } - return null; - } + public static BufferedReader getReader(final URLConnection urlConnection) { + try { + return new BufferedReader(new InputStreamReader( + urlConnection.getInputStream())); + } catch (Throwable t) { + t.printStackTrace(); + } + return null; + } - /** - * Gets inputstream from url - * - * @param url - * @return inputstream from url - */ - public static InputStream getInputStream(final URL url) { - final URLConnection con = getConnection(url); - try { - return con.getInputStream(); - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } + /** + * Gets inputstream from url + * + * @param url + * @return inputstream from url + */ + public static InputStream getInputStream(final URL url) { + final URLConnection con = getConnection(url); + try { + return con.getInputStream(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } - /** - * Opens a connection - * - * @param url - * @return URLConnection to URL - */ - public static URLConnection getConnection(final URL url) { - try { - final URLConnection con = url.openConnection(); - con.setRequestProperty("User-Agent", agent); - return con; - } catch (Throwable t) { - t.printStackTrace(); - } - return null; - } + /** + * Opens a connection + * + * @param url + * @return URLConnection to URL + */ + public static URLConnection getConnection(final URL url) { + try { + final URLConnection con = url.openConnection(); + con.setRequestProperty("User-Agent", agent); + return con; + } catch (Throwable t) { + t.printStackTrace(); + } + return null; + } - public static BufferedReader getReader(final URL url, String username, String password) { - try { - String data = URLEncoder.encode("username", "UTF-8") + "=" + username; - data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + password; - - URLConnection connection = url.openConnection(); - - connection.setDoOutput(true); + public static BufferedReader getReader(final URL url, String username, String password) { + try { + String data = URLEncoder.encode("username", "UTF-8") + "=" + username; + data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + password; + + URLConnection connection = url.openConnection(); + + connection.setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream()); wr.write(data); wr.flush(); wr.close(); - + return new BufferedReader(new InputStreamReader(connection.getInputStream())); - } catch (Throwable t) { - t.printStackTrace(); - } - return null; - } - - public static URLConnection getConnection(final URL url, String username, String password) { - try { - String data = URLEncoder.encode("username", "UTF-8") + "=" + username; - data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + password; - - URLConnection connection = url.openConnection(); - - connection.setDoOutput(true); + } catch (Throwable t) { + t.printStackTrace(); + } + return null; + } + + public static URLConnection getConnection(final URL url, String username, String password) { + try { + String data = URLEncoder.encode("username", "UTF-8") + "=" + username; + data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + password; + + URLConnection connection = url.openConnection(); + + connection.setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream()); wr.write(data); wr.flush(); wr.close(); - + return connection; - } catch (Throwable t) { - t.printStackTrace(); - } - return null; - } + } catch (Throwable t) { + t.printStackTrace(); + } + return null; + } - /** - * Downloads a file on the internet - * @param url - * @param destination - * @param listener - */ - public static void downloadFile(final URL url, final File destination, - final ProgressListener listener) { - try { - final URLConnection connection = getConnection(url); - int size = connection.getContentLength(); - SizeInputStream sizeInputStream = new SizeInputStream( - connection.getInputStream(), size, listener); - BufferedInputStream in = new BufferedInputStream(sizeInputStream); - FileOutputStream fileOut = new FileOutputStream(destination); - try { - byte data[] = new byte[1024]; - int count; - while ((count = in.read(data, 0, 1024)) != -1) { - fileOut.write(data, 0, count); - } - } finally { - if (in != null) - in.close(); - if (fileOut != null) - fileOut.close(); - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - - /** - * Downloads a file on the internet - * @param url - * @param destination - * @param listener - */ - public static void downloadFile(final URL url, final File destination, - final ProgressListener listener, String username, String password) { - try { - final URLConnection connection = getConnection(url, username, password); - int size = connection.getContentLength(); - SizeInputStream sizeInputStream = new SizeInputStream( - connection.getInputStream(), size, listener); - BufferedInputStream in = new BufferedInputStream(sizeInputStream); - FileOutputStream fileOut = new FileOutputStream(destination); - try { - byte data[] = new byte[1024]; - int count; - while ((count = in.read(data, 0, 1024)) != -1) { - fileOut.write(data, 0, count); - } - } finally { - if (in != null) - in.close(); - if (fileOut != null) - fileOut.close(); - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - - /** - * Converts file format to url format - * @param file - * @return url to file - */ - public static URL toURL(File file) { - try { - return file.toURI().toURL(); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - return null; - } + /** + * Downloads a file on the internet + * + * @param url + * @param destination + * @param listener + */ + public static void downloadFile(final URL url, final File destination, + final ProgressListener listener) { + try { + final URLConnection connection = getConnection(url); + int size = connection.getContentLength(); + SizeInputStream sizeInputStream = new SizeInputStream( + connection.getInputStream(), size, listener); + BufferedInputStream in = new BufferedInputStream(sizeInputStream); + FileOutputStream fileOut = new FileOutputStream(destination); + try { + byte data[] = new byte[1024]; + int count; + while ((count = in.read(data, 0, 1024)) != -1) { + fileOut.write(data, 0, count); + } + } finally { + if (in != null) + in.close(); + if (fileOut != null) + fileOut.close(); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } - public static JSONParser getJsonParser() { - if (jsonParser == null){ - jsonParser = new JSONParser(); - } - return jsonParser; - } + /** + * Downloads a file on the internet + * + * @param url + * @param destination + * @param listener + */ + public static void downloadFile(final URL url, final File destination, + final ProgressListener listener, String username, String password) { + try { + final URLConnection connection = getConnection(url, username, password); + int size = connection.getContentLength(); + SizeInputStream sizeInputStream = new SizeInputStream( + connection.getInputStream(), size, listener); + BufferedInputStream in = new BufferedInputStream(sizeInputStream); + FileOutputStream fileOut = new FileOutputStream(destination); + try { + byte data[] = new byte[1024]; + int count; + while ((count = in.read(data, 0, 1024)) != -1) { + fileOut.write(data, 0, count); + } + } finally { + if (in != null) + in.close(); + if (fileOut != null) + fileOut.close(); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } - public static URI appendUri(String uri, String appendQuery) throws URISyntaxException { - URI oldUri = new URI(uri); + /** + * Converts file format to url format + * + * @param file + * @return url to file + */ + public static URL toURL(File file) { + try { + return file.toURI().toURL(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + return null; + } - String newQuery = oldUri.getQuery(); - if (newQuery == null) { - newQuery = appendQuery; - } else { - newQuery += "&" + appendQuery; - } + public static JSONParser getJsonParser() { + if (jsonParser == null) { + jsonParser = new JSONParser(); + } + return jsonParser; + } - return new URI(oldUri.getScheme(), oldUri.getAuthority(), - oldUri.getPath(), newQuery, oldUri.getFragment()); - } + public static URI appendUri(String uri, String appendQuery) { + try { + URI oldUri = new URI(uri); + + String newQuery = oldUri.getQuery(); + if (newQuery == null) { + newQuery = appendQuery; + } else { + newQuery += "&" + appendQuery; + } + return new URI(oldUri.getScheme(), oldUri.getAuthority(), + oldUri.getPath(), newQuery, oldUri.getFragment()); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + return null; + } } From 6829a0595e4b1887b6a57766ff40c251b0b6e3f5 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 5 Jun 2016 01:45:45 +0200 Subject: [PATCH 03/13] [CLEANUP] Removed deprecated Core#versionValid --- src/main/java/org/parabot/core/Core.java | 38 +----------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/src/main/java/org/parabot/core/Core.java b/src/main/java/org/parabot/core/Core.java index c391960..dad719e 100644 --- a/src/main/java/org/parabot/core/Core.java +++ b/src/main/java/org/parabot/core/Core.java @@ -24,7 +24,7 @@ import java.security.NoSuchAlgorithmException; */ @SuppressWarnings("Duplicates") public class Core { - + private static boolean debug; private static boolean verbose; private static boolean dump; @@ -173,42 +173,6 @@ public class Core { return true; } - /** - * @return true if no new version is found, otherwise false. - * @Deprecated use #validVersion instead - *

- * Checks the version of the bot using a variable comparison from the bot code and the Parabot website - */ - private static boolean versionValid() { - BufferedReader br = WebUtil.getReader(Configuration.GET_BOT_VERSION); - try { - String version = null; - if (br != null) { - JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(br); - version = (String) object.get("result"); - } - if (version != null) { - if (!Configuration.BOT_VERSION.equals(version)) { - Core.verbose("Our version: " + Configuration.BOT_VERSION); - Core.verbose("Latest version: " + version); - return false; - } - } - } catch (NumberFormatException | IOException | ParseException e) { - e.printStackTrace(); - } finally { - try { - if (br != null) { - br.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - return true; - } - /** * Compares the latest version from the BDN and the current version * From d8e0c93d3f6a67cf72e487dec59c84c598824d96 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 5 Jun 2016 02:07:30 +0200 Subject: [PATCH 04/13] [FEATURE] Comparing versions with the latest API --- src/main/java/org/parabot/core/Configuration.java | 2 ++ src/main/java/org/parabot/core/Core.java | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/parabot/core/Configuration.java b/src/main/java/org/parabot/core/Configuration.java index b9c9871..1b10eb4 100644 --- a/src/main/java/org/parabot/core/Configuration.java +++ b/src/main/java/org/parabot/core/Configuration.java @@ -22,7 +22,9 @@ public class Configuration { public static final String GET_RANDOMS = "http://v3.bdn.parabot.org/api/bot/download/randoms"; public static final String DATA_API = "http://bdn.parabot.org/api/v2/data/"; public static final String ITEM_API = DATA_API + "items/"; + public static final String COMPARE_VERSION_URL = "http://v3.bdn.parabot.org/api/bot/compare/%s/%s"; + public static final String COMPARE_CHECKSUM_URL = "http://v3.bdn.parabot.org/api/bot/checksum/%s/%s"; public static final Version BOT_VERSION = ProjectProperties.getProjectVersion(); diff --git a/src/main/java/org/parabot/core/Core.java b/src/main/java/org/parabot/core/Core.java index dad719e..34d7292 100644 --- a/src/main/java/org/parabot/core/Core.java +++ b/src/main/java/org/parabot/core/Core.java @@ -157,13 +157,9 @@ public class Core { } String result; - if ((result = WebUtil.getContents("http://bdn.parabot.org/api/v2/bot/checksum", "checksum=" + URLEncoder.encode(sb.toString(), "UTF-8"))) != null) { + if ((result = WebUtil.getContents(String.format(Configuration.COMPARE_CHECKSUM_URL, "client", currentVersion.get()), "checksum=" + URLEncoder.encode(sb.toString(), "UTF-8"))) != null) { JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(result); - if (!(boolean) object.get("result")) { - Core.verbose("Latest checksum: " + sb.toString()); - Core.verbose("Latest checksum: " + object.get("current")); - return false; - } + return Boolean.parseBoolean((String) object.get("result")); } } } catch (NoSuchAlgorithmException | ParseException | IOException | URISyntaxException e) { From 64713f665eece83ca43f088b489d16a5f03c203c Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 5 Jun 2016 02:10:49 +0200 Subject: [PATCH 05/13] [CLEANUP] Reformated code --- src/main/java/org/parabot/core/Core.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/parabot/core/Core.java b/src/main/java/org/parabot/core/Core.java index 34d7292..a6a19cd 100644 --- a/src/main/java/org/parabot/core/Core.java +++ b/src/main/java/org/parabot/core/Core.java @@ -152,8 +152,8 @@ public class Core { byte[] mdbytes = md.digest(); StringBuilder sb = new StringBuilder(""); - for (int i = 0; i < mdbytes.length; i++) { - sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1)); + for (byte mdbyte : mdbytes) { + sb.append(Integer.toString((mdbyte & 0xff) + 0x100, 16).substring(1)); } String result; @@ -183,7 +183,7 @@ public class Core { if (br != null) { JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(br); boolean latest = Boolean.parseBoolean((String) object.get("result")); - if (!latest){ + if (!latest) { Directories.clearCache(); } return latest; From 36410bf71c84d722a41ecd877a82508203c3cbab Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Mon, 6 Jun 2016 14:40:58 +0200 Subject: [PATCH 06/13] [FEATURE] Added NoProgresssListener --- .../org/parabot/core/io/NoProgressListener.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main/java/org/parabot/core/io/NoProgressListener.java diff --git a/src/main/java/org/parabot/core/io/NoProgressListener.java b/src/main/java/org/parabot/core/io/NoProgressListener.java new file mode 100644 index 0000000..247bf39 --- /dev/null +++ b/src/main/java/org/parabot/core/io/NoProgressListener.java @@ -0,0 +1,16 @@ +package org.parabot.core.io; + +/** + * @author JKetelaar + */ +public class NoProgressListener implements ProgressListener { + @Override + public void onProgressUpdate(double value) { + + } + + @Override + public void updateDownloadSpeed(double mbPerSecond) { + + } +} From 0e59f63cf2e20c745cb2426b5a522c1988b0ab71 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Mon, 6 Jun 2016 14:41:10 +0200 Subject: [PATCH 07/13] [TASK] Implemented NoProgressListener --- .../parabot/core/parsers/randoms/PublicRandoms.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/parabot/core/parsers/randoms/PublicRandoms.java b/src/main/java/org/parabot/core/parsers/randoms/PublicRandoms.java index 2ddc409..9eb6315 100644 --- a/src/main/java/org/parabot/core/parsers/randoms/PublicRandoms.java +++ b/src/main/java/org/parabot/core/parsers/randoms/PublicRandoms.java @@ -4,6 +4,7 @@ import org.parabot.core.Configuration; import org.parabot.core.Context; import org.parabot.core.Core; import org.parabot.core.Directories; +import org.parabot.core.io.NoProgressListener; import org.parabot.core.io.ProgressListener; import org.parabot.environment.api.utils.WebUtil; @@ -51,17 +52,7 @@ public class PublicRandoms extends RandomParser { return; } String downloadLink = Configuration.GET_RANDOMS; - WebUtil.downloadFile(new URL(downloadLink), random, new ProgressListener() { - @Override - public void onProgressUpdate(double v) { - - } - - @Override - public void updateDownloadSpeed(double v) { - - } - }); + WebUtil.downloadFile(new URL(downloadLink), random, new NoProgressListener()); } catch (Exception e) { e.printStackTrace(); } From 456a7bc2541c8e4c35ba0b8b27af27789c003275 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Mon, 6 Jun 2016 14:48:27 +0200 Subject: [PATCH 08/13] [TASK] Implemented `-no_validation` --- src/main/java/org/parabot/core/Core.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/parabot/core/Core.java b/src/main/java/org/parabot/core/Core.java index a6a19cd..bf3903b 100644 --- a/src/main/java/org/parabot/core/Core.java +++ b/src/main/java/org/parabot/core/Core.java @@ -35,7 +35,7 @@ public class Core { private static Version currentVersion = Configuration.BOT_VERSION; private static Version latestVersion; - + public static void disableValidation() { Core.validate = false; } @@ -159,6 +159,7 @@ public class Core { String result; if ((result = WebUtil.getContents(String.format(Configuration.COMPARE_CHECKSUM_URL, "client", currentVersion.get()), "checksum=" + URLEncoder.encode(sb.toString(), "UTF-8"))) != null) { JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(result); + System.out.println(object.get("result")); return Boolean.parseBoolean((String) object.get("result")); } } @@ -179,7 +180,6 @@ public class Core { BufferedReader br = WebUtil.getReader(url); try { - latestVersion = null; if (br != null) { JSONObject object = (JSONObject) WebUtil.getJsonParser().parse(br); boolean latest = Boolean.parseBoolean((String) object.get("result")); @@ -240,12 +240,17 @@ public class Core { Core.verbose("Checking for updates..."); validateCache(); - if (validVersion() && checksumValid()) { - Core.verbose("No updates available."); + if (validate) { + if (validVersion() && checksumValid()) { + Core.verbose("No updates available."); + return true; + } else { + Core.verbose("Updates available..."); + return false; + } + }else{ + Core.verbose("Validation disabled"); return true; - } else { - Core.verbose("Updates available..."); - return false; } } } \ No newline at end of file From 84541917ab6466b9d1e9f91fa6b147a9f667fd21 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Mon, 6 Jun 2016 14:48:35 +0200 Subject: [PATCH 09/13] [CLEANUP] Removed whiteline --- src/main/java/org/parabot/core/Core.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/parabot/core/Core.java b/src/main/java/org/parabot/core/Core.java index bf3903b..23e79a8 100644 --- a/src/main/java/org/parabot/core/Core.java +++ b/src/main/java/org/parabot/core/Core.java @@ -35,7 +35,7 @@ public class Core { private static Version currentVersion = Configuration.BOT_VERSION; private static Version latestVersion; - + public static void disableValidation() { Core.validate = false; } From ae528c21a81f25c9a116ea2131f8ab0c2eac8860 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 12 Jun 2016 01:40:02 +0200 Subject: [PATCH 10/13] [TASK] Removed Naga totally, including Uliratha This is temporarly, as long as there's no new version --- src/main/java/org/parabot/core/Context.java | 10 -- .../java/org/parabot/core/lib/naga/Naga.java | 72 -------- src/main/java/org/parabot/core/ui/Logger.java | 7 +- .../org/parabot/environment/Environment.java | 2 - .../parabot/environment/scripts/Script.java | 5 - .../scripts/executers/BDNScriptsExecuter.java | 4 - .../scripts/uliratha/UlirathaClient.java | 158 ------------------ .../scripts/uliratha/UlirathaExecuter.java | 49 ------ 8 files changed, 1 insertion(+), 306 deletions(-) delete mode 100644 src/main/java/org/parabot/core/lib/naga/Naga.java delete mode 100644 src/main/java/org/parabot/environment/scripts/uliratha/UlirathaClient.java delete mode 100644 src/main/java/org/parabot/environment/scripts/uliratha/UlirathaExecuter.java diff --git a/src/main/java/org/parabot/core/Context.java b/src/main/java/org/parabot/core/Context.java index 8cfd7b7..acbe9c0 100644 --- a/src/main/java/org/parabot/core/Context.java +++ b/src/main/java/org/parabot/core/Context.java @@ -14,7 +14,6 @@ import org.parabot.environment.input.Keyboard; import org.parabot.environment.input.Mouse; import org.parabot.environment.scripts.Script; import org.parabot.environment.scripts.randoms.RandomHandler; -import org.parabot.environment.scripts.uliratha.UlirathaClient; import org.parabot.environment.servers.ServerProvider; import java.applet.Applet; @@ -49,7 +48,6 @@ public class Context { private Mouse mouse; private Keyboard keyboard; private ServerProviderInfo providerInfo; - private UlirathaClient ulirathaClient; private JSONParser jsonParser; private PrintStream defaultOut; @@ -354,14 +352,6 @@ public class Context { return username; } - public UlirathaClient getUlirathaClient() { - return ulirathaClient; - } - - public void setUlirathaClient(UlirathaClient ulirathaClient) { - this.ulirathaClient = ulirathaClient; - } - public static void setUsername(String username) { Context.username = username; } diff --git a/src/main/java/org/parabot/core/lib/naga/Naga.java b/src/main/java/org/parabot/core/lib/naga/Naga.java deleted file mode 100644 index 9154e7e..0000000 --- a/src/main/java/org/parabot/core/lib/naga/Naga.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.parabot.core.lib.naga; - -import org.parabot.core.Core; -import org.parabot.core.Directories; -import org.parabot.core.build.BuildPath; -import org.parabot.core.lib.Library; - -import java.io.File; -import java.net.URL; - -/** - * @author JKetelaar - */ -public class Naga extends Library { - - private static boolean valid; - - @Override - public void init() { - if (!hasJar()) { - System.err.println("Failed to load javafx... [jar missing]"); - return; - } - Core.verbose("Adding javafx jar file to build path: " - + getJarFileURL().getPath()); - BuildPath.add(getJarFileURL()); - - try { - Class.forName("javafx.application.Application"); - valid = true; - } catch (ClassNotFoundException e) { - System.err - .println("Failed to add javafx to build path, or incorrupt download"); - } - - Core.verbose("JavaFX initialized."); - } - - @Override - public boolean isAdded() { - return valid; - } - - @Override - public File getJarFile() { - return new File(Directories.getCachePath(), "naga.jar"); - } - - @Override - public URL getDownloadLink() { - try { - return new URL("http://bdn.parabot.org/api/v2/data/dependencies/naga"); - } catch (Throwable t) { - t.printStackTrace(); - } - return null; - } - - @Override - public boolean requiresJar() { - return true; - } - - @Override - public String getLibraryName() { - return "Naga"; - } - - public static boolean isValid() { - return valid; - } -} diff --git a/src/main/java/org/parabot/core/ui/Logger.java b/src/main/java/org/parabot/core/ui/Logger.java index b5d6636..640216c 100644 --- a/src/main/java/org/parabot/core/ui/Logger.java +++ b/src/main/java/org/parabot/core/ui/Logger.java @@ -1,8 +1,6 @@ package org.parabot.core.ui; -import org.parabot.core.Context; import org.parabot.core.ui.components.GamePanel; -import org.parabot.environment.scripts.uliratha.UlirathaClient; import javax.swing.*; import java.awt.*; @@ -63,10 +61,7 @@ public class Logger extends JPanel { instance.model.addElement(message); if (uliratha){ - UlirathaClient client; - if ((client = Context.getInstance().getUlirathaClient()) != null) { - client.sendMessage(message); - } + // TODO: Implement latest Uliratha } int last = instance.list.getModel().getSize() - 1; diff --git a/src/main/java/org/parabot/environment/Environment.java b/src/main/java/org/parabot/environment/Environment.java index 7964123..e17d0fd 100644 --- a/src/main/java/org/parabot/environment/Environment.java +++ b/src/main/java/org/parabot/environment/Environment.java @@ -4,7 +4,6 @@ import org.parabot.core.Core; import org.parabot.core.desc.ServerDescription; import org.parabot.core.lib.Library; import org.parabot.core.lib.javafx.JavaFX; -import org.parabot.core.lib.naga.Naga; import org.parabot.core.parsers.servers.ServerParser; import org.parabot.core.ui.components.VerboseLoader; import org.parabot.environment.api.utils.WebUtil; @@ -30,7 +29,6 @@ public class Environment { LinkedList libs = new LinkedList<>(); libs.add(new JavaFX()); - libs.add(new Naga()); for(Library lib : libs) { if (lib.requiresJar()) { diff --git a/src/main/java/org/parabot/environment/scripts/Script.java b/src/main/java/org/parabot/environment/scripts/Script.java index 971d296..5fdd485 100644 --- a/src/main/java/org/parabot/environment/scripts/Script.java +++ b/src/main/java/org/parabot/environment/scripts/Script.java @@ -123,11 +123,6 @@ public class Script implements Runnable { this.state = STATE_STOPPED; context.setRunningScript(null); - if (context.getUlirathaClient() != null) { - context.getUlirathaClient().disconnect(); - context.setUlirathaClient(null); - } - BotUI.getInstance().toggleRun(); Core.verbose("Done."); } diff --git a/src/main/java/org/parabot/environment/scripts/executers/BDNScriptsExecuter.java b/src/main/java/org/parabot/environment/scripts/executers/BDNScriptsExecuter.java index e29b450..fdfc199 100644 --- a/src/main/java/org/parabot/environment/scripts/executers/BDNScriptsExecuter.java +++ b/src/main/java/org/parabot/environment/scripts/executers/BDNScriptsExecuter.java @@ -8,7 +8,6 @@ import org.parabot.core.ui.utils.UILog; import org.parabot.environment.api.utils.WebUtil; import org.parabot.environment.scripts.Script; import org.parabot.environment.scripts.loader.JavaScriptLoader; -import org.parabot.environment.scripts.uliratha.UlirathaExecuter; import javax.swing.*; import java.lang.reflect.Constructor; @@ -77,9 +76,6 @@ public class BDNScriptsExecuter extends ScriptExecuter { script.setScriptID(this.id); super.finalize(tg, script); - if (manager.getAccount().getApi() != null) { - new UlirathaExecuter(manager.getAccount().getApi()).start(this.id); - } } catch (NoClassDefFoundError | ClassNotFoundException ignored) { UILog.log("Error", "Failed to load BDN script, error: [This server provider does not support this script]", JOptionPane.ERROR_MESSAGE); } catch (Throwable t) { diff --git a/src/main/java/org/parabot/environment/scripts/uliratha/UlirathaClient.java b/src/main/java/org/parabot/environment/scripts/uliratha/UlirathaClient.java deleted file mode 100644 index 0ef0083..0000000 --- a/src/main/java/org/parabot/environment/scripts/uliratha/UlirathaClient.java +++ /dev/null @@ -1,158 +0,0 @@ -package org.parabot.environment.scripts.uliratha; - -import naga.ExceptionObserver; -import naga.NIOService; -import naga.NIOSocket; -import naga.SocketObserver; -import naga.packetreader.RegularPacketReader; -import naga.packetwriter.RegularPacketWriter; -import org.parabot.core.ui.Logger; - -import java.io.*; - -/** - * @author JKetelaar - */ - -public class UlirathaClient extends Thread { - - private String host; - private int port; - private NIOSocket socket; - private boolean connected; - private int scriptID; - private String api; - private boolean valid; - - public UlirathaClient(String host, int port, int scriptID, String api) { - this.host = host; - this.port = port; - this.scriptID = scriptID; - this.api = api; - } - - @Override - public void run() { - connect(); - } - - private void connect() { - try { - NIOService service = new NIOService(); - service.setExceptionObserver(new ExceptionObserver() { - @Override - public void notifyExceptionThrown(Throwable throwable) { - throwable.printStackTrace(); - if (valid) { - reconnect(); - connected = false; - } - } - }); - socket = service.openSocket(host, port); - socket.setPacketReader(new RegularPacketReader(4, true)); - socket.setPacketWriter(new RegularPacketWriter(4, true)); - socket.listen(new SocketObserver() { - public void connectionOpened(NIOSocket nioSocket) { - try { - sendObjects(nioSocket, new Object[]{76, scriptID, api}); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void packetReceived(NIOSocket socket, byte[] packet) { - try { - DataInputStream stream = new DataInputStream(new ByteArrayInputStream(packet)); - int packetID = stream.readInt(); - - switch (packetID){ - case 75: - valid = stream.readBoolean(); - if (valid) { - Logger.addMessage("We're connected with the Uliratha server!", false); - connected = true; - }else{ - socket.close(); - } - break; - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void packetSent(NIOSocket nioSocket, Object o) { - - } - - public void connectionBroken(NIOSocket nioSocket, Exception exception) { - if (valid) { - Logger.addMessage("We lost connection with the Uliratha server, reconnecting...", false); - reconnect(); - connected = false; - }else{ - Logger.addMessage("We're disconnected from the Uliratha server", false); - } - } - }); - while (true) { - service.selectBlocking(); - } - } catch (IOException e) { - if (valid) { - reconnect(); - connected = false; - } - } - } - - private void reconnect() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - connect(); - } - - public boolean isConnected() { - return connected; - } - - public void disconnect(){ - valid = false; - socket.close(); - } - - private void sendObjects(NIOSocket socket, Object[] objects) throws IOException { - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - DataOutputStream dataStream = new DataOutputStream(stream); - for (Object o : objects) { - if (o instanceof String) { - dataStream.writeUTF((String) o); - } else if (o instanceof Integer) { - dataStream.writeInt((Integer) o); - } else if (o instanceof byte[]) { - dataStream.write((byte[]) o); - } else if (o instanceof Long) { - dataStream.writeLong((Long) o); - } else if (o instanceof Boolean) { - dataStream.writeBoolean((Boolean) o); - } - } - dataStream.flush(); - final byte[] content = stream.toByteArray(); - dataStream.close(); - socket.write(content); - } - - public void sendMessage(String message){ - try { - sendObjects(socket, new Object[]{83, message}); - } catch (IOException e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/main/java/org/parabot/environment/scripts/uliratha/UlirathaExecuter.java b/src/main/java/org/parabot/environment/scripts/uliratha/UlirathaExecuter.java deleted file mode 100644 index 47cfc5e..0000000 --- a/src/main/java/org/parabot/environment/scripts/uliratha/UlirathaExecuter.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.parabot.environment.scripts.uliratha; - -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; -import org.parabot.core.Context; -import org.parabot.environment.api.utils.WebUtil; - -import java.io.IOException; - -/** - * @author JKetelaar - */ -public class UlirathaExecuter { - - private String api; - private static boolean isVip = true; - - public UlirathaExecuter(String api){ - this.api = api; - } - - public void start(int scriptID){ - if (UlirathaExecuter.isVip) { - String vipUrl = "http://bdn.parabot.org/api/v2/user/" + api + "/vip"; - JSONParser parser = new JSONParser(); - try { - JSONObject vipObject = (JSONObject) parser.parse(WebUtil.getReader(vipUrl)); - - boolean isVip = (boolean) vipObject.get("result"); - if (isVip) { - String serverUrl = "http://bdn.parabot.org/api/v2/clients/server"; - JSONObject serverObject = (JSONObject) parser.parse(WebUtil.getReader(serverUrl)); - JSONObject detailsObject = (JSONObject) serverObject.get("result"); - String host = (String) detailsObject.get("host"); - long port = (long) detailsObject.get("port"); - - UlirathaClient client = new UlirathaClient(host, (int) port, scriptID, api); - client.start(); - Context.getInstance().setUlirathaClient(client); - }else{ - UlirathaExecuter.isVip = false; - } - } catch (IOException | ParseException | ClassCastException e) { - e.printStackTrace(); - } - } - } -} From 2b3e6649a71bb2550951281b8f7ecf8382e21686 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 12 Jun 2016 01:46:05 +0200 Subject: [PATCH 11/13] [BUGFIX] Removed naga from dependency --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index ed9ff72..8ad4ddf 100755 --- a/pom.xml +++ b/pom.xml @@ -36,12 +36,6 @@ - - naga - naga - 1.0 - provided - javafx javafx From 6c13e9dbb785fb35db6b3f50ab5b93752d3a38b2 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 12 Jun 2016 03:23:10 +0200 Subject: [PATCH 12/13] [TASK] Added readme for labels --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ef23a16..1c0bc4a 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,7 @@ If you'd like to have either or both the client and the API in your project, use ``` **For the latest versions of our dependencies, please check our examples on [the Maven Repository](https://github.com/Parabot/Maven-Repository/tree/master/examples)** + + +#### Labels +Labels are created with [GHLabel](https://github.com/jimmycuadra/ghlabel), whereas the yml is located in the .github directory \ No newline at end of file From 3e2008b67365bac68062a281e6782ef787e90963 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Sun, 12 Jun 2016 03:23:18 +0200 Subject: [PATCH 13/13] [FEATURE] Added labels yml config file --- .github/labels.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/labels.yml diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..b2323c2 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,30 @@ +- name: priority:low + color: bfe5bf +- name: priority:medium + color: bfe5bf +- name: priority:high + color: bfe5bf +- name: status:accepted + color: fef2c0 +- name: status:unconfirmed + color: fef2c0 +- name: status:needs more info + color: fef2c0 +- name: status:rejected + color: fef2c0 +- name: status:under consideration + color: fef2c0 +- name: type:bug + color: f7c6c7 +- name: type:feature + color: f7c6c7 +- name: type:improvement + color: f7c6c7 +- name: type:question + color: f7c6c7 +- name: os:windows + color: "666699" +- name: os:mac + color: "666699" +- name: os:other + color: "666699" \ No newline at end of file