# -*- coding: utf8 -*- # # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) import os import re from code.fileutils import makeDir from code.stringutils import stripWindows, stripNewLine mapsConfFile = "newserverdata/conf/maps.conf" if os.path.isfile(mapsConfFile): os.remove(mapsConfFile) mapsIndexFile = "newserverdata/db/map_index.txt" if os.path.isfile(mapsIndexFile): os.remove(mapsIndexFile) npcMainScript = "newserverdata/npc/re/scripts_main.conf" mapsIndex = 1 scriptRe = re.compile("^(((?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+))|(?Pfunction)|-)" + "[|](?Pscript)[|](?P[^|]+)([|]" "(?P[\d-]+)((,((?P[\d]+),(?P[\d]+)))|)|)$") scriptRe2 = re.compile("^(((?P[^/](.+))[.]gat,([ ]*)(?P[\d]+),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+))|(?Pfunction)|-)" + "[\t](?Pscript)[\t](?P[\w#'\\[\\]_ äü.-]+)[\t]" "(((?P[\d-]+)((,((?P[\d-]+),(?P[\d-]+)))|)(|,)(|[ \t]))|){(|[ ])$") shopRe = re.compile("^(?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)(|,(?P[\d]+))" + "[|](?Pshop)[|](?P[^|]+)[|]" "(?P[\d-]+),(?P(.+))$") shopRe2 = re.compile("^(?P[^/](.+))[.]gat,([ ]*)(?P[\d]+),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)" + "[\t](?Pshop)[\t](?P[^\t]+)[\t]" "(?P[\d]+),(?P(.+))$") mapFlagRe = re.compile("^(?P[^/](.+))" + "[|](?Pmapflag)[|](?P[\w#']+)(|[|](?P.*))$") mapFlagRe2 = re.compile("^(?P[^/](.+))[.]gat" + "[ ](?Pmapflag)[ ](?P[\w#']+)(|[ ](?P.*))$") warpRe = re.compile("^(?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)[|]" "(?Pwarp)[|](?P[^|]+)[|](?P[\d-]+),(?P[\d-]+),(?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)$") warpRe2 = re.compile("^(?P[^/](.+))[.]gat,([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)([\t]+)" "(?Pwarp)[\t](?P[^\t]+)([\t]+)(?P[\d-]+),(?P[\d-]+),(?P[^/](.+))[.]gat,([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)$") warpRe3 = re.compile("^(?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)[|]" "(?Pwarp)[|](?P[\d-]+),(?P[\d-]+),(?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)$") monsterRe = re.compile("^(?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+),([ ]*)(?P[\d-]+),(?P[\d-]+)[|]" "(?Pmonster)[|](?P[^|]+)[|]" "(?P[\d]+),(?P[\d]+),(?P[\d]+)ms,(?P[\d]+)ms(|,(?P