/* Class525 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class Class525 {
	public static Class525 aClass525_6997 = new Class525(0);
	public static Class525 aClass525_6998;
	public static Class525 aClass525_6999 = new Class525(1);
	static Class135 aClass135_7000;

	Class525(int i) {
		/* empty */
	}

	static {
		aClass525_6998 = new Class525(2);
	}

	static void method11689(Class457 class457, byte i) {
		Class14.aClass457_137 = class457;
	}

	static final void method11690(Class477 class477, short i) {
		int i_0_ = (((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 -= 1577301031) * 2028895127]);
		Class35 class35 = Class109.method2606(i_0_, -742414876);
		Class118 class118 = Class35.aClass118Array464[i_0_ >> 16];
		Class570.method12355(class35, class118, false, 1, class477, 1495260434);
	}

	static final void method11691(Class477 class477, int i) {
		int i_1_ = (((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 -= 1577301031) * 2028895127]);
		if (Class92_Sub17.aClass200Array8765 != null && i_1_ < -1463267015 * Class436.anInt6285 && (Class92_Sub17.aClass200Array8765[i_1_].aString2436.equalsIgnoreCase(Class454.aClass497_Sub1_Sub3_Sub5_Sub1_6388.aString11111)))
			((Class477) class477).anIntArray6497[((((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1)] = 1;
		else
			((Class477) class477).anIntArray6497[((((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1)] = 0;
	}

	static final void method11692(Class477 class477, byte i) {
		((Class477) class477).anInt6498 -= -1140365234;
		int i_2_ = (((Class477) class477).anIntArray6497[2028895127 * ((Class477) class477).anInt6498]);
		boolean bool = 1 == (((Class477) class477).anIntArray6497[2028895127 * ((Class477) class477).anInt6498 + 1]);
		((Class477) class477).anObjectArray6499[(((Class477) class477).anInt6500 += 1803340247) * -443336217 - 1] = Class573.method12396(i_2_, bool, (byte) -41);
	}

	static void method11693(int i) {
		Class187.aClass113_2234.method2646((byte) 1);
	}

	public static void method11694(String string, boolean bool, boolean bool_3_, byte i) {
		do {
			try {
				if (string.equalsIgnoreCase("commands") || string.equalsIgnoreCase("help")) {
					Class319.method6276("commands - This command", 1468322118);
					Class319.method6276("cls - Clear console", 1468322118);
					Class319.method6276("displayfps - Toggle FPS and other information", 1468322118);
					Class319.method6276("renderer - Print graphics renderer information", 1468322118);
					Class319.method6276("heap - Print java memory information", 1468322118);
					Class319.method6276("getcamerapos - Print location and direction of camera for use in bug reports", 1468322118);
				} else if (string.equalsIgnoreCase("cls")) {
					Class184.anInt2215 = 0;
					Class184.anInt2207 = 0;
				} else if (string.equalsIgnoreCase("displayfps")) {
					client.aBool8115 = !client.aBool8115;
					if (client.aBool8115)
						Class319.method6276("FPS on", 1468322118);
					else
						Class319.method6276("FPS off", 1468322118);
				} else if (string.equals("renderer")) {
					Class170 class170 = Class327.aClass84_5125.method1914();
					Class319.method6276(new StringBuilder().append("Toolkit ID: ").append(Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8629.method13917(946578383)).toString(), 1468322118);
					Class319.method6276(new StringBuilder().append("Vendor: ").append(350841811 * class170.anInt2130).toString(), 1468322118);
					Class319.method6276(new StringBuilder().append("Name: ").append(class170.aString2129).toString(), 1468322118);
					Class319.method6276(new StringBuilder().append("Version: ").append(class170.anInt2136 * 35291603).toString(), 1468322118);
					Class319.method6276(new StringBuilder().append("Device: ").append(class170.aString2137).toString(), 1468322118);
					Class319.method6276(new StringBuilder().append("Driver Version: ").append(4701298338918313193L * class170.aLong2138).toString(), 1468322118);
				} else if (string.equals("heap"))
					Class319.method6276(new StringBuilder().append("Heap: ").append(Class238.anInt2813 * -197065905).append("MB").toString(), 1468322118);
				else {
					if (!string.equalsIgnoreCase("getcamerapos"))
						break;
					Class538 class538 = client.aClass237_8070.method4789((byte) -110);
					Class319.method6276(new StringBuilder().append("Pos: ").append(Class454.aClass497_Sub1_Sub3_Sub5_Sub1_6388.aByte8402).append(",").append((class538.anInt7085 * 1532636785 + (Class92_Sub14.anInt8754 * -1297049311 >> 9)) >> 6).append(",").append(((Class348_Sub3.anInt10169 * -1558380401 >> 9) + -438699449 * class538.anInt7083) >> 6).append(",").append(((Class92_Sub14.anInt8754 * -1297049311 >> 9) + class538.anInt7085 * 1532636785) & 0x3f).append(",").append(((-1558380401 * Class348_Sub3.anInt10169 >> 9) + class538.anInt7083 * -438699449) & 0x3f).append(" Height: ").append((Class280.method5677(Class92_Sub14.anInt8754 * -1297049311, Class348_Sub3.anInt10169 * -1558380401, (Class454.aClass497_Sub1_Sub3_Sub5_Sub1_6388.aByte8402), 16711935)) - Class193.anInt2310 * -1051887285).toString(), 1468322118);
					Class319.method6276(new StringBuilder().append("Look: ").append(Class454.aClass497_Sub1_Sub3_Sub5_Sub1_6388.aByte8402).append(",").append((1420186967 * Class471.anInt6463 + class538.anInt7085 * 1532636785) >> 6).append(",").append((-438699449 * class538.anInt7083 + Class426.anInt6202 * -640338569) >> 6).append(",").append((1532636785 * class538.anInt7085 + Class471.anInt6463 * 1420186967) & 0x3f).append(",").append((class538.anInt7083 * -438699449 + -640338569 * Class426.anInt6202) & 0x3f).append(" Height: ").append((Class280.method5677(Class471.anInt6463 * 1420186967, Class426.anInt6202 * -640338569, (Class454.aClass497_Sub1_Sub3_Sub5_Sub1_6388.aByte8402), 16711935)) - Class526.anInt7003 * 361847479).toString(), 1468322118);
				}
			} catch (Exception exception) {
				Class319.method6276((Class404.aClass404_5782.method7191(Class316.aClass469_4747, -697385825)), 1468322118);
			}
			return;
		} while (false);
		if (Class495.aClass495_6658 != Class401.aClass495_5754 || client.anInt8213 * 1038386101 >= 2) {
			try {
				if (string.equalsIgnoreCase("wm1")) {
					Class421.method7658(1, -1, -1, false, (byte) 44);
					if (Class92_Sub10.method14665((byte) 36) == 1)
						Class319.method6276("Success", 1468322118);
					else
						Class319.method6276("Failure", 1468322118);
					return;
				}
				if (string.equalsIgnoreCase("wm2")) {
					Class421.method7658(2, -1, -1, false, (byte) 74);
					if (Class92_Sub10.method14665((byte) 112) == 2)
						Class319.method6276("Success", 1468322118);
					else
						Class319.method6276("Failure", 1468322118);
					return;
				}
				if (Class423.aBool6174 && string.equalsIgnoreCase("wm3")) {
					Class421.method7658(3, 1024, 768, false, (byte) 94);
					if (Class92_Sub10.method14665((byte) 22) == 3)
						Class319.method6276("Success", 1468322118);
					else
						Class319.method6276("Failure", 1468322118);
					return;
				}
				if (string.startsWith("setlobby ")) {
					int i_4_ = -1;
					Object object = null;
					string = string.substring(9);
					int i_5_ = string.indexOf(' ');
					if (i_5_ == -1)
						Class319.method6276("Failure", 1468322118);
					else {
						try {
							i_4_ = Integer.parseInt(string.substring(0, i_5_));
						} catch (NumberFormatException numberformatexception) {
							/* empty */
						}
						if (i_4_ == -1)
							Class319.method6276("Failure", 1468322118);
						else {
							String string_6_ = new StringBuilder().append(string.substring(1 + i_5_).trim()).append(".runescape.com").toString();
							Class128.method3059(string_6_, i_4_, -1997913143);
							Class319.method6276("Success", 1468322118);
							return;
						}
						return;
					}
					return;
				}
				if (string.startsWith("setmediastream ")) {
					int i_7_ = -1;
					Object object = null;
					string = string.substring(15);
					int i_8_ = string.indexOf(' ');
					if (-1 == i_8_)
						Class319.method6276("Failure", 1468322118);
					else {
						try {
							i_7_ = Integer.parseInt(string.substring(0, i_8_));
						} catch (NumberFormatException numberformatexception) {
							/* empty */
						}
						if (i_7_ == -1)
							Class319.method6276("Failure", 1468322118);
						else {
							String string_9_ = new StringBuilder().append(string.substring(i_8_ + 1).trim()).append(".runescape.com").toString();
							Class324.method6302(string_9_, i_7_, (short) 29820);
							Class269.aClass285_4170.method5705(Class408.aClass613_5973.aString7840, Class408.aClass613_5973.method13071(-727117538), -1869684889);
							Class211.aClass265_2551.method5271((byte) -94);
							Class319.method6276("Success", 1468322118);
							return;
						}
						return;
					}
					return;
				}
				if (string.equalsIgnoreCase("tk0")) {
					Class621.method13178(0, false, -1761983479);
					if (Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8629.method13917(118491114) == 0) {
						Class319.method6276("Success", 1468322118);
						Class92_Sub20.aClass587_Sub11_10075.method14590((Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8645), 0, -760826150);
						Class106.method2583(1338164479);
						client.aBool8022 = false;
					} else
						Class319.method6276("Failure", 1468322118);
					return;
				}
				if (string.equalsIgnoreCase("tk1")) {
					Class621.method13178(1, false, 1318248036);
					if (Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8629.method13917(1665561969) == 1) {
						Class319.method6276("Success", 1468322118);
						Class92_Sub20.aClass587_Sub11_10075.method14590((Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8645), 1, 805352120);
						Class106.method2583(1338164479);
						client.aBool8022 = false;
					} else
						Class319.method6276("Failure", 1468322118);
					return;
				}
				if (string.equalsIgnoreCase("tk3")) {
					Class621.method13178(3, false, -945099814);
					if (Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8629.method13917(-224149398) == 3) {
						Class319.method6276("Success", 1468322118);
						Class92_Sub20.aClass587_Sub11_10075.method14590((Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8645), 3, -2092157321);
						Class106.method2583(1338164479);
						client.aBool8022 = false;
					} else
						Class319.method6276("Failure", 1468322118);
					return;
				}
				if (string.equalsIgnoreCase("tk5")) {
					Class621.method13178(5, false, 767750681);
					if (Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8629.method13917(-267193901) == 5) {
						Class319.method6276("Success", 1468322118);
						Class92_Sub20.aClass587_Sub11_10075.method14590((Class92_Sub20.aClass587_Sub11_10075.aClass441_Sub19_8645), 5, 75347101);
						Class106.method2583(1338164479);
						client.aBool8022 = false;
					} else
						Class319.method6276("Failure", 1468322118);
					return;
				}
				if (string.equalsIgnoreCase("clientdrop")) {
					if (0 == client.anInt8013 * 906940163)
						Class599.method12907(-1691830364);
					else if (906940163 * client.anInt8013 == 6)
						client.aClass190_8065.aBool2281 = true;
					return;
				}
				if (string.equalsIgnoreCase("breakcon")) {
					Class190[] class190s = client.aClass190Array8254;
					for (int i_10_ = 0; i_10_ < class190s.length; i_10_++) {
						Class190 class190 = class190s[i_10_];
						if (class190.method3963(-1747326973) != null)
							class190.method3963(-2125022522).method12368(1228987292);
					}
					Class121.aClass275_1667.method5398((byte) 2);
					return;
				}
				if (string.startsWith("getclientvarpbit")) {
					int i_11_ = Integer.parseInt(string.substring(17));
					Class319.method6276(new StringBuilder().append("varpbit=").append(Class246.aClass5_3969.method85(Class246.aClass5_3969.method70(i_11_, -798534234), (byte) -67)).toString(), 1468322118);
					return;
				}
				if (string.startsWith("getclientvarp")) {
					int i_12_ = Integer.parseInt(string.substring(14));
					Class319.method6276(new StringBuilder().append("varp=").append(Class246.aClass5_3969.method82((Class246.aClass5_3969.method77(Class212.aClass212_2560, i_12_, 1599214059)), (byte) 125)).toString(), 1468322118);
					return;
				}
				if (string.startsWith("directlogin")) {
					String[] strings = Class490.method11125(string.substring(12), ' ', 1738526254);
					if (strings.length == 2)
						Class546.method11948(strings[0], strings[1], -198835277);
					return;
				}
				if (string.startsWith("snlogin ")) {
					String[] strings = Class490.method11125(string.substring(8), ' ', 1738526254);
					int i_13_ = Integer.parseInt(strings[0]);
					Class325.method6311(i_13_, 339888278);
					return;
				}
				if (string.startsWith("setoutput ")) {
					File file = new File(string.substring(10));
					if (file.exists()) {
						file = new File(new StringBuilder().append(string.substring(10)).append(".").append(Class121.method2891(2043651021)).append(".log").toString());
						if (file.exists()) {
							Class319.method6276("file already exists!", 1468322118);
							return;
						}
					}
					if (Class184.aFileOutputStream2212 != null) {
						Class184.aFileOutputStream2212.close();
						Class184.aFileOutputStream2212 = null;
					}
					try {
						Class184.aFileOutputStream2212 = new FileOutputStream(file);
					} catch (FileNotFoundException filenotfoundexception) {
						Class319.method6276(new StringBuilder().append("Could not create ").append(file.getName()).toString(), 1468322118);
					} catch (SecurityException securityexception) {
						Class319.method6276(new StringBuilder().append("Cannot write to ").append(file.getName()).toString(), 1468322118);
					}
					return;
				}
				if (string.equals("closeoutput")) {
					if (null != Class184.aFileOutputStream2212)
						Class184.aFileOutputStream2212.close();
					Class184.aFileOutputStream2212 = null;
					return;
				}
				if (string.startsWith("runscript ")) {
					File file = new File(string.substring(10));
					if (!file.exists()) {
						Class319.method6276("No such file", 1468322118);
						return;
					}
					byte[] is = Class628.method13233(file, (byte) 12);
					if (is == null) {
						Class319.method6276("Failed to read file", 1468322118);
						return;
					}
					String[] strings = (Class490.method11125(Class132.method3082(Class87.method2293(is, 353443696), '\r', "", 1303273349), '\n', 1738526254));
					Class206.method4389(strings, -1038735522);
				}
				if (client.anInt8013 * 906940163 == 0 || client.anInt8013 * 906940163 == 7) {
					Class190 class190 = Class587_Sub22.method15814(-16711936);
					Class587_Sub45 class587_sub45 = Class70.method1609(Class320.aClass320_4854, class190.aClass426_2279, 2042697197);
					class587_sub45.aClass587_Sub4_Sub1_9890.method14416(string.length() + 3, 1302373931);
					class587_sub45.aClass587_Sub4_Sub1_9890.method14416(bool ? 1 : 0, 1302373931);
					class587_sub45.aClass587_Sub4_Sub1_9890.method14416(bool_3_ ? 1 : 0, 1302373931);
					class587_sub45.aClass587_Sub4_Sub1_9890.method14382(string, -70739132);
					class190.method3964(class587_sub45, 2048259310);
				}
			} catch (Exception exception) {
				Class319.method6276((Class404.aClass404_5782.method7191(Class316.aClass469_4747, -560853489)), 1468322118);
				return;
			}
		}
		if (0 != client.anInt8013 * 906940163 && 7 != client.anInt8013 * 906940163)
			Class319.method6276(new StringBuilder().append(Class404.aClass404_5784.method7191(Class316.aClass469_4747, -1133344348)).append(string).toString(), 1468322118);
	}
}
