Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Toolkit;
- import java.awt.datatransfer.StringSelection;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileReader;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.io.OutputStreamWriter;
- import java.net.Socket;
- import java.net.UnknownHostException;
- import java.util.ArrayList;
- import java.util.Iterator;
- public class NewClass
- implements Runnable {
- public String ircNick;
- public String ircLineStart = "[IRC]";
- public Socket ircSocket;
- private BufferedWriter ircWriter;
- private BufferedReader ircReader;
- private String B = "";
- private String jdField_k_of_type_JavaLangString = "";
- private ArrayList g = new ArrayList();
- private ArrayList j = new ArrayList();
- private ArrayList jdField_k_of_type_JavaUtilArrayList = new ArrayList();
- private boolean D = true;
- private boolean u;
- public static ArrayList i = new ArrayList();
- public void run() {
- try {
- H();
- this.ircSocket = new Socket(mR.ao, mR.bR);
- this.ircWriter = new BufferedWriter(new OutputStreamWriter(this.ircSocket.getOutputStream()));
- this.ircReader = new BufferedReader(new InputStreamReader(this.ircSocket.getInputStream()));
- this.ircWriter.write("NICK " + ircNick + "\n");
- this.ircWriter.write("USER " + ircNick + " - - :" + ircNick + "\n");
- this.ircWriter.flush();
- String str1;
- while (((str1 = this.ircReader.readLine()) != null) && (mS.K.w())) {
- str1 = str1.replaceAll("§", "");
- if (str1.contains("PING")) {
- this.ircWriter.write("PONG " + str1.substring(str1.indexOf(":")) + "\n");
- this.ircWriter.flush();
- continue;
- }
- if (str1.contains(" MODE " + ircNick)) {
- if (!mR.as.equals("null")) {
- G();
- }
- d(mR.ap, mR.aq);
- continue;
- }
- String str2;
- if ((str1.contains(" NOTICE ")) && (str1.startsWith(":NickServ!"))) {
- str2 = str1.substring(str1.indexOf(":", str1.indexOf("NOTICE")) + 1);
- mR.jdField_a_of_type_Nd.h("§c" + str2, false);
- continue;
- }
- Object localObject1;
- if (str1.contains(" PRIVMSG ")) {
- str2 = str1.substring(str1.indexOf(":", str1.indexOf("PRIVMSG")) + 1);
- localObject1 = str1.substring(1, str1.indexOf("!"));
- str1 = str1.replace("§", "");
- if (str2.contains("\001VERSION\001")) {
- B((String)localObject1);
- continue;
- }
- if (!i.contains(((String)localObject1).toLowerCase())) {
- if (((str2.startsWith("GET_SERVER")) || (str2.startsWith("SET_SERVER"))) && (str1.toLowerCase().contains(mR.ap.toLowerCase()))) {
- continue;
- }
- if (((str2.startsWith("GET_SERVER")) || (str2.startsWith("SET_SERVER"))) && (!str1.toLowerCase().contains(mR.ap.toLowerCase()))) {
- if (str2.contains("GET_SERVER")) {
- h((String)localObject1, str2);
- } else {
- e((String)localObject1, str2);
- }
- } else if (str1.toLowerCase().contains(mR.ap.toLowerCase())) {
- mR.jdField_a_of_type_Nd.h(ircLineStart + "§" + a((String)localObject1, false) + (String)localObject1 + "§f: " + str2, false);
- } else {
- mR.jdField_a_of_type_Nd.h(ircLineStart + "§" + a((String)localObject1, false) + (String)localObject1 + " §f-> " + "§" + a(ircNick, false) + ircNick + "§f: " + str2, false);
- }
- }
- continue;
- }
- if (str1.contains(" 353 ")) {
- if (this.u) {
- this.jdField_k_of_type_JavaUtilArrayList.clear();
- this.g.clear();
- this.j.clear();
- this.u = false;
- }
- str2 = str1.substring(str1.lastIndexOf(":") + 1);
- if (!str2.substring(0, str2.length() - 1).contains(" ")) {
- this.jdField_k_of_type_JavaUtilArrayList.add(f(str2));
- continue;
- }
- localObject1 = str2.trim().split(" ");
- for (String str3 : localObject1) {
- this.jdField_k_of_type_JavaUtilArrayList.add(f(str3));
- }
- continue;
- }
- if (str1.contains(" 366 ")) {
- this.u = true;
- if (!this.D) {
- continue;
- }
- this.D = false;
- str2 = mT.a.h() + "Online Users (" + this.jdField_k_of_type_JavaUtilArrayList.size() + "): " + mT.b.h();
- localObject1 = this.jdField_k_of_type_JavaUtilArrayList.iterator();
- while (((Iterator)localObject1).hasNext()) {
- ? ? ? = ((Iterator)localObject1).next();
- str2 = str2 + "§" + a(? ? ?.toString()
- , true) + ???.toString() + mT.b.h() + ", ";
- }
- str2 = str2.substring(0, str2.length() - 2);
- mR.jdField_a_of_type_Nd.h(str2, false);
- continue;
- }
- if (str1.contains(" JOIN ")) {
- if (mS.K.n(1)) {
- mR.jdField_a_of_type_Nd.h(ircLineStart + str1.substring(1, str1.indexOf("!")) + " has joined IRC.", false);
- }
- F();
- continue;
- }
- if ((str1.contains(" QUIT ")) || (str1.contains(" PART "))) {
- if (!mS.K.n(1)) {
- continue;
- }
- mR.jdField_a_of_type_Nd.h(ircLineStart + str1.substring(1, str1.indexOf("!")) + " has left IRC.", false);
- continue;
- }
- if (str1.contains(" KICK ")) {
- str2 = str1.substring(str1.indexOf("KICK"));
- localObject1 = str2.split(" ");
- if (localObject1[2].equalsIgnoreCase(ircNick)) {
- mR.jdField_a_of_type_Nd.h(ircLineStart + "You have been kicked from IRC.", false);
- mS.K.f(false);
- mS.L.f(false);
- mS.L.f(false);
- break;
- }
- mR.jdField_a_of_type_Nd.h(ircLineStart + localObject1[2] + " has been kicked from IRC.", false);
- continue;
- }
- if (!str1.contains(" 475 ")) {
- continue;
- }
- mR.jdField_a_of_type_Nd.h(ircLineStart + "This channel is password protected.", false);
- }
- this.ircSocket.close();
- this.ircWriter.close();
- this.ircReader.close();
- } catch (UnknownHostException localUnknownHostException) {
- localUnknownHostException.printStackTrace();
- } catch (IOException localIOException) {
- localIOException.printStackTrace();
- }
- }
- public void B(String paramString) {
- try {
- this.ircWriter.write("PRIVMSG " + paramString + " :" + "\001VERSION Client: Nodus\001\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public String f(String paramString) {
- if ((paramString.charAt(0) == '@') || ((paramString.charAt(0) == '~') && (!this.g.contains(paramString)))) {
- paramString = paramString.substring(1);
- this.g.add(paramString.toLowerCase());
- } else if ((paramString.charAt(0) == '+') && (!this.j.contains(paramString))) {
- paramString = paramString.substring(1);
- this.j.add(paramString.toLowerCase());
- } else if ((paramString.charAt(0) == '%') || (paramString.charAt(0) == '&')) {
- paramString = paramString.substring(1);
- }
- return paramString;
- }
- public void g(String paramString1, String paramString2) {
- try {
- this.jdField_k_of_type_JavaLangString = paramString2;
- this.ircWriter.write("PRIVMSG NICKSERV :REGISTER " + paramString1 + " " + paramString2 + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public void G() {
- try {
- this.ircWriter.write("PRIVMSG NICKSERV :IDENTIFY " + mR.as + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public void A(String paramString) {
- try {
- this.ircWriter.write("KICK " + mR.ap + " " + paramString + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public void e(String paramString1, String paramString2) {
- String[] arrayOfString = paramString2.split(";");
- if (arrayOfString.length < 4) {
- return;
- }
- if ((arrayOfString[1].equalsIgnoreCase(ircNick)) && (paramString1.equalsIgnoreCase(this.B))) {
- if (arrayOfString[2].equals("127.0.0.1")) {
- mR.jdField_a_of_type_Nd.h(ircLineStart + new StringBuilder().append(paramString1).append(" is not in a server.").toString(), false);
- } else {
- mR.jdField_a_of_type_Nd.h(ircLineStart + paramString1 + " is on server " + arrayOfString[2] + ":" + arrayOfString[3] + " as " + arrayOfString[4], false);
- mR.jdField_a_of_type_Nd.h(ircLineStart + "Address added to clipboard.", false);
- String str = arrayOfString[2] + ":" + arrayOfString[3];
- StringSelection localStringSelection = new StringSelection(str);
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(localStringSelection, null);
- }
- this.B = "";
- }
- }
- public void h(String paramString1, String paramString2) {
- try {
- String[] arrayOfString = paramString2.split(";");
- if (arrayOfString.length < 1) {
- return;
- }
- if (arrayOfString[1].equalsIgnoreCase(ircNick)) {
- if (mS.N.w()) {
- this.ircWriter.write("PRIVMSG " + paramString1 + " :SET_SERVER;" + paramString1 + ";" + mR.s + ";" + mR.y + ";" + mR.i.b.jdField_k_of_type_JavaLangString + "\n");
- this.ircWriter.flush();
- } else {
- this.ircWriter.write("PRIVMSG " + paramString1 + " :SET_SERVER;" + paramString1 + ";127.0.0.1;25565;" + mR.i.b.jdField_k_of_type_JavaLangString + "\n");
- this.ircWriter.flush();
- }
- }
- } catch (Exception localException) {
- }
- }
- public void E(String paramString) {
- try {
- this.B = paramString;
- mR.jdField_a_of_type_Nd.h(ircLineStart + "Attempting to get " + paramString + "'s server.", false);
- this.ircWriter.write("PRIVMSG " + paramString + " :GET_SERVER;" + paramString + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public void C(String paramString) {
- try {
- mR.jdField_a_of_type_Nd.h(ircLineStart + "§" + a(ircNick, false) + ircNick + "§f: " + paramString, false);
- this.ircWriter.write("PRIVMSG " + mR.ap + " :" + paramString + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public void f(String paramString1, String paramString2) {
- try {
- mR.jdField_a_of_type_Nd.h(ircLineStart + "§" + a(ircNick, false) + ircNick + " §f-> " + "§" + a(paramString1, false) + "§f:" + paramString2, false);
- this.ircWriter.write("PRIVMSG " + paramString1 + " :" + paramString2 + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public void y() {
- try {
- this.D = true;
- this.ircWriter.write("NAMES " + mR.ap + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public void F() {
- try {
- this.ircWriter.write("NAMES " + mR.ap + "\n");
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public char a(String paramString, boolean paramBoolean) {
- if (this.g.contains(paramString.toLowerCase())) {
- return 'c';
- }
- if (this.j.contains(paramString.toLowerCase())) {
- return '5';
- }
- if (!paramBoolean) {
- return mT.c.a();
- }
- return 'f';
- }
- public void d(String paramString1, String paramString2) {
- try {
- this.D = true;
- this.ircWriter.write("PART " + mR.ap + "\n");
- this.ircWriter.write("JOIN " + paramString1 + (!paramString2.equals("") ? " " + paramString2 : "") + "\n");
- mR.ap = paramString1;
- mR.aq = paramString2;
- mR.jdField_a_of_type_LB.F();
- this.ircWriter.flush();
- } catch (Exception localException) {
- }
- }
- public static File c() {
- return new File(lB.e, "ignore.txt");
- }
- public static void H() {
- try {
- BufferedReader localBufferedReader = new BufferedReader(new FileReader(c()));
- String str;
- for (int m = 0; (str = localBufferedReader.readLine()) != null; m++) {
- i.add(str.toLowerCase());
- }
- localBufferedReader.close();
- } catch (Exception localException) {
- }
- }
- public void E() {
- try {
- BufferedWriter localBufferedWriter = new BufferedWriter(new FileWriter(c()));
- for (int m = 0; m < i.size(); m++) {
- localBufferedWriter.write((String)i.get(m) + "\r\n");
- }
- localBufferedWriter.close();
- } catch (Exception localException) {
- }
- }
- }
- /* Location: L:\Minecraft\Nodus2\data\.minecraft\bin\minecraft.jar
- * Qualified Name: nn
- * JD-Core Version: 0.6.0
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement