L2ClientDat decoder.
This commit is contained in:
52
L2ClientDat/java/com/l2jmobius/config/ConfigDebug.java
Normal file
52
L2ClientDat/java/com/l2jmobius/config/ConfigDebug.java
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import com.l2jmobius.util.DebugUtil;
|
||||
|
||||
import jfork.nproperty.Cfg;
|
||||
import jfork.nproperty.CfgIgnore;
|
||||
import jfork.nproperty.ConfigParser;
|
||||
|
||||
@Cfg
|
||||
public class ConfigDebug extends ConfigParser
|
||||
{
|
||||
@CfgIgnore
|
||||
private static final ConfigDebug _instance = new ConfigDebug();
|
||||
public static boolean DAT_ADD_END_BYTES = true;
|
||||
public static boolean DAT_DEBUG_MSG = false;
|
||||
public static boolean DAT_DEBUG_POS = false;
|
||||
public static int DAT_DEBUG_POS_LIMIT = 100000;
|
||||
public static boolean DAT_REPLACEMENT_NAMES = true;
|
||||
public static boolean ENCRYPT = true;
|
||||
public static boolean SAVE_DECODE = false;
|
||||
|
||||
public static void load()
|
||||
{
|
||||
try
|
||||
{
|
||||
ConfigParser.parse((_instance), "./config/config_debug.ini");
|
||||
}
|
||||
catch (IOException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e)
|
||||
{
|
||||
DebugUtil.getLogger().error("Failed to load configuration file.", e);
|
||||
}
|
||||
}
|
||||
}
|
78
L2ClientDat/java/com/l2jmobius/config/ConfigWindow.java
Normal file
78
L2ClientDat/java/com/l2jmobius/config/ConfigWindow.java
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.config;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.l2jmobius.util.DebugUtil;
|
||||
|
||||
import jfork.nproperty.Cfg;
|
||||
import jfork.nproperty.CfgIgnore;
|
||||
import jfork.nproperty.ConfigParser;
|
||||
|
||||
@Cfg
|
||||
public class ConfigWindow extends ConfigParser
|
||||
{
|
||||
@CfgIgnore
|
||||
private static final ConfigWindow _instance = new ConfigWindow();
|
||||
@CfgIgnore
|
||||
private static final String PATH = "./config/config_window.ini";
|
||||
public static String FILE_OPEN_CURRENT_DIRECTORY_UNPACK = ".";
|
||||
public static String FILE_OPEN_CURRENT_DIRECTORY_PACK = ".";
|
||||
public static String FILE_OPEN_CURRENT_DIRECTORY = ".";
|
||||
public static String FILE_SAVE_CURRENT_DIRECTORY = ".";
|
||||
public static String CURRENT_CHRONICLE = "";
|
||||
public static int WINDOW_HEIGHT = 600;
|
||||
public static int WINDOW_WIDTH = 800;
|
||||
public static String CURRENT_ENCRYPT = ".";
|
||||
public static String CURRENT_DECRYPT = ".";
|
||||
public static String LAST_FILE_SELECTED = ".";
|
||||
|
||||
public static void load()
|
||||
{
|
||||
try
|
||||
{
|
||||
ConfigParser.parse((_instance), PATH);
|
||||
}
|
||||
catch (IOException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e)
|
||||
{
|
||||
DebugUtil.getLogger().error("Failed to load configuration file.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void save(String key, String var)
|
||||
{
|
||||
try
|
||||
{
|
||||
Properties props = new Properties();
|
||||
props.load(new FileInputStream(PATH));
|
||||
props.setProperty(key, var);
|
||||
FileOutputStream output = new FileOutputStream(PATH);
|
||||
props.store(output, "Saved settings");
|
||||
output.close();
|
||||
ConfigWindow.load();
|
||||
}
|
||||
catch (Exception props)
|
||||
{
|
||||
// empty catch block
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user