{"action":"created","comment":{"url":"https://api.github.com/repos/runelite/runelite/pulls/comments/187789779","pull_request_review_id":119643797,"id":187789779,"diff_hunk":"@@ -0,0 +1,119 @@\n+/*\n+ * Copyright (c) 2018, William Gray <wgray5093@gmail.com>\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice, this\n+ *    list of conditions and the following disclaimer.\n+ * 2. Redistributions in binary form must reproduce the above copyright notice,\n+ *    this list of conditions and the following disclaimer in the documentation\n+ *    and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+package net.runelite.client.plugins.pinginfobox;\n+\n+import java.net.InetAddress;\n+import java.net.Socket;\n+import java.net.UnknownHostException;\n+import java.time.Instant;\n+import java.time.temporal.ChronoUnit;\n+import java.util.concurrent.ScheduledExecutorService;\n+import javax.inject.Inject;\n+import lombok.Getter;\n+import lombok.extern.slf4j.Slf4j;\n+import net.runelite.api.Client;\n+import net.runelite.api.GameState;\n+import net.runelite.client.plugins.Plugin;\n+import net.runelite.client.plugins.PluginDescriptor;\n+import net.runelite.client.task.Schedule;\n+import net.runelite.client.ui.overlay.Overlay;\n+\n+@PluginDescriptor(\n+\tname = \"Ping Infobox\",\n+\tenabledByDefault = false\n+)\n+@Slf4j\n+public class PingInfoboxPlugin extends Plugin\n+{\n+\t@Inject\n+\tprivate Client client;\n+\n+\t@Getter\n+\tprivate int ping;\n+\n+\t@Inject\n+\tprivate PingInfoboxOverlay pingOverlay;\n+\n+\t@Override\n+\tpublic Overlay getOverlay()\n+\t{\n+\t\treturn pingOverlay;\n+\t}\n+\n+\t@Schedule(\n+\t\tasynchronous = true,\n+\t\tperiod = 5,\n+\t\tunit = ChronoUnit.SECONDS\n+\t)\n+\tpublic long getPingToCurrentWorld()\n+\t{\n+\t\tInetAddress host = null;\n+\t\tInstant start;\n+\t\tif (client.getGameState().equals(GameState.LOGGED_IN))\n+\t\t{\n+\t\t\ttry\n+\t\t\t{\n+\t\t\t\thost = InetAddress.getByName(client.getWorldHostname());\n+\t\t\t}\n+\t\t\tcatch (UnknownHostException he)\n+\t\t\t{\n+\t\t\t\tlog.warn(\"Cannot ping host\", he);","path":"runelite-client/src/main/java/net/runelite/client/plugins/pinginfobox/PingInfoboxPlugin.java","position":81,"original_position":83,"commit_id":"bc15322333d7fab1e405ce73dae232b193c6adef","original_commit_id":"543c11f8bdca7c23c4378a15647bc31a21dd06c1","user":{"login":"CustardGod","id":39203754,"avatar_url":"https://avatars2.githubusercontent.com/u/39203754?v=4","gravatar_id":"","url":"https://api.github.com/users/CustardGod","html_url":"https://github.com/CustardGod","followers_url":"https://api.github.com/users/CustardGod/followers","following_url":"https://api.github.com/users/CustardGod/following{/other_user}","gists_url":"https://api.github.com/users/CustardGod/gists{/gist_id}","starred_url":"https://api.github.com/users/CustardGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustardGod/subscriptions","organizations_url":"https://api.github.com/users/CustardGod/orgs","repos_url":"https://api.github.com/users/CustardGod/repos","events_url":"https://api.github.com/users/CustardGod/events{/privacy}","received_events_url":"https://api.github.com/users/CustardGod/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2018-05-13T06:01:20Z","updated_at":"2018-05-13T06:01:20Z","html_url":"https://github.com/runelite/runelite/pull/2668#discussion_r187789779","pull_request_url":"https://api.github.com/repos/runelite/runelite/pulls/2668","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/runelite/runelite/pulls/comments/187789779"},"html":{"href":"https://github.com/runelite/runelite/pull/2668#discussion_r187789779"},"pull_request":{"href":"https://api.github.com/repos/runelite/runelite/pulls/2668"}},"in_reply_to_id":187789417},"pull_request":{"url":"https://api.github.com/repos/runelite/runelite/pulls/2668","id":187651095,"html_url":"https://github.com/runelite/runelite/pull/2668","diff_url":"https://github.com/runelite/runelite/pull/2668.diff","patch_url":"https://github.com/runelite/runelite/pull/2668.patch","issue_url":"https://api.github.com/repos/runelite/runelite/issues/2668","number":2668,"state":"open","locked":false,"title":"Add Ping Infobox Plugin","user":{"login":"CustardGod","id":39203754,"avatar_url":"https://avatars2.githubusercontent.com/u/39203754?v=4","gravatar_id":"","url":"https://api.github.com/users/CustardGod","html_url":"https://github.com/CustardGod","followers_url":"https://api.github.com/users/CustardGod/followers","following_url":"https://api.github.com/users/CustardGod/following{/other_user}","gists_url":"https://api.github.com/users/CustardGod/gists{/gist_id}","starred_url":"https://api.github.com/users/CustardGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustardGod/subscriptions","organizations_url":"https://api.github.com/users/CustardGod/orgs","repos_url":"https://api.github.com/users/CustardGod/repos","events_url":"https://api.github.com/users/CustardGod/events{/privacy}","received_events_url":"https://api.github.com/users/CustardGod/received_events","type":"User","site_admin":false},"body":"Adds an infobox in the top right corner that shows the user's ping to the current world\r\n\r\nText color is Green below 50, Yellow from 50 to 99, and Red above 100.\r\nAlso adds Client#getWorldHostname(), credit to @Abextm \r\n\r\n![image](https://user-images.githubusercontent.com/39203754/39963621-85c78a0a-5647-11e8-8047-59eb818baaf8.png)\r\n\r\n\r\n ","created_at":"2018-05-13T03:52:43Z","updated_at":"2018-05-13T06:01:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83479eb1eae2de331510df69f1c61e53880ee082","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/runelite/runelite/pulls/2668/commits","review_comments_url":"https://api.github.com/repos/runelite/runelite/pulls/2668/comments","review_comment_url":"https://api.github.com/repos/runelite/runelite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/runelite/runelite/issues/2668/comments","statuses_url":"https://api.github.com/repos/runelite/runelite/statuses/bc15322333d7fab1e405ce73dae232b193c6adef","head":{"label":"CustardGod:PingInfobox","ref":"PingInfobox","sha":"bc15322333d7fab1e405ce73dae232b193c6adef","user":{"login":"CustardGod","id":39203754,"avatar_url":"https://avatars2.githubusercontent.com/u/39203754?v=4","gravatar_id":"","url":"https://api.github.com/users/CustardGod","html_url":"https://github.com/CustardGod","followers_url":"https://api.github.com/users/CustardGod/followers","following_url":"https://api.github.com/users/CustardGod/following{/other_user}","gists_url":"https://api.github.com/users/CustardGod/gists{/gist_id}","starred_url":"https://api.github.com/users/CustardGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustardGod/subscriptions","organizations_url":"https://api.github.com/users/CustardGod/orgs","repos_url":"https://api.github.com/users/CustardGod/repos","events_url":"https://api.github.com/users/CustardGod/events{/privacy}","received_events_url":"https://api.github.com/users/CustardGod/received_events","type":"User","site_admin":false},"repo":{"id":133092361,"name":"runelite","full_name":"CustardGod/runelite","owner":{"login":"CustardGod","id":39203754,"avatar_url":"https://avatars2.githubusercontent.com/u/39203754?v=4","gravatar_id":"","url":"https://api.github.com/users/CustardGod","html_url":"https://github.com/CustardGod","followers_url":"https://api.github.com/users/CustardGod/followers","following_url":"https://api.github.com/users/CustardGod/following{/other_user}","gists_url":"https://api.github.com/users/CustardGod/gists{/gist_id}","starred_url":"https://api.github.com/users/CustardGod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CustardGod/subscriptions","organizations_url":"https://api.github.com/users/CustardGod/orgs","repos_url":"https://api.github.com/users/CustardGod/repos","events_url":"https://api.github.com/users/CustardGod/events{/privacy}","received_events_url":"https://api.github.com/users/CustardGod/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CustardGod/runelite","description":"Open source Old School RuneScape client","fork":true,"url":"https://api.github.com/repos/CustardGod/runelite","forks_url":"https://api.github.com/repos/CustardGod/runelite/forks","keys_url":"https://api.github.com/repos/CustardGod/runelite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CustardGod/runelite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CustardGod/runelite/teams","hooks_url":"https://api.github.com/repos/CustardGod/runelite/hooks","issue_events_url":"https://api.github.com/repos/CustardGod/runelite/issues/events{/number}","events_url":"https://api.github.com/repos/CustardGod/runelite/events","assignees_url":"https://api.github.com/repos/CustardGod/runelite/assignees{/user}","branches_url":"https://api.github.com/repos/CustardGod/runelite/branches{/branch}","tags_url":"https://api.github.com/repos/CustardGod/runelite/tags","blobs_url":"https://api.github.com/repos/CustardGod/runelite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CustardGod/runelite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CustardGod/runelite/git/refs{/sha}","trees_url":"https://api.github.com/repos/CustardGod/runelite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CustardGod/runelite/statuses/{sha}","languages_url":"https://api.github.com/repos/CustardGod/runelite/languages","stargazers_url":"https://api.github.com/repos/CustardGod/runelite/stargazers","contributors_url":"https://api.github.com/repos/CustardGod/runelite/contributors","subscribers_url":"https://api.github.com/repos/CustardGod/runelite/subscribers","subscription_url":"https://api.github.com/repos/CustardGod/runelite/subscription","commits_url":"https://api.github.com/repos/CustardGod/runelite/commits{/sha}","git_commits_url":"https://api.github.com/repos/CustardGod/runelite/git/commits{/sha}","comments_url":"https://api.github.com/repos/CustardGod/runelite/comments{/number}","issue_comment_url":"https://api.github.com/repos/CustardGod/runelite/issues/comments{/number}","contents_url":"https://api.github.com/repos/CustardGod/runelite/contents/{+path}","compare_url":"https://api.github.com/repos/CustardGod/runelite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CustardGod/runelite/merges","archive_url":"https://api.github.com/repos/CustardGod/runelite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CustardGod/runelite/downloads","issues_url":"https://api.github.com/repos/CustardGod/runelite/issues{/number}","pulls_url":"https://api.github.com/repos/CustardGod/runelite/pulls{/number}","milestones_url":"https://api.github.com/repos/CustardGod/runelite/milestones{/number}","notifications_url":"https://api.github.com/repos/CustardGod/runelite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CustardGod/runelite/labels{/name}","releases_url":"https://api.github.com/repos/CustardGod/runelite/releases{/id}","deployments_url":"https://api.github.com/repos/CustardGod/runelite/deployments","created_at":"2018-05-11T21:58:09Z","updated_at":"2018-05-13T04:01:56Z","pushed_at":"2018-05-13T05:53:57Z","git_url":"git://github.com/CustardGod/runelite.git","ssh_url":"git@github.com:CustardGod/runelite.git","clone_url":"https://github.com/CustardGod/runelite.git","svn_url":"https://github.com/CustardGod/runelite","homepage":"https://runelite.net","size":39949,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"runelite:master","ref":"master","sha":"927f5070d89aa5494b74b246973970b460e5720b","user":{"login":"runelite","id":13814776,"avatar_url":"https://avatars1.githubusercontent.com/u/13814776?v=4","gravatar_id":"","url":"https://api.github.com/users/runelite","html_url":"https://github.com/runelite","followers_url":"https://api.github.com/users/runelite/followers","following_url":"https://api.github.com/users/runelite/following{/other_user}","gists_url":"https://api.github.com/users/runelite/gists{/gist_id}","starred_url":"https://api.github.com/users/runelite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runelite/subscriptions","organizations_url":"https://api.github.com/users/runelite/orgs","repos_url":"https://api.github.com/users/runelite/repos","events_url":"https://api.github.com/users/runelite/events{/privacy}","received_events_url":"https://api.github.com/users/runelite/received_events","type":"Organization","site_admin":false},"repo":{"id":57461213,"name":"runelite","full_name":"runelite/runelite","owner":{"login":"runelite","id":13814776,"avatar_url":"https://avatars1.githubusercontent.com/u/13814776?v=4","gravatar_id":"","url":"https://api.github.com/users/runelite","html_url":"https://github.com/runelite","followers_url":"https://api.github.com/users/runelite/followers","following_url":"https://api.github.com/users/runelite/following{/other_user}","gists_url":"https://api.github.com/users/runelite/gists{/gist_id}","starred_url":"https://api.github.com/users/runelite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runelite/subscriptions","organizations_url":"https://api.github.com/users/runelite/orgs","repos_url":"https://api.github.com/users/runelite/repos","events_url":"https://api.github.com/users/runelite/events{/privacy}","received_events_url":"https://api.github.com/users/runelite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/runelite/runelite","description":"Open source Old School RuneScape client","fork":false,"url":"https://api.github.com/repos/runelite/runelite","forks_url":"https://api.github.com/repos/runelite/runelite/forks","keys_url":"https://api.github.com/repos/runelite/runelite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/runelite/runelite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/runelite/runelite/teams","hooks_url":"https://api.github.com/repos/runelite/runelite/hooks","issue_events_url":"https://api.github.com/repos/runelite/runelite/issues/events{/number}","events_url":"https://api.github.com/repos/runelite/runelite/events","assignees_url":"https://api.github.com/repos/runelite/runelite/assignees{/user}","branches_url":"https://api.github.com/repos/runelite/runelite/branches{/branch}","tags_url":"https://api.github.com/repos/runelite/runelite/tags","blobs_url":"https://api.github.com/repos/runelite/runelite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/runelite/runelite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/runelite/runelite/git/refs{/sha}","trees_url":"https://api.github.com/repos/runelite/runelite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/runelite/runelite/statuses/{sha}","languages_url":"https://api.github.com/repos/runelite/runelite/languages","stargazers_url":"https://api.github.com/repos/runelite/runelite/stargazers","contributors_url":"https://api.github.com/repos/runelite/runelite/contributors","subscribers_url":"https://api.github.com/repos/runelite/runelite/subscribers","subscription_url":"https://api.github.com/repos/runelite/runelite/subscription","commits_url":"https://api.github.com/repos/runelite/runelite/commits{/sha}","git_commits_url":"https://api.github.com/repos/runelite/runelite/git/commits{/sha}","comments_url":"https://api.github.com/repos/runelite/runelite/comments{/number}","issue_comment_url":"https://api.github.com/repos/runelite/runelite/issues/comments{/number}","contents_url":"https://api.github.com/repos/runelite/runelite/contents/{+path}","compare_url":"https://api.github.com/repos/runelite/runelite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/runelite/runelite/merges","archive_url":"https://api.github.com/repos/runelite/runelite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/runelite/runelite/downloads","issues_url":"https://api.github.com/repos/runelite/runelite/issues{/number}","pulls_url":"https://api.github.com/repos/runelite/runelite/pulls{/number}","milestones_url":"https://api.github.com/repos/runelite/runelite/milestones{/number}","notifications_url":"https://api.github.com/repos/runelite/runelite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/runelite/runelite/labels{/name}","releases_url":"https://api.github.com/repos/runelite/runelite/releases{/id}","deployments_url":"https://api.github.com/repos/runelite/runelite/deployments","created_at":"2016-04-30T20:48:02Z","updated_at":"2018-05-13T05:49:10Z","pushed_at":"2018-05-13T05:57:27Z","git_url":"git://github.com/runelite/runelite.git","ssh_url":"git@github.com:runelite/runelite.git","clone_url":"https://github.com/runelite/runelite.git","svn_url":"https://github.com/runelite/runelite","homepage":"https://runelite.net","size":39950,"stargazers_count":534,"watchers_count":534,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":504,"mirror_url":null,"archived":false,"open_issues_count":772,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":504,"open_issues":772,"watchers":534,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/runelite/runelite/pulls/2668"},"html":{"href":"https://github.com/runelite/runelite/pull/2668"},"issue":{"href":"https://api.github.com/repos/runelite/runelite/issues/2668"},"comments":{"href":"https://api.github.com/repos/runelite/runelite/issues/2668/comments"},"review_comments":{"href":"https://api.github.com/repos/runelite/runelite/pulls/2668/comments"},"review_comment":{"href":"https://api.github.com/repos/runelite/runelite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/runelite/runelite/pulls/2668/commits"},"statuses":{"href":"https://api.github.com/repos/runelite/runelite/statuses/bc15322333d7fab1e405ce73dae232b193c6adef"}},"author_association":"NONE"}}
{"actor":{"display_login":"CustardGod"}}