Files
2006Scape/2006Scape Client/src/main/java/Main.java
T
ipkpjersi fd731242dd Added Screenshots (#656)
* Added ability to take screenshots

Since we have a screenshots folder in the 2006Scape folder in the home path, we might as well make use of it.

* Removed duplicate screenshot warning message

We don't need a warning message for duplicate screenshots, if it takes screenshots that's good enough.

* Added subfolders option for screenshots

This allows for much more flexibility when it comes to screenshots because we can choose any number of levels of subfolders.

* Removed unused code

* Added check for screenshots

* Fixed screenshots NPE when logged out

* Added Local to titlebar when running locally

* Added sendMessage param for screenshots

* Default to send messages for screenshots

* Use the sendMessage variable

Oops lol

* Added ability to take screenshots

Since we have a screenshots folder in the 2006Scape folder in the home path, we might as well make use of it.

* Removed duplicate screenshot warning message

We don't need a warning message for duplicate screenshots, if it takes screenshots that's good enough.

* Added subfolders option for screenshots

This allows for much more flexibility when it comes to screenshots because we can choose any number of levels of subfolders.

* Removed unused code

* Added check for screenshots

* Fixed screenshots NPE when logged out

* Added Local to titlebar when running locally

* Added sendMessage param for screenshots

* Default to send messages for screenshots

* Use the sendMessage variable

Oops lol

* Added screenshots QOL option

* Use server name var for screenshots
2024-09-21 02:30:53 +01:00

109 lines
2.8 KiB
Java

import java.net.InetAddress;
import java.net.UnknownHostException;
public final class Main {
/*
DEAR DEVELOPER!
If you want to run the client locally, the easiest way to do that is run the class "Client.java" instead!
If you REALLY want to use this class, add program arguments "-s localhost".
*/
public static void main(String[] args) {
try {
// Process client arguments to connect to
for (int i = 0; i < args.length; i++) {
switch(args[i]) {
case "-dev" :
case "-local":
case "-offline":
ClientSettings.SERVER_IP = "localhost";
ClientSettings.CHECK_CRC = false;
break;
case "-no-crc":
case "-no-cache-crc":
ClientSettings.CHECK_CRC = false;
break;
case "-qol":
case "-fixes":
ClientSettings.CUSTOM_SETTINGS_TAB = true;
ClientSettings.BILINEAR_MINIMAP_FILTERING = true;
ClientSettings.FIX_TRANSPARENCY_OVERFLOW = true;
ClientSettings.FULL_512PX_VIEWPORT = true;
ClientSettings.CONTROL_KEY_ZOOMING = true;
break;
case "-no-nav":
case "-disable-nav":
ClientSettings.SHOW_NAVBAR = false;
break;
case"-no-snow":
case"-hide-snow":
case"-disable-snow":
ClientSettings.SNOW_FLOOR_ENABLED = false;
ClientSettings.SNOW_FLOOR_FORCE_ENABLED = false;
ClientSettings.SNOW_OVERLAY_FORCE_ENABLED = false;
ClientSettings.SNOW_OVERLAY_ENABLED = false;
break;
case"-no-roofs":
case"-hide-roofs":
case"-disable-roofs":
ClientSettings.HIDE_ROOFS = true;
break;
case"-show-zoom":
ClientSettings.SHOW_ZOOM_LEVEL_MESSAGES = true;
break;
case"-screenshots":
case"-enable-screenshots":
ClientSettings.SCREENSHOTS_ENABLED = true;
break;
}
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
switch(args[i]) {
case "-s":
case "-server":
case "-ip":
ClientSettings.SERVER_IP = args[++i];
break;
}
}
}
Game game = new Game();
// Process other arguments
for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
switch(args[i]) {
case "-u":
case "-user":
case "-username":
game.myUsername = args[++i];
break;
case "-p":
case "-pass":
case "-password":
game.myPassword = args[++i];
break;
case "-w":
case "-world":
ClientSettings.SERVER_WORLD = Integer.parseInt(args[++i]);
break;
}
}
}
Game.nodeID = 10;
Game.portOff = 0;
Game.setHighMem();
Game.isMembers = true;
Signlink.storeid = 32;
Signlink.startpriv(InetAddress.getLocalHost());
game.createClientFrame(503, 765);
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
}