Attempt to mimic clang-format
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@ -82,7 +82,8 @@ public final class LegacyFrame extends Frame /* TODO consider JFrame */ {
|
||||
|
||||
private final Launcher launcher;
|
||||
|
||||
public LegacyFrame(String title, Applet applet) {
|
||||
public LegacyFrame(String title, Applet applet)
|
||||
{
|
||||
super(title);
|
||||
|
||||
launcher = new Launcher(applet);
|
||||
@ -98,35 +99,24 @@ public final class LegacyFrame extends Frame /* TODO consider JFrame */ {
|
||||
addWindowListener(new ForceExitHandler());
|
||||
}
|
||||
|
||||
public void start (
|
||||
String user,
|
||||
String session,
|
||||
int width,
|
||||
int height,
|
||||
boolean maximize,
|
||||
String serverAddress,
|
||||
String serverPort,
|
||||
boolean isDemo
|
||||
) {
|
||||
// Implements support for launching in to multiplayer on classic servers using a mpticket
|
||||
// file generated by an external program and stored in the instance's root folder.
|
||||
public void start(String user, String session, int width, int height, boolean maximize, String serverAddress,
|
||||
String serverPort, boolean isDemo)
|
||||
{
|
||||
// Implements support for launching in to multiplayer on classic servers using a
|
||||
// mpticket
|
||||
// file generated by an external program and stored in the instance's root
|
||||
// folder.
|
||||
|
||||
Path mpticketFile =
|
||||
Paths.get(System.getProperty("user.dir"), "..", "mpticket");
|
||||
Path mpticketFile = Paths.get(System.getProperty("user.dir"), "..", "mpticket");
|
||||
|
||||
Path mpticketFileCorrupt =
|
||||
Paths.get(System.getProperty("user.dir"), "..", "mpticket.corrupt");
|
||||
Path mpticketFileCorrupt = Paths.get(System.getProperty("user.dir"), "..", "mpticket.corrupt");
|
||||
|
||||
if (Files.exists(mpticketFile)) {
|
||||
try {
|
||||
List<String> lines = Files.readAllLines(mpticketFile, StandardCharsets.UTF_8);
|
||||
|
||||
if (lines.size() < 3) {
|
||||
Files.move(
|
||||
mpticketFile,
|
||||
mpticketFileCorrupt,
|
||||
StandardCopyOption.REPLACE_EXISTING
|
||||
);
|
||||
Files.move(mpticketFile, mpticketFileCorrupt, StandardCopyOption.REPLACE_EXISTING);
|
||||
|
||||
LOGGER.warning("Mpticket file is corrupted!");
|
||||
} else {
|
||||
@ -175,10 +165,12 @@ public final class LegacyFrame extends Frame /* TODO consider JFrame */ {
|
||||
private final class ForceExitHandler extends WindowAdapter {
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent event) {
|
||||
public void windowClosing(WindowEvent event)
|
||||
{
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
Thread.sleep(30000L);
|
||||
} catch (InterruptedException e) {
|
||||
|
Reference in New Issue
Block a user