Replaced qualified names with simple names.
This commit is contained in:
@@ -174,8 +174,8 @@ public class L2ClientDat extends JFrame
|
||||
{
|
||||
currentFileWindow = fileopen.getSelectedFile();
|
||||
ConfigWindow.save("FILE_OPEN_CURRENT_DIRECTORY_PACK", currentFileWindow.getPath());
|
||||
L2ClientDat.addLogConsole("---------------------------------------", true);
|
||||
L2ClientDat.addLogConsole("selected folder: " + currentFileWindow.getPath(), true);
|
||||
addLogConsole("---------------------------------------", true);
|
||||
addLogConsole("selected folder: " + currentFileWindow.getPath(), true);
|
||||
try
|
||||
{
|
||||
MassTxtPacker.getInstance().pack(String.valueOf(jComboBoxChronicle.getSelectedItem()), currentFileWindow.getPath(), CryptVersionParser.getInstance().getEncryptKey(String.valueOf(jComboBoxEncrypt.getSelectedItem())));
|
||||
@@ -199,8 +199,8 @@ public class L2ClientDat extends JFrame
|
||||
{
|
||||
currentFileWindow = fileopen.getSelectedFile();
|
||||
ConfigWindow.save("FILE_OPEN_CURRENT_DIRECTORY_UNPACK", currentFileWindow.getPath());
|
||||
L2ClientDat.addLogConsole("---------------------------------------", true);
|
||||
L2ClientDat.addLogConsole("selected folder: " + currentFileWindow.getPath(), true);
|
||||
addLogConsole("---------------------------------------", true);
|
||||
addLogConsole("selected folder: " + currentFileWindow.getPath(), true);
|
||||
try
|
||||
{
|
||||
MassTxtUnpacker.getInstance().unpack(String.valueOf(jComboBoxChronicle.getSelectedItem()), currentFileWindow.getPath(), CryptVersionParser.getInstance().getDecryptKey(String.valueOf(jComboBoxDecrypt.getSelectedItem())));
|
||||
@@ -224,8 +224,8 @@ public class L2ClientDat extends JFrame
|
||||
{
|
||||
currentFileWindow = fileopen.getSelectedFile();
|
||||
ConfigWindow.save("FILE_OPEN_CURRENT_DIRECTORY", currentFileWindow.getPath());
|
||||
L2ClientDat.addLogConsole("---------------------------------------", true);
|
||||
L2ClientDat.addLogConsole("selected folder: " + currentFileWindow.getPath(), true);
|
||||
addLogConsole("---------------------------------------", true);
|
||||
addLogConsole("selected folder: " + currentFileWindow.getPath(), true);
|
||||
try
|
||||
{
|
||||
MassRecryptor.getInstance().recrypt(String.valueOf(jComboBoxChronicle.getSelectedItem()), currentFileWindow.getPath(), CryptVersionParser.getInstance().getDecryptKey(String.valueOf(jComboBoxDecrypt.getSelectedItem())), CryptVersionParser.getInstance().getEncryptKey(String.valueOf(jComboBoxEncrypt.getSelectedItem())));
|
||||
@@ -251,8 +251,8 @@ public class L2ClientDat extends JFrame
|
||||
{
|
||||
currentFileWindow = fileopen.getSelectedFile();
|
||||
ConfigWindow.save("LAST_FILE_SELECTED", currentFileWindow.getAbsolutePath());
|
||||
L2ClientDat.addLogConsole("---------------------------------------", true);
|
||||
L2ClientDat.addLogConsole("Open file: " + currentFileWindow.getName(), true);
|
||||
addLogConsole("---------------------------------------", true);
|
||||
addLogConsole("Open file: " + currentFileWindow.getName(), true);
|
||||
try
|
||||
{
|
||||
OpenDat.start(String.valueOf(jComboBoxChronicle.getSelectedItem()), currentFileWindow, currentFileWindow.getName(), CryptVersionParser.getInstance().getDecryptKey(String.valueOf(jComboBoxDecrypt.getSelectedItem())));
|
||||
@@ -289,13 +289,13 @@ public class L2ClientDat extends JFrame
|
||||
{
|
||||
// empty catch block
|
||||
}
|
||||
L2ClientDat.addLogConsole("---------------------------------------", true);
|
||||
L2ClientDat.addLogConsole("Saved: " + f.getPath(), true);
|
||||
addLogConsole("---------------------------------------", true);
|
||||
addLogConsole("Saved: " + f.getPath(), true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
L2ClientDat.addLogConsole("No open file!", true);
|
||||
addLogConsole("No open file!", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ public class L2ClientDat extends JFrame
|
||||
{
|
||||
if (currentFileWindow == null)
|
||||
{
|
||||
L2ClientDat.addLogConsole("Error saving dat. No file name.", true);
|
||||
addLogConsole("Error saving dat. No file name.", true);
|
||||
return;
|
||||
}
|
||||
byte[] buff = null;
|
||||
@@ -322,7 +322,7 @@ public class L2ClientDat extends JFrame
|
||||
buff = DescriptorWriter.parseData(currentFileWindow, crypter, desc, textPaneMain.getText());
|
||||
GameDataName.getInstance().checkAndUpdate(currentFileWindow.getParent(), crypter);
|
||||
}
|
||||
L2ClientDat.addLogConsole("Not found the structure of the file: " + currentFileWindow.getName(), true);
|
||||
addLogConsole("Not found the structure of the file: " + currentFileWindow.getName(), true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ public class L2ClientDat extends JFrame
|
||||
}
|
||||
if (buff == null)
|
||||
{
|
||||
L2ClientDat.addLogConsole("buff == null.", true);
|
||||
addLogConsole("buff == null.", true);
|
||||
return;
|
||||
}
|
||||
try
|
||||
@@ -352,7 +352,7 @@ public class L2ClientDat extends JFrame
|
||||
DebugUtil.getLogger().error(e.getMessage(), e);
|
||||
return;
|
||||
}
|
||||
L2ClientDat.addLogConsole("Packed successfully.", true);
|
||||
addLogConsole("Packed successfully.", true);
|
||||
}
|
||||
|
||||
private void saveComboBox(JComboBox<?> jComboBox, String param)
|
||||
|
@@ -68,7 +68,7 @@ public class ConfigWindow extends ConfigParser
|
||||
FileOutputStream output = new FileOutputStream(PATH);
|
||||
props.store(output, "Saved settings");
|
||||
output.close();
|
||||
ConfigWindow.load();
|
||||
load();
|
||||
}
|
||||
catch (Exception props)
|
||||
{
|
||||
|
@@ -43,7 +43,7 @@ public class ByteReader
|
||||
|
||||
public static int readUInt(ByteBuffer buffer)
|
||||
{
|
||||
return ByteReader.readInt(buffer);
|
||||
return readInt(buffer);
|
||||
}
|
||||
|
||||
public static short readShort(ByteBuffer buffer)
|
||||
@@ -135,12 +135,12 @@ public class ByteReader
|
||||
{
|
||||
a = "0" + a;
|
||||
}
|
||||
return a + ByteReader.readRGB(buffer);
|
||||
return a + readRGB(buffer);
|
||||
}
|
||||
|
||||
public static String readUtfString(ByteBuffer buffer, boolean isRaw) throws Exception
|
||||
{
|
||||
int size = ByteReader.readInt(buffer);
|
||||
int size = readInt(buffer);
|
||||
if (size <= 0)
|
||||
{
|
||||
return "";
|
||||
@@ -162,19 +162,19 @@ public class ByteReader
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ByteReader.checkAndReplaceNewLine(isRaw, new String(new String(bytes, "Unicode").getBytes("UTF-8"), "UTF-8"));
|
||||
return checkAndReplaceNewLine(isRaw, new String(new String(bytes, "Unicode").getBytes("UTF-8"), "UTF-8"));
|
||||
}
|
||||
|
||||
public static String readString(ByteBuffer input, boolean isRaw) throws IOException
|
||||
{
|
||||
int len = ByteReader.readCompactInt(input);
|
||||
int len = readCompactInt(input);
|
||||
if (len == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
byte[] bytes = new byte[len > 0 ? len : -2 * len];
|
||||
input.get(bytes);
|
||||
return ByteReader.checkAndReplaceNewLine(isRaw, new String(bytes, 0, bytes.length - (len > 0 ? 1 : 2), len > 0 ? defaultCharset : utf16leCharset).intern());
|
||||
return checkAndReplaceNewLine(isRaw, new String(bytes, 0, bytes.length - (len > 0 ? 1 : 2), len > 0 ? defaultCharset : utf16leCharset).intern());
|
||||
}
|
||||
|
||||
private static String checkAndReplaceNewLine(boolean isRaw, String str)
|
||||
|
@@ -36,7 +36,7 @@ public class ByteWriter
|
||||
|
||||
public static Buffer writeCompactInt(int count)
|
||||
{
|
||||
byte[] b = ByteWriter.compactIntToByteArray(count);
|
||||
byte[] b = compactIntToByteArray(count);
|
||||
ByteBuffer buffer = ByteBuffer.allocate(b.length).order(BYTE_ORDER);
|
||||
buffer.put(b);
|
||||
return buffer;
|
||||
@@ -97,7 +97,7 @@ public class ByteWriter
|
||||
public static Buffer writeRGBA(String rgba)
|
||||
{
|
||||
ByteBuffer buffer = ByteBuffer.allocate(4).order(BYTE_ORDER);
|
||||
buffer.put((byte[]) ByteWriter.writeRGB(rgba.substring(0, 6)).array());
|
||||
buffer.put((byte[]) writeRGB(rgba.substring(0, 6)).array());
|
||||
buffer.put((byte) Integer.parseInt(rgba.substring(6, 8), 16));
|
||||
return buffer;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class ByteWriter
|
||||
}
|
||||
if (!isRaw)
|
||||
{
|
||||
str = ByteWriter.checkAndReplaceNewLine(str);
|
||||
str = checkAndReplaceNewLine(str);
|
||||
size = str.length();
|
||||
}
|
||||
ByteBuffer buffer = ByteBuffer.allocate((size * 2) + 4).order(BYTE_ORDER);
|
||||
@@ -127,16 +127,16 @@ public class ByteWriter
|
||||
{
|
||||
if ((s == null) || s.isEmpty())
|
||||
{
|
||||
return ByteWriter.writeCompactInt(0);
|
||||
return writeCompactInt(0);
|
||||
}
|
||||
if (!isRaw)
|
||||
{
|
||||
s = ByteWriter.checkAndReplaceNewLine(s);
|
||||
s = checkAndReplaceNewLine(s);
|
||||
}
|
||||
s = s + '\u0000';
|
||||
boolean def = defaultCharset.newEncoder().canEncode(s);
|
||||
byte[] bytes = s.getBytes(def ? defaultCharset : utf16leCharset);
|
||||
byte[] bSize = ByteWriter.compactIntToByteArray(def ? bytes.length : (-bytes.length) / 2);
|
||||
byte[] bSize = compactIntToByteArray(def ? bytes.length : (-bytes.length) / 2);
|
||||
ByteBuffer buffer = ByteBuffer.allocate(bytes.length + bSize.length).order(BYTE_ORDER);
|
||||
buffer.put(bSize);
|
||||
buffer.put(bytes);
|
||||
|
@@ -75,9 +75,9 @@ public class Util
|
||||
{
|
||||
if ((counter % 16) == 0)
|
||||
{
|
||||
result.append(Util.fillHex(i, 4) + ": ");
|
||||
result.append(fillHex(i, 4) + ": ");
|
||||
}
|
||||
result.append(Util.fillHex(data[i] & 255, 2) + " ");
|
||||
result.append(fillHex(data[i] & 255, 2) + " ");
|
||||
if (++counter != 16)
|
||||
{
|
||||
continue;
|
||||
@@ -130,7 +130,7 @@ public class Util
|
||||
|
||||
public static String printData(byte[] blop)
|
||||
{
|
||||
return Util.printData(blop, blop.length);
|
||||
return printData(blop, blop.length);
|
||||
}
|
||||
|
||||
public static List<File> loadFiles(String dir, String prefix)
|
||||
@@ -225,7 +225,7 @@ public class Util
|
||||
{
|
||||
byte[] data = new byte[buf.remaining()];
|
||||
buf.get(data);
|
||||
String hex = Util.printData(data, data.length);
|
||||
String hex = printData(data, data.length);
|
||||
buf.position(buf.position() - data.length);
|
||||
return hex;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public class Util
|
||||
DiagnosticCollector diagnostics = new DiagnosticCollector();
|
||||
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
||||
StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);
|
||||
Iterable<? extends JavaFileObject> compilationUnit = fileManager.getJavaFileObjectsFromFiles(Util.loadFiles(sourceFile, ".java"));
|
||||
Iterable<? extends JavaFileObject> compilationUnit = fileManager.getJavaFileObjectsFromFiles(loadFiles(sourceFile, ".java"));
|
||||
JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnit);
|
||||
if (!task.call().booleanValue())
|
||||
{
|
||||
|
@@ -45,7 +45,7 @@ public class CryptVersionParser
|
||||
|
||||
private CryptVersionParser()
|
||||
{
|
||||
CryptVersionParser.parseCryptVersion();
|
||||
parseCryptVersion();
|
||||
}
|
||||
|
||||
private static void parseCryptVersion()
|
||||
|
@@ -77,7 +77,7 @@ public class DescriptorWriter
|
||||
}
|
||||
if (desc.isRawData())
|
||||
{
|
||||
Buffer result = DescriptorWriter.parseNodeValue(currentFile, crypter, data, desc.getNodes().get(0), true);
|
||||
Buffer result = parseNodeValue(currentFile, crypter, data, desc.getNodes().get(0), true);
|
||||
if (result != null)
|
||||
{
|
||||
stream.write((byte[]) result.array());
|
||||
@@ -92,7 +92,7 @@ public class DescriptorWriter
|
||||
ByteBuffer buffer = ByteBuffer.allocateDirect(data.length() * 2);
|
||||
String lines = data.replace("\r\n", "\t");
|
||||
HashMap<ParamNode, Integer> counters = new HashMap<>();
|
||||
DescriptorWriter.packData(currentFile, crypter, buffer, lines, counters, new HashMap<String, String>(), new HashMap<ParamNode, String>(), desc.getNodes());
|
||||
packData(currentFile, crypter, buffer, lines, counters, new HashMap<String, String>(), new HashMap<ParamNode, String>(), desc.getNodes());
|
||||
try
|
||||
{
|
||||
buffer.flip();
|
||||
@@ -133,22 +133,22 @@ public class DescriptorWriter
|
||||
{
|
||||
list.add(m.group(1));
|
||||
}
|
||||
DescriptorWriter.writeSize(currentFile, crypter, buffer, counters, node, list.size());
|
||||
writeSize(currentFile, crypter, buffer, counters, node, list.size());
|
||||
for (String str : list)
|
||||
{
|
||||
paramMap.putAll(Util.stringToMap(str));
|
||||
DescriptorWriter.packData(currentFile, crypter, buffer, str, counters, paramMap, mapData, node.getSubNodes());
|
||||
packData(currentFile, crypter, buffer, str, counters, paramMap, mapData, node.getSubNodes());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
param = DescriptorWriter.getDataString(node, node.getName(), paramMap, mapData);
|
||||
param = getDataString(node, node.getName(), paramMap, mapData);
|
||||
if (param == null)
|
||||
{
|
||||
throw new Exception("Error getDataString == null node: " + node.getName());
|
||||
}
|
||||
if (param.isEmpty() || param.equals("{}"))
|
||||
{
|
||||
DescriptorWriter.writeSize(currentFile, crypter, buffer, counters, node, 0);
|
||||
writeSize(currentFile, crypter, buffer, counters, node, 0);
|
||||
continue;
|
||||
}
|
||||
List<String> subParams = Util.splitList(param);
|
||||
@@ -157,7 +157,7 @@ public class DescriptorWriter
|
||||
{
|
||||
throw new Exception("Wrong static cycle count for cycle: " + node.getName() + " size: " + subParams.size() + " params: " + Arrays.toString(subParams.toArray()));
|
||||
}
|
||||
DescriptorWriter.writeSize(currentFile, crypter, buffer, counters, node, cycleSize);
|
||||
writeSize(currentFile, crypter, buffer, counters, node, cycleSize);
|
||||
int nPramNode = 0;
|
||||
int nCycleNode = 0;
|
||||
for (ParamNode n : node.getSubNodes())
|
||||
@@ -189,13 +189,13 @@ public class DescriptorWriter
|
||||
}
|
||||
mapData.put(n, sub2Params.get(paramIndex++));
|
||||
}
|
||||
DescriptorWriter.packData(currentFile, crypter, buffer, lines, counters, paramMap, mapData, node.getSubNodes());
|
||||
packData(currentFile, crypter, buffer, lines, counters, paramMap, mapData, node.getSubNodes());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (node.getEntityType().isWrapper())
|
||||
{
|
||||
List<String> subParams = Util.splitList(DescriptorWriter.getDataString(node, node.getName(), paramMap, mapData));
|
||||
List<String> subParams = Util.splitList(getDataString(node, node.getName(), paramMap, mapData));
|
||||
int paramIndex = 0;
|
||||
for (ParamNode n : node.getSubNodes())
|
||||
{
|
||||
@@ -205,19 +205,19 @@ public class DescriptorWriter
|
||||
}
|
||||
mapData.put(n, subParams.get(paramIndex++));
|
||||
}
|
||||
DescriptorWriter.packData(currentFile, crypter, buffer, lines, counters, paramMap, mapData, node.getSubNodes());
|
||||
packData(currentFile, crypter, buffer, lines, counters, paramMap, mapData, node.getSubNodes());
|
||||
continue;
|
||||
}
|
||||
if (node.getEntityType().isVariable())
|
||||
{
|
||||
buffer.put((byte[]) DescriptorWriter.parseNodeValue(currentFile, crypter, DescriptorWriter.getDataString(node, node.getName(), paramMap, mapData), node, false).array());
|
||||
buffer.put((byte[]) parseNodeValue(currentFile, crypter, getDataString(node, node.getName(), paramMap, mapData), node, false).array());
|
||||
continue;
|
||||
}
|
||||
if (!node.getEntityType().isIf() || ((param = DescriptorWriter.getDataString(node, node.getParamIf(), paramMap, mapData)) == null) || !node.getValIf().equalsIgnoreCase(param))
|
||||
if (!node.getEntityType().isIf() || ((param = getDataString(node, node.getParamIf(), paramMap, mapData)) == null) || !node.getValIf().equalsIgnoreCase(param))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
DescriptorWriter.packData(currentFile, crypter, buffer, lines, counters, paramMap, mapData, node.getSubNodes());
|
||||
packData(currentFile, crypter, buffer, lines, counters, paramMap, mapData, node.getSubNodes());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -336,7 +336,7 @@ public class DescriptorWriter
|
||||
throw new CycleArgumentException("Invalid argument [" + node.getName() + "] for cycle");
|
||||
}
|
||||
}
|
||||
Buffer buff = DescriptorWriter.parseNodeValue(currentFile, crypter, String.valueOf(cycleSize), iterator, false);
|
||||
Buffer buff = parseNodeValue(currentFile, crypter, String.valueOf(cycleSize), iterator, false);
|
||||
int pos = counters.get(iterator);
|
||||
if (pos >= 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user