From c6095ad062eaa0f5576cfab1c4fe436b90c2fbfe Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 10 Apr 2021 00:45:07 -0300 Subject: Add initial tools --- hercules/list_mapcache.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 hercules/list_mapcache.py (limited to 'hercules/list_mapcache.py') diff --git a/hercules/list_mapcache.py b/hercules/list_mapcache.py new file mode 100755 index 0000000..2a83f53 --- /dev/null +++ b/hercules/list_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 readInt16, readInt32 +from code.server.maps import listMapCache + +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 + listMapCache(f, mapsCount) + + +runFunction("serverdata/db/re/map_cache.dat") -- cgit v1.2.3-60-g2f50