diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-31 01:08:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-31 12:19:12 +0300 |
commit | 746192af34a65504cb86a4eca068a8f0fbb361f5 (patch) | |
tree | 12d399627720f7fc72e66deb64bac7ef0d9eb71e /hercules/extract_mapcache.py | |
parent | 63f135d8af2a81a78626d6229d077e3f91a35288 (diff) | |
download | evol-tools-746192af34a65504cb86a4eca068a8f0fbb361f5.tar.gz evol-tools-746192af34a65504cb86a4eca068a8f0fbb361f5.tar.bz2 evol-tools-746192af34a65504cb86a4eca068a8f0fbb361f5.tar.xz evol-tools-746192af34a65504cb86a4eca068a8f0fbb361f5.zip |
hercules: split implimentation to many files.
Diffstat (limited to 'hercules/extract_mapcache.py')
-rwxr-xr-x | hercules/extract_mapcache.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/hercules/extract_mapcache.py b/hercules/extract_mapcache.py new file mode 100755 index 0000000..fc82404 --- /dev/null +++ b/hercules/extract_mapcache.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.server.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 + extractMaps(f, mapsCount) + +runFunction("serverdata/db/re/map_cache.dat") |