@@ -50,7 +50,11 @@ import server.maps.*;
|
|||||||
import tools.PacketCreator;
|
import tools.PacketCreator;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.IOException;
|
||||||
|
import java.nio.file.DirectoryStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
@@ -448,8 +452,14 @@ public final class Channel {
|
|||||||
|
|
||||||
private static String[] getEvents() {
|
private static String[] getEvents() {
|
||||||
List<String> events = new ArrayList<>();
|
List<String> events = new ArrayList<>();
|
||||||
for (File file : new File("scripts/event").listFiles()) {
|
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get("scripts/event"))) {
|
||||||
events.add(file.getName().substring(0, file.getName().length() - 3));
|
for (Path path : stream) {
|
||||||
|
String fileName = path.getFileName().toString();
|
||||||
|
events.add(fileName.substring(0, fileName.length() - 3));
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.warn("Unable to load events !");
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return events.toArray(new String[0]);
|
return events.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ public enum WZFiles {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String getWzDirectory() {
|
private static String getWzDirectory() {
|
||||||
// Either provide a custom directory path through the "wz-path" property when launching the .jar,
|
// Either provide a custom directory path through the "wz-path" property when launching the .jar, or don't provide one to use the default "wz" directory
|
||||||
// or don't provide one to use the default "wz" directory
|
|
||||||
String propertyPath = System.getProperty("wz-path");
|
String propertyPath = System.getProperty("wz-path");
|
||||||
if (propertyPath != null && new File(propertyPath).isDirectory()) {
|
if (propertyPath != null && new File(propertyPath).isDirectory()) {
|
||||||
return propertyPath;
|
return propertyPath;
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ public class XMLDomMapleData implements Data {
|
|||||||
boolean foundChild = false;
|
boolean foundChild = false;
|
||||||
for (int i = 0; i < childNodes.getLength(); i++) {
|
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||||
Node childNode = childNodes.item(i);
|
Node childNode = childNodes.item(i);
|
||||||
if (childNode.getNodeType() == Node.ELEMENT_NODE && childNode.getAttributes().getNamedItem("name").getNodeValue().equals(s)) {
|
if (childNode.getNodeType() == Node.ELEMENT_NODE
|
||||||
|
&& childNode.getAttributes().getNamedItem("name").getNodeValue().equals(s)) {
|
||||||
myNode = childNode;
|
myNode = childNode;
|
||||||
foundChild = true;
|
foundChild = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ public class SkillbookInformationProvider {
|
|||||||
private static String readFileToString(Path file, String encoding) throws IOException {
|
private static String readFileToString(Path file, String encoding) throws IOException {
|
||||||
Scanner scanner = new Scanner(file, encoding);
|
Scanner scanner = new Scanner(file, encoding);
|
||||||
String text = "";
|
String text = "";
|
||||||
try(scanner) {
|
try (scanner) {
|
||||||
|
|
||||||
text = scanner.useDelimiter("\\A").next();
|
text = scanner.useDelimiter("\\A").next();
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import server.life.MonsterStats;
|
|||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package tools.mapletools;
|
|||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.DirectoryStream;
|
import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
@@ -171,7 +170,6 @@ public class BossHpBarFetcher {
|
|||||||
|
|
||||||
System.out.println("Reporting results...");
|
System.out.println("Reporting results...");
|
||||||
|
|
||||||
|
|
||||||
printReportFileHeader(printWriter);
|
printReportFileHeader(printWriter);
|
||||||
printReportFileResults(printWriter);
|
printReportFileResults(printWriter);
|
||||||
|
|
||||||
|
|||||||
@@ -621,7 +621,8 @@ public class CashCosmeticsChecker {
|
|||||||
printReportFileHeader();
|
printReportFileHeader();
|
||||||
|
|
||||||
if (!missingCosmeticsNpcTypes.isEmpty()) {
|
if (!missingCosmeticsNpcTypes.isEmpty()) {
|
||||||
printWriter.println("Found " + missingCosmeticsNpcTypes.size() + " entries with missing cosmetic entries.");
|
printWriter.println(
|
||||||
|
"Found " + missingCosmeticsNpcTypes.size() + " entries with missing cosmetic entries.");
|
||||||
|
|
||||||
for (Pair<Pair<Integer, String>, List<Integer>> mcn : getSortedMapEntries(missingCosmeticsNpcTypes)) {
|
for (Pair<Pair<Integer, String>, List<Integer>> mcn : getSortedMapEntries(missingCosmeticsNpcTypes)) {
|
||||||
printWriter.println(" NPC " + mcn.getLeft());
|
printWriter.println(" NPC " + mcn.getLeft());
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package tools.mapletools;
|
package tools.mapletools;
|
||||||
|
|
||||||
import provider.wz.WZDirectoryEntry;
|
|
||||||
import provider.wz.WZFileEntry;
|
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.DirectoryStream;
|
import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
@@ -267,7 +264,6 @@ public class CashDropFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void reportNxDropData() {
|
private static void reportNxDropData() {
|
||||||
//NEED FUTURE UPDATE
|
|
||||||
try (con; PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
|
try (con; PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
|
||||||
System.out.println("Reading Character.wz ...");
|
System.out.println("Reading Character.wz ...");
|
||||||
ArrayList<Path> files = new ArrayList<>();
|
ArrayList<Path> files = new ArrayList<>();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package tools.mapletools;
|
|||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ package tools.mapletools;
|
|||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -16,8 +17,8 @@ import java.sql.SQLException;
|
|||||||
* a SQL table that the server will make use.
|
* a SQL table that the server will make use.
|
||||||
*/
|
*/
|
||||||
public class CouponInstaller {
|
public class CouponInstaller {
|
||||||
private static final File COUPON_INPUT_FILE_1 = new File(WZFiles.ITEM.getFilePath(), "/Cash/0521.img.xml");
|
private static final Path COUPON_INPUT_FILE_1 = WZFiles.ITEM.getFile().resolve("Cash/0521.img.xml");
|
||||||
private static final File COUPON_INPUT_FILE_2 = new File(WZFiles.ITEM.getFilePath(), "/Cash/0536.img.xml");
|
private static final Path COUPON_INPUT_FILE_2 = WZFiles.ITEM.getFile().resolve("Cash/0536.img.xml");
|
||||||
private static final Connection con = SimpleDatabaseConnection.getConnection();
|
private static final Connection con = SimpleDatabaseConnection.getConnection();
|
||||||
private static BufferedReader bufferedReader = null;
|
private static BufferedReader bufferedReader = null;
|
||||||
private static byte status = 0;
|
private static byte status = 0;
|
||||||
@@ -192,20 +193,17 @@ public class CouponInstaller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void installRateCoupons(File file) {
|
private static void installRateCoupons(Path file) {
|
||||||
// This will reference one line at a time
|
// This will reference one line at a time
|
||||||
String line = null;
|
String line = null;
|
||||||
|
|
||||||
try {
|
try (BufferedReader br = Files.newBufferedReader(file)) {
|
||||||
InputStreamReader fileReader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
|
bufferedReader = br;
|
||||||
bufferedReader = new BufferedReader(fileReader);
|
|
||||||
|
|
||||||
while ((line = bufferedReader.readLine()) != null) {
|
while ((line = bufferedReader.readLine()) != null) {
|
||||||
translateToken(line);
|
translateToken(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
bufferedReader.close();
|
|
||||||
fileReader.close();
|
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
System.out.println("Unable to open file '" + file + "'");
|
System.out.println("Unable to open file '" + file + "'");
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -126,7 +126,8 @@ public class DojoUpdate {
|
|||||||
if (!isDojoMapid) {
|
if (!isDojoMapid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try(PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_DIRECTORY.resolve(curPath).resolve(file.getFileName())));
|
try (PrintWriter pw = new PrintWriter(
|
||||||
|
Files.newOutputStream(OUTPUT_DIRECTORY.resolve(curPath).resolve(file.getFileName())));
|
||||||
BufferedReader br = Files.newBufferedReader(file);) {
|
BufferedReader br = Files.newBufferedReader(file);) {
|
||||||
printWriter = pw;
|
printWriter = pw;
|
||||||
bufferedReader = br;
|
bufferedReader = br;
|
||||||
@@ -168,7 +169,7 @@ public class DojoUpdate {
|
|||||||
folder = INPUT_DIRECTORY.resolve(curPath);
|
folder = INPUT_DIRECTORY.resolve(curPath);
|
||||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(folder)) {
|
try (DirectoryStream<Path> stream = Files.newDirectoryStream(folder)) {
|
||||||
for (Path path : stream) {
|
for (Path path : stream) {
|
||||||
if(Files.isRegularFile(path)) {
|
if (Files.isRegularFile(path)) {
|
||||||
try {
|
try {
|
||||||
parseDojoData(path, curPath);
|
parseDojoData(path, curPath);
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
@@ -196,6 +197,5 @@ public class DojoUpdate {
|
|||||||
Duration durationBetween = Duration.between(instantStarted, instantStopped);
|
Duration durationBetween = Duration.between(instantStarted, instantStopped);
|
||||||
System.out.println("Get elapsed time in milliseconds: " + durationBetween.toMillis());
|
System.out.println("Get elapsed time in milliseconds: " + durationBetween.toMillis());
|
||||||
System.out.println("Get elapsed time in seconds: " + durationBetween.toSeconds());
|
System.out.println("Get elapsed time in seconds: " + durationBetween.toSeconds());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ public class EmptyItemWzChecker {
|
|||||||
|
|
||||||
private static void generateStringWz() throws IOException {
|
private static void generateStringWz() throws IOException {
|
||||||
System.out.println("Generating clean String.wz ...");
|
System.out.println("Generating clean String.wz ...");
|
||||||
String[][] stringWzFiles = {{"Cash", "Consume", "Ins", "Pet"}, {"Etc"}, {"Eqp"}};
|
String[][] stringWzFiles = { { "Cash", "Consume", "Ins", "Pet" }, { "Etc" }, { "Eqp" } };
|
||||||
String stringWzPath = "/String.wz/";
|
String stringWzPath = "/String.wz/";
|
||||||
|
|
||||||
File folder = new File(OUTPUT_PATH + "/String.wz/");
|
File folder = new File(OUTPUT_PATH + "/String.wz/");
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package tools.mapletools;
|
|||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.DirectoryStream;
|
import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
@@ -358,7 +357,8 @@ public class EquipmentOmniLeveller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void copyCashItemData(Path file, String curPath) throws IOException {
|
private static void copyCashItemData(Path file, String curPath) throws IOException {
|
||||||
try(PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_DIRECTORY.resolve(curPath).resolve(file.getFileName())));
|
try (PrintWriter pw = new PrintWriter(
|
||||||
|
Files.newOutputStream(OUTPUT_DIRECTORY.resolve(curPath).resolve(file.getFileName())));
|
||||||
BufferedReader br = Files.newBufferedReader(file);) {
|
BufferedReader br = Files.newBufferedReader(file);) {
|
||||||
printWriter = pw;
|
printWriter = pw;
|
||||||
bufferedReader = br;
|
bufferedReader = br;
|
||||||
@@ -370,8 +370,8 @@ public class EquipmentOmniLeveller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void parseEquipData(Path file, String curPath) throws IOException {
|
private static void parseEquipData(Path file, String curPath) throws IOException {
|
||||||
|
try (PrintWriter pw = new PrintWriter(
|
||||||
try(PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_DIRECTORY.resolve(curPath).resolve(file.getFileName())));
|
Files.newOutputStream(OUTPUT_DIRECTORY.resolve(curPath).resolve(file.getFileName())));
|
||||||
BufferedReader br = Files.newBufferedReader(file);) {
|
BufferedReader br = Files.newBufferedReader(file);) {
|
||||||
printWriter = pw;
|
printWriter = pw;
|
||||||
bufferedReader = br;
|
bufferedReader = br;
|
||||||
@@ -391,8 +391,6 @@ public class EquipmentOmniLeveller {
|
|||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
copyCashItemData(file, curPath);
|
copyCashItemData(file, curPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void printFileFooter() {
|
private static void printFileFooter() {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package tools.mapletools;
|
package tools.mapletools;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@@ -302,7 +301,7 @@ public class GachaponItemIdRetriever {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void setupDirectories(Path file) {
|
private static void setupDirectories(Path file) {
|
||||||
if(!Files.exists(file.getParent())) {
|
if (!Files.exists(file.getParent())) {
|
||||||
try {
|
try {
|
||||||
Files.createDirectories(file.getParent());
|
Files.createDirectories(file.getParent());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -313,7 +312,7 @@ public class GachaponItemIdRetriever {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try(con) {
|
try (con) {
|
||||||
loadHandbookUseNames();
|
loadHandbookUseNames();
|
||||||
fetchDataOnMapleHandbook();
|
fetchDataOnMapleHandbook();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package tools.mapletools;
|
|||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.file.DirectoryStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,18 +74,18 @@ public class MapFieldLimitChecker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void listFiles(String directoryName, ArrayList<File> files) {
|
private static void listFiles(Path directory, ArrayList<Path> files) {
|
||||||
File directory = new File(directoryName);
|
try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory)) {
|
||||||
|
for (Path path : stream) {
|
||||||
// get all the files from a directory
|
if (Files.isRegularFile(path)) {
|
||||||
File[] fList = directory.listFiles();
|
files.add(path);
|
||||||
for (File file : fList) {
|
} else if (Files.isDirectory(path)) {
|
||||||
if (file.isFile()) {
|
listFiles(path, files);
|
||||||
files.add(file);
|
|
||||||
} else if (file.isDirectory()) {
|
|
||||||
listFiles(file.getAbsolutePath(), files);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getMapIdFromFilename(String name) {
|
private static int getMapIdFromFilename(String name) {
|
||||||
@@ -134,18 +136,17 @@ public class MapFieldLimitChecker {
|
|||||||
|
|
||||||
private static void loadMapWz() throws IOException {
|
private static void loadMapWz() throws IOException {
|
||||||
System.out.println("Reading Map.wz ...");
|
System.out.println("Reading Map.wz ...");
|
||||||
ArrayList<File> files = new ArrayList<>();
|
ArrayList<Path> files = new ArrayList<>();
|
||||||
listFiles(WZFiles.MAP.getFilePath() + "/Map", files);
|
listFiles(WZFiles.MAP.getFile().resolve("Map"), files);
|
||||||
|
|
||||||
for (File f : files) {
|
for (Path f : files) {
|
||||||
InputStreamReader fileReader = new InputStreamReader(new FileInputStream(f), StandardCharsets.UTF_8);
|
try (BufferedReader br = Files.newBufferedReader(f)) {
|
||||||
bufferedReader = new BufferedReader(fileReader);
|
bufferedReader = br;
|
||||||
|
|
||||||
mapid = getMapIdFromFilename(f.getName());
|
mapid = getMapIdFromFilename(f.getFileName().toString());
|
||||||
inspectMapEntry();
|
inspectMapEntry();
|
||||||
|
|
||||||
bufferedReader.close();
|
}
|
||||||
fileReader.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ package tools.mapletools;
|
|||||||
import server.life.MonsterStats;
|
import server.life.MonsterStats;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package tools.mapletools;
|
|||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ package tools.mapletools;
|
|||||||
import provider.*;
|
import provider.*;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package tools.mapletools;
|
|||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package tools.mapletools;
|
package tools.mapletools;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -40,15 +41,15 @@ public class ReactorDropFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void removeScriptedReactorids(String directoryName) {
|
private static void removeScriptedReactorids(String directoryName) {
|
||||||
File directory = new File(directoryName);
|
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(directoryName))) {
|
||||||
|
for (Path path : stream) {
|
||||||
// get all the files from a directory
|
if (Files.isRegularFile(path)) {
|
||||||
File[] fList = directory.listFiles();
|
reactors.remove(getReactorIdFromFilename(path.getFileName().toString()));
|
||||||
for (File file : fList) {
|
|
||||||
if (file.isFile()) {
|
|
||||||
reactors.remove(getReactorIdFromFilename(file.getName()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadReactoridsOnDB() throws SQLException {
|
private static void loadReactoridsOnDB() throws SQLException {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import server.ItemInformationProvider;
|
|||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import provider.wz.WZFiles;
|
|||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package tools.mapletools;
|
|||||||
import server.life.MonsterStats;
|
import server.life.MonsterStats;
|
||||||
import tools.Pair;
|
import tools.Pair;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import java.io.*;
|
|||||||
import java.nio.file.DirectoryStream;
|
import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.StandardOpenOption;
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
|
||||||
@@ -151,7 +150,6 @@ public class SkillbookStackUpdate {
|
|||||||
parseItemFile(path, outputDirectory.resolve(path.getFileName()));
|
parseItemFile(path, outputDirectory.resolve(path.getFileName()));
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user