TAJLN

Chat

Oct 14th, 2017
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.41 KB | None | 0 0
  1. /* */ package mineplex.core.chat;
  2. /* */
  3. /* */ import java.security.SecureRandom;
  4. /* */ import java.security.cert.X509Certificate;
  5. /* */ import java.util.HashMap;
  6. /* */ import java.util.Iterator;
  7. /* */ import java.util.Set;
  8. /* */ import java.util.UUID;
  9. /* */ import javax.net.ssl.HostnameVerifier;
  10. /* */ import javax.net.ssl.HttpsURLConnection;
  11. /* */ import javax.net.ssl.SSLContext;
  12. /* */ import javax.net.ssl.SSLSession;
  13. /* */ import javax.net.ssl.TrustManager;
  14. /* */ import javax.net.ssl.X509TrustManager;
  15. /* */ import mineplex.core.MiniPlugin;
  16. /* */ import mineplex.core.account.CoreClient;
  17. /* */ import mineplex.core.account.CoreClientManager;
  18. /* */ import mineplex.core.achievement.AchievementManager;
  19. /* */ import mineplex.core.chat.command.BroadcastCommand;
  20. /* */ import mineplex.core.chat.command.ChatSlowCommand;
  21. /* */ import mineplex.core.chat.command.SilenceCommand;
  22. /* */ import mineplex.core.common.Rank;
  23. /* */ import mineplex.core.common.util.C;
  24. /* */ import mineplex.core.common.util.F;
  25. /* */ import mineplex.core.common.util.UtilPlayer;
  26. /* */ import mineplex.core.common.util.UtilServer;
  27. /* */ import mineplex.core.common.util.UtilText;
  28. /* */ import mineplex.core.common.util.UtilTime;
  29. /* */ import mineplex.core.common.util.UtilTime.TimeUnit;
  30. /* */ import mineplex.core.preferences.PreferencesManager;
  31. /* */ import mineplex.core.preferences.UserPreferences;
  32. /* */ import mineplex.core.recharge.Recharge;
  33. /* */ import mineplex.core.updater.UpdateType;
  34. /* */ import mineplex.core.updater.event.UpdateEvent;
  35. /* */ import org.bukkit.entity.Player;
  36. /* */ import org.bukkit.event.EventHandler;
  37. /* */ import org.bukkit.event.EventPriority;
  38. /* */ import org.bukkit.event.block.SignChangeEvent;
  39. /* */ import org.bukkit.event.player.AsyncPlayerChatEvent;
  40. /* */ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
  41. /* */ import org.bukkit.event.player.PlayerQuitEvent;
  42. /* */ import org.bukkit.plugin.java.JavaPlugin;
  43. /* */ import org.json.simple.JSONArray;
  44. /* */ import org.json.simple.JSONObject;
  45. /* */ import org.json.simple.JSONValue;
  46. /* */
  47. /* */
  48. /* */
  49. /* */
  50. /* */
  51. /* */
  52. /* */
  53. /* */
  54. /* */
  55. /* */
  56. /* */
  57. /* */
  58. /* */
  59. /* */
  60. /* */
  61. /* */
  62. /* */
  63. /* */
  64. /* */
  65. /* */
  66. /* */
  67. /* */
  68. /* */
  69. /* */
  70. /* */
  71. /* */
  72. /* */
  73. /* */
  74. /* */
  75. /* */
  76. /* */
  77. /* */
  78. /* */
  79. /* */ public class Chat
  80. /* */ extends MiniPlugin
  81. /* */ {
  82. /* */ private CoreClientManager _clientManager;
  83. /* */ private PreferencesManager _preferences;
  84. /* */ private AchievementManager _achievements;
  85. /* 85 */ private String[] _hackusations = { "hack", "hax", "hacker", "hacking", "cheat", "cheater", "cheating", "forcefield", "flyhack", "flyhacking", "autoclick", "aimbot" };
  86. /* 86 */ private String _filterUrl = "https://10.33.53.5:8003/content/item/moderate";
  87. /* 87 */ private String _appId = "34018d65-466d-4a91-8e92-29ca49f022c4";
  88. /* 88 */ private String _apiKey = "oUywMpwZcIzZO5AWnfDx";
  89. /* */ private String _serverName;
  90. /* 90 */ private int _chatSlow = 0;
  91. /* 91 */ private long _silenced = 0L;
  92. /* 92 */ private boolean _threeSecondDelay = true;
  93. /* 93 */ private HashMap<UUID, MessageData> _playerLastMessage = new HashMap();
  94. /* */ private String _website;
  95. /* */
  96. /* */ public Chat(JavaPlugin plugin, CoreClientManager clientManager, PreferencesManager preferences, AchievementManager achievements, String serverName, String website)
  97. /* */ {
  98. /* 98 */ super("Chat", plugin);
  99. /* 99 */ this._clientManager = clientManager;
  100. /* 100 */ this._serverName = serverName;
  101. /* 101 */ this._preferences = preferences;
  102. /* 102 */ this._achievements = achievements;
  103. /* */
  104. /* 104 */ this._website = website;
  105. /* */ try
  106. /* */ {
  107. /* 107 */ trustCert();
  108. /* */ }
  109. /* */ catch (Exception e) {
  110. /* 110 */ e.printStackTrace();
  111. /* */ }
  112. /* */ }
  113. /* */
  114. /* */ public void addCommands()
  115. /* */ {
  116. /* 116 */ addCommand(new SilenceCommand(this));
  117. /* 117 */ addCommand(new BroadcastCommand(this));
  118. /* 118 */ addCommand(new ChatSlowCommand(this));
  119. /* */ }
  120. /* */
  121. /* */ public void setChatSlow(int seconds, boolean inform) {
  122. /* 122 */ if (seconds < 0) {
  123. /* 123 */ seconds = 0;
  124. /* */ }
  125. /* 125 */ this._chatSlow = seconds;
  126. /* 126 */ if (inform) {
  127. /* 127 */ if (seconds == 0) {
  128. /* 128 */ UtilServer.broadcast(F.main("Chat", "Chat Slow is now disabled"));
  129. /* */ } else {
  130. /* 130 */ UtilServer.broadcast(F.main("Chat", "Chat slow is now enabled with a cooldown of " + F.time(new StringBuilder().append(seconds).append(" seconds").toString())));
  131. /* */ }
  132. /* */ }
  133. /* */ }
  134. /* */
  135. /* */ public void Silence(long duration, boolean inform) {
  136. /* 136 */ this._silenced = (duration > 0L ? System.currentTimeMillis() + duration : duration);
  137. /* 137 */ if (!inform) {
  138. /* 138 */ return;
  139. /* */ }
  140. /* 140 */ if (duration == -1L) {
  141. /* 141 */ UtilServer.broadcast(F.main("Chat", "Chat has been silenced for " + F.time("Permanent") + "."));
  142. /* 142 */ } else if (duration == 0L) {
  143. /* 143 */ UtilServer.broadcast(F.main("Chat", "Chat is no longer silenced."));
  144. /* */ } else {
  145. /* 145 */ UtilServer.broadcast(F.main("Chat", "Chat has been silenced for " + F.time(UtilTime.MakeStr(duration, 1)) + "."));
  146. /* */ }
  147. /* */ }
  148. /* */
  149. /* */ @EventHandler
  150. /* */ public void preventMe(PlayerCommandPreprocessEvent event) {
  151. /* 151 */ if ((event.getMessage().toLowerCase().startsWith("/me ")) || (event.getMessage().toLowerCase().startsWith("/bukkit"))) {
  152. /* 152 */ event.getPlayer().sendMessage(F.main(getName(), "No, you!"));
  153. /* 153 */ event.setCancelled(true);
  154. /* */ }
  155. /* */ }
  156. /* */
  157. /* */ @EventHandler
  158. /* */ public void lagTest(PlayerCommandPreprocessEvent event) {
  159. /* 159 */ if ((event.getMessage().equals("lag")) || (event.getMessage().equals("ping"))) {
  160. /* 160 */ event.getPlayer().sendMessage(F.main(getName(), "PONG!"));
  161. /* 161 */ event.setCancelled(true);
  162. /* */ }
  163. /* */ }
  164. /* */
  165. /* */ @EventHandler
  166. /* */ public void SilenceUpdate(UpdateEvent event) {
  167. /* 167 */ if (event.getType() != UpdateType.FAST) {
  168. /* 168 */ return;
  169. /* */ }
  170. /* 170 */ SilenceEnd();
  171. /* */ }
  172. /* */
  173. /* */ public void SilenceEnd() {
  174. /* 174 */ if (this._silenced <= 0L) {
  175. /* 175 */ return;
  176. /* */ }
  177. /* 177 */ if (System.currentTimeMillis() > this._silenced) {
  178. /* 178 */ Silence(0L, true);
  179. /* */ }
  180. /* */ }
  181. /* */
  182. /* */ public boolean SilenceCheck(Player player) {
  183. /* 183 */ SilenceEnd();
  184. /* 184 */ if (this._silenced == 0L) {
  185. /* 185 */ return false;
  186. /* */ }
  187. /* 187 */ if (this._clientManager.Get(player).GetRank().Has(player, Rank.MODERATOR, false)) {
  188. /* 188 */ return false;
  189. /* */ }
  190. /* 190 */ if (this._silenced == -1L) {
  191. /* 191 */ UtilPlayer.message(player, F.main(getName(), "Chat is silenced permanently."));
  192. /* */ } else {
  193. /* 193 */ UtilPlayer.message(player, F.main(getName(), "Chat is silenced for " + F.time(UtilTime.MakeStr(this._silenced - System.currentTimeMillis(), 1)) + "."));
  194. /* */ }
  195. /* 195 */ return true;
  196. /* */ }
  197. /* */
  198. /* */ @EventHandler
  199. /* */ public void removeChat(AsyncPlayerChatEvent event)
  200. /* */ {
  201. /* 201 */ if (event.isCancelled()) {
  202. /* 202 */ return;
  203. /* */ }
  204. /* */
  205. /* 205 */ if (event.isAsynchronous()) {
  206. /* 206 */ for (Iterator<Player> playerIterator = event.getRecipients().iterator(); playerIterator.hasNext();) {
  207. /* 207 */ if (!((UserPreferences)this._preferences.Get((Player)playerIterator.next())).ShowChat) {
  208. /* 208 */ playerIterator.remove();
  209. /* */ }
  210. /* */ }
  211. /* */ }
  212. /* */ }
  213. /* */
  214. /* */ @EventHandler(priority=EventPriority.HIGHEST)
  215. /* */ public void onSignChange(SignChangeEvent event) {
  216. /* 216 */ if (this._clientManager.Get(event.getPlayer()).GetRank().Has(Rank.ADMIN)) {
  217. /* 217 */ return;
  218. /* */ }
  219. /* 219 */ if (SilenceCheck(event.getPlayer())) {
  220. /* 220 */ event.setCancelled(true);
  221. /* 221 */ return;
  222. /* */ }
  223. /* 223 */ for (int i = 0; i < event.getLines().length; i++)
  224. /* */ {
  225. /* 225 */ String line = event.getLine(i);
  226. /* 226 */ String filteredLine; if ((line != null) && (line.length() > 0) && ((filteredLine = getFilteredMessage(event.getPlayer(), line)) != null)) { String filteredLine;
  227. /* 227 */ event.setLine(i, filteredLine);
  228. /* */ }
  229. /* */ }
  230. /* */ }
  231. /* */
  232. /* */ @EventHandler(priority=EventPriority.HIGHEST)
  233. /* 233 */ public void filterChat(AsyncPlayerChatEvent event) { if (event.isCancelled()) {
  234. /* 234 */ return;
  235. /* */ }
  236. /* 236 */ if (event.isAsynchronous()) {
  237. /* 237 */ String filteredMessage = getFilteredMessage(event.getPlayer(), event.getMessage());
  238. /* 238 */ for (Player onlinePlayer : event.getRecipients()) {
  239. /* 239 */ onlinePlayer.sendMessage(String.format(event.getFormat(), new Object[] { event.getPlayer().getDisplayName(), filteredMessage }));
  240. /* */ }
  241. /* 241 */ event.setCancelled(true);
  242. /* */ }
  243. /* */ }
  244. /* */
  245. /* */ public String getFilteredMessage(Player player, String originalMessage) {
  246. /* 246 */ return originalMessage;
  247. /* */ }
  248. /* */
  249. /* */ @EventHandler(priority=EventPriority.LOWEST)
  250. /* */ public void HandleChat(AsyncPlayerChatEvent event) {
  251. /* 251 */ if (event.isCancelled()) {
  252. /* 252 */ return;
  253. /* */ }
  254. /* 254 */ Player sender = event.getPlayer();
  255. /* 255 */ if (SilenceCheck(sender)) {
  256. /* 256 */ event.setCancelled(true);
  257. /* 257 */ return;
  258. /* */ }
  259. /* 259 */ if ((this._threeSecondDelay) && (this._clientManager.Get(sender).GetRank() == Rank.ALL) && (this._achievements.getMineplexLevelNumber(sender, Rank.ALL) < 25) && (!Recharge.Instance.use(sender, "All Chat Message", 3000L, false, false))) {
  260. /* 260 */ UtilPlayer.message(sender, C.cYellow + "You can only chat once every 3 seconds to prevent spam.");
  261. /* 261 */ UtilPlayer.message(sender, C.cYellow + "Buy a Rank at " + C.cGreen + this._website + C.cYellow + " to remove this limit!");
  262. /* 262 */ event.setCancelled(true);
  263. /* 263 */ } else if ((!this._clientManager.Get(sender).GetRank().Has(Rank.MODERATOR)) && (!Recharge.Instance.use(sender, "Chat Message", 400L, false, false))) {
  264. /* 264 */ UtilPlayer.message(sender, F.main("Chat", "You are sending messages too fast."));
  265. /* 265 */ event.setCancelled(true);
  266. /* 266 */ } else if ((!this._clientManager.Get(sender).GetRank().Has(Rank.HELPER)) && (msgContainsHack(event.getMessage()))) {
  267. /* 267 */ UtilPlayer.message(sender, F.main("Chat", "Accusing players of cheating in-game is against the rules.If you think someone is cheating, please gather evidence and report it at " + F.link(this._website)));
  268. /* 268 */ event.setCancelled(true);
  269. /* 269 */ } else if (this._playerLastMessage.containsKey(sender.getUniqueId())) {
  270. /* 270 */ MessageData lastMessage = (MessageData)this._playerLastMessage.get(sender.getUniqueId());
  271. /* 271 */ long chatSlowTime = 1000L * this._chatSlow;
  272. /* 272 */ long timeDiff = System.currentTimeMillis() - lastMessage.getTimeSent();
  273. /* 273 */ if ((timeDiff < chatSlowTime) && (!this._clientManager.Get(sender).GetRank().Has(Rank.HELPER))) {
  274. /* 274 */ UtilPlayer.message(sender, F.main("Chat", "Chat slow enabled. Please wait " + F.time(UtilTime.convertString(chatSlowTime - timeDiff, 1, UtilTime.TimeUnit.FIT))));
  275. /* 275 */ event.setCancelled(true);
  276. /* 276 */ } else if ((!this._clientManager.Get(sender).GetRank().Has(Rank.MODERATOR)) && (UtilText.isStringSimilar(event.getMessage(), lastMessage.getMessage(), 0.8F))) {
  277. /* 277 */ UtilPlayer.message(sender, F.main("Chat", "This message is too similar to your previous message."));
  278. /* 278 */ event.setCancelled(true);
  279. /* */ }
  280. /* */ }
  281. /* 281 */ if (!event.isCancelled()) {
  282. /* 282 */ this._playerLastMessage.put(sender.getUniqueId(), new MessageData(event.getMessage()));
  283. /* */ }
  284. /* */ }
  285. /* */
  286. /* */ private boolean msgContainsHack(String msg) {
  287. /* 287 */ msg = " " + msg.toLowerCase().replaceAll("[^a-z ]", "") + " ";
  288. /* 288 */ String[] arrayOfString; int j = (arrayOfString = this._hackusations).length; for (int i = 0; i < j; i++) { String s = arrayOfString[i];
  289. /* 289 */ if (msg.contains(" " + s + " "))
  290. /* 290 */ return true;
  291. /* */ }
  292. /* 292 */ return false;
  293. /* */ }
  294. /* */
  295. /* */ public String hasher(JSONArray hasharray, String message) {
  296. /* 296 */ StringBuilder newmsg = new StringBuilder(message);
  297. /* 297 */ for (int i = 0; i < hasharray.size(); i++) {
  298. /* 298 */ Long charindex = (Long)hasharray.get(i);
  299. /* 299 */ int charidx = charindex.intValue();
  300. /* 300 */ newmsg.setCharAt(charidx, '*');
  301. /* */ }
  302. /* 302 */ return newmsg.toString();
  303. /* */ }
  304. /* */
  305. /* */ public JSONArray parseHashes(String response) {
  306. /* 306 */ JSONObject checkhash = (JSONObject)JSONValue.parse(response);
  307. /* 307 */ JSONArray hasharray = (JSONArray)checkhash.get("hashes");
  308. /* 308 */ return hasharray;
  309. /* */ }
  310. /* */
  311. /* */ private JSONObject buildJsonChatObject(String filtertype, String name, String player, String msg, String server, int rule) {
  312. /* 312 */ JSONObject message = new JSONObject();
  313. /* 313 */ String str; switch ((str = filtertype).hashCode()) {case -618857213: if (str.equals("moderate")) break; break; case -265713450: if (str.equals("username")) {} case 3052376: if ((goto 285) && (str.equals("chat")))
  314. /* */ {
  315. /* 315 */ message.put("content", msg);
  316. /* */
  317. /* */ break label285;
  318. /* */
  319. /* 319 */ JSONObject content = new JSONObject();
  320. /* 320 */ content.put("content", msg);
  321. /* 321 */ content.put("type", "text");
  322. /* 322 */ JSONArray parts = new JSONArray();
  323. /* 323 */ parts.add(content);
  324. /* 324 */ JSONObject mainContent = new JSONObject();
  325. /* 325 */ mainContent.put("applicationId", this._appId);
  326. /* 326 */ mainContent.put("createInstant", Long.valueOf(System.currentTimeMillis()));
  327. /* 327 */ mainContent.put("parts", parts);
  328. /* 328 */ mainContent.put("senderDisplayName", name);
  329. /* 329 */ mainContent.put("senderId", player);
  330. /* 330 */ message.put("content", mainContent);
  331. /* */
  332. /* */ break label285;
  333. /* */
  334. /* 334 */ message.put("player_id", name);
  335. /* 335 */ message.put("username", name);
  336. /* 336 */ message.put("language", "en");
  337. /* 337 */ message.put("rule", Integer.valueOf(rule)); }
  338. /* */ break; }
  339. /* */ label285:
  340. /* 340 */ return message;
  341. /* */ }
  342. /* */
  343. /* */ /* Error */
  344. /* */ private String getResponseFromCleanSpeak(JSONObject message, String filtertype)
  345. /* */ {
  346. /* */ // Byte code:
  347. /* */ // 0: aload_0
  348. /* */ // 1: getfield 67 mineplex/core/chat/Chat:_filterUrl Ljava/lang/String;
  349. /* */ // 4: astore_3
  350. /* */ // 5: aconst_null
  351. /* */ // 6: astore 4
  352. /* */ // 8: aconst_null
  353. /* */ // 9: astore 5
  354. /* */ // 11: aconst_null
  355. /* */ // 12: astore 6
  356. /* */ // 14: aconst_null
  357. /* */ // 15: astore 7
  358. /* */ // 17: aconst_null
  359. /* */ // 18: astore 8
  360. /* */ // 20: new 645 java/net/URL
  361. /* */ // 23: dup
  362. /* */ // 24: aload_3
  363. /* */ // 25: invokespecial 647 java/net/URL:<init> (Ljava/lang/String;)V
  364. /* */ // 28: astore 10
  365. /* */ // 30: aload 10
  366. /* */ // 32: invokevirtual 648 java/net/URL:openConnection ()Ljava/net/URLConnection;
  367. /* */ // 35: checkcast 652 javax/net/ssl/HttpsURLConnection
  368. /* */ // 38: astore 5
  369. /* */ // 40: aload 5
  370. /* */ // 42: ldc_w 654
  371. /* */ // 45: ldc_w 656
  372. /* */ // 48: invokevirtual 658 java/net/HttpURLConnection:setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V
  373. /* */ // 51: aload 5
  374. /* */ // 53: ldc_w 664
  375. /* */ // 56: ldc_w 666
  376. /* */ // 59: invokevirtual 658 java/net/HttpURLConnection:setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V
  377. /* */ // 62: aload 5
  378. /* */ // 64: ldc_w 668
  379. /* */ // 67: aload_0
  380. /* */ // 68: getfield 75 mineplex/core/chat/Chat:_apiKey Ljava/lang/String;
  381. /* */ // 71: invokevirtual 670 java/net/HttpURLConnection:addRequestProperty (Ljava/lang/String;Ljava/lang/String;)V
  382. /* */ // 74: aload_1
  383. /* */ // 75: invokevirtual 673 org/json/simple/JSONObject:toString ()Ljava/lang/String;
  384. /* */ // 78: astore 11
  385. /* */ // 80: aload 5
  386. /* */ // 82: iconst_1
  387. /* */ // 83: invokevirtual 674 java/net/HttpURLConnection:setDoOutput (Z)V
  388. /* */ // 86: new 677 java/io/DataOutputStream
  389. /* */ // 89: dup
  390. /* */ // 90: aload 5
  391. /* */ // 92: invokevirtual 679 java/net/HttpURLConnection:getOutputStream ()Ljava/io/OutputStream;
  392. /* */ // 95: invokespecial 683 java/io/DataOutputStream:<init> (Ljava/io/OutputStream;)V
  393. /* */ // 98: astore 6
  394. /* */ // 100: aload 6
  395. /* */ // 102: aload 11
  396. /* */ // 104: invokevirtual 686 java/io/DataOutputStream:writeBytes (Ljava/lang/String;)V
  397. /* */ // 107: aload 6
  398. /* */ // 109: invokevirtual 689 java/io/DataOutputStream:flush ()V
  399. /* */ // 112: aload 6
  400. /* */ // 114: invokevirtual 692 java/io/DataOutputStream:close ()V
  401. /* */ // 117: new 695 java/io/InputStreamReader
  402. /* */ // 120: dup
  403. /* */ // 121: aload 5
  404. /* */ // 123: invokevirtual 697 java/net/HttpURLConnection:getInputStream ()Ljava/io/InputStream;
  405. /* */ // 126: ldc_w 701
  406. /* */ // 129: invokestatic 703 java/nio/charset/Charset:forName (Ljava/lang/String;)Ljava/nio/charset/Charset;
  407. /* */ // 132: invokespecial 709 java/io/InputStreamReader:<init> (Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
  408. /* */ // 135: astore 8
  409. /* */ // 137: new 712 java/io/BufferedReader
  410. /* */ // 140: dup
  411. /* */ // 141: aload 8
  412. /* */ // 143: invokespecial 714 java/io/BufferedReader:<init> (Ljava/io/Reader;)V
  413. /* */ // 146: astore 7
  414. /* */ // 148: new 717 java/lang/StringBuffer
  415. /* */ // 151: dup
  416. /* */ // 152: invokespecial 719 java/lang/StringBuffer:<init> ()V
  417. /* */ // 155: astore 4
  418. /* */ // 157: goto +11 -> 168
  419. /* */ // 160: aload 4
  420. /* */ // 162: aload 9
  421. /* */ // 164: invokevirtual 720 java/lang/StringBuffer:append (Ljava/lang/String;)Ljava/lang/StringBuffer;
  422. /* */ // 167: pop
  423. /* */ // 168: aload 7
  424. /* */ // 170: invokevirtual 723 java/io/BufferedReader:readLine ()Ljava/lang/String;
  425. /* */ // 173: dup
  426. /* */ // 174: astore 9
  427. /* */ // 176: ifnonnull -16 -> 160
  428. /* */ // 179: aload 7
  429. /* */ // 181: invokevirtual 726 java/io/BufferedReader:close ()V
  430. /* */ // 184: goto +210 -> 394
  431. /* */ // 187: astore 9
  432. /* */ // 189: getstatic 727 java/lang/System:out Ljava/io/PrintStream;
  433. /* */ // 192: new 162 java/lang/StringBuilder
  434. /* */ // 195: dup
  435. /* */ // 196: ldc_w 731
  436. /* */ // 199: invokespecial 166 java/lang/StringBuilder:<init> (Ljava/lang/String;)V
  437. /* */ // 202: aload 9
  438. /* */ // 204: invokevirtual 733 java/lang/Exception:getMessage ()Ljava/lang/String;
  439. /* */ // 207: invokevirtual 175 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
  440. /* */ // 210: invokevirtual 178 java/lang/StringBuilder:toString ()Ljava/lang/String;
  441. /* */ // 213: invokevirtual 734 java/io/PrintStream:println (Ljava/lang/String;)V
  442. /* */ // 216: aload 5
  443. /* */ // 218: ifnull +8 -> 226
  444. /* */ // 221: aload 5
  445. /* */ // 223: invokevirtual 739 java/net/HttpURLConnection:disconnect ()V
  446. /* */ // 226: aload 6
  447. /* */ // 228: ifnull +33 -> 261
  448. /* */ // 231: aload 6
  449. /* */ // 233: invokevirtual 689 java/io/DataOutputStream:flush ()V
  450. /* */ // 236: goto +10 -> 246
  451. /* */ // 239: astore 13
  452. /* */ // 241: aload 13
  453. /* */ // 243: invokevirtual 742 java/io/IOException:printStackTrace ()V
  454. /* */ // 246: aload 6
  455. /* */ // 248: invokevirtual 692 java/io/DataOutputStream:close ()V
  456. /* */ // 251: goto +10 -> 261
  457. /* */ // 254: astore 13
  458. /* */ // 256: aload 13
  459. /* */ // 258: invokevirtual 742 java/io/IOException:printStackTrace ()V
  460. /* */ // 261: aload 7
  461. /* */ // 263: ifnull +18 -> 281
  462. /* */ // 266: aload 7
  463. /* */ // 268: invokevirtual 726 java/io/BufferedReader:close ()V
  464. /* */ // 271: goto +10 -> 281
  465. /* */ // 274: astore 13
  466. /* */ // 276: aload 13
  467. /* */ // 278: invokevirtual 742 java/io/IOException:printStackTrace ()V
  468. /* */ // 281: aload 8
  469. /* */ // 283: ifnull +196 -> 479
  470. /* */ // 286: aload 8
  471. /* */ // 288: invokevirtual 745 java/io/InputStreamReader:close ()V
  472. /* */ // 291: goto +188 -> 479
  473. /* */ // 294: astore 13
  474. /* */ // 296: aload 13
  475. /* */ // 298: invokevirtual 742 java/io/IOException:printStackTrace ()V
  476. /* */ // 301: goto +178 -> 479
  477. /* */ // 304: astore 12
  478. /* */ // 306: aload 5
  479. /* */ // 308: ifnull +8 -> 316
  480. /* */ // 311: aload 5
  481. /* */ // 313: invokevirtual 739 java/net/HttpURLConnection:disconnect ()V
  482. /* */ // 316: aload 6
  483. /* */ // 318: ifnull +33 -> 351
  484. /* */ // 321: aload 6
  485. /* */ // 323: invokevirtual 689 java/io/DataOutputStream:flush ()V
  486. /* */ // 326: goto +10 -> 336
  487. /* */ // 329: astore 13
  488. /* */ // 331: aload 13
  489. /* */ // 333: invokevirtual 742 java/io/IOException:printStackTrace ()V
  490. /* */ // 336: aload 6
  491. /* */ // 338: invokevirtual 692 java/io/DataOutputStream:close ()V
  492. /* */ // 341: goto +10 -> 351
  493. /* */ // 344: astore 13
  494. /* */ // 346: aload 13
  495. /* */ // 348: invokevirtual 742 java/io/IOException:printStackTrace ()V
  496. /* */ // 351: aload 7
  497. /* */ // 353: ifnull +18 -> 371
  498. /* */ // 356: aload 7
  499. /* */ // 358: invokevirtual 726 java/io/BufferedReader:close ()V
  500. /* */ // 361: goto +10 -> 371
  501. /* */ // 364: astore 13
  502. /* */ // 366: aload 13
  503. /* */ // 368: invokevirtual 742 java/io/IOException:printStackTrace ()V
  504. /* */ // 371: aload 8
  505. /* */ // 373: ifnull +18 -> 391
  506. /* */ // 376: aload 8
  507. /* */ // 378: invokevirtual 745 java/io/InputStreamReader:close ()V
  508. /* */ // 381: goto +10 -> 391
  509. /* */ // 384: astore 13
  510. /* */ // 386: aload 13
  511. /* */ // 388: invokevirtual 742 java/io/IOException:printStackTrace ()V
  512. /* */ // 391: aload 12
  513. /* */ // 393: athrow
  514. /* */ // 394: aload 5
  515. /* */ // 396: ifnull +8 -> 404
  516. /* */ // 399: aload 5
  517. /* */ // 401: invokevirtual 739 java/net/HttpURLConnection:disconnect ()V
  518. /* */ // 404: aload 6
  519. /* */ // 406: ifnull +33 -> 439
  520. /* */ // 409: aload 6
  521. /* */ // 411: invokevirtual 689 java/io/DataOutputStream:flush ()V
  522. /* */ // 414: goto +10 -> 424
  523. /* */ // 417: astore 13
  524. /* */ // 419: aload 13
  525. /* */ // 421: invokevirtual 742 java/io/IOException:printStackTrace ()V
  526. /* */ // 424: aload 6
  527. /* */ // 426: invokevirtual 692 java/io/DataOutputStream:close ()V
  528. /* */ // 429: goto +10 -> 439
  529. /* */ // 432: astore 13
  530. /* */ // 434: aload 13
  531. /* */ // 436: invokevirtual 742 java/io/IOException:printStackTrace ()V
  532. /* */ // 439: aload 7
  533. /* */ // 441: ifnull +18 -> 459
  534. /* */ // 444: aload 7
  535. /* */ // 446: invokevirtual 726 java/io/BufferedReader:close ()V
  536. /* */ // 449: goto +10 -> 459
  537. /* */ // 452: astore 13
  538. /* */ // 454: aload 13
  539. /* */ // 456: invokevirtual 742 java/io/IOException:printStackTrace ()V
  540. /* */ // 459: aload 8
  541. /* */ // 461: ifnull +18 -> 479
  542. /* */ // 464: aload 8
  543. /* */ // 466: invokevirtual 745 java/io/InputStreamReader:close ()V
  544. /* */ // 469: goto +10 -> 479
  545. /* */ // 472: astore 13
  546. /* */ // 474: aload 13
  547. /* */ // 476: invokevirtual 742 java/io/IOException:printStackTrace ()V
  548. /* */ // 479: aconst_null
  549. /* */ // 480: astore 9
  550. /* */ // 482: aload 4
  551. /* */ // 484: ifnull +10 -> 494
  552. /* */ // 487: aload 4
  553. /* */ // 489: invokevirtual 746 java/lang/StringBuffer:toString ()Ljava/lang/String;
  554. /* */ // 492: astore 9
  555. /* */ // 494: aload 9
  556. /* */ // 496: areturn
  557. /* */ // Line number table:
  558. /* */ // Java source line #347 -> byte code offset #0
  559. /* */ // Java source line #348 -> byte code offset #5
  560. /* */ // Java source line #349 -> byte code offset #8
  561. /* */ // Java source line #350 -> byte code offset #11
  562. /* */ // Java source line #351 -> byte code offset #14
  563. /* */ // Java source line #352 -> byte code offset #17
  564. /* */ // Java source line #355 -> byte code offset #20
  565. /* */ // Java source line #356 -> byte code offset #30
  566. /* */ // Java source line #357 -> byte code offset #40
  567. /* */ // Java source line #358 -> byte code offset #51
  568. /* */ // Java source line #359 -> byte code offset #62
  569. /* */ // Java source line #360 -> byte code offset #74
  570. /* */ // Java source line #361 -> byte code offset #80
  571. /* */ // Java source line #362 -> byte code offset #86
  572. /* */ // Java source line #363 -> byte code offset #100
  573. /* */ // Java source line #364 -> byte code offset #107
  574. /* */ // Java source line #365 -> byte code offset #112
  575. /* */ // Java source line #366 -> byte code offset #117
  576. /* */ // Java source line #367 -> byte code offset #137
  577. /* */ // Java source line #368 -> byte code offset #148
  578. /* */ // Java source line #369 -> byte code offset #157
  579. /* */ // Java source line #370 -> byte code offset #160
  580. /* */ // Java source line #369 -> byte code offset #168
  581. /* */ // Java source line #372 -> byte code offset #179
  582. /* */ // Java source line #373 -> byte code offset #184
  583. /* */ // Java source line #374 -> byte code offset #187
  584. /* */ // Java source line #375 -> byte code offset #189
  585. /* */ // Java source line #378 -> byte code offset #216
  586. /* */ // Java source line #379 -> byte code offset #221
  587. /* */ // Java source line #381 -> byte code offset #226
  588. /* */ // Java source line #383 -> byte code offset #231
  589. /* */ // Java source line #384 -> byte code offset #236
  590. /* */ // Java source line #385 -> byte code offset #239
  591. /* */ // Java source line #386 -> byte code offset #241
  592. /* */ // Java source line #389 -> byte code offset #246
  593. /* */ // Java source line #390 -> byte code offset #251
  594. /* */ // Java source line #391 -> byte code offset #254
  595. /* */ // Java source line #392 -> byte code offset #256
  596. /* */ // Java source line #395 -> byte code offset #261
  597. /* */ // Java source line #397 -> byte code offset #266
  598. /* */ // Java source line #398 -> byte code offset #271
  599. /* */ // Java source line #399 -> byte code offset #274
  600. /* */ // Java source line #400 -> byte code offset #276
  601. /* */ // Java source line #403 -> byte code offset #281
  602. /* */ // Java source line #405 -> byte code offset #286
  603. /* */ // Java source line #406 -> byte code offset #291
  604. /* */ // Java source line #407 -> byte code offset #294
  605. /* */ // Java source line #408 -> byte code offset #296
  606. /* */ // Java source line #377 -> byte code offset #304
  607. /* */ // Java source line #378 -> byte code offset #306
  608. /* */ // Java source line #379 -> byte code offset #311
  609. /* */ // Java source line #381 -> byte code offset #316
  610. /* */ // Java source line #383 -> byte code offset #321
  611. /* */ // Java source line #384 -> byte code offset #326
  612. /* */ // Java source line #385 -> byte code offset #329
  613. /* */ // Java source line #386 -> byte code offset #331
  614. /* */ // Java source line #389 -> byte code offset #336
  615. /* */ // Java source line #390 -> byte code offset #341
  616. /* */ // Java source line #391 -> byte code offset #344
  617. /* */ // Java source line #392 -> byte code offset #346
  618. /* */ // Java source line #395 -> byte code offset #351
  619. /* */ // Java source line #397 -> byte code offset #356
  620. /* */ // Java source line #398 -> byte code offset #361
  621. /* */ // Java source line #399 -> byte code offset #364
  622. /* */ // Java source line #400 -> byte code offset #366
  623. /* */ // Java source line #403 -> byte code offset #371
  624. /* */ // Java source line #405 -> byte code offset #376
  625. /* */ // Java source line #406 -> byte code offset #381
  626. /* */ // Java source line #407 -> byte code offset #384
  627. /* */ // Java source line #408 -> byte code offset #386
  628. /* */ // Java source line #411 -> byte code offset #391
  629. /* */ // Java source line #378 -> byte code offset #394
  630. /* */ // Java source line #379 -> byte code offset #399
  631. /* */ // Java source line #381 -> byte code offset #404
  632. /* */ // Java source line #383 -> byte code offset #409
  633. /* */ // Java source line #384 -> byte code offset #414
  634. /* */ // Java source line #385 -> byte code offset #417
  635. /* */ // Java source line #386 -> byte code offset #419
  636. /* */ // Java source line #389 -> byte code offset #424
  637. /* */ // Java source line #390 -> byte code offset #429
  638. /* */ // Java source line #391 -> byte code offset #432
  639. /* */ // Java source line #392 -> byte code offset #434
  640. /* */ // Java source line #395 -> byte code offset #439
  641. /* */ // Java source line #397 -> byte code offset #444
  642. /* */ // Java source line #398 -> byte code offset #449
  643. /* */ // Java source line #399 -> byte code offset #452
  644. /* */ // Java source line #400 -> byte code offset #454
  645. /* */ // Java source line #403 -> byte code offset #459
  646. /* */ // Java source line #405 -> byte code offset #464
  647. /* */ // Java source line #406 -> byte code offset #469
  648. /* */ // Java source line #407 -> byte code offset #472
  649. /* */ // Java source line #408 -> byte code offset #474
  650. /* */ // Java source line #412 -> byte code offset #479
  651. /* */ // Java source line #413 -> byte code offset #482
  652. /* */ // Java source line #414 -> byte code offset #487
  653. /* */ // Java source line #416 -> byte code offset #494
  654. /* */ // Local variable table:
  655. /* */ // start length slot name signature
  656. /* */ // 0 497 0 this Chat
  657. /* */ // 0 497 1 message JSONObject
  658. /* */ // 0 497 2 filtertype String
  659. /* */ // 4 21 3 url String
  660. /* */ // 6 482 4 response StringBuffer
  661. /* */ // 9 391 5 connection java.net.HttpURLConnection
  662. /* */ // 12 413 6 outputStream java.io.DataOutputStream
  663. /* */ // 15 430 7 bufferedReader java.io.BufferedReader
  664. /* */ // 18 447 8 inputStream java.io.InputStreamReader
  665. /* */ // 160 3 9 inputLine String
  666. /* */ // 174 3 9 inputLine String
  667. /* */ // 187 16 9 exception Exception
  668. /* */ // 480 15 9 pmresponse String
  669. /* */ // 28 3 10 obj java.net.URL
  670. /* */ // 78 25 11 urlParameters String
  671. /* */ // 304 88 12 localObject Object
  672. /* */ // 239 3 13 e java.io.IOException
  673. /* */ // 254 3 13 e java.io.IOException
  674. /* */ // 274 3 13 e java.io.IOException
  675. /* */ // 294 3 13 e java.io.IOException
  676. /* */ // 329 3 13 e java.io.IOException
  677. /* */ // 344 3 13 e java.io.IOException
  678. /* */ // 364 3 13 e java.io.IOException
  679. /* */ // 384 3 13 e java.io.IOException
  680. /* */ // 417 3 13 e java.io.IOException
  681. /* */ // 432 3 13 e java.io.IOException
  682. /* */ // 452 3 13 e java.io.IOException
  683. /* */ // 472 3 13 e java.io.IOException
  684. /* */ // Exception table:
  685. /* */ // from to target type
  686. /* */ // 20 184 187 java/lang/Exception
  687. /* */ // 231 236 239 java/io/IOException
  688. /* */ // 246 251 254 java/io/IOException
  689. /* */ // 266 271 274 java/io/IOException
  690. /* */ // 286 291 294 java/io/IOException
  691. /* */ // 20 216 304 finally
  692. /* */ // 321 326 329 java/io/IOException
  693. /* */ // 336 341 344 java/io/IOException
  694. /* */ // 356 361 364 java/io/IOException
  695. /* */ // 376 381 384 java/io/IOException
  696. /* */ // 409 414 417 java/io/IOException
  697. /* */ // 424 429 432 java/io/IOException
  698. /* */ // 444 449 452 java/io/IOException
  699. /* */ // 464 469 472 java/io/IOException
  700. /* */ }
  701. /* */
  702. /* */ public static void trustCert()
  703. /* */ throws Exception
  704. /* */ {
  705. /* 420 */ TrustManager[] trustAllCerts = { new X509TrustManager()
  706. /* */ {
  707. /* */ public X509Certificate[] getAcceptedIssuers()
  708. /* */ {
  709. /* 424 */ return null;
  710. /* */ }
  711. /* */
  712. /* */
  713. /* */
  714. /* */ public void checkClientTrusted(X509Certificate[] certs, String authType) {}
  715. /* */
  716. /* */
  717. /* */
  718. /* */ public void checkServerTrusted(X509Certificate[] certs, String authType) {}
  719. /* 434 */ } };
  720. /* 435 */ SSLContext sc = SSLContext.getInstance("SSL");
  721. /* 436 */ sc.init(null, trustAllCerts, new SecureRandom());
  722. /* 437 */ HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
  723. /* 438 */ HostnameVerifier allHostsValid = new HostnameVerifier()
  724. /* */ {
  725. /* */ public boolean verify(String hostname, SSLSession session)
  726. /* */ {
  727. /* 442 */ return true;
  728. /* */ }
  729. /* 444 */ };
  730. /* 445 */ HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
  731. /* */ }
  732. /* */
  733. /* */ public long Silenced() {
  734. /* 449 */ return this._silenced;
  735. /* */ }
  736. /* */
  737. /* */ @EventHandler
  738. /* */ public void playerQuit(PlayerQuitEvent event) {
  739. /* 454 */ this._playerLastMessage.remove(event.getPlayer().getUniqueId());
  740. /* */ }
  741. /* */
  742. /* */ public void setThreeSecondDelay(boolean b) {
  743. /* 458 */ this._threeSecondDelay = b;
  744. /* */ }
  745. /* */ }
  746.  
  747.  
  748. /* Location: C:\Users\Tilen\Desktop\Fake Servers\Mineplex\2015 test\Lobby-1\plugins\Hub.jar!\mineplex\core\chat\Chat.class
  749. * Java compiler version: 7 (51.0)
  750. * JD-Core Version: 0.7.1
  751. */
Advertisement
Add Comment
Please, Sign In to add comment