summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2008-11-11 14:42:59 +0000
committerJared Adams <jaxad0127@gmail.com>2008-11-11 14:42:59 +0000
commit39b9de05511c50aac936228bf68f1de410baf13e (patch)
treee28c3e050d46df2ad0bd82d61a2866cdd6243d1c /tools
parent515f38e52100eac09275f0821e93e0eaf3e2cc3c (diff)
downloadserverdata-39b9de05511c50aac936228bf68f1de410baf13e.tar.gz
serverdata-39b9de05511c50aac936228bf68f1de410baf13e.tar.bz2
serverdata-39b9de05511c50aac936228bf68f1de410baf13e.tar.xz
serverdata-39b9de05511c50aac936228bf68f1de410baf13e.zip
Update some files in the converter tool
Still getting used to git.
Diffstat (limited to 'tools')
-rw-r--r--tools/tmwcon/src/converter/Main.java19
-rw-r--r--tools/tmwcon/src/converter/Process.java7
-rw-r--r--tools/tmwcon/usage16
3 files changed, 40 insertions, 2 deletions
diff --git a/tools/tmwcon/src/converter/Main.java b/tools/tmwcon/src/converter/Main.java
index 4f3a6947..c5aa4257 100644
--- a/tools/tmwcon/src/converter/Main.java
+++ b/tools/tmwcon/src/converter/Main.java
@@ -66,6 +66,17 @@ public class Main extends Thread {
public static void run(String[] args, int unused) {
reader = new XMLMapTransformer();
+ PrintWriter summary = null;
+
+ try {
+ File temp = new File("summary.txt");
+ temp.createNewFile();
+ summary = new PrintWriter(temp);
+ } catch (Exception e) {
+ System.out.println("Problem opening summary file for writing:");
+ e.printStackTrace();
+ }
+
File folder = new File("server-data/data/");
Process.prepWLK(folder);
@@ -76,7 +87,13 @@ public class Main extends Thread {
for (File f : tmxs) {
name = getName(folder, f);
System.out.printf("== %s ==\n", name);
- Process.processMap(name, loadMap(f));
+ if (summary != null) summary.printf("== %s ==\n", name);
+ Process.processMap(name, loadMap(f), summary);
+ }
+
+ if (summary != null) {
+ summary.flush();
+ summary.close();
}
}
diff --git a/tools/tmwcon/src/converter/Process.java b/tools/tmwcon/src/converter/Process.java
index b7fafbf5..78bf1e2c 100644
--- a/tools/tmwcon/src/converter/Process.java
+++ b/tools/tmwcon/src/converter/Process.java
@@ -106,12 +106,17 @@ public class Process {
}
}
- public static void processMap(String name, Map map) {
+ public static void processMap(String name, Map map, PrintWriter summary) {
if (name == null) return;
if (map == null) return;
Properties props = map.getProperties();
String title = getProp(props, "name", "");
+ if (summary != null) {
+ summary.printf("\tName: '%s'\n", title);
+ summary.printf("\tMusic: '%s'\n", getProp(props, "music", ""));
+ summary.printf("\tMinimap: '%s'\n", getProp(props, "minimap", ""));
+ }
String folderName = "server-data/npc/" + name;
if (title.length() > 0) {
folderName += "_" + title.replaceAll("\\s", "_");
diff --git a/tools/tmwcon/usage b/tools/tmwcon/usage
index e69de29b..f8fc8d8b 100644
--- a/tools/tmwcon/usage
+++ b/tools/tmwcon/usage
@@ -0,0 +1,16 @@
+Dependancies:
+ ant (recent version)
+ J2SE 5 or higher (or equivalent)
+ Tiled or Tiled core jar file (in this directory)
+ TMW Tiled plugin jar (in this directory or the plugins directory)
+
+Compilation:
+ Run ant from this directory.
+
+Usage:
+ a directory called tmwdata containing the client data
+ output will be in a directory called server-data
+ if the aforementioned jar files are in class path you can run the converter jar file directly:
+ java jar converter.jar
+ otherwise, the Converter class can handle that for you:
+ java Converter