mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 00:37:55 +00:00
Reformat of code
This commit is contained in:
@@ -13,86 +13,86 @@ import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Parabot v2
|
||||
*
|
||||
*
|
||||
* @author Everel/Parnassian/Clisprail
|
||||
* @author Matt, Dane
|
||||
* @version 2.04
|
||||
*/
|
||||
public final class Landing {
|
||||
// forum account
|
||||
private static String username = null;
|
||||
private static String password = null;
|
||||
// forum account
|
||||
private static String username = null;
|
||||
private static String password = null;
|
||||
|
||||
public static void main(String... args) throws IOException {
|
||||
parseArgs(args);
|
||||
public static void main(String... args) throws IOException {
|
||||
parseArgs(args);
|
||||
|
||||
Core.verbose("Debug mode: " + Core.inDebugMode());
|
||||
Core.verbose("Debug mode: " + Core.inDebugMode());
|
||||
|
||||
try {
|
||||
Core.verbose("Setting look and feel: "
|
||||
+ UIManager.getSystemLookAndFeelClassName());
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
try {
|
||||
Core.verbose("Setting look and feel: "
|
||||
+ UIManager.getSystemLookAndFeelClassName());
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
if (!Core.inDebugMode() && !Core.isValid()) {
|
||||
UILog.log(
|
||||
"Updates",
|
||||
"Please download the newest version of parabot at http://www.parabot.org/",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
return;
|
||||
}
|
||||
if (!Core.inDebugMode() && !Core.isValid()) {
|
||||
UILog.log(
|
||||
"Updates",
|
||||
"Please download the newest version of parabot at http://www.parabot.org/",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
Core.verbose("Validating directories...");
|
||||
Directories.validate();
|
||||
Core.verbose("Validating account manager...");
|
||||
AccountManager.validate();
|
||||
Core.verbose("Validating directories...");
|
||||
Directories.validate();
|
||||
Core.verbose("Validating account manager...");
|
||||
AccountManager.validate();
|
||||
|
||||
if (username != null && password != null) {
|
||||
new LoginUI(username, password);
|
||||
username = null;
|
||||
password = null;
|
||||
return;
|
||||
}
|
||||
if (username != null && password != null) {
|
||||
new LoginUI(username, password);
|
||||
username = null;
|
||||
password = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Core.verbose("Starting login gui...");
|
||||
new LoginUI().setVisible(true);
|
||||
}
|
||||
Core.verbose("Starting login gui...");
|
||||
new LoginUI().setVisible(true);
|
||||
}
|
||||
|
||||
private static void parseArgs(String... args) {
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
final String arg = args[i].toLowerCase();
|
||||
switch (arg.toLowerCase()) {
|
||||
case "-createdirs":
|
||||
Directories.validate();
|
||||
System.out
|
||||
.println("Directories created, you can now run parabot.");
|
||||
System.exit(0);
|
||||
break;
|
||||
case "-debug":
|
||||
Core.setDebug(true);
|
||||
break;
|
||||
case "-v":
|
||||
case "-verbose":
|
||||
Core.setVerbose(true);
|
||||
break;
|
||||
case "-server":
|
||||
ServerSelector.initServer = args[++i];
|
||||
break;
|
||||
case "-login":
|
||||
username = args[++i];
|
||||
password = args[++i];
|
||||
break;
|
||||
case "-proxy":
|
||||
Ip.spoofIP(args[++i], args[++i]);
|
||||
break;
|
||||
case "-loadlocal":
|
||||
Core.setLoadLocal(true);
|
||||
break;
|
||||
}
|
||||
private static void parseArgs(String... args) {
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
final String arg = args[i].toLowerCase();
|
||||
switch (arg.toLowerCase()) {
|
||||
case "-createdirs":
|
||||
Directories.validate();
|
||||
System.out
|
||||
.println("Directories created, you can now run parabot.");
|
||||
System.exit(0);
|
||||
break;
|
||||
case "-debug":
|
||||
Core.setDebug(true);
|
||||
break;
|
||||
case "-v":
|
||||
case "-verbose":
|
||||
Core.setVerbose(true);
|
||||
break;
|
||||
case "-server":
|
||||
ServerSelector.initServer = args[++i];
|
||||
break;
|
||||
case "-login":
|
||||
username = args[++i];
|
||||
password = args[++i];
|
||||
break;
|
||||
case "-proxy":
|
||||
Ip.spoofIP(args[++i], args[++i]);
|
||||
break;
|
||||
case "-loadlocal":
|
||||
Core.setLoadLocal(true);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user