diff options
Diffstat (limited to 'hercules/code/server')
25 files changed, 82 insertions, 98 deletions
diff --git a/hercules/code/server/account.py b/hercules/code/server/account.py index 28aafe4..7763766 100644 --- a/hercules/code/server/account.py +++ b/hercules/code/server/account.py @@ -5,8 +5,8 @@ import re -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile +from code.stringutils import stripNewLine, escapeSqlStr def convertSex(sex): if sex == "M" or sex == "F" or sex == "S": diff --git a/hercules/code/server/accreg.py b/hercules/code/server/accreg.py index 98b0934..b69910f 100644 --- a/hercules/code/server/accreg.py +++ b/hercules/code/server/accreg.py @@ -5,9 +5,8 @@ import re -from code.fileutils import * -from code.stringutils import * -from code.server.dbitem import * +from code.fileutils import readFile +from code.stringutils import stripNewLine def convertAccReg(): srcFile = "olddb/accreg.txt" diff --git a/hercules/code/server/db/char.py b/hercules/code/server/db/char.py index c1bb4a8..cd8e0cc 100644 --- a/hercules/code/server/db/char.py +++ b/hercules/code/server/db/char.py @@ -3,8 +3,8 @@ # Copyright (C) 2015 Evol Online # Author: Andrei Karas (4144) -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile +from code.stringutils import escapeSqlStr def saveCharTable(users): dstFile = "newdb/char.sql" diff --git a/hercules/code/server/db/charregnumdb.py b/hercules/code/server/db/charregnumdb.py index 8837c9d..1617c13 100644 --- a/hercules/code/server/db/charregnumdb.py +++ b/hercules/code/server/db/charregnumdb.py @@ -3,8 +3,7 @@ # Copyright (C) 2015 Evol Online # Author: Andrei Karas (4144) -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile def saveCharRegNumDbTable(users): dstFile = "newdb/char_reg_num_db.sql" diff --git a/hercules/code/server/db/inventory.py b/hercules/code/server/db/inventory.py index 52a2fd0..e5c1e6a 100644 --- a/hercules/code/server/db/inventory.py +++ b/hercules/code/server/db/inventory.py @@ -3,8 +3,7 @@ # Copyright (C) 2015 Evol Online # Author: Andrei Karas (4144) -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile def saveInventoryTable(users): dstFile = "newdb/inventory.sql" diff --git a/hercules/code/server/db/skill.py b/hercules/code/server/db/skill.py index 2f45813..d21eb3d 100644 --- a/hercules/code/server/db/skill.py +++ b/hercules/code/server/db/skill.py @@ -3,8 +3,7 @@ # Copyright (C) 2015 Evol Online # Author: Andrei Karas (4144) -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile def saveSkillTable(users): dstFile = "newdb/skill.sql" diff --git a/hercules/code/server/evol/athena.py b/hercules/code/server/evol/athena.py index 567db3b..59d8223 100644 --- a/hercules/code/server/evol/athena.py +++ b/hercules/code/server/evol/athena.py @@ -5,11 +5,10 @@ import re -from code.fileutils import * -from code.stringutils import * -from code.server.dbitem import * -from code.server.dbskill import * -from code.server.dbuser import * +from code.stringutils import stripNewLine, removeGat +from code.server.dbitem import Item +from code.server.dbskill import Skill, skills +from code.server.dbuser import User comaSplit = re.compile(",") spaceSplit = re.compile(" ") diff --git a/hercules/code/server/evol/consts.py b/hercules/code/server/evol/consts.py index d2c5c9b..c63f559 100644 --- a/hercules/code/server/evol/consts.py +++ b/hercules/code/server/evol/consts.py @@ -5,9 +5,6 @@ import re -from code.fileutils import * -from code.stringutils import * - def convertConsts(quests): dstFile = "newserverdata/db/const.txt" fieldsSplit = re.compile("\t+") diff --git a/hercules/code/server/evol/itemdb.py b/hercules/code/server/evol/itemdb.py index b86b848..a60e57d 100644 --- a/hercules/code/server/evol/itemdb.py +++ b/hercules/code/server/evol/itemdb.py @@ -5,9 +5,8 @@ import re -from code.configutils import * -from code.fileutils import * -from code.stringutils import * +from code.configutils import writeIntField, writeStartBlock, writeEndBlock, writeStartScript, writeEndScript, writeStrField, writeSubField +from code.fileutils import readFile def convertItemDb(): srcFile = "oldserverdata/db/item_db.txt" diff --git a/hercules/code/server/evol/main.py b/hercules/code/server/evol/main.py index 308bc87..0483118 100644 --- a/hercules/code/server/evol/main.py +++ b/hercules/code/server/evol/main.py @@ -4,23 +4,22 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) -from code.server.account import * -from code.server.accreg import * -from code.server.party import * -from code.server.storage import * -from code.server.db.char import * -from code.server.db.charregnumdb import * -from code.server.db.inventory import * -from code.server.db.skill import * -from code.server.evol.athena import * -from code.server.evol.consts import * -from code.server.evol.itemdb import * -from code.server.evol.mobdb import * -from code.server.evol.mobskilldb import * -from code.server.evol.npcs import * -from code.server.utils import * -from code.server.questsdb import * -from code.serverutils import * +from code.server.account import convertAccount +from code.server.accreg import convertAccReg +from code.server.party import convertParty +from code.server.storage import convertStorage +from code.server.db.char import saveCharTable +from code.server.db.charregnumdb import saveCharRegNumDbTable +from code.server.db.inventory import saveInventoryTable +from code.server.db.skill import saveSkillTable +from code.server.evol.athena import readAthena +from code.server.evol.consts import convertConsts +from code.server.evol.itemdb import convertItemDb +from code.server.evol.mobdb import convertMobDb +from code.server.evol.mobskilldb import convertMobSkillDb +from code.server.evol.npcs import createMainScript, convertNpcs +from code.server.questsdb import convertQuestsDb +from code.serverutils import cleanServerData def serverEvolMain(): cleanServerData() diff --git a/hercules/code/server/evol/mobdb.py b/hercules/code/server/evol/mobdb.py index a09348b..74eda04 100644 --- a/hercules/code/server/evol/mobdb.py +++ b/hercules/code/server/evol/mobdb.py @@ -5,9 +5,6 @@ import re -from code.fileutils import * -from code.stringutils import * - def convertMobDb(): srcFile = "oldserverdata/db/mob_db.txt" dstFile = "newserverdata/db/re/mob_db.txt" diff --git a/hercules/code/server/evol/mobskilldb.py b/hercules/code/server/evol/mobskilldb.py index 6f0bf12..a5a7d5f 100644 --- a/hercules/code/server/evol/mobskilldb.py +++ b/hercules/code/server/evol/mobskilldb.py @@ -5,8 +5,7 @@ import re -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile def convertMobSkillDb(): srcFile = "oldserverdata/db/mob_skill_db.txt" diff --git a/hercules/code/server/evol/npcs.py b/hercules/code/server/evol/npcs.py index 2d198c1..6efe811 100644 --- a/hercules/code/server/evol/npcs.py +++ b/hercules/code/server/evol/npcs.py @@ -3,10 +3,11 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) +import os import re -from code.fileutils import * -from code.stringutils import * +from code.fileutils import makeDir +from code.stringutils import stripWindows, stripNewLine mapsConfFile = "newserverdata/conf/maps.conf" mapsIndexFile = "newserverdata/db/map_index.txt" diff --git a/hercules/code/server/maps.py b/hercules/code/server/maps.py index bdeb0f7..2ef0173 100644 --- a/hercules/code/server/maps.py +++ b/hercules/code/server/maps.py @@ -3,9 +3,11 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) +import array +import struct import zlib -from code.fileutils import * +from code.fileutils import readMapName, readInt16, readInt32, readData, makeDir def listMapCache(f, mapsCount): print "Known maps:" diff --git a/hercules/code/server/party.py b/hercules/code/server/party.py index b71f66f..c75a541 100644 --- a/hercules/code/server/party.py +++ b/hercules/code/server/party.py @@ -5,9 +5,8 @@ import re -from code.fileutils import * -from code.stringutils import * -from code.server.dbitem import * +from code.fileutils import readFile +from code.stringutils import stripNewLine, escapeSqlStr def findLeaderId(name, users): for userId in users: diff --git a/hercules/code/server/questsdb.py b/hercules/code/server/questsdb.py index 25b0303..880a7f9 100644 --- a/hercules/code/server/questsdb.py +++ b/hercules/code/server/questsdb.py @@ -3,16 +3,11 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) -import re -from sets import Set - -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile def convertQuestsDb(): srcFile = "oldserverdata/db/questvars.txt" dstFile = "newserverdata/db/quest_db.txt" - fieldsSplit = re.compile(",") quests = dict() with open(srcFile, "r") as r: with open(dstFile, "w") as w: diff --git a/hercules/code/server/storage.py b/hercules/code/server/storage.py index a8d5802..6bddb52 100644 --- a/hercules/code/server/storage.py +++ b/hercules/code/server/storage.py @@ -5,9 +5,9 @@ import re -from code.fileutils import * -from code.stringutils import * -from code.server.dbitem import * +from code.fileutils import readFile +from code.stringutils import stripNewLine +from code.server.dbitem import Item def convertStorage(): srcFile = "olddb/storage.txt" @@ -33,7 +33,7 @@ def convertStorage(): tmp = comaSplit.split(rows[0]) accountId = tmp[0] - storage_amount = tmp[1] +# storage_amount = tmp[1] data = spaceSplit.split(rows[1]) for itemStr in data: diff --git a/hercules/code/server/tmw/athena.py b/hercules/code/server/tmw/athena.py index 4c59ea1..6ad3e9c 100644 --- a/hercules/code/server/tmw/athena.py +++ b/hercules/code/server/tmw/athena.py @@ -5,11 +5,10 @@ import re -from code.fileutils import * -from code.stringutils import * -from code.server.dbitem import * -from code.server.dbskill import * -from code.server.dbuser import * +from code.stringutils import stripNewLine +from code.server.dbitem import Item +from code.server.dbskill import Skill, skills +from code.server.dbuser import User comaSplit = re.compile(",") spaceSplit = re.compile(" ") diff --git a/hercules/code/server/tmw/consts.py b/hercules/code/server/tmw/consts.py index c3ca848..5b8403e 100644 --- a/hercules/code/server/tmw/consts.py +++ b/hercules/code/server/tmw/consts.py @@ -3,10 +3,11 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) +import os import re -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile +from code.stringutils import stripNewLine fieldsSplit = re.compile(":") diff --git a/hercules/code/server/tmw/itemdb.py b/hercules/code/server/tmw/itemdb.py index 0729fc3..beccd09 100644 --- a/hercules/code/server/tmw/itemdb.py +++ b/hercules/code/server/tmw/itemdb.py @@ -3,11 +3,11 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) +import os import re -from code.configutils import * -from code.fileutils import * -from code.stringutils import * +from code.configutils import writeStartScript, writeEndScript, writeIntField, writeStrField +from code.fileutils import readFile def getItemDbFile(srcDir): files = os.listdir(srcDir) diff --git a/hercules/code/server/tmw/main.py b/hercules/code/server/tmw/main.py index 59363ac..f3dd10d 100644 --- a/hercules/code/server/tmw/main.py +++ b/hercules/code/server/tmw/main.py @@ -4,23 +4,23 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) -from code.server.account import * -from code.server.accreg import * -from code.server.party import * -from code.server.storage import * -from code.server.db.char import * -from code.server.db.charregnumdb import * -from code.server.db.inventory import * -from code.server.db.skill import * -from code.server.tmw.athena import * -from code.server.tmw.consts import * -from code.server.tmw.itemdb import * -from code.server.tmw.mobdb import * -from code.server.tmw.mobskilldb import * -from code.server.tmw.npcs import * -from code.server.utils import * -from code.server.questsdb import * -from code.serverutils import * +from sets import Set + +from code.server.account import convertAccount +from code.server.accreg import convertAccReg +from code.server.party import convertParty +from code.server.storage import convertStorage +from code.server.db.char import saveCharTableCustom +from code.server.db.charregnumdb import saveCharRegNumDbTable +from code.server.db.inventory import saveInventoryTable +from code.server.db.skill import saveSkillTable +from code.server.tmw.athena import readAthena +from code.server.tmw.consts import convertConsts +from code.server.tmw.itemdb import convertItemDb +from code.server.tmw.mobdb import convertMobDb +from code.server.tmw.mobskilldb import convertMobSkillDb +from code.server.tmw.npcs import createMainScript, convertNpcs +from code.serverutils import cleanServerData def serverTmwMain(isNew): try: diff --git a/hercules/code/server/tmw/mobdb.py b/hercules/code/server/tmw/mobdb.py index 652a203..04d1fce 100644 --- a/hercules/code/server/tmw/mobdb.py +++ b/hercules/code/server/tmw/mobdb.py @@ -3,11 +3,12 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) -import re, math +import math +import os +import re -from code.configutils import * -from code.fileutils import * -from code.stringutils import * +from code.configutils import isHaveData, writeCondField2, writeStartBlock, writeEndBlock, writeIntField, writeStrField, writeFieldArr, writeIntField2, writeFieldList, writeSubField +from code.fileutils import readFile def getMobDbFile(srcDir): files = os.listdir(srcDir) diff --git a/hercules/code/server/tmw/mobskilldb.py b/hercules/code/server/tmw/mobskilldb.py index cba7d70..7188824 100644 --- a/hercules/code/server/tmw/mobskilldb.py +++ b/hercules/code/server/tmw/mobskilldb.py @@ -5,8 +5,7 @@ import re -from code.fileutils import * -from code.stringutils import * +from code.fileutils import readFile def convertMobSkillDb(): srcFile = "oldserverdata/world/map/db/mob_skill_db.txt" diff --git a/hercules/code/server/tmw/npcs.py b/hercules/code/server/tmw/npcs.py index dc73d75..c51da78 100644 --- a/hercules/code/server/tmw/npcs.py +++ b/hercules/code/server/tmw/npcs.py @@ -3,10 +3,11 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) +import os import re -from code.fileutils import * -from code.stringutils import * +from code.fileutils import makeDir +from code.stringutils import stripWindows, stripNewLine mapsConfFile = "newserverdata/conf/maps.conf" if os.path.isfile(mapsConfFile): diff --git a/hercules/code/server/utils.py b/hercules/code/server/utils.py index 0f164ca..ebbddf3 100644 --- a/hercules/code/server/utils.py +++ b/hercules/code/server/utils.py @@ -3,7 +3,7 @@ # Copyright (C) 2014 Evol Online # Author: Andrei Karas (4144) -from code.fileutils import * +from code.fileutils import removeAllFiles, makeDir def cleanServerData(): removeAllFiles("newserverdata") |