Merge pull request #2 from truongdatnhan/eclipse
Clean up formatting & Update NIO in some remaining files
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -33,7 +33,7 @@
|
|||||||
<jcip-annotations.version>1.0</jcip-annotations.version> <!-- Annotations for concurrency documentation -->
|
<jcip-annotations.version>1.0</jcip-annotations.version> <!-- Annotations for concurrency documentation -->
|
||||||
<commons-io.version>2.11.0</commons-io.version> <!-- Util library used by some of our tools -->
|
<commons-io.version>2.11.0</commons-io.version> <!-- Util library used by some of our tools -->
|
||||||
<HikariCP.version>5.0.1</HikariCP.version> <!-- Database connection pool -->
|
<HikariCP.version>5.0.1</HikariCP.version> <!-- Database connection pool -->
|
||||||
<mysql-connector-java.version>8.0.29</mysql-connector-java.version> <!-- MySQL JDBC driver -->
|
<mysql-connector-java.version>8.0.30</mysql-connector-java.version> <!-- MySQL JDBC driver -->
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -25,16 +25,18 @@ import provider.Data;
|
|||||||
import provider.DataDirectoryEntry;
|
import provider.DataDirectoryEntry;
|
||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
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.Paths;
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class XMLWZFile implements DataProvider {
|
public class XMLWZFile implements DataProvider {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(DataProvider.class);
|
||||||
private final Path root;
|
private final Path root;
|
||||||
private final WZDirectoryEntry rootForNavigation;
|
private final WZDirectoryEntry rootForNavigation;
|
||||||
|
|
||||||
@@ -58,17 +60,14 @@ public class XMLWZFile implements DataProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
log.warn("Can not open file/directory at " + lroot);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized Data getData(String path) {
|
public synchronized Data getData(String path) {
|
||||||
Path dataFile = root.resolve(path + ".xml");
|
Path dataFile = root.resolve(path + ".xml");
|
||||||
//File(root, path + ".xml");
|
|
||||||
Path imageDataDir = root.resolve(path);
|
Path imageDataDir = root.resolve(path);
|
||||||
//File imageDataDir = new File(root, path);
|
|
||||||
if (!Files.exists(dataFile)) {
|
if (!Files.exists(dataFile)) {
|
||||||
return null;// bitches
|
return null;// bitches
|
||||||
}
|
}
|
||||||
@@ -81,7 +80,6 @@ public class XMLWZFile implements DataProvider {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return domMapleData;
|
return domMapleData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,17 @@ import provider.Data;
|
|||||||
import provider.DataProvider;
|
import provider.DataProvider;
|
||||||
import provider.DataProviderFactory;
|
import provider.DataProviderFactory;
|
||||||
import provider.DataTool;
|
import provider.DataTool;
|
||||||
|
import provider.wz.WZDirectoryEntry;
|
||||||
|
import provider.wz.WZFileEntry;
|
||||||
import provider.wz.WZFiles;
|
import provider.wz.WZFiles;
|
||||||
import tools.DatabaseConnection;
|
import tools.DatabaseConnection;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
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.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -185,22 +191,27 @@ public class SkillbookInformationProvider {
|
|||||||
return loadedSkillbooks;
|
return loadedSkillbooks;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void listFiles(String directoryName, ArrayList<File> files) {
|
private static void listFiles(String directoryName, ArrayList<Path> files) {
|
||||||
File directory = new File(directoryName);
|
Path directory = Paths.get(directoryName);
|
||||||
|
|
||||||
// get all the files from a directory
|
// get all the files from a directory
|
||||||
File[] fList = directory.listFiles();
|
try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory)) {
|
||||||
for (File file : fList) {
|
for (Path path : stream) {
|
||||||
if (file.isFile()) {
|
|
||||||
files.add(file);
|
if (Files.isRegularFile(path)) {
|
||||||
} else if (file.isDirectory()) {
|
files.add(path);
|
||||||
listFiles(file.getAbsolutePath(), files);
|
} else if (Files.isDirectory(path)) {
|
||||||
|
listFiles(path.toAbsolutePath().toString(), files);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<File> listFilesFromDirectoryRecursively(String directory) {
|
private static List<Path> listFilesFromDirectoryRecursively(String directory) {
|
||||||
ArrayList<File> files = new ArrayList<>();
|
ArrayList<Path> files = new ArrayList<>();
|
||||||
listFiles(directory, files);
|
listFiles(directory, files);
|
||||||
|
|
||||||
return files;
|
return files;
|
||||||
@@ -219,22 +230,20 @@ public class SkillbookInformationProvider {
|
|||||||
return skillbookIds;
|
return skillbookIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String readFileToString(File 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 {
|
try(scanner) {
|
||||||
try {
|
|
||||||
text = scanner.useDelimiter("\\A").next();
|
text = scanner.useDelimiter("\\A").next();
|
||||||
} finally {
|
|
||||||
scanner.close();
|
|
||||||
}
|
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Map<Integer, SkillBookEntry> fileSearchMatchingData(File file) {
|
private static Map<Integer, SkillBookEntry> fileSearchMatchingData(Path file) {
|
||||||
Map<Integer, SkillBookEntry> scriptFileSkillbooks = new HashMap<>();
|
Map<Integer, SkillBookEntry> scriptFileSkillbooks = new HashMap<>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -245,7 +254,7 @@ public class SkillbookInformationProvider {
|
|||||||
scriptFileSkillbooks.put(skillbookId, SkillBookEntry.SCRIPT);
|
scriptFileSkillbooks.put(skillbookId, SkillBookEntry.SCRIPT);
|
||||||
}
|
}
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
log.error("Failed to read file:{}", file.getName(), ioe);
|
log.error("Failed to read file:{}", file.getFileName(), ioe);
|
||||||
}
|
}
|
||||||
|
|
||||||
return scriptFileSkillbooks;
|
return scriptFileSkillbooks;
|
||||||
@@ -254,8 +263,8 @@ public class SkillbookInformationProvider {
|
|||||||
private static Map<Integer, SkillBookEntry> fetchSkillbooksFromScripts() {
|
private static Map<Integer, SkillBookEntry> fetchSkillbooksFromScripts() {
|
||||||
Map<Integer, SkillBookEntry> scriptSkillbooks = new HashMap<>();
|
Map<Integer, SkillBookEntry> scriptSkillbooks = new HashMap<>();
|
||||||
|
|
||||||
for (File file : listFilesFromDirectoryRecursively("./scripts")) {
|
for (Path file : listFilesFromDirectoryRecursively("./scripts")) {
|
||||||
if (file.getName().endsWith(".js")) {
|
if (file.getFileName().endsWith(".js")) {
|
||||||
scriptSkillbooks.putAll(fileSearchMatchingData(file));
|
scriptSkillbooks.putAll(fileSearchMatchingData(file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,8 +134,6 @@ public class BossHpBarFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void readBossHpBarData() throws IOException {
|
private static void readBossHpBarData() throws IOException {
|
||||||
|
|
||||||
|
|
||||||
final Path mobDirectory = WZFiles.MOB.getFile();
|
final Path mobDirectory = WZFiles.MOB.getFile();
|
||||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(mobDirectory)) {
|
try (DirectoryStream<Path> stream = Files.newDirectoryStream(mobDirectory)) {
|
||||||
for (Path path : stream) {
|
for (Path path : stream) {
|
||||||
@@ -167,7 +165,7 @@ public class BossHpBarFetcher {
|
|||||||
private static void reportBossHpBarData() {
|
private static void reportBossHpBarData() {
|
||||||
// This will reference one line at a time
|
// This will reference one line at a time
|
||||||
|
|
||||||
try(final PrintWriter printWriter = new PrintWriter(Files.newOutputStream(ToolConstants.getOutputFile(OUTPUT_FILE_NAME)))) {
|
try (PrintWriter printWriter = new PrintWriter(Files.newOutputStream(ToolConstants.getOutputFile(OUTPUT_FILE_NAME)))) {
|
||||||
System.out.println("Reading WZs...");
|
System.out.println("Reading WZs...");
|
||||||
readBossHpBarData();
|
readBossHpBarData();
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
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.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.sql.Connection;
|
import java.sql.Connection;
|
||||||
@@ -177,18 +180,20 @@ public class CashDropFetcher {
|
|||||||
printWriter.println();
|
printWriter.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void listFiles(String directoryName, ArrayList<File> files) {
|
private static void listFiles(Path directoryName, ArrayList<Path> files) {
|
||||||
File directory = new File(directoryName);
|
|
||||||
|
|
||||||
// get all the files from a directory
|
// get all the files from a directory
|
||||||
File[] fList = directory.listFiles();
|
try (DirectoryStream<Path> stream = Files.newDirectoryStream(directoryName)) {
|
||||||
for (File file : fList) {
|
for (Path path : stream) {
|
||||||
if (file.isFile()) {
|
if (Files.isRegularFile(path)) {
|
||||||
files.add(file);
|
files.add(path);
|
||||||
} else if (file.isDirectory()) {
|
} else if (Files.isDirectory(path)) {
|
||||||
listFiles(file.getAbsolutePath(), files);
|
listFiles(path, files);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getItemIdFromFilename(String name) {
|
private static int getItemIdFromFilename(String name) {
|
||||||
@@ -263,42 +268,39 @@ public class CashDropFetcher {
|
|||||||
|
|
||||||
private static void reportNxDropData() {
|
private static void reportNxDropData() {
|
||||||
//NEED FUTURE UPDATE
|
//NEED FUTURE UPDATE
|
||||||
try {
|
try (con; PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
|
||||||
System.out.println("Reading Character.wz ...");
|
System.out.println("Reading Character.wz ...");
|
||||||
ArrayList<File> files = new ArrayList<>();
|
ArrayList<Path> files = new ArrayList<>();
|
||||||
listFiles(WZFiles.CHARACTER.getFilePath(), files);
|
listFiles(WZFiles.CHARACTER.getFile(), files);
|
||||||
|
|
||||||
InputStreamReader fileReader = null;
|
for (Path path : files) {
|
||||||
for (File f : files) {
|
|
||||||
// System.out.println("Parsing " + f.getAbsolutePath());
|
// System.out.println("Parsing " + f.getAbsolutePath());
|
||||||
int itemid = getItemIdFromFilename(f.getName());
|
int itemid = getItemIdFromFilename(path.getFileName().toString());
|
||||||
if (itemid < 0) {
|
if (itemid < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fileReader = new InputStreamReader(new FileInputStream(f), StandardCharsets.UTF_8);
|
bufferedReader = Files.newBufferedReader(path);
|
||||||
bufferedReader = new BufferedReader(fileReader);
|
|
||||||
|
|
||||||
currentItemid = itemid;
|
currentItemid = itemid;
|
||||||
inspectEquipWzEntry();
|
inspectEquipWzEntry();
|
||||||
|
|
||||||
bufferedReader.close();
|
bufferedReader.close();
|
||||||
fileReader.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Reading Item.wz ...");
|
System.out.println("Reading Item.wz ...");
|
||||||
files = new ArrayList<>();
|
files = new ArrayList<>();
|
||||||
listFiles(WZFiles.ITEM.getFilePath(), files);
|
listFiles(WZFiles.ITEM.getFile(), files);
|
||||||
|
|
||||||
for (File f : files) {
|
for (Path path : files) {
|
||||||
// System.out.println("Parsing " + f.getAbsolutePath());
|
// System.out.println("Parsing " + f.getAbsolutePath());
|
||||||
fileReader = new InputStreamReader(new FileInputStream(f), StandardCharsets.UTF_8);
|
bufferedReader = Files.newBufferedReader(path);
|
||||||
bufferedReader = new BufferedReader(fileReader);
|
|
||||||
|
|
||||||
if (f.getName().length() <= ITEM_FILE_NAME_SIZE) {
|
if (path.getFileName().toString().length() <= ITEM_FILE_NAME_SIZE) {
|
||||||
inspectItemWzEntry();
|
inspectItemWzEntry();
|
||||||
} else { // pet file structure is similar to equips, maybe there are other item-types following this behaviour?
|
} else { // pet file structure is similar to equips, maybe there are other item-types
|
||||||
int itemid = getItemIdFromFilename(f.getName());
|
// following this behaviour?
|
||||||
|
int itemid = getItemIdFromFilename(path.getFileName().toString());
|
||||||
if (itemid < 0) {
|
if (itemid < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -308,27 +310,23 @@ public class CashDropFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bufferedReader.close();
|
bufferedReader.close();
|
||||||
fileReader.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Reporting results...");
|
System.out.println("Reporting results...");
|
||||||
|
|
||||||
// report suspects of missing quest drop data, as well as those drop data that may have incorrect questids.
|
// report suspects of missing quest drop data, as well as those drop data that
|
||||||
printWriter = new PrintWriter(Files.newOutputStream(OUTPUT_FILE));
|
// may have incorrect questids.
|
||||||
|
printWriter = pw;
|
||||||
printReportFileHeader();
|
printReportFileHeader();
|
||||||
|
|
||||||
reportNxDropResults(true);
|
reportNxDropResults(true);
|
||||||
reportNxDropResults(false);
|
reportNxDropResults(false);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printWriter.println("NX LIST"); // list of all cash items found
|
* printWriter.println("NX LIST"); // list of all cash items found for(Integer
|
||||||
for(Integer nx : nxItems) {
|
* nx : nxItems) { printWriter.println(nx); }
|
||||||
printWriter.println(nx);
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
con.close();
|
|
||||||
printWriter.close();
|
|
||||||
System.out.println("Done!");
|
System.out.println("Done!");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
System.out.println("Warning: Could not establish connection to database to report quest data.");
|
System.out.println("Warning: Could not establish connection to database to report quest data.");
|
||||||
|
|||||||
@@ -156,18 +156,16 @@ public class CashVegaChecker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void reportMissingVegaItems() {
|
private static void reportMissingVegaItems() {
|
||||||
//NEED FUTURE UPDATE
|
|
||||||
System.out.println("Reporting results ...");
|
System.out.println("Reporting results ...");
|
||||||
|
|
||||||
try {
|
try (PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
|
||||||
printWriter = new PrintWriter(Files.newOutputStream(OUTPUT_FILE));
|
printWriter = pw;
|
||||||
printReportFileHeader();
|
printReportFileHeader();
|
||||||
|
|
||||||
for (Integer itemid : vegaItems) {
|
for (Integer itemid : vegaItems) {
|
||||||
printWriter.println(" " + itemid);
|
printWriter.println(" " + itemid);
|
||||||
}
|
}
|
||||||
|
|
||||||
printWriter.close();
|
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
ioe.printStackTrace();
|
ioe.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -22,7 +21,6 @@ import java.time.Instant;
|
|||||||
* Estimated parse time: 10 seconds
|
* Estimated parse time: 10 seconds
|
||||||
*/
|
*/
|
||||||
public class DojoUpdate {
|
public class DojoUpdate {
|
||||||
//private static final Path INPUT_DIRECTORY = WZFiles.MAP.getFile().resolve("/Map/Map9");
|
|
||||||
private static final Path INPUT_DIRECTORY = WZFiles.MAP.getFile().resolve("Map").resolve("Map9");
|
private static final Path INPUT_DIRECTORY = WZFiles.MAP.getFile().resolve("Map").resolve("Map9");
|
||||||
private static final Path OUTPUT_DIRECTORY = ToolConstants.getOutputFile("dojo-maps");
|
private static final Path OUTPUT_DIRECTORY = ToolConstants.getOutputFile("dojo-maps");
|
||||||
private static final Path WORKING_DIRECTORY = Paths.get("").toAbsolutePath();
|
private static final Path WORKING_DIRECTORY = Paths.get("").toAbsolutePath();
|
||||||
|
|||||||
@@ -299,9 +299,6 @@ public class GachaponItemIdRetriever {
|
|||||||
System.out.println(ex.getMessage());
|
System.out.println(ex.getMessage());
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setupDirectories(Path file) {
|
private static void setupDirectories(Path file) {
|
||||||
|
|||||||
@@ -171,14 +171,12 @@ public class IdRetriever {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Instant instantStarted = Instant.now();
|
Instant instantStarted = Instant.now();
|
||||||
try {
|
try (con) {
|
||||||
if (INSTALL_SQLTABLE) {
|
if (INSTALL_SQLTABLE) {
|
||||||
parseMapleHandbook();
|
parseMapleHandbook();
|
||||||
} else {
|
} else {
|
||||||
fetchDataOnMapleHandbook();
|
fetchDataOnMapleHandbook();
|
||||||
}
|
}
|
||||||
|
|
||||||
con.close();
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
System.out.println("Error: invalid SQL syntax");
|
System.out.println("Error: invalid SQL syntax");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ public class MesoFetcher {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -126,8 +126,7 @@ public class MobBookIndexer {
|
|||||||
|
|
||||||
private static void indexFromDropData() {
|
private static void indexFromDropData() {
|
||||||
|
|
||||||
try(con;
|
try (con; BufferedReader br = Files.newBufferedReader(INPUT_FILE);) {
|
||||||
BufferedReader br = Files.newBufferedReader(INPUT_FILE);) {
|
|
||||||
bufferedReader = br;
|
bufferedReader = br;
|
||||||
String line = null;
|
String line = null;
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ public class MobBookUpdate {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ public class NoItemIdFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void evaluateDropsFromDb() {
|
private static void evaluateDropsFromDb() {
|
||||||
try {
|
try (con) {
|
||||||
System.out.println("Evaluating item data on DB...");
|
System.out.println("Evaluating item data on DB...");
|
||||||
|
|
||||||
evaluateDropsFromTable("drop_data");
|
evaluateDropsFromTable("drop_data");
|
||||||
@@ -194,7 +194,6 @@ public class NoItemIdFetcher {
|
|||||||
System.out.println("Inexistent itemid count: " + nonExistingIds.size());
|
System.out.println("Inexistent itemid count: " + nonExistingIds.size());
|
||||||
System.out.println("Total itemid count: " + existingIds.size());
|
System.out.println("Total itemid count: " + existingIds.size());
|
||||||
|
|
||||||
con.close();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ public class QuestItemFetcher {
|
|||||||
String line = null;
|
String line = null;
|
||||||
Path file = null;
|
Path file = null;
|
||||||
|
|
||||||
try{
|
try (PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
|
||||||
System.out.println("Reading WZs...");
|
System.out.println("Reading WZs...");
|
||||||
|
|
||||||
file = WZFiles.QUEST.getFile().resolve("Check.img.xml");
|
file = WZFiles.QUEST.getFile().resolve("Check.img.xml");
|
||||||
@@ -450,8 +450,9 @@ public class QuestItemFetcher {
|
|||||||
filterDirectorySearchMatchingData("src", itemsWithQuest);
|
filterDirectorySearchMatchingData("src", itemsWithQuest);
|
||||||
|
|
||||||
System.out.println("Reporting results...");
|
System.out.println("Reporting results...");
|
||||||
// report suspects of missing quest drop data, as well as those drop data that may have incorrect questids.
|
// report suspects of missing quest drop data, as well as those drop data that
|
||||||
printWriter = new PrintWriter(Files.newOutputStream(OUTPUT_FILE));
|
// may have incorrect questids.
|
||||||
|
printWriter = pw;
|
||||||
|
|
||||||
printReportFileHeader();
|
printReportFileHeader();
|
||||||
|
|
||||||
@@ -503,7 +504,6 @@ public class QuestItemFetcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printWriter.close();
|
|
||||||
System.out.println("Done!");
|
System.out.println("Done!");
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
System.out.println("Unable to open file '" + file + "'");
|
System.out.println("Unable to open file '" + file + "'");
|
||||||
|
|||||||
@@ -86,14 +86,14 @@ public class ReactorDropFetcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void reportMissingReactors() {
|
private static void reportMissingReactors() {
|
||||||
try(con;
|
try (con; PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
|
||||||
PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
|
|
||||||
System.out.println("Fetching reactors from DB...");
|
System.out.println("Fetching reactors from DB...");
|
||||||
fetchMissingReactorDrops();
|
fetchMissingReactorDrops();
|
||||||
|
|
||||||
printWriter = pw;
|
printWriter = pw;
|
||||||
|
|
||||||
// report suspects of missing quest drop data, as well as those drop data that may have incorrect questids.
|
// report suspects of missing quest drop data, as well as those drop data that
|
||||||
|
// may have incorrect questids.
|
||||||
System.out.println("Reporting results...");
|
System.out.println("Reporting results...");
|
||||||
printReportFileHeader();
|
printReportFileHeader();
|
||||||
reportMissingReactorDrops();
|
reportMissingReactorDrops();
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ public class SkillMakerReagentIndexer {
|
|||||||
translateToken(line);
|
translateToken(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SortReagentList();
|
SortReagentList();
|
||||||
|
|
||||||
printWriter = pw;
|
printWriter = pw;
|
||||||
|
|||||||
@@ -111,7 +111,8 @@ public class SkillbookChanceFetcher {
|
|||||||
|
|
||||||
List<Map.Entry<Pair<Integer, Integer>, Integer>> skillbookChancesList = sortedSkillbookChances();
|
List<Map.Entry<Pair<Integer, Integer>, Integer>> skillbookChancesList = sortedSkillbookChances();
|
||||||
for (Map.Entry<Pair<Integer, Integer>, Integer> e : skillbookChancesList) {
|
for (Map.Entry<Pair<Integer, Integer>, Integer> e : skillbookChancesList) {
|
||||||
printWriter.println("(" + e.getKey().getLeft() + ", " + e.getKey().getRight() + ", 1, 1, 0, " + e.getValue() + "),");
|
printWriter.println("(" + e.getKey().getLeft() + ", " + e.getKey().getRight() + ", 1, 1, 0, "
|
||||||
|
+ e.getValue() + "),");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
|
|||||||
Reference in New Issue
Block a user