summaryrefslogtreecommitdiff
path: root/outdated/tmwcon/src/converter/Main.java
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-11 21:29:07 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-11 21:29:07 +0300
commitabe9f3303d7970e38074150f35805ba924b29ed9 (patch)
treeb6d6df8be8fc789c88bc3d76b4053d830436a19d /outdated/tmwcon/src/converter/Main.java
parent05ca41d4c761a7ed4085e995e1d372a06c5539b3 (diff)
downloadtools-abe9f3303d7970e38074150f35805ba924b29ed9.tar.gz
tools-abe9f3303d7970e38074150f35805ba924b29ed9.tar.bz2
tools-abe9f3303d7970e38074150f35805ba924b29ed9.tar.xz
tools-abe9f3303d7970e38074150f35805ba924b29ed9.zip
Remove outdated tools. Look like they really outdated and unused.
Diffstat (limited to 'outdated/tmwcon/src/converter/Main.java')
-rw-r--r--outdated/tmwcon/src/converter/Main.java110
1 files changed, 0 insertions, 110 deletions
diff --git a/outdated/tmwcon/src/converter/Main.java b/outdated/tmwcon/src/converter/Main.java
deleted file mode 100644
index 80dfe30..0000000
--- a/outdated/tmwcon/src/converter/Main.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * TMWServ to eAthena Converter (c) 2008 Jared Adams
- * License: GPL, v2 or later
- */
-
-package converter;
-
-import java.io.*;
-import java.util.*;
-
-import tiled.io.xml.*;
-
-public class Main {
- public static XMLMapTransformer reader = null;
-
- private static tiled.core.Map loadMap(File file) {
- tiled.core.Map map = null;
- try {
- map = reader.readMap(file.getAbsolutePath());
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return map;
- }
-
- public static boolean isTMX(File in) {
- if (in.isDirectory()) return false;
-
- return in.getName().matches(".*\\.tmx(\\.gz)?$");
- }
-
- public static Collection<File> getTMXFiles(File directory) {
- if (!directory.isDirectory()) return Collections.emptyList();
-
- List<File> ret = new Vector<File>();
-
- for (File f : directory.listFiles()) {
- if (f.isDirectory()) {
- ret.addAll(getTMXFiles(f));
- } else if (isTMX(f)) {
- ret.add(f);
- }
- }
-
- return ret;
- }
-
- public static PrintWriter getWriter(File f) {
- try {
- f.createNewFile();
- return new PrintWriter(f);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return null;
- }
-
- public static String getName(File folder, File file) {
- String path = folder.getAbsolutePath();
- String name = file.getAbsolutePath();
- if (name.startsWith(path)) name = name.substring(path.length() + 1);
- if (name.endsWith(".gz")) name = name.substring(0, name.length() - 3);
- if (name.endsWith(".tmx")) name = name.substring(0, name.length() - 4);
- return name;
- }
-
- 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/");
- folder.mkdirs();
- Process.prepWLK(folder);
-
- folder = new File("tmwdata/maps/");
-
- Collection<File> tmxs = getTMXFiles(folder);
- Vector<String> folders = new Vector<String>();
- String name;
- for (File f : tmxs) {
- name = getName(folder, f);
- System.out.printf("== %s ==\n", name);
- if (summary != null) summary.printf("== %s ==\n", name);
- folders.add(Process.processMap(name, loadMap(f), f, summary));
- }
-
- if (summary != null) {
- summary.flush();
- summary.close();
- }
-
- Process.writeMasterImport(folders.toArray(new String[0]));
- }
-
- public static void main(String[] args) {
- run(args, 0);
- }
-}