summaryrefslogtreecommitdiff
path: root/hercules/convert_mapcache_to_tmx.py
blob: bcc50ac82d956c208c729d3f7ebdaf352da00822 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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")