added file/console logging

using log4j-core to implement level logging. Logs can be found in the directory ./logs/
This commit is contained in:
Niklas 2020-04-01 18:55:10 +02:00
parent da675b2695
commit 43726ad2a9
26 changed files with 471 additions and 239 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@ out/
META-INF/
target/
*/target/
dist/src/main/resources/jre.zip
dist/src/main/resources/jre.zip
logs/

View File

@ -55,6 +55,11 @@
<artifactId>forms_rt</artifactId>
<version>7.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.1</version>
</dependency>
</dependencies>
<build>

View File

@ -22,6 +22,10 @@ import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import de.mc8051.arma3launcher.steam.SteamTimer;
import de.mc8051.arma3launcher.utils.TaskBarUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configurator;
import org.ini4j.Ini;
import javax.swing.*;
@ -29,18 +33,19 @@ import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Locale;
import java.util.Properties;
import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 23.03.2020.
*/
public class ArmA3Launcher {
private static final Logger logger = LogManager.getLogger(ArmA3Launcher.class);
public static final String[] SUPPORTED_LANGUAGES = {"en_US", "de_DE"};
public static String VERSION;
@ -51,40 +56,70 @@ public class ArmA3Launcher {
public static Config config;
public static Ini user_config;
public static void main(String... args) throws Exception {
public static void main(String... args) {
Configurator.setAllLevels(LogManager.getRootLogger().getName(), Level.INFO);
config = ConfigFactory.load("arma3launcher");
CLIENT_NAME = config.getString("name");
logger.info("Application with client name {} started", CLIENT_NAME);
final Properties properties = new Properties();
properties.load(ArmA3Launcher.class.getClassLoader().getResourceAsStream("project.properties"));
try {
properties.load(ArmA3Launcher.class.getClassLoader().getResourceAsStream("project.properties"));
} catch (IOException e) {
logger.error(e);
System.exit(0);
}
VERSION = properties.getProperty("version");
logger.info("Application version v{}", VERSION);
APPLICATION_PATH = getAppData() + CLIENT_NAME;
logger.debug("Application path {}", APPLICATION_PATH);
USER_AGENT = config.getString("sync.useragent") + "/" + VERSION;
if (new File(APPLICATION_PATH).mkdirs()) {
Logger.getLogger(ArmA3Launcher.class.getName()).log(Level.SEVERE, "Can not create " + APPLICATION_PATH);
logger.error("Can not create " + APPLICATION_PATH);
System.exit(0);
}
File userConfigFile = new File(APPLICATION_PATH + File.separator + "config.ini");
if(!userConfigFile.exists()) {
if(!userConfigFile.createNewFile()) {
Logger.getLogger(ArmA3Launcher.class.getName()).log(Level.SEVERE, "Can not create " + userConfigFile.getAbsolutePath());
if (!userConfigFile.exists()) {
try {
if (!userConfigFile.createNewFile()) {
logger.error("Can not create " + userConfigFile.getAbsolutePath());
System.exit(0);
}
} catch (IOException e) {
logger.error(e);
System.exit(0);
}
}
user_config = new Ini(userConfigFile);
try {
user_config = new Ini(userConfigFile);
} catch (IOException e) {
logger.error("Couldn't read " + userConfigFile.getAbsolutePath(), e);
System.exit(0);
}
final Parameter debugParameter = Parameters.DEBUG.toParameter();
if(debugParameter.getValue() != null && (Boolean) debugParameter.getValue())
Configurator.setAllLevels(LogManager.getRootLogger().getName(), Level.ALL);
logger.debug("Setup steam timer");
Timer steamTimer = new Timer();
setLanguage();
UIManager.setLookAndFeel(new FlatDarkLaf());
try {
UIManager.setLookAndFeel(new FlatDarkLaf());
} catch (UnsupportedLookAndFeelException e) {
logger.error("Failed to set LAF", e);
}
logger.debug("Setup frame with client name {}", CLIENT_NAME);
JFrame frame = new JFrame(CLIENT_NAME);
TaskBarUtils.getInstance().setWindow(frame);
@ -94,11 +129,13 @@ public class ArmA3Launcher {
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
logger.info("Shutting down application correctly");
steamTimer.cancel();
steamTimer.purge();
TaskBarUtils.getInstance().removeTrayIcon();
gui.exit();
frame.dispose();
logger.info("Shut down");
}
});
@ -113,7 +150,9 @@ public class ArmA3Launcher {
new SteamTimer(),
500, // run first occurrence immediately
10000); // run every thirty seconds
logger.info("SteamTimer scheduled at fixed rate");
logger.debug("GUI launched");
frame.setVisible(true);
}
@ -135,14 +174,17 @@ public class ArmA3Launcher {
private static void setLanguage() {
String lang = Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry();
logger.debug("Default language {}", lang);
String clientSetting = ArmA3Launcher.user_config.get("client", "language");
if(clientSetting != null && !clientSetting.equals("system") && Arrays.asList(SUPPORTED_LANGUAGES).contains(clientSetting)) {
if (clientSetting != null && !clientSetting.equals("system") && Arrays.asList(SUPPORTED_LANGUAGES).contains(clientSetting)) {
Locale.setDefault(new Locale(clientSetting.split("_")[0], clientSetting.split("_")[1]));
logger.info("Using config language {}", lang);
return;
}
if(!Arrays.asList(SUPPORTED_LANGUAGES).contains(lang))
if (!Arrays.asList(SUPPORTED_LANGUAGES).contains(lang))
Locale.setDefault(new Locale("en", "US"));
logger.info("Using language {}", lang);
}
}

View File

@ -1232,7 +1232,7 @@
</properties>
<border type="empty"/>
<children>
<grid id="4b04" layout-manager="GridLayoutManager" row-count="39" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="4b04" layout-manager="GridLayoutManager" row-count="40" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="5"/>
<constraints/>
<properties>
@ -1394,7 +1394,7 @@
<grid id="a0aec" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="2" left="5" bottom="3" right="0"/>
<constraints>
<grid row="10" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="11" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-14736860"/>
@ -1416,7 +1416,7 @@
<grid id="51038" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="25" right="0"/>
<constraints>
<grid row="9" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="10" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@ -1424,7 +1424,7 @@
</grid>
<component id="ba337" class="javax.swing.JLabel">
<constraints>
<grid row="11" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="12" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Profile"/>
@ -1433,13 +1433,13 @@
</component>
<component id="645c2" class="javax.swing.JComboBox" binding="settingsProfileCombo">
<constraints>
<grid row="11" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="12" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="ee343" class="javax.swing.JLabel">
<constraints>
<grid row="12" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="13" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Use64BitClient"/>
@ -1448,7 +1448,7 @@
</component>
<component id="3ba17" class="javax.swing.JLabel">
<constraints>
<grid row="14" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="15" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="NoSplash"/>
@ -1457,7 +1457,7 @@
</component>
<component id="37fea" class="javax.swing.JLabel">
<constraints>
<grid row="15" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="16" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="SkipIntro"/>
@ -1466,7 +1466,7 @@
</component>
<component id="435dd" class="javax.swing.JLabel">
<constraints>
<grid row="16" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="17" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="World"/>
@ -1475,7 +1475,7 @@
</component>
<component id="7fe7" class="javax.swing.JTextField" binding="settingsWorldText">
<constraints>
<grid row="16" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="17" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@ -1483,7 +1483,7 @@
</component>
<component id="60855" class="javax.swing.JLabel">
<constraints>
<grid row="18" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="19" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="MaxMem"/>
@ -1492,7 +1492,7 @@
</component>
<component id="3bf4b" class="javax.swing.JLabel">
<constraints>
<grid row="19" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="20" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="MaxVRAM"/>
@ -1501,7 +1501,7 @@
</component>
<component id="b9b2e" class="javax.swing.JLabel">
<constraints>
<grid row="20" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="21" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="NoCB"/>
@ -1511,7 +1511,7 @@
</component>
<component id="823ee" class="javax.swing.JLabel">
<constraints>
<grid row="21" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="22" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="CpuCount"/>
@ -1520,7 +1520,7 @@
</component>
<component id="b86c3" class="javax.swing.JLabel">
<constraints>
<grid row="22" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="23" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="ExThreads"/>
@ -1529,7 +1529,7 @@
</component>
<component id="dfcec" class="javax.swing.JLabel">
<constraints>
<grid row="23" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="24" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Malloc"/>
@ -1538,7 +1538,7 @@
</component>
<component id="31ea0" class="javax.swing.JLabel">
<constraints>
<grid row="24" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="25" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="NoLogs"/>
@ -1547,7 +1547,7 @@
</component>
<component id="b30fd" class="javax.swing.JLabel">
<constraints>
<grid row="25" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="26" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="EnableHT"/>
@ -1556,7 +1556,7 @@
</component>
<component id="c4f30" class="javax.swing.JLabel">
<constraints>
<grid row="26" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="27" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Hugepages"/>
@ -1566,7 +1566,7 @@
<grid id="66873" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="0" bottom="5" right="0"/>
<constraints>
<grid row="17" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="18" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@ -1597,7 +1597,7 @@
<grid id="e765b" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="0" bottom="5" right="0"/>
<constraints>
<grid row="13" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="14" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@ -1628,7 +1628,7 @@
<grid id="c2001" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="0" bottom="5" right="0"/>
<constraints>
<grid row="27" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="28" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@ -1658,7 +1658,7 @@
</grid>
<component id="605f" class="javax.swing.JLabel">
<constraints>
<grid row="28" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="29" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="NoPause"/>
@ -1667,7 +1667,7 @@
</component>
<component id="12886" class="javax.swing.JLabel">
<constraints>
<grid row="29" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="30" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="ShowScriptErrors"/>
@ -1676,7 +1676,7 @@
</component>
<component id="f2d04" class="javax.swing.JLabel">
<constraints>
<grid row="30" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="31" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="FilePatching"/>
@ -1685,7 +1685,7 @@
</component>
<component id="d2664" class="javax.swing.JLabel">
<constraints>
<grid row="31" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="32" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Init"/>
@ -1694,7 +1694,7 @@
</component>
<component id="9367" class="javax.swing.JLabel">
<constraints>
<grid row="32" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="33" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Beta"/>
@ -1703,7 +1703,7 @@
</component>
<component id="4e786" class="javax.swing.JLabel">
<constraints>
<grid row="33" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="34" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="CrashDiag"/>
@ -1712,7 +1712,7 @@
</component>
<component id="b9ac8" class="javax.swing.JLabel">
<constraints>
<grid row="35" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="36" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Window"/>
@ -1722,7 +1722,7 @@
<grid id="cc3b" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="0" bottom="5" right="0"/>
<constraints>
<grid row="34" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="35" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@ -1752,7 +1752,7 @@
</grid>
<component id="4c4c9" class="javax.swing.JLabel">
<constraints>
<grid row="36" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="37" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="PosX"/>
@ -1761,7 +1761,7 @@
</component>
<component id="8f956" class="javax.swing.JLabel">
<constraints>
<grid row="37" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="38" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="PosY"/>
@ -1770,7 +1770,7 @@
</component>
<component id="e4cad" class="javax.swing.JCheckBox" binding="settingsNoCBBox">
<constraints>
<grid row="20" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="21" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1778,7 +1778,7 @@
</component>
<component id="8fe70" class="javax.swing.JComboBox" binding="settingsMallocCombo">
<constraints>
<grid row="23" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="24" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<model>
@ -1793,7 +1793,7 @@
</component>
<component id="95bee" class="javax.swing.JCheckBox" binding="settingsNoLogsBox">
<constraints>
<grid row="24" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="25" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1801,7 +1801,7 @@
</component>
<component id="f6552" class="javax.swing.JCheckBox" binding="settingsEnableHTBox">
<constraints>
<grid row="25" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="26" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1809,7 +1809,7 @@
</component>
<component id="f639b" class="javax.swing.JCheckBox" binding="settingsHugeoagesBox">
<constraints>
<grid row="26" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="27" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1817,7 +1817,7 @@
</component>
<component id="728e8" class="javax.swing.JCheckBox" binding="settingsNoPauseBox">
<constraints>
<grid row="28" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="29" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1825,7 +1825,7 @@
</component>
<component id="b92f" class="javax.swing.JCheckBox" binding="settingsShowScriptErrorsBox">
<constraints>
<grid row="29" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="30" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1833,7 +1833,7 @@
</component>
<component id="83780" class="javax.swing.JCheckBox" binding="settingsFilePatchingBox">
<constraints>
<grid row="30" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="31" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1841,7 +1841,7 @@
</component>
<component id="4cf92" class="javax.swing.JCheckBox" binding="settingsCrashDiagBox">
<constraints>
<grid row="33" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="34" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1849,7 +1849,7 @@
</component>
<component id="d669d" class="javax.swing.JCheckBox" binding="settingsWindowBox">
<constraints>
<grid row="35" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="36" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1857,37 +1857,37 @@
</component>
<component id="1fd16" class="javax.swing.JSpinner" binding="settingsMaxMemSpinner">
<constraints>
<grid row="18" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="19" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="67772" class="javax.swing.JSpinner" binding="settingsMaxVRamSpinner">
<constraints>
<grid row="19" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="20" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="d8a9" class="javax.swing.JSpinner" binding="settingsCpuCountSpinner">
<constraints>
<grid row="21" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="22" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="fcb58" class="javax.swing.JSpinner" binding="settingsPosXSpinner">
<constraints>
<grid row="36" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="37" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="7ddc1" class="javax.swing.JSpinner" binding="settingsPosYSpinner">
<constraints>
<grid row="37" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="38" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="27334" class="javax.swing.JTextField" binding="settingsInitText">
<constraints>
<grid row="31" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="32" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@ -1895,7 +1895,7 @@
</component>
<component id="94149" class="javax.swing.JComboBox" binding="settingsExThreadsCombo">
<constraints>
<grid row="22" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="23" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<model>
@ -1907,7 +1907,7 @@
</component>
<component id="ef3d" class="javax.swing.JCheckBox" binding="settingsSkipIntroBox">
<constraints>
<grid row="15" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="16" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1915,7 +1915,7 @@
</component>
<component id="2f359" class="javax.swing.JCheckBox" binding="settingsNoSplashBox">
<constraints>
<grid row="14" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="15" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1923,7 +1923,7 @@
</component>
<component id="98a41" class="javax.swing.JCheckBox" binding="settingsUseSixtyFourBitBox">
<constraints>
<grid row="12" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="13" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
@ -1951,7 +1951,7 @@
</component>
<component id="40092" class="javax.swing.JTextField" binding="settingsBetaText">
<constraints>
<grid row="32" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="33" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@ -1960,7 +1960,7 @@
<grid id="fc050" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="25" left="0" bottom="5" right="0"/>
<constraints>
<grid row="38" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="39" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@ -1995,7 +1995,7 @@
</component>
<component id="46dd0" class="javax.swing.JLabel">
<constraints>
<grid row="18" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="19" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="MB"/>
@ -2003,12 +2003,29 @@
</component>
<component id="e45c5" class="javax.swing.JLabel">
<constraints>
<grid row="19" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="20" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="MB"/>
</properties>
</component>
<component id="f901c" class="javax.swing.JLabel">
<constraints>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="lang" key="use_debug"/>
<toolTipText resource-bundle="lang" key="use_debug_tooltip"/>
</properties>
</component>
<component id="2a999" class="javax.swing.JCheckBox" binding="settingsDebugBox">
<constraints>
<grid row="9" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
</children>
</grid>
</children>

View File

@ -35,6 +35,10 @@ import de.mc8051.arma3launcher.utils.Humanize;
import de.mc8051.arma3launcher.utils.ImageUtils;
import de.mc8051.arma3launcher.utils.LangUtils;
import de.mc8051.arma3launcher.utils.TaskBarUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configurator;
import org.json.JSONArray;
import javax.swing.*;
@ -71,8 +75,6 @@ import java.util.List;
import java.util.ResourceBundle;
import java.util.Scanner;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -185,6 +187,9 @@ public class LauncherGUI implements Observer {
private JPanel presetNotePane;
private JLabel aboutUpdateLabel;
private JButton updateButton;
private JCheckBox settingsDebugBox;
private static final Logger logger = LogManager.getLogger(LauncherGUI.class);
private JCheckBoxTree repoTree;
private FileChecker fileChecker;
@ -193,6 +198,8 @@ public class LauncherGUI implements Observer {
private Updater updater = new Updater();
public LauncherGUI() {
logger.info("Initialize GUI");
fileChecker = new FileChecker(syncCheckProgress);
syncer = new Syncer(this);
@ -269,6 +276,9 @@ public class LauncherGUI implements Observer {
.replace("${name}", ArmA3Launcher.CLIENT_NAME)
.replace("${version}", ArmA3Launcher.VERSION));
logger.debug("Client title text: {}", title.getText());
logger.debug("Client subtitle text: {}", subtitle.getText());
initSettings();
logo.setIcon(new ImageIcon(ImageUtils.getScaledImage(TaskBarUtils.IMAGE_LGO, 128, 128)));
@ -385,7 +395,7 @@ public class LauncherGUI implements Observer {
ArmA3Launcher.user_config.store();
initSettings();
} catch (IOException ex) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
});
@ -618,7 +628,7 @@ public class LauncherGUI implements Observer {
JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(mainPanel);
frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
} catch (IOException ex) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
SwingUtilities.invokeLater(() -> aboutUpdateLabel.setText("UPDATE FAILED " + ex.getMessage()));
}
});
@ -626,14 +636,17 @@ public class LauncherGUI implements Observer {
}
public static void infoBox(String infoMessage, String titleBar) {
logger.info("Info message: {} {}", titleBar, infoMessage);
JOptionPane.showMessageDialog(null, infoMessage, "INFO: " + titleBar, JOptionPane.INFORMATION_MESSAGE);
}
public static void warnBox(String infoMessage, String titleBar) {
logger.info("Warn message: {} {}", titleBar, infoMessage);
JOptionPane.showMessageDialog(null, infoMessage, titleBar, JOptionPane.WARNING_MESSAGE);
}
public static void errorBox(String errorMessage, String titleBar) {
logger.info("Error message: {} {}", titleBar, errorMessage);
JOptionPane.showMessageDialog(null, errorMessage, "ERROR: " + titleBar, JOptionPane.ERROR_MESSAGE);
}
@ -794,6 +807,15 @@ public class LauncherGUI implements Observer {
settingsShowParameterBox.addItemListener(e -> parameterText.setVisible(e.getStateChange() == ItemEvent.SELECTED));
initCheckBox(settingsCheckModsBox, Parameters.CHECK_MODSET.toParameter());
initCheckBox(settingsDebugBox, Parameters.DEBUG.toParameter());
settingsDebugBox.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
Configurator.setAllLevels(LogManager.getRootLogger().getName(), Level.DEBUG);
} else {
Configurator.setAllLevels(LogManager.getRootLogger().getName(), Level.INFO);
}
});
initCheckBox(settingsUseWorkshopBox, Parameters.USE_WORKSHOP.toParameter());
settingsUseWorkshopBox.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
@ -1093,7 +1115,7 @@ public class LauncherGUI implements Observer {
@Override
public void update(String s) {
Logger.getLogger(getClass().getName()).log(Level.INFO, "Observer received: " + s);
logger.info("Observer received: {}", s);
if (s.equals(RepositoryManger.Type.METADATA.toString())) {
switch (RepositoryManger.getInstance().getStatus(RepositoryManger.Type.METADATA)) {
case ERROR:
@ -1126,7 +1148,7 @@ public class LauncherGUI implements Observer {
if (checkModsetParameter.getValue() != null && (boolean) checkModsetParameter.getValue()) {
if (!fileChecker.isChecked()) {
SwingUtilities.invokeLater(() -> fileCheck(false));
Logger.getLogger(getClass().getName()).log(Level.INFO, "Started file check on launch");
logger.info("Started file check on launch");
}
}
break;
@ -1891,7 +1913,7 @@ public class LauncherGUI implements Observer {
panel34.add(settingScrollPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
settingScrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null));
final JPanel panel35 = new JPanel();
panel35.setLayout(new GridLayoutManager(39, 4, new Insets(0, 0, 0, 5), -1, -1));
panel35.setLayout(new GridLayoutManager(40, 4, new Insets(0, 0, 0, 5), -1, -1));
panel35.setOpaque(false);
settingScrollPane.setViewportView(panel35);
final JLabel label23 = new JLabel();
@ -1959,7 +1981,7 @@ public class LauncherGUI implements Observer {
panel37.setLayout(new GridLayoutManager(1, 1, new Insets(2, 5, 3, 0), -1, -1));
panel37.setBackground(new Color(-14736860));
panel37.setEnabled(false);
panel35.add(panel37, new GridConstraints(10, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel35.add(panel37, new GridConstraints(11, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JLabel label30 = new JLabel();
Font label30Font = this.$$$getFont$$$(null, Font.BOLD, 16, label30.getFont());
if (label30Font != null) label30.setFont(label30Font);
@ -1967,71 +1989,71 @@ public class LauncherGUI implements Observer {
panel37.add(label30, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel38 = new JPanel();
panel38.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 25, 0), -1, -1));
panel35.add(panel38, new GridConstraints(9, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel35.add(panel38, new GridConstraints(10, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JLabel label31 = new JLabel();
label31.setText("Profile");
label31.setToolTipText(ResourceBundle.getBundle("lang").getString("profile_desc"));
panel35.add(label31, new GridConstraints(11, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label31, new GridConstraints(12, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsProfileCombo = new JComboBox();
panel35.add(settingsProfileCombo, new GridConstraints(11, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsProfileCombo, new GridConstraints(12, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label32 = new JLabel();
label32.setText("Use64BitClient");
label32.setToolTipText(ResourceBundle.getBundle("lang").getString("use64bitclient_desc"));
panel35.add(label32, new GridConstraints(12, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label32, new GridConstraints(13, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label33 = new JLabel();
label33.setText("NoSplash");
label33.setToolTipText(ResourceBundle.getBundle("lang").getString("nosplash_desc"));
panel35.add(label33, new GridConstraints(14, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label33, new GridConstraints(15, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label34 = new JLabel();
label34.setText("SkipIntro");
label34.setToolTipText(ResourceBundle.getBundle("lang").getString("skipintro_desc"));
panel35.add(label34, new GridConstraints(15, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label34, new GridConstraints(16, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label35 = new JLabel();
label35.setText("World");
label35.setToolTipText(ResourceBundle.getBundle("lang").getString("world_desc"));
panel35.add(label35, new GridConstraints(16, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label35, new GridConstraints(17, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsWorldText = new JTextField();
panel35.add(settingsWorldText, new GridConstraints(16, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
panel35.add(settingsWorldText, new GridConstraints(17, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label36 = new JLabel();
label36.setText("MaxMem");
label36.setToolTipText(ResourceBundle.getBundle("lang").getString("maxmem_desc"));
panel35.add(label36, new GridConstraints(18, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label36, new GridConstraints(19, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label37 = new JLabel();
label37.setText("MaxVRAM");
label37.setToolTipText(ResourceBundle.getBundle("lang").getString("maxvram_desc"));
panel35.add(label37, new GridConstraints(19, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label37, new GridConstraints(20, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label38 = new JLabel();
label38.setText("NoCB");
label38.setToolTipText(ResourceBundle.getBundle("lang").getString("nocb_desc"));
label38.setVerifyInputWhenFocusTarget(false);
panel35.add(label38, new GridConstraints(20, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label38, new GridConstraints(21, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label39 = new JLabel();
label39.setText("CpuCount");
label39.setToolTipText(ResourceBundle.getBundle("lang").getString("cpucount_desc"));
panel35.add(label39, new GridConstraints(21, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label39, new GridConstraints(22, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label40 = new JLabel();
label40.setText("ExThreads");
label40.setToolTipText(ResourceBundle.getBundle("lang").getString("exthreads_desc"));
panel35.add(label40, new GridConstraints(22, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label40, new GridConstraints(23, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label41 = new JLabel();
label41.setText("Malloc");
label41.setToolTipText(ResourceBundle.getBundle("lang").getString("malloc_desc"));
panel35.add(label41, new GridConstraints(23, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label41, new GridConstraints(24, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label42 = new JLabel();
label42.setText("NoLogs");
label42.setToolTipText(ResourceBundle.getBundle("lang").getString("nologs_desc"));
panel35.add(label42, new GridConstraints(24, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label42, new GridConstraints(25, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label43 = new JLabel();
label43.setText("EnableHT");
label43.setToolTipText(ResourceBundle.getBundle("lang").getString("enableht_desc"));
panel35.add(label43, new GridConstraints(25, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label43, new GridConstraints(26, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label44 = new JLabel();
label44.setText("Hugepages");
label44.setToolTipText(ResourceBundle.getBundle("lang").getString("hugepages_desc"));
panel35.add(label44, new GridConstraints(26, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label44, new GridConstraints(27, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel39 = new JPanel();
panel39.setLayout(new GridLayoutManager(1, 1, new Insets(5, 0, 5, 0), -1, -1));
panel35.add(panel39, new GridConstraints(17, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel35.add(panel39, new GridConstraints(18, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JPanel panel40 = new JPanel();
panel40.setLayout(new GridLayoutManager(1, 1, new Insets(2, 6, 5, 0), -1, -1));
panel40.setBackground(new Color(-14210516));
@ -2043,7 +2065,7 @@ public class LauncherGUI implements Observer {
panel40.add(label45, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel41 = new JPanel();
panel41.setLayout(new GridLayoutManager(1, 1, new Insets(5, 0, 5, 0), -1, -1));
panel35.add(panel41, new GridConstraints(13, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel35.add(panel41, new GridConstraints(14, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JPanel panel42 = new JPanel();
panel42.setLayout(new GridLayoutManager(1, 1, new Insets(2, 6, 5, 0), -1, -1));
panel42.setBackground(new Color(-14210516));
@ -2055,7 +2077,7 @@ public class LauncherGUI implements Observer {
panel42.add(label46, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel43 = new JPanel();
panel43.setLayout(new GridLayoutManager(1, 1, new Insets(5, 0, 5, 0), -1, -1));
panel35.add(panel43, new GridConstraints(27, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel35.add(panel43, new GridConstraints(28, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JPanel panel44 = new JPanel();
panel44.setLayout(new GridLayoutManager(1, 1, new Insets(2, 6, 5, 0), -1, -1));
panel44.setBackground(new Color(-14210516));
@ -2068,34 +2090,34 @@ public class LauncherGUI implements Observer {
final JLabel label48 = new JLabel();
label48.setText("NoPause");
label48.setToolTipText(ResourceBundle.getBundle("lang").getString("nopause_desc"));
panel35.add(label48, new GridConstraints(28, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label48, new GridConstraints(29, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label49 = new JLabel();
label49.setText("ShowScriptErrors");
label49.setToolTipText(ResourceBundle.getBundle("lang").getString("showscripterrors_desc"));
panel35.add(label49, new GridConstraints(29, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label49, new GridConstraints(30, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label50 = new JLabel();
label50.setText("FilePatching");
label50.setToolTipText(ResourceBundle.getBundle("lang").getString("filepatching_desc"));
panel35.add(label50, new GridConstraints(30, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label50, new GridConstraints(31, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label51 = new JLabel();
label51.setText("Init");
label51.setToolTipText(ResourceBundle.getBundle("lang").getString("init_desc"));
panel35.add(label51, new GridConstraints(31, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label51, new GridConstraints(32, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label52 = new JLabel();
label52.setText("Beta");
label52.setToolTipText(ResourceBundle.getBundle("lang").getString("beta_desc"));
panel35.add(label52, new GridConstraints(32, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label52, new GridConstraints(33, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label53 = new JLabel();
label53.setText("CrashDiag");
label53.setToolTipText(ResourceBundle.getBundle("lang").getString("crashdiag_desc"));
panel35.add(label53, new GridConstraints(33, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label53, new GridConstraints(34, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label54 = new JLabel();
label54.setText("Window");
label54.setToolTipText(ResourceBundle.getBundle("lang").getString("window_desc"));
panel35.add(label54, new GridConstraints(35, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label54, new GridConstraints(36, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel45 = new JPanel();
panel45.setLayout(new GridLayoutManager(1, 1, new Insets(5, 0, 5, 0), -1, -1));
panel35.add(panel45, new GridConstraints(34, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel35.add(panel45, new GridConstraints(35, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JPanel panel46 = new JPanel();
panel46.setLayout(new GridLayoutManager(1, 1, new Insets(2, 6, 5, 0), -1, -1));
panel46.setBackground(new Color(-14210516));
@ -2108,14 +2130,14 @@ public class LauncherGUI implements Observer {
final JLabel label56 = new JLabel();
label56.setText("PosX");
label56.setToolTipText(ResourceBundle.getBundle("lang").getString("posx_desc"));
panel35.add(label56, new GridConstraints(36, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label56, new GridConstraints(37, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label57 = new JLabel();
label57.setText("PosY");
label57.setToolTipText(ResourceBundle.getBundle("lang").getString("posy_desc"));
panel35.add(label57, new GridConstraints(37, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label57, new GridConstraints(38, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsNoCBBox = new JCheckBox();
settingsNoCBBox.setText("");
panel35.add(settingsNoCBBox, new GridConstraints(20, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsNoCBBox, new GridConstraints(21, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsMallocCombo = new JComboBox();
final DefaultComboBoxModel defaultComboBoxModel2 = new DefaultComboBoxModel();
defaultComboBoxModel2.addElement("");
@ -2125,59 +2147,59 @@ public class LauncherGUI implements Observer {
defaultComboBoxModel2.addElement("jemalloc_bi_x64");
defaultComboBoxModel2.addElement("system");
settingsMallocCombo.setModel(defaultComboBoxModel2);
panel35.add(settingsMallocCombo, new GridConstraints(23, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsMallocCombo, new GridConstraints(24, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsNoLogsBox = new JCheckBox();
settingsNoLogsBox.setText("");
panel35.add(settingsNoLogsBox, new GridConstraints(24, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsNoLogsBox, new GridConstraints(25, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsEnableHTBox = new JCheckBox();
settingsEnableHTBox.setText("");
panel35.add(settingsEnableHTBox, new GridConstraints(25, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsEnableHTBox, new GridConstraints(26, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsHugeoagesBox = new JCheckBox();
settingsHugeoagesBox.setText("");
panel35.add(settingsHugeoagesBox, new GridConstraints(26, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsHugeoagesBox, new GridConstraints(27, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsNoPauseBox = new JCheckBox();
settingsNoPauseBox.setText("");
panel35.add(settingsNoPauseBox, new GridConstraints(28, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsNoPauseBox, new GridConstraints(29, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsShowScriptErrorsBox = new JCheckBox();
settingsShowScriptErrorsBox.setText("");
panel35.add(settingsShowScriptErrorsBox, new GridConstraints(29, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsShowScriptErrorsBox, new GridConstraints(30, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsFilePatchingBox = new JCheckBox();
settingsFilePatchingBox.setText("");
panel35.add(settingsFilePatchingBox, new GridConstraints(30, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsFilePatchingBox, new GridConstraints(31, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsCrashDiagBox = new JCheckBox();
settingsCrashDiagBox.setText("");
panel35.add(settingsCrashDiagBox, new GridConstraints(33, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsCrashDiagBox, new GridConstraints(34, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsWindowBox = new JCheckBox();
settingsWindowBox.setText("");
panel35.add(settingsWindowBox, new GridConstraints(35, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsWindowBox, new GridConstraints(36, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsMaxMemSpinner = new JSpinner();
panel35.add(settingsMaxMemSpinner, new GridConstraints(18, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsMaxMemSpinner, new GridConstraints(19, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsMaxVRamSpinner = new JSpinner();
panel35.add(settingsMaxVRamSpinner, new GridConstraints(19, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsMaxVRamSpinner, new GridConstraints(20, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsCpuCountSpinner = new JSpinner();
panel35.add(settingsCpuCountSpinner, new GridConstraints(21, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsCpuCountSpinner, new GridConstraints(22, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsPosXSpinner = new JSpinner();
panel35.add(settingsPosXSpinner, new GridConstraints(36, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsPosXSpinner, new GridConstraints(37, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsPosYSpinner = new JSpinner();
panel35.add(settingsPosYSpinner, new GridConstraints(37, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsPosYSpinner, new GridConstraints(38, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsInitText = new JTextField();
panel35.add(settingsInitText, new GridConstraints(31, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
panel35.add(settingsInitText, new GridConstraints(32, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
settingsExThreadsCombo = new JComboBox();
final DefaultComboBoxModel defaultComboBoxModel3 = new DefaultComboBoxModel();
defaultComboBoxModel3.addElement("");
defaultComboBoxModel3.addElement("3");
defaultComboBoxModel3.addElement("7");
settingsExThreadsCombo.setModel(defaultComboBoxModel3);
panel35.add(settingsExThreadsCombo, new GridConstraints(22, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsExThreadsCombo, new GridConstraints(23, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsSkipIntroBox = new JCheckBox();
settingsSkipIntroBox.setText("");
panel35.add(settingsSkipIntroBox, new GridConstraints(15, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsSkipIntroBox, new GridConstraints(16, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsNoSplashBox = new JCheckBox();
settingsNoSplashBox.setText("");
panel35.add(settingsNoSplashBox, new GridConstraints(14, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsNoSplashBox, new GridConstraints(15, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsUseSixtyFourBitBox = new JCheckBox();
settingsUseSixtyFourBitBox.setText("");
panel35.add(settingsUseSixtyFourBitBox, new GridConstraints(12, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(settingsUseSixtyFourBitBox, new GridConstraints(13, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label58 = new JLabel();
this.$$$loadLabelText$$$(label58, ResourceBundle.getBundle("lang").getString("language"));
panel35.add(label58, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
@ -2189,10 +2211,10 @@ public class LauncherGUI implements Observer {
settingsLanguageCombo.setModel(defaultComboBoxModel4);
panel35.add(settingsLanguageCombo, new GridConstraints(7, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsBetaText = new JTextField();
panel35.add(settingsBetaText, new GridConstraints(32, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
panel35.add(settingsBetaText, new GridConstraints(33, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JPanel panel47 = new JPanel();
panel47.setLayout(new GridLayoutManager(1, 1, new Insets(25, 0, 5, 0), -1, -1));
panel35.add(panel47, new GridConstraints(38, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel35.add(panel47, new GridConstraints(39, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
settingsResetDefault = new JButton();
Font settingsResetDefaultFont = this.$$$getFont$$$(null, Font.BOLD, 14, settingsResetDefault.getFont());
if (settingsResetDefaultFont != null) settingsResetDefault.setFont(settingsResetDefaultFont);
@ -2207,10 +2229,17 @@ public class LauncherGUI implements Observer {
panel35.add(settingsUseWorkshopBox, new GridConstraints(5, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label60 = new JLabel();
label60.setText("MB");
panel35.add(label60, new GridConstraints(18, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label60, new GridConstraints(19, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label61 = new JLabel();
label61.setText("MB");
panel35.add(label61, new GridConstraints(19, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel35.add(label61, new GridConstraints(20, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label62 = new JLabel();
this.$$$loadLabelText$$$(label62, ResourceBundle.getBundle("lang").getString("use_debug"));
label62.setToolTipText(ResourceBundle.getBundle("lang").getString("use_debug_tooltip"));
panel35.add(label62, new GridConstraints(9, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
settingsDebugBox = new JCheckBox();
settingsDebugBox.setText("");
panel35.add(settingsDebugBox, new GridConstraints(9, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
aboutTab = new JPanel();
aboutTab.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
aboutTab.setOpaque(true);
@ -2241,16 +2270,16 @@ public class LauncherGUI implements Observer {
final JPanel panel51 = new JPanel();
panel51.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
panel50.add(panel51, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JLabel label62 = new JLabel();
this.$$$loadLabelText$$$(label62, ResourceBundle.getBundle("lang").getString("developer_page"));
panel51.add(label62, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_SOUTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label63 = new JLabel();
this.$$$loadLabelText$$$(label63, ResourceBundle.getBundle("lang").getString("developer_page"));
panel51.add(label63, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_SOUTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
aboutDeveloperLabel = new JLabel();
aboutDeveloperLabel.setRequestFocusEnabled(true);
aboutDeveloperLabel.setText("github.com");
panel51.add(aboutDeveloperLabel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_SOUTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label63 = new JLabel();
this.$$$loadLabelText$$$(label63, ResourceBundle.getBundle("lang").getString("project_page"));
panel51.add(label63, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label64 = new JLabel();
this.$$$loadLabelText$$$(label64, ResourceBundle.getBundle("lang").getString("project_page"));
panel51.add(label64, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
aboutProjectLabel = new JLabel();
aboutProjectLabel.setText("gurkengewuerz.de");
panel51.add(aboutProjectLabel, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));

View File

@ -1,18 +1,18 @@
package de.mc8051.arma3launcher;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.ini4j.Ini;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 24.03.2020.
*/
public class Parameter {
private final static Logger logger = LogManager.getLogger(Parameter.class);
private String name;
private ParameterType pType;
private Class<?> persistentClass;
@ -66,9 +66,10 @@ public class Parameter {
}
try {
logger.debug("{}: saved value {}", name, data);
ArmA3Launcher.user_config.store();
} catch (IOException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
@ -101,7 +102,11 @@ public class Parameter {
public Object getValue() {
final Object configValue = getConfigValue();
if(configValue != null) return configValue;
if(configValue != null) {
logger.debug("{}: use config value {}", name, configValue);
return configValue;
}
logger.debug("{}: use default value", name);
return getDefault();
}

View File

@ -12,6 +12,7 @@ public enum Parameters {
USE_WORKSHOP("UseWorkshop", Parameter.ParameterType.CLIENT, Boolean.class),
ARMA_PATH("armaPath", Parameter.ParameterType.CLIENT, String.class),
MOD_PATH("modPath", Parameter.ParameterType.CLIENT, String.class),
DEBUG("debug", Parameter.ParameterType.CLIENT, Boolean.class),
PROFILE("Profile", Parameter.ParameterType.ARMA, String.class, "name"),
USE_64_BIT_CLIENT("Use64BitClient", Parameter.ParameterType.ARMA, Boolean.class),

View File

@ -1,7 +1,6 @@
package de.mc8051.arma3launcher.objects;
import de.mc8051.arma3launcher.repo.RepositoryManger;
import de.mc8051.arma3launcher.utils.Callback;
/**
* Created by gurkengewuerz.de on 27.03.2020.

View File

@ -3,24 +3,23 @@ package de.mc8051.arma3launcher.objects;
import de.mc8051.arma3launcher.ArmA3Launcher;
import de.mc8051.arma3launcher.utils.FileUtils;
import de.mc8051.arma3launcher.utils.URLUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 25.03.2020.
*/
public class ModFile implements AbstractMod {
private static final Logger logger = LogManager.getLogger(ModFile.class);
private File f;
private long size;
private String folder;
@ -98,7 +97,7 @@ public class ModFile implements AbstractMod {
localGeneratedSHA1sum = FileUtils.sha1Hex(f);
}
} catch (IOException | NoSuchAlgorithmException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
return localGeneratedSHA1sum;
}

View File

@ -1,8 +1,9 @@
package de.mc8051.arma3launcher.objects;
import de.mc8051.arma3launcher.ArmA3Launcher;
import de.mc8051.arma3launcher.Parameter;
import de.mc8051.arma3launcher.Parameters;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.ini4j.Ini;
import org.json.JSONArray;
import org.json.JSONObject;
@ -10,11 +11,8 @@ import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
/**
@ -22,6 +20,8 @@ import java.util.stream.Collectors;
*/
public class Modset implements Comparable {
private static final Logger logger = LogManager.getLogger(Modset.class);
public static HashMap<String, Modset> MODSET_LIST = new HashMap<>();
private String name;
@ -74,9 +74,10 @@ public class Modset implements Comparable {
section.add(name, ja.toString());
try {
logger.debug("{}: saved modset {}", String.join(";", list));
ArmA3Launcher.user_config.store();
} catch (IOException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
}
@ -91,9 +92,10 @@ public class Modset implements Comparable {
section.remove(name);
try {
logger.debug("{}: removed modset and saved", name);
ArmA3Launcher.user_config.store();
} catch (IOException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
}

View File

@ -6,6 +6,9 @@ import de.mc8051.arma3launcher.interfaces.Observer;
import de.mc8051.arma3launcher.objects.AbstractMod;
import de.mc8051.arma3launcher.objects.Mod;
import de.mc8051.arma3launcher.objects.ModFile;
import de.mc8051.arma3launcher.utils.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.swing.*;
import java.io.IOException;
@ -15,8 +18,6 @@ import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
/**
@ -24,6 +25,8 @@ import java.util.stream.Collectors;
*/
public class FileChecker implements Observable {
private static final Logger logger = LogManager.getLogger(FileChecker.class);
private List<Observer> observerList = new ArrayList<>();
private JProgressBar pb;
private boolean stop = false;
@ -48,6 +51,7 @@ public class FileChecker implements Observable {
}
public void check(boolean fastscan) {
logger.info("Initiated file check with {} scan", fastscan ? "fast" : "hash");
running = true;
deleted.clear();
changed.clear();
@ -67,6 +71,7 @@ public class FileChecker implements Observable {
stop = false;
running = false;
notifyObservers("fileCheckerStopped");
logger.info("File checker stopped");
return;
}
if (abstractMod instanceof Mod) {
@ -85,6 +90,7 @@ public class FileChecker implements Observable {
stop = false;
running = false;
notifyObservers("fileCheckerStopped");
logger.info("File checker stopped");
return;
}
}
@ -118,6 +124,8 @@ public class FileChecker implements Observable {
}
private void checkFile(String mod, ModFile mf, boolean fastscan) {
logger.debug("Check {}", mf.getLocaleFile().getAbsolutePath());
ArrayList<ModFile> temp = new ArrayList<>();
if (!mf.exists()) {
@ -126,6 +134,7 @@ public class FileChecker implements Observable {
added.put(mod, temp);
addedCount++;
size += mf.getSize();
logger.info("File {} not exists", mf.getLocaleFile().getAbsolutePath());
return;
}
@ -137,9 +146,12 @@ public class FileChecker implements Observable {
changed.put(mod, temp);
changedCount++;
size += mf.getSize();
logger.debug("File {} changed", mf.getLocaleFile().getAbsolutePath());
return;
}
}
logger.debug("File {} is okay", mf.getLocaleFile().getAbsolutePath());
}
private void checkDeleted() {
@ -180,10 +192,11 @@ public class FileChecker implements Observable {
if (deleteable == null) {
deleted.add(localPath);
logger.info("Deleted {}", localPath);
}
}
} catch (IOException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}

View File

@ -10,6 +10,8 @@ import de.mc8051.arma3launcher.objects.ModFile;
import de.mc8051.arma3launcher.objects.Modset;
import de.mc8051.arma3launcher.objects.Server;
import de.mc8051.arma3launcher.utils.Callback;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.ini4j.Ini;
import org.json.JSONArray;
import org.json.JSONObject;
@ -26,9 +28,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import static java.time.temporal.ChronoUnit.SECONDS;
@ -37,6 +36,8 @@ import static java.time.temporal.ChronoUnit.SECONDS;
*/
public class RepositoryManger implements Observable {
private static final Logger logger = LogManager.getLogger(RepositoryManger.class);
private static RepositoryManger instance;
public static ArrayList<AbstractMod> MOD_LIST = new ArrayList<>();
@ -52,6 +53,7 @@ public class RepositoryManger implements Observable {
}
public void getAsync(String urlS, Callback.HttpCallback callback) {
logger.info("async http request {}", urlS);
new Thread(() -> {
try {
URI url = new URI(urlS);
@ -70,13 +72,13 @@ public class RepositoryManger implements Observable {
Response r = new Response(response);
if (!r.isSuccessful()) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Cant open " + r.request().uri() + " code " + r.getStatusCode());
logger.error("Cant open {} code {}", r.request().uri(), r.getStatusCode());
return;
}
callback.response(r);
} catch (IOException | URISyntaxException | InterruptedException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
callback.response(null);
}
}).start();
@ -132,7 +134,7 @@ public class RepositoryManger implements Observable {
statusMap.replace(Type.METADATA, DownloadStatus.FINNISHED);
RepositoryManger.getInstance().notifyObservers(Type.METADATA.toString());
} catch (NullPointerException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
});
@ -198,7 +200,7 @@ public class RepositoryManger implements Observable {
statusMap.replace(Type.MODSET, DownloadStatus.FINNISHED);
RepositoryManger.getInstance().notifyObservers(Type.MODSET.toString());
} catch (NullPointerException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
});

View File

@ -3,6 +3,8 @@ package de.mc8051.arma3launcher.repo;
import de.mc8051.arma3launcher.ArmA3Launcher;
import de.mc8051.arma3launcher.utils.Callback;
import de.mc8051.arma3launcher.utils.URLUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
@ -14,14 +16,14 @@ import java.net.http.HttpResponse;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 29.03.2020.
*/
public class Updater {
private static final Logger logger = LogManager.getLogger(Updater.class);
private File patcherFile = new File(ArmA3Launcher.APPLICATION_PATH + File.separator + "patcher.jar");
private File me;
private long lastCheck = 0;
@ -37,17 +39,17 @@ public class Updater {
public void update() throws IOException {
if (!me.exists() || !me.isFile()) throw new IOException("Own jar not exists. Are you running in dev?");
if (!patcherFile.exists()) throw new IOException("Patcher does not exists");
Runtime.getRuntime().exec(
"\"" + System.getProperty("java.home") + File.separator + "bin" + File.separator + "java\"" +
" -jar \"" + patcherFile.getAbsolutePath() + "\"" +
" \"" + ArmA3Launcher.config.getString("sync.url") + "/.sync/" + URLUtils.encodeToURL(newFile) + "\"" +
" \"" + me.getAbsolutePath() + "\""
);
final String command = "\"" + System.getProperty("java.home") + File.separator + "bin" + File.separator + "java\"" +
" -jar \"" + patcherFile.getAbsolutePath() + "\"" +
" \"" + ArmA3Launcher.config.getString("sync.url") + "/.sync/" + URLUtils.encodeToURL(newFile) + "\"" +
" \"" + me.getAbsolutePath() + "\"";
logger.info("Run patcher: {}", command);
Runtime.getRuntime().exec(command);
}
public void downloadPatcher() {
if(patcherFile.exists()) {
Logger.getLogger(getClass().getName()).log(Level.INFO, "Patcher already exists. Skip.");
logger.info("Patcher already exists. Skip copy.");
return;
}
try {
@ -63,13 +65,13 @@ public class Updater {
if (r.statusCode() != 200) return;
try {
Files.copy(tempFile, patcherFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
Logger.getLogger(getClass().getName()).log(Level.INFO, "Patcher copied to " + patcherFile.getAbsolutePath());
logger.info("Patcher copied to " + patcherFile.getAbsolutePath());
} catch (IOException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Copy patcher failed", e);
logger.error("Copy patcher failed", e);
}
});
} catch (IOException | URISyntaxException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
@ -86,6 +88,8 @@ public class Updater {
return;
}
logger.info("Check for newest version");
getNewestVersion(new Callback.HttpCallback() {
@Override
public void response(Response r) {
@ -98,6 +102,8 @@ public class Updater {
if(needUpdate) downloadPatcher();
lastCheck = System.currentTimeMillis();
logger.info(needUpdate ? "Need to update to {}" : "already on newest version {}", newestVersion.get());
callback.response(needUpdate, newestVersion);
}
});

View File

@ -8,7 +8,7 @@ public class Version implements Comparable<Version> {
return this.version;
}
public Version(String version) {
public Version(String version) throws IllegalArgumentException {
if (version == null)
throw new IllegalArgumentException("Version can not be null");
if (!version.matches("[0-9]+(\\.[0-9]+)*"))

View File

@ -13,6 +13,8 @@ import de.mc8051.arma3launcher.objects.AbstractMod;
import de.mc8051.arma3launcher.objects.ModFile;
import de.mc8051.arma3launcher.utils.Humanize;
import de.mc8051.arma3launcher.utils.TaskBarUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.swing.*;
import java.io.File;
@ -27,15 +29,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
/**
* Created by gurkengewuerz.de on 25.03.2020.
*/
public class Syncer implements Observable, SyncListener {
private static final Logger logger = LogManager.getLogger(Syncer.class);
private List<Observer> observerList = new ArrayList<>();
private boolean stopped = false;
@ -120,7 +121,7 @@ public class Syncer implements Observable, SyncListener {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
continue;
} else if (lastPause) {
@ -132,7 +133,7 @@ public class Syncer implements Observable, SyncListener {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
@ -144,6 +145,8 @@ public class Syncer implements Observable, SyncListener {
}
if (mf != null) {
logger.info("ZSync - Sync file {}", mf.getLocaleFile().getAbsolutePath());
final Path mfPath = mf.getLocaleFile().toPath();
final String mfModPath = mf.getModPath();
if(!workshopFiles.isEmpty()) {
@ -152,8 +155,10 @@ public class Syncer implements Observable, SyncListener {
Map.Entry<Path, Long> workshopFile = workshopFiles.entrySet()
.stream().filter(e -> e.getKey().toAbsolutePath().toString().toLowerCase().endsWith(modfilePatj)).findFirst().get();
if(workshopFile.getValue() == mf.getSize()) {
logger.info("ZSync - Found file in {}. Copy.", workshopFile.getKey());
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(mfModPath + ": Found in Steam-Workshop. Copy."));
Files.copy(workshopFile.getKey(), mfPath, StandardCopyOption.REPLACE_EXISTING);
logger.info("ZSync - Copied");
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(mfModPath + ": Copied"));
success++;
finnishCurrent();
@ -161,12 +166,6 @@ public class Syncer implements Observable, SyncListener {
}
} catch (NoSuchElementException | IOException ignored) {}
}
if(workshopFiles.containsKey(mfPath)) {
final Long workshopFileSize = workshopFiles.get(mfPath);
if(mf.getSize() == workshopFileSize) {
Logger.getLogger(getClass().getName()).log(Level.INFO, mfPath + "");
}
}
Zsync.Options o = new Zsync.Options();
o.setOutputFile(Paths.get(mf.getLocaleFile().getAbsolutePath()));
@ -179,7 +178,7 @@ public class Syncer implements Observable, SyncListener {
syncObserver = new SyncObserver(this);
zsync.zsync(URI.create(mf.getRemoteFile() + ".zsync"), o, syncObserver);
} catch (ZsyncException | IllegalArgumentException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
} else {
modlist.remove(0);
@ -206,7 +205,9 @@ public class Syncer implements Observable, SyncListener {
.filter((p) -> p.toFile().exists())
.filter((p) -> p.toFile().canRead())
.filter((p) -> p.toFile().canWrite())
.forEach((p) -> p.toFile().delete());
.forEach((p) -> {
logger.info(p.toFile().delete() ? "ZSync - Deleted file {}" : "ZSync - Error deleting file", p);
});
}
public void cleanUpEmptyFolders() {
@ -220,22 +221,24 @@ public class Syncer implements Observable, SyncListener {
.filter((p) -> p.toFile().canRead())
.filter((p) -> p.toFile().canWrite())
.filter((p) -> p.toFile().list().length == 0)
.forEach((p) -> p.toFile().delete());
.forEach((p) -> {
logger.info(p.toFile().delete() ? "ZSync - Deleted empty folder {}" : "ZSync - Error deleting empty folder", p);
});;
} catch (IOException e) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
@Override
public void zsyncStarted(Zsync.Options options) {
Logger.getLogger(getClass().getName()).log(Level.INFO, "ZSync started " + options.getOutputFile());
logger.info("ZSync - started " + options.getOutputFile());
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Sync started"));
}
@Override
public void zsyncFailed(Exception exception) {
currentDownload_failed = true;
Logger.getLogger(getClass().getName()).log(Level.INFO, "Zsync failed " + exception.getMessage());
logger.error("ZSync - failed", exception);
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Sync failed"));
}
@ -245,14 +248,14 @@ public class Syncer implements Observable, SyncListener {
speedCalcTime+=System.currentTimeMillis()-downloadStarted;
if (speedCalcSize > 20 * 1024 * 1024) {
final double speedByte = ((double)speedCalcSize)/((double)speedCalcTime /1000);
logger.info("ZSync - download speed: {} bytes/s", speedByte);
SwingUtilities.invokeLater(() -> gui.syncDownloadSpeedLabel.setText(Humanize.binaryPrefix(Double.valueOf(speedByte).longValue()) + "/s"));
speedCalcSize = 0L;
speedCalcTime = 0L;
}
Logger.getLogger(getClass().getName()).log(Level.INFO, "Zsync complete");
logger.info("ZSync - complete");
if (currentDownload_failed)
failed++;
@ -284,44 +287,46 @@ public class Syncer implements Observable, SyncListener {
@Override
public void controlFileDownloadingStarted(Path path, long length) {
Logger.getLogger(getClass().getName()).log(Level.INFO, "controlFileDownloadingStarted " + length);
logger.debug("ZSync - control file downloading started: length {} bytes", length);
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Get Header"));
}
@Override
public void controlFileReadingComplete() {
logger.debug("ZSync - control file downloading complete");
}
@Override
public void outputFileWritingStarted(long length) {
logger.debug("ZSync - output file writing started: {} bytes", length);
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Writing File"));
}
@Override
public void outputFileWritingCompleted() {
logger.debug("ZSync - output file writing completed");
}
@Override
public void inputFileReadingStarted(Path inputFile, long length) {
logger.info("ZSync - input file reading started: {} bytes", length);
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Reading File"));
}
@Override
public void inputFileReadingComplete() {
logger.debug("ZSync - input file reading complete");
}
@Override
public void controlFileDownloadingComplete() {
Logger.getLogger(getClass().getName()).log(Level.INFO, "controlFileDownloadingComplete");
logger.debug("ZSync - control file downloading complete");
}
@Override
public void remoteFileDownloadingInitiated(List<ContentRange> ranges) {
downloadStarted = System.currentTimeMillis();
Logger.getLogger(getClass().getName()).log(Level.INFO, "remoteFileDownloadingInitiated");
logger.debug("ZSync - remote file downloading initiated");
SwingUtilities.invokeLater(() -> gui.syncStatusLabel.setText(currentDownload.getModPath() + ": Downloading"));
}
@ -330,12 +335,12 @@ public class Syncer implements Observable, SyncListener {
downloadDownloaded = 0;
downloadSize = length;
Logger.getLogger(getClass().getName()).log(Level.INFO, "remoteFileDownloadingStarted " + length);
logger.info("ZSync - remote file downloading started: {} bytes", length);
}
@Override
public void remoteFileDownloadingComplete() {
Logger.getLogger(getClass().getName()).log(Level.INFO, "remoteFileDownloadingStarted");
logger.info("ZSync - remote file downloading complete");
}
@Override

View File

@ -1,6 +1,8 @@
package de.mc8051.arma3launcher.repo.sync;
import de.mc8051.arma3launcher.Parameters;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.nio.file.Files;
@ -15,6 +17,8 @@ import java.util.stream.Collectors;
*/
public class WorkshopUtil {
private static final Logger logger = LogManager.getLogger(WorkshopUtil.class);
public static Map<Path, Long> workshopFiles() {
Map<Path, Long> fileMap = new HashMap<>();
@ -22,8 +26,12 @@ public class WorkshopUtil {
if(armaPath == null) return fileMap;
final Path workshopPath = Paths.get(armaPath, "!Workshop");
logger.debug("Get workshop files in {}", workshopPath);
if(!workshopPath.toFile().exists()) return fileMap;
if(!workshopPath.toFile().exists()) {
logger.debug("Workshop folder does not exists");
return fileMap;
}
if(!workshopPath.toFile().isDirectory()) return fileMap;
try {
@ -32,6 +40,7 @@ public class WorkshopUtil {
(filePath, fileAttr) -> fileAttr.isRegularFile())
.filter((p) -> p.toFile().getName().endsWith(".pbo"))
.collect(Collectors.toMap(path -> path, path -> path.toFile().length()));
logger.info("Found {} Workshop files", fileMap.size());
return fileMap;
} catch (IOException ex) {
return fileMap;

View File

@ -3,18 +3,20 @@ package de.mc8051.arma3launcher.steam;
import de.mc8051.arma3launcher.WinRegistry;
import de.mc8051.arma3launcher.interfaces.Observer;
import de.mc8051.arma3launcher.utils.SteamUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.util.ArrayList;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 23.03.2020.
*/
public class SteamTimer extends TimerTask {
private static final Logger logger = LogManager.getLogger(SteamTimer.class);
private static ArrayList<Observer> observers = new ArrayList<>();
private static boolean old_steamrunning = false;
public static boolean steam_running = false;
@ -37,27 +39,32 @@ public class SteamTimer extends TimerTask {
return;
}
logger.debug("steam.exe found");
String activeSteamUser = WinRegistry.getValue("HKEY_CURRENT_USER\\Software\\Valve\\Steam\\ActiveProcess", "ActiveUser");
if (activeSteamUser.equals("0x0")) {
steam_running = false;
notifyObservers("steamtimer");
logger.debug("Steam ActiveUser 0x0");
return;
}
steam_running = true;
logger.debug("Steam ActiveUser {}", activeSteamUser);
arma_running = SteamUtils.findProcess("arma3.exe")
|| SteamUtils.findProcess("arma3_x64.exe")
|| SteamUtils.findProcess("arma3battleye.exe")
|| SteamUtils.findProcess("arma3launcher.exe");
logger.debug(arma_running ? "ArmA process found" : "ArmA process not found");
notifyObservers("steamtimer");
} catch (IOException | InterruptedException e) {
steam_running = false;
arma_running = false;
notifyObservers("steamtimer");
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
@ -67,6 +74,8 @@ public class SteamTimer extends TimerTask {
public void notifyObservers(String obj) {
if (old_arma_running != arma_running || old_steamrunning != steam_running || !firstRun) {
logger.info("Steam timer values changed - Steam from {} to {} - ArmA from {} to {}",
old_steamrunning, steam_running, old_arma_running, arma_running);
for (Observer o : observers) o.update(obj);
firstRun = true;
}

View File

@ -4,17 +4,17 @@ import de.mc8051.arma3launcher.Parameter;
import de.mc8051.arma3launcher.Parameters;
import de.mc8051.arma3launcher.WinRegistry;
import de.mc8051.arma3launcher.objects.Modset;
import de.mc8051.arma3launcher.steam.SteamTimer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
/**
@ -22,41 +22,59 @@ import java.util.stream.Collectors;
*/
public class ArmaUtils {
private static final Logger logger = LogManager.getLogger(ArmaUtils.class);
public static Path getInstallationPath() {
logger.debug("Find ArmA 3 installation path");
String regKey = null;
try {
regKey = WinRegistry.getValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\bohemia interactive\\arma 3", "main");
logger.debug("Found installation path in 32-bit registry");
} catch (IOException | InterruptedException ignored) {
try {
regKey = WinRegistry.getValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\bohemia interactive\\arma 3", "main");
logger.debug("Found installation path in 64-bit registry");
} catch (IOException | InterruptedException e) {
Logger.getLogger(ArmaUtils.class.getName()).log(Level.INFO, "Arma patch cant be detected automatically");
logger.error("Arma patch cant be detected automatically", e);
}
}
if (regKey == null) return null;
final Path main = Paths.get(regKey);
if (!checkArmaPath(main)) return null;
logger.info("ArmA 3 installation path found in {}", main);
return main;
}
public static boolean checkArmaPath(Path path) {
logger.debug("Checking if valid ArmA path {}", path);
ArrayList<String> search = new ArrayList<>(Arrays.asList("arma3.exe", "steam.dll"));
final File f = path.toFile();
if (!f.exists() || !f.isDirectory()) return false;
if (f.listFiles() == null) return false;
if (!f.exists() || !f.isDirectory()) {
logger.debug("ArmA path does not exists or is not a directory");
return false;
}
if (f.listFiles() == null) {
logger.debug("ArmA path does not contain files");
return false;
}
File[] listOfFiles = f.listFiles();
try {
for (File file : listOfFiles) {
if (search.isEmpty()) return true;
if (search.isEmpty()) {
logger.info("Found valid ArmA path {}", path);
return true;
}
if (file.isFile()) {
search.remove(file.getName().toLowerCase());
}
}
} catch (NullPointerException ex) {
} catch (NullPointerException ignored) {
logger.debug("ArmA path is invalid");
return false;
}
logger.debug("ArmA is invalid. Not all files found. missing: {}", search);
return false;
}
@ -96,19 +114,21 @@ public class ArmaUtils {
}
public static void start(Modset modset, String... additionalParams) {
logger.info("Start ArmA with modset {}", modset.getName());
final Parameter armaPathParameter = Parameters.ARMA_PATH.toParameter();
File arma3battleye = new File((String) armaPathParameter.getValue(), "arma3battleye.exe");
logger.debug("ArmA 3 BattleEye executable {}", arma3battleye.getAbsolutePath());
final Parameter use64Bit = Parameters.USE_64_BIT_CLIENT.toParameter();
String gameParameters = getGameParameter(modset);
String additionalParameters = String.join(" ", additionalParams);
String battleEye = "\"" + arma3battleye.getAbsolutePath() + "\" 2 1 1 -exe " + ((Boolean) use64Bit.getValue() ? "arma3_x64.exe" : "arma3.exe");
String command = battleEye + " " + gameParameters + " " + additionalParameters;
Logger.getLogger(ArmaUtils.class.getName()).log(Level.INFO, command);
logger.info(command);
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
Logger.getLogger(ArmaUtils.class.getName()).log(Level.INFO, "Starting failed!", e);
logger.error("Starting failed!", e);
}
}
}

View File

@ -1,18 +1,21 @@
package de.mc8051.arma3launcher.utils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 27.03.2020.
*/
public class TaskBarUtils {
private static final Logger logger = LogManager.getLogger(TaskBarUtils.class);
public static BufferedImage IMAGE_ICON = createIcon();
public static BufferedImage IMAGE_LGO = createLogo();
@ -31,6 +34,8 @@ public class TaskBarUtils {
taskbar = Taskbar.getTaskbar();
}
logger.info(isTaskbarSupported ? "Taskbar is supported" : "Taskbar not supported");
isSystemtraySupported = SystemTray.isSupported();
if (isSystemtraySupported) {
tray = SystemTray.getSystemTray();
@ -54,9 +59,11 @@ public class TaskBarUtils {
});
});
} catch (AWTException e) {
Logger.getLogger(TaskBarUtils.class.getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
}
logger.info(isSystemtraySupported ? "Systemtray is supported" : "Systemtray not supported");
}
public static TaskBarUtils getInstance() {
@ -109,7 +116,7 @@ public class TaskBarUtils {
public void notification(String caption, String text, TrayIcon.MessageType type) {
if (!isSystemtraySupported) return;
if (trayIcon == null) return;
logger.debug("Sending notification: {} {}", caption, text);
trayIcon.displayMessage(caption, text, type);
}
@ -127,7 +134,7 @@ public class TaskBarUtils {
try {
return ImageIO.read(TaskBarUtils.class.getResourceAsStream("/icons/logo_32.png"));
} catch (IOException e) {
Logger.getLogger(TaskBarUtils.class.getName()).log(Level.SEVERE, null, e);
logger.error(e);
return null;
}
}
@ -136,7 +143,7 @@ public class TaskBarUtils {
try {
return ImageIO.read(TaskBarUtils.class.getResourceAsStream("/icons/logo_256.png"));
} catch (IOException e) {
Logger.getLogger(TaskBarUtils.class.getName()).log(Level.SEVERE, null, e);
logger.error(e);
return null;
}
}

View File

@ -1,21 +1,24 @@
package de.mc8051.arma3launcher.utils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by gurkengewuerz.de on 29.03.2020.
*/
public class URLUtils {
private static final Logger logger = LogManager.getLogger(URLUtils.class);
public static String encodeToURL(String s) {
try {
return URLEncoder.encode(s, StandardCharsets.UTF_8.name()).replace("+", "%20").replace("@", "%40");
} catch (UnsupportedEncodingException e) {
Logger.getLogger(URLUtils.class.getName()).log(Level.SEVERE, null, e);
logger.error(e);
}
return "";
}

View File

@ -17,7 +17,8 @@
"CheckModset": false,
"UseWorkshop": false,
"behaviourAfterStart": "nothing",
"language": "system"
"language": "system",
"debug": false
},
"arma": {
"Profile": "",

View File

@ -181,5 +181,22 @@ nicht jeder Fehler unsererseits behoben werden kann.
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,<br/>
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br/>
</tt>
<h2>org.apache.log4j</h2>
<tt>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</tt>
</body>
</html>

View File

@ -71,12 +71,7 @@ use64bitclient_desc=Startet Arma3 mit der f
use_workshop=Versuche Workshop Inhalte zu nutzen
use_workshop_desc=Bei großen Modspacks versucht der Client bereits heruntergeladene Workshop Inhalte, die gleich sind, zu kopieren um so den Download schneller zu gestalten
warning=Warnung
warning_workshop=Der Client versucht sein bestes die gleichen Dateien zu finden,\
jedoch kann es vorkommen das es nicht die identischen Dateien sind.\
Im Falle eines Fehlgeschlagenem Syncen mit dieser Option, solltest\
du sie deaktivieren und ohne diese Option erneut syncen.\
\
Ebenfalls könnte es zu kurzen Performance einbußen kommen.
warning_workshop=Der Client versucht sein bestes die gleichen Dateien zu finden, jedoch kann es vorkommen das es nicht die identischen Dateien sind. Im Falle eines Fehlgeschlagenem Syncen mit dieser Option, solltest du sie deaktivieren und ohne diese Option erneut syncen. Ebenfalls könnte es zu kurzen Performance einbußen kommen.Der Client versucht sein bestes die gleichen Dateien zu finden, jedoch kann es vorkommen das es nicht die identischen Dateien sind. Im Falle eines fehlgeschlagenem Syncen mit dieser Option, solltest du sie deaktivieren und ohne diese Option erneut syncen. Ebenfalls könnte es zu kurzen Performance einbußen kommen.
window_desc=Ist diese Option aktiv, wird Arma 3 im Fenstermodus gestartet.
world_desc=Hier kann eine Karte eingetragen werden, die geladen und in den Menüs als Hintergrund angezeigt werden soll (z.B. „altis“ oder „stratis“ ohne Anführungszeichen!). Ist das Feld leer, wird keine Karte während des Startens geladen und der Start von Arma 3 ist entsprechend schneller.
path_not_set=ArmA oder Mod Verzeichnis nicht gesetzt
@ -114,4 +109,6 @@ modset_exists_msg=Bitte w
modset_exists=Preset mit diesen Namen existiert bereits
update_now=Jetzt updaten!
arma_path_not_found=ArmA 3 Pfad nicht gefunden
arma_path_not_found_msg=Der Installationsordner von ArmA 3 konnte nicht automatisch erkannt werden. Bitte gehe zuerst in die Einstellungen.
arma_path_not_found_msg=Der Installationsordner von ArmA 3 konnte nicht automatisch erkannt werden. Bitte gehe zuerst in die Einstellungen.
use_debug=Detaillierter Log
use_debug_tooltip=Der Client benutzt einen detaillierten Log. Die Funktion ist nur wichtig, wenn du einen Fehler melden möchtest

View File

@ -112,4 +112,6 @@ modset_exists_msg=Please choose another name for your preset.
modset_exists=Preset with these names already exists
update_now=Update now!
arma_path_not_found=ArmA 3 path can't be detected
arma_path_not_found_msg=The installation folder of ArmA 3 could not be detected automatically. Please go to the settings first.
arma_path_not_found_msg=The installation folder of ArmA 3 could not be detected automatically. Please go to the settings first.
use_debug=Use debug log
use_debug_tooltip=The client uses a detailed log. This function is only important if you want to report an error.

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Properties>
<Property name="logPath">logs/</Property>
<Property name="rollingFileName">launcher</Property>
</Properties>
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout
pattern="[%highlight{%-5level}] %d{DEFAULT} %c{1}.%M() - %msg%n%throwable{short.lineNumber}"/>
</Console>
<RollingFile name="rollingFile" fileName="${logPath}/${rollingFileName}.log"
filePattern="${logPath}/${rollingFileName}_%d{yyyy-MM-dd}.log">
<PatternLayout
pattern="[%highlight{%-5level}] %d{DEFAULT} %c{1}.%M() - %msg%n%throwable{short.lineNumber}"/>
<Policies>
<!-- Causes a rollover if the log file is older than the current JVM's start time -->
<OnStartupTriggeringPolicy/>
<!-- Causes a rollover once the date/time pattern no longer applies to the active file -->
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="${logPath}" maxDepth="2">
<IfFileName glob="*/${rollingFileName}*.log">
<IfLastModified age="2d">
<IfAny>
<IfAccumulatedFileCount exceeds="10"/>
</IfAny>
</IfLastModified>
</IfFileName>
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
</Appenders>
<Loggers>
<Root level="DEBUG" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="rollingFile"/>
</Root>
</Loggers>
</Configuration>

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<properties>
<gui.version>0.1.1002</gui.version>
<gui.version>0.1.1003</gui.version>
</properties>
<groupId>de.mc8051</groupId>