From 746192af34a65504cb86a4eca068a8f0fbb361f5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 31 Oct 2014 01:08:46 +0300 Subject: hercules: split implimentation to many files. --- hercules/convert_mapcache_to_tmx.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 hercules/convert_mapcache_to_tmx.py (limited to 'hercules/convert_mapcache_to_tmx.py') diff --git a/hercules/convert_mapcache_to_tmx.py b/hercules/convert_mapcache_to_tmx.py new file mode 100755 index 0000000..bcc50ac --- /dev/null +++ b/hercules/convert_mapcache_to_tmx.py @@ -0,0 +1,24 @@ +#! /usr/bin/env python +# -*- coding: utf8 -*- +# +# Copyright (C) 2014 Evol Online +# Author: Andrei Karas (4144) + +import os + +from code.fileutils import * +from code.servertoclient.maps import * + +def runFunction(path): + with open(path, "rb") as f: + size = readInt32(f) + if os.path.getsize(path) != size: + print "Map cache corrupted, wrong file size." + exit(1) + mapsCount = readInt16(f) + print "Maps count: " + str(mapsCount) + readInt16(f) # padding + covertToTmx(f, mapsCount) + + +runFunction("serverdata/db/re/map_cache.dat") -- cgit v1.2.3-70-g09d2