From 534c5b2edd4985bbec5e04d6170cb850f2f7defe Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Wed, 19 Jan 2022 00:08:28 +0100 Subject: [PATCH] Add more Github Actions (#6530) Renames "build_servers.yml" to "build_servers_gcc.yml" Removed Pre-Renewal and Renewal from GCC compilation Added an action for Pre-Renewal and Renewal Added an action for VIP Added an action for different packet versions Added MSVS build Changed some make server to make all Added master building Disabled LTO by default Added some missing override declarations Added Clang building Disabled Clang 12 and 13 for the time being Thanks to @aleos89 and @Akkarinage for their help and input. --- .github/workflows/build_servers_clang.yml | 49 ++++++++++++ .github/workflows/build_servers_gcc.yml | 50 ++++++++++++ .github/workflows/build_servers_modes.yml | 77 +++++++++++++++++++ .github/workflows/build_servers_msbuild.yml | 43 +++++++++++ .../build_servers_packetversions.yml | 70 +++++++++++++++++ ...uild_servers.yml => build_servers_vip.yml} | 36 +++++++-- .github/workflows/npc_db_validation.yml | 3 + configure | 2 +- configure.in | 2 +- src/char/int_guild.hpp | 8 +- src/char/inter.hpp | 4 +- src/common/database.hpp | 2 +- src/map/achievement.hpp | 12 +-- src/map/atcommand.cpp | 8 +- src/map/battleground.hpp | 4 +- src/map/elemental.hpp | 4 +- src/map/guild.cpp | 4 +- src/map/guild.hpp | 5 +- src/map/homunculus.hpp | 6 +- src/map/instance.hpp | 4 +- src/map/itemdb.hpp | 30 ++++---- src/map/mercenary.hpp | 4 +- src/map/mob.hpp | 24 +++--- src/map/npc.hpp | 4 +- src/map/pc.hpp | 31 ++++---- src/map/pet.hpp | 6 +- src/map/quest.hpp | 6 +- src/map/script.hpp | 6 +- src/map/skill.hpp | 33 ++++---- src/map/status.hpp | 15 ++-- 30 files changed, 440 insertions(+), 112 deletions(-) create mode 100644 .github/workflows/build_servers_clang.yml create mode 100644 .github/workflows/build_servers_gcc.yml create mode 100644 .github/workflows/build_servers_modes.yml create mode 100644 .github/workflows/build_servers_msbuild.yml create mode 100644 .github/workflows/build_servers_packetversions.yml rename .github/workflows/{build_servers.yml => build_servers_vip.yml} (72%) diff --git a/.github/workflows/build_servers_clang.yml b/.github/workflows/build_servers_clang.yml new file mode 100644 index 0000000000..54e2bfa8b2 --- /dev/null +++ b/.github/workflows/build_servers_clang.yml @@ -0,0 +1,49 @@ +name: Build servers with Clang +# build_servers_clang.yml + +on: + push: + branches: + - master + pull_request: + paths: + # Always trigger all Github Actions if an action or something CI related was changed + - '.github/workflows/**' + - 'tools/ci/**' + # This workflow should run when a file in a source directory has been modified. + - 'src/**' + - '3rdparty/**' + +jobs: + build: + # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version. + # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot. + if: "!contains(github.event.head_commit.message, 'ci-skip')" + runs-on: ${{ matrix.os }} + strategy: + matrix: + # The ubuntu-latest label currently points to ubuntu-18.04. + # Available: ubuntu-20.04, ubuntu-18.04 + os: [ubuntu-18.04] + # Version list can be found on https://github.com/marketplace/actions/install-clang + clang: ['3.9', '4.0', '5.0', '6.0', '7', '8', '9', '10', '11'] #, '12', '13'] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Clang + uses: egor-tensin/setup-clang@v1 + with: + version: ${{ matrix.clang }} + platform: x64 + + - name: Command - configure + env: + CONFIGURE_FLAGS: 'CC=clang-${{ matrix.clang }} CXX=clang++-${{ matrix.clang }} --enable-buildbot=yes' + run: ./configure $CONFIGURE_FLAGS + + - name: Command - make clean + run: make clean + + - name: Command - make all + run: make all diff --git a/.github/workflows/build_servers_gcc.yml b/.github/workflows/build_servers_gcc.yml new file mode 100644 index 0000000000..2da009b20a --- /dev/null +++ b/.github/workflows/build_servers_gcc.yml @@ -0,0 +1,50 @@ +name: Build servers with GCC +# build_servers_gcc.yml + +on: + push: + branches: + - master + pull_request: + paths: + # Always trigger all Github Actions if an action or something CI related was changed + - '.github/workflows/**' + - 'tools/ci/**' + # This workflow should run when a file in a source directory has been modified. + - 'src/**' + - '3rdparty/**' + +jobs: + build: + # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version. + # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot. + if: "!contains(github.event.head_commit.message, 'ci-skip')" + runs-on: ${{ matrix.os }} + strategy: + matrix: + # The ubuntu-latest label currently points to ubuntu-18.04. + # Available: ubuntu-20.04, ubuntu-18.04 + os: [ubuntu-latest] + # Older versions of GCC are not available via unaltered aptitude repo lists. + gcc: ['7', '8', '9', '10'] + + steps: + - uses: actions/checkout@v2 + + - name: Update & Install packages + # Ubuntu runners already have most of the packages rAthena requires to build. + # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md + run: | + sudo apt update + sudo apt install zlib1g-dev libpcre3-dev gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} + + - name: Command - configure + env: + CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-buildbot=yes' + run: ./configure $CONFIGURE_FLAGS + + - name: Command - make clean + run: make clean + + - name: Command - make all + run: make all diff --git a/.github/workflows/build_servers_modes.yml b/.github/workflows/build_servers_modes.yml new file mode 100644 index 0000000000..dc2f28dc1b --- /dev/null +++ b/.github/workflows/build_servers_modes.yml @@ -0,0 +1,77 @@ +name: Build servers in Pre-Renewal and Renewal +# build_servers_modes.yml + +on: + push: + branches: + - master + pull_request: + paths: + # Always trigger all Github Actions if an action or something CI related was changed + - '.github/workflows/**' + - 'tools/ci/**' + # This workflow should run when a file in a source directory has been modified. + - 'src/**' + - '3rdparty/**' + +jobs: + build: + # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version. + # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot. + if: "!contains(github.event.head_commit.message, 'ci-skip')" + runs-on: ${{ matrix.os }} + strategy: + matrix: + # The ubuntu-latest label currently points to ubuntu-18.04. + # Available: ubuntu-20.04, ubuntu-18.04 + os: [ubuntu-latest] + # Older versions of GCC are not available via unaltered aptitude repo lists. + gcc: ['10'] + # We run build checks for both Renewal and PRE-Renewal + mode: ['PRE','RE'] + + steps: + - uses: actions/checkout@v2 + + # A simple 'yes' and 'no' can be confusing, so we use names to display in the current job then convert them for use in the compiler. + - name: Variable Parsing - PRE + if: ${{ matrix.mode == 'PRE' }} + run: | + echo "PRERE=yes" >> $GITHUB_ENV + - name: Variable Parsing - RE + if: ${{ matrix.mode == 'RE' }} + run: | + echo "PRERE=no" >> $GITHUB_ENV + + - name: Update & Install packages + # Ubuntu runners already have most of the packages rAthena requires to build. + # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md + run: | + sudo apt update + sudo apt install zlib1g-dev libpcre3-dev gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} + + - name: Start MySQL + run: sudo systemctl start mysql.service + + - name: Setup Database and import table data + run: ./tools/ci/sql.sh + + - name: Command - configure + env: + CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-prere=${{ env.PRERE }} --enable-buildbot=yes' + run: ./configure $CONFIGURE_FLAGS + + - name: Command - make clean + run: make clean + + - name: Command - make server + run: make server + + - name: Run Once - login-server + run: ./login-server --run-once + + - name: Run Once - char-server + run: ./char-server --run-once + + - name: Run Once - map-server + run: ./map-server --run-once diff --git a/.github/workflows/build_servers_msbuild.yml b/.github/workflows/build_servers_msbuild.yml new file mode 100644 index 0000000000..fb22b5af2c --- /dev/null +++ b/.github/workflows/build_servers_msbuild.yml @@ -0,0 +1,43 @@ +name: Build servers with MSVS +# build_servers_msbuild.yml + +on: + push: + branches: + - master + pull_request: + paths: + # Always trigger all Github Actions if an action or something CI related was changed + - '.github/workflows/**' + - 'tools/ci/**' + # This workflow should run when a file in a source directory has been modified. + - 'src/**' + - '3rdparty/**' + +jobs: + build: + # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version. + # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot. + if: "!contains(github.event.head_commit.message, 'ci-skip')" + runs-on: ${{ matrix.os }} + strategy: + matrix: + # The windows-latest label currently points to windows-2019. + # Available: windows-2016, windows-2019 and windows-2022 + os: [windows-latest] + # We run build checks for both Renewal and PRE-Renewal + mode: ['PRE', 'RE'] + + steps: + - uses: actions/checkout@v2 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + + - name: Build solution in Debug + if: ${{ matrix.mode == 'PRE' }} + run: msbuild rAthena.sln -t:rebuild -property:Configuration=Debug /p:DefineConstants="BUILDBOT%3BPRERE" + + - name: Build solution in Debug + if: ${{ matrix.mode == 'RE' }} + run: msbuild rAthena.sln -t:rebuild -property:Configuration=Debug /p:DefineConstants="BUILDBOT" diff --git a/.github/workflows/build_servers_packetversions.yml b/.github/workflows/build_servers_packetversions.yml new file mode 100644 index 0000000000..06bb41718e --- /dev/null +++ b/.github/workflows/build_servers_packetversions.yml @@ -0,0 +1,70 @@ +name: Build servers with different packet versions +# build_servers_packetversions.yml + +on: + push: + branches: + - master + pull_request: + paths: + # Always trigger all Github Actions if an action or something CI related was changed + - '.github/workflows/**' + - 'tools/ci/**' + # This workflow should run when a file in a source directory has been modified. + - 'src/**' + - '3rdparty/**' + +jobs: + build: + # Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version. + # It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot. + if: "!contains(github.event.head_commit.message, 'ci-skip')" + runs-on: ${{ matrix.os }} + strategy: + matrix: + # The ubuntu-latest label currently points to ubuntu-18.04. + # Available: ubuntu-20.04, ubuntu-18.04 + os: [ubuntu-latest] + # Older versions of GCC are not available via unaltered aptitude repo lists. + gcc: ['10'] + # We run build checks for both Renewal and PRE-Renewal + mode: ['PRE','RE'] + # Check build success for different packet-versions + packetver: ['20211103', '20200902', '20200401', '20180620', '20151104'] + + steps: + - uses: actions/checkout@v2 + + # A simple 'yes' and 'no' can be confusing, so we use names to display in the current job then convert them for use in the compiler. + - name: Variable Parsing - PRE + if: ${{ matrix.mode == 'PRE' }} + run: | + echo "PRERE=yes" >> $GITHUB_ENV + - name: Variable Parsing - RE + if: ${{ matrix.mode == 'RE' }} + run: | + echo "PRERE=no" >> $GITHUB_ENV + + - name: Update & Install packages + # Ubuntu runners already have most of the packages rAthena requires to build. + # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md + run: | + sudo apt update + sudo apt install zlib1g-dev libpcre3-dev gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} + + - name: Start MySQL + run: sudo systemctl start mysql.service + + - name: Setup Database and import table data + run: ./tools/ci/sql.sh + + - name: Command - configure + env: + CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-prere=${{ env.PRERE }} --enable-packetver=${{ matrix.packetver }} --enable-buildbot=yes' + run: ./configure $CONFIGURE_FLAGS + + - name: Command - make clean + run: make clean + + - name: Command - make all + run: make all diff --git a/.github/workflows/build_servers.yml b/.github/workflows/build_servers_vip.yml similarity index 72% rename from .github/workflows/build_servers.yml rename to .github/workflows/build_servers_vip.yml index 60d52ad653..3d428ff539 100644 --- a/.github/workflows/build_servers.yml +++ b/.github/workflows/build_servers_vip.yml @@ -1,10 +1,16 @@ -name: Build Servers from a Pull Request -# build_servers.yml +name: Build servers in VIP mode +# build_servers_vip.yml on: + push: + branches: + - master pull_request: paths: - # This workflow should run when a file in the src/ directory has been modified. + # Always trigger all Github Actions if an action or something CI related was changed + - '.github/workflows/**' + - 'tools/ci/**' + # This workflow should run when a file in a source directory has been modified. - 'src/**' - '3rdparty/**' @@ -20,14 +26,13 @@ jobs: # Available: ubuntu-20.04, ubuntu-18.04 os: [ubuntu-latest] # Older versions of GCC are not available via unaltered aptitude repo lists. - gcc: ['7', '8', '9', '10'] + gcc: ['10'] # We run build checks for both Renewal and PRE-Renewal mode: ['PRE', 'RE'] - # This workflow currently does not run different jobs for VIP enabled/disabled. That would be a waste of time. steps: - uses: actions/checkout@v2 - + # A simple 'yes' and 'no' can be confusing, so we use names to display in the current job then convert them for use in the compiler. - name: Variable Parsing - PRE if: ${{ matrix.mode == 'PRE' }} @@ -44,10 +49,16 @@ jobs: run: | sudo apt update sudo apt install zlib1g-dev libpcre3-dev gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} - + + - name: Start MySQL + run: sudo systemctl start mysql.service + + - name: Setup Database and import table data + run: ./tools/ci/sql.sh + - name: Command - configure env: - CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-prere=${{ env.PRERE }} --enable-buildbot=yes' + CONFIGURE_FLAGS: 'CC=gcc-${{ matrix.gcc }} CXX=g++-${{ matrix.gcc }} --enable-prere=${{ env.PRERE }} --enable-buildbot=yes --enable-vip=yes' run: ./configure $CONFIGURE_FLAGS - name: Command - make clean @@ -55,3 +66,12 @@ jobs: - name: Command - make server run: make server + + - name: Run Once - login-server + run: ./login-server --run-once + + - name: Run Once - char-server + run: ./char-server --run-once + + - name: Run Once - map-server + run: ./map-server --run-once diff --git a/.github/workflows/npc_db_validation.yml b/.github/workflows/npc_db_validation.yml index 8d55928d59..dda035f29a 100644 --- a/.github/workflows/npc_db_validation.yml +++ b/.github/workflows/npc_db_validation.yml @@ -6,6 +6,9 @@ name: Validate NPC Scripts and DB Changes on: push: + branches: + - master + pull_request: paths: # Always trigger all Github Actions if an action or something CI related was changed - '.github/workflows/**' diff --git a/configure b/configure index 0a10b80702..9007bedf0e 100755 --- a/configure +++ b/configure @@ -3457,7 +3457,7 @@ if test "${enable_lto+set}" = set; then : esac else - enable_lto="yes" + enable_lto="no" fi diff --git a/configure.in b/configure.in index bb12342220..6a7eeec45c 100644 --- a/configure.in +++ b/configure.in @@ -290,7 +290,7 @@ AC_ARG_ENABLE( *) AC_MSG_ERROR([[invalid argument --enable-lto=$disableval... stopping]]);; esac ], - [enable_lto="yes"] + [enable_lto="no"] ) diff --git a/src/char/int_guild.hpp b/src/char/int_guild.hpp index bc2198ec04..fce3dd330f 100644 --- a/src/char/int_guild.hpp +++ b/src/char/int_guild.hpp @@ -38,10 +38,12 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + void loadingFinished() override; + + // Additional t_exp get_nextexp(uint16 level); - void loadingFinished(); }; int inter_guild_parse_frommap(int fd); diff --git a/src/char/inter.hpp b/src/char/inter.hpp index d054b3ccc1..21d305cb44 100644 --- a/src/char/inter.hpp +++ b/src/char/inter.hpp @@ -20,8 +20,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; }; extern InterServerDatabase interServerDb; diff --git a/src/common/database.hpp b/src/common/database.hpp index e945198562..6ec31af735 100644 --- a/src/common/database.hpp +++ b/src/common/database.hpp @@ -84,7 +84,7 @@ public: TypesafeYamlDatabase( const std::string& type_, uint16 version_ ) : YamlDatabase( type_, version_, version_ ){ } - void clear(){ + void clear() override{ this->data.clear(); } diff --git a/src/map/achievement.hpp b/src/map/achievement.hpp index cd0a4b1bb2..eb2c958d07 100644 --- a/src/map/achievement.hpp +++ b/src/map/achievement.hpp @@ -106,10 +106,10 @@ public: } - void clear(); - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); - void loadingFinished(); + void clear() override; + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; + void loadingFinished() override; // Additional bool mobexists(uint32 mob_id); @@ -128,8 +128,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; }; extern AchievementLevelDatabase achievement_level_db; diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 1c0a2a0a78..22ef142a72 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -101,9 +101,11 @@ public: } - void clear(); - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); + void clear() override; + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; + + // Additional const char* checkAlias( const char* alias ); }; diff --git a/src/map/battleground.hpp b/src/map/battleground.hpp index 5b23b36db7..67bbc846cc 100644 --- a/src/map/battleground.hpp +++ b/src/map/battleground.hpp @@ -118,8 +118,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; extern BattlegroundDatabase battleground_db; diff --git a/src/map/elemental.hpp b/src/map/elemental.hpp index 48d157cc82..fdd5047aae 100644 --- a/src/map/elemental.hpp +++ b/src/map/elemental.hpp @@ -91,8 +91,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; extern ElementalDatabase elemental_db; diff --git a/src/map/guild.cpp b/src/map/guild.cpp index 06b3fac20f..33a0eb55b9 100644 --- a/src/map/guild.cpp +++ b/src/map/guild.cpp @@ -73,8 +73,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; }; const std::string GuildSkillTreeDatabase::getDefaultLocation(){ diff --git a/src/map/guild.hpp b/src/map/guild.hpp index 2cdf14d0f0..0bc58e8bc4 100644 --- a/src/map/guild.hpp +++ b/src/map/guild.hpp @@ -122,9 +122,10 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; + // Additional std::shared_ptr mapname2gc(const char* mapname); std::shared_ptr mapindex2gc(int16 mapindex); }; diff --git a/src/map/homunculus.hpp b/src/map/homunculus.hpp index c584780157..909b414c44 100644 --- a/src/map/homunculus.hpp +++ b/src/map/homunculus.hpp @@ -33,8 +33,10 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + + // Additional t_exp get_nextexp(uint16 level); }; diff --git a/src/map/instance.hpp b/src/map/instance.hpp index 546d279fd4..1d37372331 100644 --- a/src/map/instance.hpp +++ b/src/map/instance.hpp @@ -100,8 +100,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; }; extern InstanceDatabase instance_db; diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index 3702ea6188..5148100464 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -841,13 +841,13 @@ public: } - void clear() { + void clear() override{ TypesafeYamlDatabase::clear(); this->combo_num = 0; } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + void loadingFinished() override; }; extern ComboDatabase itemdb_combo; @@ -1021,9 +1021,9 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; + void loadingFinished() override; // Additional bool option_exists(std::string name); @@ -1038,8 +1038,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; // Additional bool add_option(const YAML::Node &node, std::shared_ptr &entry); @@ -1061,9 +1061,9 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + void loadingFinished() override; void clear() override{ TypesafeCachedYamlDatabase::clear(); @@ -1084,9 +1084,9 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + void loadingFinished() override; // Additional bool item_exists(uint16 group_id, t_itemid nameid); diff --git a/src/map/mercenary.hpp b/src/map/mercenary.hpp index ba74c41b79..1654ac0b2e 100644 --- a/src/map/mercenary.hpp +++ b/src/map/mercenary.hpp @@ -65,8 +65,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; extern MercenaryDatabase mercenary_db; diff --git a/src/map/mob.hpp b/src/map/mob.hpp index 9fde194a40..1fe48af06a 100644 --- a/src/map/mob.hpp +++ b/src/map/mob.hpp @@ -210,8 +210,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; }; struct s_mob_item_drop_ratio { @@ -226,8 +226,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; }; struct spawn_info { @@ -277,9 +277,9 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; + void loadingFinished() override; }; extern MobDatabase mob_db; @@ -361,9 +361,9 @@ public: } - void clear() { }; - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + void clear() override{ }; + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; struct s_randomsummon_entry { @@ -383,8 +383,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; }; enum e_mob_skill_target { diff --git a/src/map/npc.hpp b/src/map/npc.hpp index 718a3bd83d..6e7c50c936 100644 --- a/src/map/npc.hpp +++ b/src/map/npc.hpp @@ -79,8 +79,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; }; extern StylistDatabase stylist_db; diff --git a/src/map/pc.hpp b/src/map/pc.hpp index e3982c2ba4..9aee11b47b 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -987,9 +987,9 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + void loadingFinished() override; }; struct s_job_info { @@ -1012,11 +1012,11 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; + void loadingFinished() override; - // Extras + // Additional uint32 get_maxBaseLv(uint16 job_id); uint32 get_maxJobLv(uint16 job_id); t_exp get_baseExp(uint16 job_id, uint32 level); @@ -1183,8 +1183,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; }; extern AttendanceDatabase attendance_db; @@ -1201,10 +1201,11 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + void loadingFinished() override; + // Additional uint32 pc_gets_status_point(uint16 level); uint32 get_table_point(uint16 level); uint32 pc_gets_trait_point(uint16 level); @@ -1477,9 +1478,9 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + void loadingFinished() override; // Additional std::shared_ptr get_skill_data(int class_, uint16 skill_id); diff --git a/src/map/pet.hpp b/src/map/pet.hpp index 088b365002..b1bf6cf5b1 100644 --- a/src/map/pet.hpp +++ b/src/map/pet.hpp @@ -135,8 +135,10 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; + + // Additional bool reload(); }; diff --git a/src/map/quest.hpp b/src/map/quest.hpp index 506e42b230..589c8f258b 100644 --- a/src/map/quest.hpp +++ b/src/map/quest.hpp @@ -59,8 +59,10 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + + // Additional bool reload(); }; diff --git a/src/map/script.hpp b/src/map/script.hpp index 72cabbe231..6487414456 100644 --- a/src/map/script.hpp +++ b/src/map/script.hpp @@ -2072,9 +2072,9 @@ public: } - void clear() { } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + void clear() override{ } + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; /** diff --git a/src/map/skill.hpp b/src/map/skill.hpp index cb6f2fe06a..2353b3fe06 100644 --- a/src/map/skill.hpp +++ b/src/map/skill.hpp @@ -314,16 +314,17 @@ private: /// Skill count, also as last index uint16 skill_num; + template bool parseNode(std::string nodeName, std::string subNodeName, YAML::Node node, T(&arr)[S]); + public: SkillDatabase() : TypesafeCachedYamlDatabase("SKILL_DB", 3, 1) { this->clear(); } - const std::string getDefaultLocation(); - template bool parseNode(std::string nodeName, std::string subNodeName, YAML::Node node, T (&arr)[S]); - uint64 parseBodyNode(const YAML::Node &node); - void clear(); - void loadingFinished(); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; + void clear() override; + void loadingFinished() override; // Additional uint16 get_index( uint16 skill_id, bool silent, const char* func, const char* file, int line ); @@ -462,8 +463,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; extern SkillArrowDatabase skill_arrow_db; @@ -480,8 +481,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; struct s_skill_improvise_db { @@ -494,8 +495,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; }; void do_init_skill(void); @@ -2569,8 +2570,10 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + + // Additional std::shared_ptr findBook(t_itemid nameid); }; @@ -2590,8 +2593,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; }; extern MagicMushroomDatabase magic_mushroom_db; diff --git a/src/map/status.hpp b/src/map/status.hpp index 420d665b48..18ad9413a5 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -91,8 +91,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode( const YAML::Node& node ); + const std::string getDefaultLocation() override; + uint64 parseBodyNode( const YAML::Node& node ) override; // Additional std::shared_ptr findLevelInfo( const struct item_data& data, struct item& item ); @@ -112,8 +112,8 @@ public: } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node &node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node &node) override; }; extern SizeFixDatabase size_fix_db; @@ -127,12 +127,13 @@ public: this->clear(); } - void clear() { + void clear() override{ std::fill_n(&attr_fix_table[0][0][0], MAX_ELE_LEVEL * ELE_MAX * ELE_MAX, 100); } - const std::string getDefaultLocation(); - uint64 parseBodyNode(const YAML::Node& node); + const std::string getDefaultLocation() override; + uint64 parseBodyNode(const YAML::Node& node) override; + // Additional int16 getAttribute(uint16 level, uint16 atk_ele, uint16 def_ele); };