/* Class212 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentLinkedQueue;

public final class Class212
{
    static Map aMap2428;
    public static final long aLong2429 = 60000L;
    static HashMap aHashMap2430 = new HashMap();
    public static final long aLong2431 = 1000L;
    public static int anInt2432;
    static int anInt2433;
    
    public static String method3098(Date date, String string, int i) {
	return method3099(date, string, method3101(-1941417231),
			  Class621.aClass621_8076, 383636055);
    }
    
    static String method3099(Date date, String string, TimeZone timezone,
			     Class621 class621, int i) {
	if (null == aMap2428) {
	    aMap2428 = new HashMap(7);
	    Class621[] class621s = Class621.method7462(-214968742);
	    for (int i_0_ = 0; i_0_ < class621s.length; i_0_++) {
		Class621 class621_1_ = class621s[i_0_];
		aMap2428.put(class621_1_, new ConcurrentLinkedQueue());
	    }
	}
	ConcurrentLinkedQueue concurrentlinkedqueue
	    = (ConcurrentLinkedQueue) aMap2428.get(class621);
	SimpleDateFormat simpledateformat
	    = (SimpleDateFormat) concurrentlinkedqueue.poll();
	if (null == simpledateformat)
	    simpledateformat
		= new SimpleDateFormat(string,
				       class621.method7460(1047441528));
	else
	    simpledateformat.applyPattern(string);
	simpledateformat.setTimeZone(timezone);
	String string_2_ = simpledateformat.format(date);
	concurrentlinkedqueue.add(simpledateformat);
	return string_2_;
    }
    
    static TimeZone method3100(String string, int i) {
	synchronized (aHashMap2430) {
	    TimeZone timezone = (TimeZone) aHashMap2430.get(string);
	    if (null == timezone) {
		timezone = TimeZone.getTimeZone(string);
		aHashMap2430.put(string, timezone);
	    }
	    TimeZone timezone_3_ = timezone;
	    return timezone_3_;
	}
    }
    
    static {
	Calendar.getInstance(method3100("Europe/London", -627637219));
    }
    
    Class212() throws Throwable {
	throw new Error();
    }
    
    static TimeZone method3101(int i) {
	return method3100("Europe/London", -627637219);
    }
    
    public static void method3102(String string, boolean bool, byte i) {
	if (client.anInt10701 * 487402729 == 5
	    && (!Class258.method3633(90368997)
		&& !Class14.method588((byte) 35))) {
	    Class24.aString336 = string;
	    Class24.aBool360 = bool;
	    Class579.method7065(7, -2031796992);
	}
    }
    
    static final void method3103(Class612 class612, byte i) {
	if ((((Class612) class612).anIntArray8021
	     [(((Class612) class612).anInt8022 -= 201091009) * -40654783])
	    == 0)
	    ((Class612) class612).anInt8026
		+= ((((Class612) class612).anIntArray8041
		     [((Class612) class612).anInt8026 * 1776597551])
		    * -1554985777);
    }
    
    static final void method3104(Class612 class612, int i) {
	((Class612) class612).anIntArray8021
	    [(((Class612) class612).anInt8022 += 201091009) * -40654783 - 1]
	    = Class24.anInt369 * 310852985;
    }
    
    public static void method3105(String string, boolean bool, boolean bool_4_,
				  int i) {
	do {
	    try {
		if (string.equalsIgnoreCase("commands")
		    || string.equalsIgnoreCase("help")) {
		    Class203.method3003("commands - This command", (byte) -52);
		    Class203.method3003("cls - Clear console", (byte) -21);
		    Class203.method3003
			("displayfps - Toggle FPS and other information",
			 (byte) 11);
		    Class203.method3003
			("renderer - Print graphics renderer information",
			 (byte) -10);
		    Class203.method3003("heap - Print java memory information",
					(byte) -60);
		    Class203.method3003
			("getcamerapos - Print location and direction of camera for use in bug reports",
			 (byte) 39);
		} else if (string.equalsIgnoreCase("cls")) {
		    Class74.anInt1072 = 0;
		    Class74.anInt1069 = 0;
		} else if (string.equalsIgnoreCase("displayfps")) {
		    client.aBool10673 = !client.aBool10673;
		    if (client.aBool10673)
			Class203.method3003("FPS on", (byte) -4);
		    else
			Class203.method3003("FPS off", (byte) -36);
		} else if (string.equals("renderer")) {
		    Class127 class127 = Class463.aClass151_5283.method2285();
		    Class203.method3003(new StringBuilder().append
					    ("Toolkit ID: ").append
					    (Class447.aClass487_Sub42_5156
						 .aClass637_Sub8_10521
						 .method9667((byte) 1))
					    .toString(),
					(byte) -76);
		    Class203.method3003(new StringBuilder().append
					    ("Vendor: ").append
					    (class127.anInt1521 * -1258796247)
					    .toString(),
					(byte) -11);
		    Class203.method3003(new StringBuilder().append
					    ("Name: ").append
					    (class127.aString1522).toString(),
					(byte) 66);
		    Class203.method3003(new StringBuilder().append
					    ("Version: ").append
					    (717008391 * class127.anInt1525)
					    .toString(),
					(byte) 72);
		    Class203.method3003(new StringBuilder().append
					    ("Device: ").append
					    (class127.aString1524).toString(),
					(byte) 26);
		    Class203.method3003(new StringBuilder().append
					    ("Driver Version: ").append
					    (-8392948771255560383L
					     * class127.aLong1518)
					    .toString(),
					(byte) 51);
		    String string_5_ = Class463.aClass151_5283.method2005();
		    if (string_5_.length() > 0)
			Class203.method3003(string_5_, (byte) -19);
		} else if (string.equals("heap"))
		    Class203.method3003(new StringBuilder().append
					    ("Heap: ").append
					    (-1814986017 * Class473.anInt5401)
					    .append
					    ("MB").toString(),
					(byte) -92);
		else if (string.equalsIgnoreCase("getcamerapos")) {
		    Class546 class546
			= client.aClass452_10749.method5499((byte) 55);
		    if (1 == Class168.anInt1964 * -532631733) {
			Class396 class396 = Class127.aClass258_Sub1_1526
						.method3590((byte) -13);
			Class396 class396_6_ = Class127.aClass258_Sub1_1526
						   .method3592(560325403);
			Class203.method3003
			    (new StringBuilder().append("Pos: ").append
				 (new Class546
				      ((Class54
					.aClass590_Sub1_Sub5_Sub1_Sub2_626
					.aByte10415),
				       (int) class396.aFloat4545 >> 9,
				       (int) class396.aFloat4547 >> 9)
				      .toString())
				 .append
				 (" Height: ").append
				 ((Class341.method4355
				   (((int) class396.aFloat4545
				     - (-494362861 * class546.anInt7397 << 9)),
				    ((int) class396.aFloat4547
				     - (1139830351 * class546.anInt7398 << 9)),
				    (Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626
				     .aByte10415),
				    -302581023)) + (int) class396.aFloat4542)
				 .toString(),
			     (byte) 42);
			Class203.method3003
			    (new StringBuilder().append("Look: ").append
				 (new Class546
				      ((Class54
					.aClass590_Sub1_Sub5_Sub1_Sub2_626
					.aByte10415),
				       (int) class396_6_.aFloat4545 >> 9,
				       (int) class396_6_.aFloat4547 >> 9)
				      .toString())
				 .append
				 (" Height: ").append
				 ((Class341.method4355
				   (((int) class396_6_.aFloat4545
				     - (-494362861 * class546.anInt7397 << 9)),
				    ((int) class396.aFloat4547
				     - (class546.anInt7398 * 1139830351 << 9)),
				    (Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626
				     .aByte10415),
				    1047121566)) + (int) class396.aFloat4542)
				 .toString(),
			     (byte) 77);
		    } else {
			Class203.method3003
			    (new StringBuilder().append("Pos: ").append
				 (Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626
				  .aByte10415)
				 .append
				 (",").append
				 ((-494362861 * class546.anInt7397
				   + (674126929 * Class79.anInt1121 >> 9))
				  >> 6)
				 .append
				 (",").append
				 (((1856271875 * Class450.anInt5163 >> 9)
				   + 1139830351 * class546.anInt7398) >> 6)
				 .append
				 (",").append
				 ((class546.anInt7397 * -494362861
				   + (674126929 * Class79.anInt1121 >> 9))
				  & 0x3f)
				 .append
				 (",").append
				 ((class546.anInt7398 * 1139830351
				   + (Class450.anInt5163 * 1856271875 >> 9))
				  & 0x3f)
				 .append
				 (" Height: ").append
				 ((Class341.method4355
				   (674126929 * Class79.anInt1121,
				    Class450.anInt5163 * 1856271875,
				    (Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626
				     .aByte10415),
				    2138344707))
				  - Class131.anInt1540 * 1273924633)
				 .toString(),
			     (byte) 55);
			Class203.method3003
			    (new StringBuilder().append("Look: ").append
				 (Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626
				  .aByte10415)
				 .append
				 (",").append
				 ((440211215 * Class347.anInt3686
				   + class546.anInt7397 * -494362861) >> 6)
				 .append
				 (",").append
				 ((61590831 * client.anInt10950
				   + class546.anInt7398 * 1139830351) >> 6)
				 .append
				 (",").append
				 ((-494362861 * class546.anInt7397
				   + 440211215 * Class347.anInt3686) & 0x3f)
				 .append
				 (",").append
				 ((client.anInt10950 * 61590831
				   + class546.anInt7398 * 1139830351) & 0x3f)
				 .append
				 (" Height: ").append
				 ((Class341.method4355
				   (Class347.anInt3686 * 440211215,
				    61590831 * client.anInt10950,
				    (Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626
				     .aByte10415),
				    -1999041280))
				  - Class404.anInt4596 * -221305509)
				 .toString(),
			     (byte) 36);
		    }
		} else if (string.equalsIgnoreCase("cam_shake_test")) {
		    Class487_Sub35_Sub9_Sub1 class487_sub35_sub9_sub1
			= new Class487_Sub35_Sub9_Sub1(0,
						       Class249.aClass249_2941,
						       Class387
							   .method4681(125),
						       2.0F);
		    Class127.aClass258_Sub1_1526
			.method3623(class487_sub35_sub9_sub1, 1830550959);
		} else {
		    if (!string.equalsIgnoreCase("cam_shake_reset"))
			break;
		    Class127.aClass258_Sub1_1526.method3583(505519314);
		}
	    } catch (Exception exception) {
		Class203.method3003
		    (Class14.aClass14_111
			 .method582(Class152_Sub4.aClass621_9504, 1260124887),
		     (byte) -72);
	    }
	    return;
	} while (false);
	if (Class607.aClass607_7988 != Class2.aClass607_18
	    || client.anInt10718 * 1925762073 >= 2) {
	    try {
		if (string.equalsIgnoreCase("wm1")) {
		    Class228.method3267(1, -1, -1, false, -1160720646);
		    if (Class180.method2708(-763497040) == 1)
			Class203.method3003("Success", (byte) 60);
		    else
			Class203.method3003("Failure", (byte) -3);
		    return;
		}
		if (string.equalsIgnoreCase("wm2")) {
		    Class228.method3267(2, -1, -1, false, 572472593);
		    if (Class180.method2708(-763497040) == 2)
			Class203.method3003("Success", (byte) 60);
		    else
			Class203.method3003("Failure", (byte) -97);
		    return;
		}
		if (Class632.aBool8130 && string.equalsIgnoreCase("wm3")) {
		    Class228.method3267(3, 1024, 768, false, 1275468862);
		    if (Class180.method2708(-763497040) == 3)
			Class203.method3003("Success", (byte) 31);
		    else
			Class203.method3003("Failure", (byte) -41);
		    return;
		}
		if (string.startsWith("setlobby ")) {
		    if (487402729 * client.anInt10701 != 14)
			Class203.method3003("Failure", (byte) 18);
		    else {
			int i_7_ = -1;
			Object object = null;
			string = string.substring(9);
			int i_8_ = string.indexOf(' ');
			if (-1 == i_8_)
			    Class203.method3003("Failure", (byte) -19);
			else {
			    try {
				i_7_
				    = Integer.parseInt(string.substring(0,
									i_8_));
			    } catch (NumberFormatException numberformatexception) {
				/* empty */
			    }
			    if (i_7_ == -1)
				Class203.method3003("Failure", (byte) 28);
			    else {
				String string_9_
				    = new StringBuilder().append
					  (string.substring(1 + i_8_).trim())
					  .append
					  (".runescape.com").toString();
				Class621.method7469(string_9_, i_7_,
						    847589207);
				Class203.method3003("Success", (byte) 35);
				return;
			    }
			    return;
			}
			return;
		    }
		    return;
		}
		if (string.startsWith("setmediastream ")) {
		    if (client.anInt10701 * 487402729 != 14)
			Class203.method3003("Failure", (byte) 89);
		    else {
			int i_10_ = -1;
			Object object = null;
			string = string.substring(15);
			int i_11_ = string.indexOf(' ');
			if (i_11_ == -1)
			    Class203.method3003("Failure", (byte) -81);
			else {
			    try {
				i_10_ = (Integer.parseInt
					 (string.substring(0, i_11_)));
			    } catch (NumberFormatException numberformatexception) {
				/* empty */
			    }
			    if (i_10_ == -1)
				Class203.method3003("Failure", (byte) -116);
			    else {
				String string_12_
				    = new StringBuilder().append
					  (string.substring(i_11_ + 1).trim())
					  .append
					  (".runescape.com").toString();
				Class404.method4921(string_12_, i_10_,
						    370284062);
				Class487_Sub33_Sub1.aClass442_11389.method5362
				    (Class298_Sub1.aClass677_9730.aString8548,
				     Class298_Sub1.aClass677_9730
					 .method8062(1466525461),
				     19007139);
				Class479_Sub2.aClass416_10069
				    .method5100(659408697);
				Class203.method3003("Success", (byte) 95);
				return;
			    }
			    return;
			}
			return;
		    }
		    return;
		}
		if (string.equalsIgnoreCase("tk0")) {
		    Class539.method6593(0, false, 2119623051);
		    if (Class447.aClass487_Sub42_5156.aClass637_Sub8_10521
			    .method9667((byte) 1)
			== 0) {
			Class203.method3003("Success", (byte) -8);
			Class447.aClass487_Sub42_5156.method9613
			    ((Class447.aClass487_Sub42_5156
			      .aClass637_Sub8_10503),
			     0, 674453470);
			Class443.method5373(191676560);
			client.aBool10699 = false;
		    } else
			Class203.method3003("Failure", (byte) 17);
		    return;
		}
		if (string.equalsIgnoreCase("tk1")) {
		    Class539.method6593(1, false, 2096843686);
		    if (Class447.aClass487_Sub42_5156.aClass637_Sub8_10521
			    .method9667((byte) 1)
			== 1) {
			Class203.method3003("Success", (byte) -18);
			Class447.aClass487_Sub42_5156.method9613
			    ((Class447.aClass487_Sub42_5156
			      .aClass637_Sub8_10503),
			     1, 605171146);
			Class443.method5373(343508943);
			client.aBool10699 = false;
		    } else
			Class203.method3003("Failure", (byte) -87);
		    return;
		}
		if (string.equalsIgnoreCase("tk3")) {
		    Class539.method6593(3, false, 2128412755);
		    if (Class447.aClass487_Sub42_5156.aClass637_Sub8_10521
			    .method9667((byte) 1)
			== 3) {
			Class203.method3003("Success", (byte) 80);
			Class447.aClass487_Sub42_5156.method9613
			    ((Class447.aClass487_Sub42_5156
			      .aClass637_Sub8_10503),
			     3, 2112945939);
			Class443.method5373(-1424406416);
			client.aBool10699 = false;
		    } else
			Class203.method3003("Failure", (byte) 18);
		    return;
		}
		if (string.equalsIgnoreCase("tk5")) {
		    Class539.method6593(5, false, 2114032876);
		    if (Class447.aClass487_Sub42_5156.aClass637_Sub8_10521
			    .method9667((byte) 1)
			== 5) {
			Class203.method3003("Success", (byte) 1);
			Class447.aClass487_Sub42_5156.method9613
			    ((Class447.aClass487_Sub42_5156
			      .aClass637_Sub8_10503),
			     5, 116565344);
			Class443.method5373(1375068471);
			client.aBool10699 = false;
		    } else
			Class203.method3003("Failure", (byte) 113);
		    return;
		}
		if (string.equalsIgnoreCase("clientdrop")) {
		    if (8 == 487402729 * client.anInt10701)
			Class224.method3242(812034835);
		    else if (client.anInt10701 * 487402729 == 15)
			client.aClass65_10744.aBool952 = true;
		    return;
		}
		if (string.equalsIgnoreCase("breakcon")) {
		    Class65[] class65s = client.aClass65Array10745;
		    for (int i_13_ = 0; i_13_ < class65s.length; i_13_++) {
			Class65 class65 = class65s[i_13_];
			if (class65.method1066((byte) -119) != null)
			    class65.method1066((byte) 97)
				.method6372((byte) 41);
		    }
		    Class417.aClass423_4673.method5166((byte) 69);
		    return;
		}
		if (string.startsWith("getclientvarpbit")) {
		    int i_14_ = Integer.parseInt(string.substring(17));
		    Class203.method3003(new StringBuilder().append
					    ("varpbit=").append
					    (Class452.aClass69_5208.method53
					     (Class452.aClass69_5208
						  .method56(i_14_, 1209020815),
					      (byte) -4))
					    .toString(),
					(byte) -46);
		    return;
		}
		if (string.startsWith("getclientvarp")) {
		    int i_15_ = Integer.parseInt(string.substring(14));
		    Class203.method3003(new StringBuilder().append("varp=")
					    .append
					    (Class452.aClass69_5208.method52
					     ((Class452.aClass69_5208.method58
					       (Class430.aClass430_5007, i_15_,
						1212908985)),
					      1907742213))
					    .toString(),
					(byte) -75);
		    return;
		}
		if (string.startsWith("directlogin")) {
		    String[] strings
			= Class429.method5254(string.substring(12), ' ',
					      (byte) -78);
		    if (strings.length == 2 || 3 == strings.length) {
			if (Class258.method3633(90368997))
			    Class25.method733(-494939240);
			Class430_Sub5.method9022(strings[0], strings[1],
						 (strings.length > 2
						  ? strings[2] : ""),
						 true, -1016559344);
		    }
		    return;
		}
		if (string.startsWith("snlogin ")) {
		    String[] strings = Class429.method5254(string.substring(8),
							   ' ', (byte) -27);
		    int i_16_ = Integer.parseInt(strings[0]);
		    String string_17_ = strings.length > 1 ? strings[1] : "";
		    Class43.method864(i_16_, string_17_, true, (short) 32766);
		    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
					    (Class222.method3225(1948227557))
					    .append
					    (".log").toString());
			if (file.exists()) {
			    Class203.method3003("file already exists!",
						(byte) 9);
			    return;
			}
		    }
		    if (Class259.aFileOutputStream3082 != null) {
			Class259.aFileOutputStream3082.close();
			Class259.aFileOutputStream3082 = null;
		    }
		    try {
			Class259.aFileOutputStream3082
			    = new FileOutputStream(file);
		    } catch (FileNotFoundException filenotfoundexception) {
			Class203.method3003(new StringBuilder().append
						("Could not create ").append
						(file.getName()).toString(),
					    (byte) -8);
		    } catch (SecurityException securityexception) {
			Class203.method3003(new StringBuilder().append
						("Cannot write to ").append
						(file.getName()).toString(),
					    (byte) -23);
		    }
		    return;
		}
		if (string.equals("closeoutput")) {
		    if (null != Class259.aFileOutputStream3082)
			Class259.aFileOutputStream3082.close();
		    Class259.aFileOutputStream3082 = null;
		    return;
		}
		if (string.startsWith("runscript ")) {
		    File file = new File(string.substring(10));
		    if (!file.exists()) {
			Class203.method3003("No such file", (byte) -27);
			return;
		    }
		    byte[] is = Class358.method4456(file, (byte) 1);
		    if (null == is) {
			Class203.method3003("Failed to read file", (byte) -4);
			return;
		    }
		    String[] strings = (Class429.method5254
					((Class131.method1674
					  (Class70.method1127(is, (byte) -112),
					   '\r', "", 324661116)),
					 '\n', (byte) -66));
		    Class535.method6556(strings, 160833203);
		}
		if (487402729 * client.anInt10701 == 8
		    || client.anInt10701 * 487402729 == 5) {
		    Class65 class65 = Class566.method6895((byte) 62);
		    Class487_Sub19 class487_sub19
			= Class667_Sub1.method9955(Class362.aClass362_3907,
						   class65.aClass676_946,
						   852043838);
		    class487_sub19.aClass487_Sub17_Sub2_10217
			.method9201(string.length() + 3, (byte) -41);
		    class487_sub19.aClass487_Sub17_Sub2_10217
			.method9201(bool ? 1 : 0, (byte) 10);
		    class487_sub19.aClass487_Sub17_Sub2_10217
			.method9201(bool_4_ ? 1 : 0, (byte) 30);
		    class487_sub19.aClass487_Sub17_Sub2_10217
			.method9210(string, -1054474757);
		    class65.method1056(class487_sub19, (byte) 87);
		}
	    } catch (Exception exception) {
		Class203.method3003
		    (Class14.aClass14_111
			 .method582(Class152_Sub4.aClass621_9504, 1483611398),
		     (byte) -61);
		return;
	    }
	}
	if (487402729 * client.anInt10701 != 8
	    && 5 != 487402729 * client.anInt10701)
	    Class203.method3003
		(new StringBuilder().append
		     (Class14.aClass14_277
			  .method582(Class152_Sub4.aClass621_9504, 1642126759))
		     .append
		     (string).toString(),
		 (byte) 42);
    }
    
    static void method3106(boolean bool, int i) {
	Class546 class546 = Class54.aClass590_Sub1_Sub5_Sub1_Sub2_626
				.method10540(-986229501);
	Class487_Sub35_Sub12 class487_sub35_sub12
	    = Class497_Sub1.method6084(-494362861 * class546.anInt7397,
				       1139830351 * class546.anInt7398);
	if (class487_sub35_sub12 == null)
	    class487_sub35_sub12
		= Class497_Sub1.method6076((Class497_Sub1.aClass572_6809
					    .anInt7677) * -822946439);
	if (Class562.aClass487_Sub35_Sub12_7568 != class487_sub35_sub12
	    || bool) {
	    Class562.aClass487_Sub35_Sub12_7568 = class487_sub35_sub12;
	    boolean bool_18_ = Class497_Sub1.method6059(class487_sub35_sub12);
	    if (bool_18_) {
		Class497_Sub1.aBool6816 = true;
		Class432.method5296(1790663249);
	    }
	}
    }
}
