Fixing indents !

This commit is contained in:
Đạt Nhân Trương
2022-08-02 23:14:17 +07:00
parent 4496e0854f
commit d9a86d6d75
32 changed files with 691 additions and 703 deletions

View File

@@ -1,12 +1,9 @@
package tools.mapletools;
import provider.wz.WZDirectoryEntry;
import provider.wz.WZFileEntry;
import provider.wz.WZFiles;
import tools.Pair;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -182,18 +179,18 @@ public class CashDropFetcher {
private static void listFiles(Path directoryName, ArrayList<Path> files) {
// get all the files from a directory
try (DirectoryStream<Path> stream = Files.newDirectoryStream(directoryName)) {
for (Path path : stream) {
if (Files.isRegularFile(path)) {
files.add(path);
} else if (Files.isDirectory(path)) {
listFiles(path, files);
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try (DirectoryStream<Path> stream = Files.newDirectoryStream(directoryName)) {
for (Path path : stream) {
if (Files.isRegularFile(path)) {
files.add(path);
} else if (Files.isDirectory(path)) {
listFiles(path, files);
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private static int getItemIdFromFilename(String name) {
@@ -267,76 +264,75 @@ public class CashDropFetcher {
}
private static void reportNxDropData() {
//NEED FUTURE UPDATE
try (con; PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
System.out.println("Reading Character.wz ...");
ArrayList<Path> files = new ArrayList<>();
listFiles(WZFiles.CHARACTER.getFile(), files);
try (con; PrintWriter pw = new PrintWriter(Files.newOutputStream(OUTPUT_FILE))) {
System.out.println("Reading Character.wz ...");
ArrayList<Path> files = new ArrayList<>();
listFiles(WZFiles.CHARACTER.getFile(), files);
for (Path path : files) {
// System.out.println("Parsing " + f.getAbsolutePath());
int itemid = getItemIdFromFilename(path.getFileName().toString());
if (itemid < 0) {
continue;
}
for (Path path : files) {
// System.out.println("Parsing " + f.getAbsolutePath());
int itemid = getItemIdFromFilename(path.getFileName().toString());
if (itemid < 0) {
continue;
}
bufferedReader = Files.newBufferedReader(path);
bufferedReader = Files.newBufferedReader(path);
currentItemid = itemid;
inspectEquipWzEntry();
currentItemid = itemid;
inspectEquipWzEntry();
bufferedReader.close();
}
bufferedReader.close();
}
System.out.println("Reading Item.wz ...");
files = new ArrayList<>();
listFiles(WZFiles.ITEM.getFile(), files);
System.out.println("Reading Item.wz ...");
files = new ArrayList<>();
listFiles(WZFiles.ITEM.getFile(), files);
for (Path path : files) {
// System.out.println("Parsing " + f.getAbsolutePath());
bufferedReader = Files.newBufferedReader(path);
for (Path path : files) {
// System.out.println("Parsing " + f.getAbsolutePath());
bufferedReader = Files.newBufferedReader(path);
if (path.getFileName().toString().length() <= ITEM_FILE_NAME_SIZE) {
inspectItemWzEntry();
} else { // pet file structure is similar to equips, maybe there are other item-types
// following this behaviour?
int itemid = getItemIdFromFilename(path.getFileName().toString());
if (itemid < 0) {
continue;
}
if (path.getFileName().toString().length() <= ITEM_FILE_NAME_SIZE) {
inspectItemWzEntry();
} else { // pet file structure is similar to equips, maybe there are other item-types
// following this behaviour?
int itemid = getItemIdFromFilename(path.getFileName().toString());
if (itemid < 0) {
continue;
}
currentItemid = itemid;
inspectEquipWzEntry();
}
currentItemid = itemid;
inspectEquipWzEntry();
}
bufferedReader.close();
}
bufferedReader.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.
printWriter = pw;
printReportFileHeader();
// report suspects of missing quest drop data, as well as those drop data that
// may have incorrect questids.
printWriter = pw;
printReportFileHeader();
reportNxDropResults(true);
reportNxDropResults(false);
reportNxDropResults(true);
reportNxDropResults(false);
/*
* printWriter.println("NX LIST"); // list of all cash items found for(Integer
* nx : nxItems) { printWriter.println(nx); }
*/
/*
* printWriter.println("NX LIST"); // list of all cash items found for(Integer
* nx : nxItems) { printWriter.println(nx); }
*/
System.out.println("Done!");
} catch (SQLException e) {
System.out.println("Warning: Could not establish connection to database to report quest data.");
System.out.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
System.out.println("Done!");
} catch (SQLException e) {
System.out.println("Warning: Could not establish connection to database to report quest data.");
System.out.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
reportNxDropData();
}
public static void main(String[] args) {
reportNxDropData();
}
}