diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/HPMHookGen/HPMHookGen.pl | 3 | ||||
-rw-r--r-- | tools/HPMHookGen/doxygen.conf | 4 | ||||
-rwxr-xr-x | tools/ci/travis.sh | 8 | ||||
-rwxr-xr-x | tools/itemdbconverter.pl | 6 | ||||
-rwxr-xr-x | tools/mobdbconverter.py | 4 | ||||
-rw-r--r-- | tools/mobskilldbconverter.py | 2 | ||||
-rw-r--r-- | tools/petdbconverter.py | 2 | ||||
-rw-r--r-- | tools/utils/common.py | 7 |
8 files changed, 22 insertions, 14 deletions
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl index e5a5c1914..46cae36cb 100755 --- a/tools/HPMHookGen/HPMHookGen.pl +++ b/tools/HPMHookGen/HPMHookGen.pl @@ -371,7 +371,8 @@ foreach my $file (@files) { # Loop through the xml files $t = ')(int fd, struct login_session_data *sd)'; # typedef LoginParseFunc $def =~ s/^LoginParseFunc\s*\*\s*(.*)$/enum parsefunc_rcode(* $1) (int fd, struct login_session_data *sd)/; } - next unless ref $t ne 'HASH' and $t =~ /^[^\[]/; # If it's not a string, or if it starts with an array subscript, we can skip it + next if ref $t eq 'HASH'; # Skip if it's not a string + next if $t =~ /^\)?\[.*\]$/; # Skip arrays or pointers to array my $if = parse($t, $def); next unless scalar keys %$if; # If it returns an empty hash reference, an error must've occurred diff --git a/tools/HPMHookGen/doxygen.conf b/tools/HPMHookGen/doxygen.conf index ec55967b1..c302f7f2f 100644 --- a/tools/HPMHookGen/doxygen.conf +++ b/tools/HPMHookGen/doxygen.conf @@ -269,7 +269,9 @@ INCLUDE_PATH = ../../src \ ../../3rdparty INCLUDE_FILE_PATTERNS = PREDEFINED = __attribute__(x)= \ - HPMHOOKGEN + HPMHOOKGEN \ + PACKETVER=20031028 \ + PACKETVER_MAIN_NUM=20031028 EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = NO #--------------------------------------------------------------------------- diff --git a/tools/ci/travis.sh b/tools/ci/travis.sh index fa7d5be93..22f523bdf 100755 --- a/tools/ci/travis.sh +++ b/tools/ci/travis.sh @@ -47,7 +47,8 @@ function aborterror { function run_server { echo "Running: $1 --run-once $2" - $1 --run-once $2 2>runlog.txt + rm -rf core* || true + CRASH_PLEASE=1 $1 --run-once $2 2>runlog.txt export errcode=$? export teststr=$(head -c 10000 runlog.txt) if [[ -n "${teststr}" ]]; then @@ -59,12 +60,17 @@ function run_server { fi if [ ${errcode} -ne 0 ]; then echo "server $1 terminated with exit code ${errcode}" + COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1) + if [[ -f "$COREFILE" ]]; then + gdb -c "$COREFILE" $1 -ex "thread apply all bt" -ex "set pagination 0" -batch + fi aborterror "Test failed" fi } function run_test { echo "Running: test_$1" + sysctl -w kernel.core_pattern=core || true ./test_$1 2>runlog.txt export errcode=$? export teststr=$(head -c 10000 runlog.txt) diff --git a/tools/itemdbconverter.pl b/tools/itemdbconverter.pl index 58cb08bc1..fe30ce24e 100755 --- a/tools/itemdbconverter.pl +++ b/tools/itemdbconverter.pl @@ -109,9 +109,9 @@ sub parsedb (@) { (?<eLV>[0-9]*)[^,:]*(?<hasmaxlv>:[\s\t]*(?<eLVmax>[0-9]*))?[^,]*,[\s\t]* (?<Refineable>[0-9]*)[^,]*,[\s\t]* (?<View>[0-9]*)[^,]*,[\s\t]* - {(?<Script>.*)}, - {(?<OnEquip>.*)}, - {(?<OnUnequip>.*)} + \{(?<Script>.*)}, + \{(?<OnEquip>.*)}, + \{(?<OnUnequip>.*)} /x ) { my %cols = map { $_ => $+{$_} } keys %+; print "/*\n" if $cols{prefix}; diff --git a/tools/mobdbconverter.py b/tools/mobdbconverter.py index 78047aed9..683e28274 100755 --- a/tools/mobdbconverter.py +++ b/tools/mobdbconverter.py @@ -188,7 +188,7 @@ def convertFile(inFile, itemDb): printField("ChaseRange", fields[21]) printField("Size", fields[22]) printField("Race", fields[23]) - print("\tElement: ({0}, {1})".format(int(fields[24]) % 10, int(fields[24]) / 20)); + print("\tElement: ({0}, {1})".format(int(fields[24]) % 10, int(int(fields[24]) / 20))); mode = int(fields[25], 0) if mode != 0: startGroup("Mode") @@ -260,7 +260,7 @@ def readItemDB(inFile, itemDb): elif line[:3] == "Id:": try: itemId = int(line[4:]) - except: + except ValueError: started = False if itemId != 0 and itemName != "": # was need for remove wrong characters diff --git a/tools/mobskilldbconverter.py b/tools/mobskilldbconverter.py index 310331043..4ba042062 100644 --- a/tools/mobskilldbconverter.py +++ b/tools/mobskilldbconverter.py @@ -206,7 +206,7 @@ def LoadOldDB(mode, serverpath): continue try: Db[MonsterId][skillidx]['val{}'.format(i)] = int(entry[12 + i]) - except: + except ValueError: Db[MonsterId][skillidx]['val{}'.format(i)] = int(entry[12 + i], 16) Db[MonsterId][skillidx]['Emotion'] = entry[17] Db[MonsterId][skillidx]['ChatMsgID'] = entry[18] diff --git a/tools/petdbconverter.py b/tools/petdbconverter.py index 261c1e6ad..1b7d2e4d6 100644 --- a/tools/petdbconverter.py +++ b/tools/petdbconverter.py @@ -175,7 +175,7 @@ def readItemDB(inFile, itemDb): elif line[:3] == "Id:": try: itemId = int(line[4:]) - except: + except ValueError: started = False if itemId != 0 and itemName != "": # was need for remove wrong characters diff --git a/tools/utils/common.py b/tools/utils/common.py index 7b7811654..acceb9b30 100644 --- a/tools/utils/common.py +++ b/tools/utils/common.py @@ -35,13 +35,13 @@ def LoadDBConsts(DBname, mode, serverpath): with io.open(filename) as f: config = libconf.load(f) db = config[DBname] - if DBname is 'item_db': + if DBname == 'item_db': for i, v in enumerate(db): consts[db[i].Id] = db[i].AegisName - elif DBname is 'mob_db': + elif DBname == 'mob_db': for i, v in enumerate(db): consts[db[i].Id] = db[i].SpriteName - elif DBname is 'skill_db': + elif DBname == 'skill_db': for i, v in enumerate(db): consts[db[i].Id] = db[i].Name else: @@ -55,7 +55,6 @@ def LoadDB(DBname, mode, serverpath): if os.path.isfile(serverpath + 'db/{}2.conf'.format(DBname)): filenames.append(serverpath + 'db/{}2.conf'.format(DBname)) - consts = dict() for filename in filenames: with io.open(filename) as f: config = libconf.load(f) |