From 2528b0dbf177cff3e3af850f4fed58307a61213c Mon Sep 17 00:00:00 2001 From: Walter Pagani Date: Wed, 30 Aug 2023 22:35:59 -0300 Subject: [PATCH] feat. upgrade module (#15) --- .github/ISSUE_TEMPLATE/bug_report.yml | 72 +++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 33 +++++++++ .github/workflows/core-build.yml | 2 - .github/workflows/core_codestyle.yml | 19 +++++ apps/.gitkeep | 0 apps/ci/.gitkeep | 0 apps/ci/ci-codestyle.sh | 40 +++++++++++ conf/.gitkeep | 0 conf/RacialTraitSwap.conf | 26 ------- conf/conf.sh.dist | 7 -- data/.gitkeep | 0 data/sql/.gitkeep | 0 data/sql/db-world/.gitkeep | 0 .../sql/db-world/base}/world.RTS.sql | 0 include.sh | 10 --- pull_request_template.md | 25 +++++++ 16 files changed, 189 insertions(+), 45 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/workflows/core_codestyle.yml create mode 100644 apps/.gitkeep create mode 100644 apps/ci/.gitkeep create mode 100644 apps/ci/ci-codestyle.sh create mode 100644 conf/.gitkeep delete mode 100644 conf/RacialTraitSwap.conf delete mode 100644 conf/conf.sh.dist create mode 100644 data/.gitkeep create mode 100644 data/sql/.gitkeep create mode 100644 data/sql/db-world/.gitkeep rename {sql/world => data/sql/db-world/base}/world.RTS.sql (100%) create mode 100644 pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..5610d2b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,72 @@ +name: Bug report +description: Create a bug report to help us improve. +title: "Bug: " +body: + - type: textarea + id: current + attributes: + label: Current Behaviour + description: | + Description of the problem or issue here. + Include entries of affected creatures / items / quests / spells etc. + If this is a crash, post the crashlog (upload to https://gist.github.com/) and include the link here. + Never upload files! Use GIST for text and YouTube for videos! + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected Behaviour + description: | + Tell us what should happen instead. + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce the problem + description: | + What does someone else need to do to encounter the same bug? + placeholder: | + 1. Step 1 + 2. Step 2 + 3. Step 3 + validations: + required: true + - type: textarea + id: extra + attributes: + label: Extra Notes + description: | + Do you have any extra notes that can help solve the issue that does not fit any other field? + placeholder: | + None + validations: + required: false + - type: textarea + id: commit + attributes: + label: AC rev. hash/commit + description: | + Copy the result of the `.server debug` command (if you need to run it from the client get a prat addon) + validations: + required: true + - type: input + id: os + attributes: + label: Operating system + description: | + The Operating System the Server is running on. + i.e. Windows 11 x64, Debian 10 x64, macOS 12, Ubuntu 20.04 + validations: + required: true + - type: textarea + id: custom + attributes: + label: Custom changes or Modules + description: | + List which custom changes or modules you have applied, i.e. Eluna module, etc. + placeholder: | + None + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..58f79dd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,33 @@ +name: Feature request +description: Suggest an idea for this project +title: "Feature: " +body: + - type: markdown + attributes: + value: | + Thank you for taking your time to fill out a feature request. Remember to fill out all fields including the title above. + An issue that is not properly filled out will be closed. + - type: textarea + id: description + attributes: + label: Describe your feature request or suggestion in detail + description: | + A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe a possible solution to your feature or suggestion in detail + description: | + A clear and concise description of any alternative solutions or features you've considered. + validations: + required: false + - type: textarea + id: additional + attributes: + label: Additional context + description: | + Add any other context or screenshots about the feature request here. + validations: + required: false diff --git a/.github/workflows/core-build.yml b/.github/workflows/core-build.yml index 921c9eb..1eec897 100644 --- a/.github/workflows/core-build.yml +++ b/.github/workflows/core-build.yml @@ -1,8 +1,6 @@ name: core-build on: push: - branches: - - 'master' pull_request: jobs: diff --git a/.github/workflows/core_codestyle.yml b/.github/workflows/core_codestyle.yml new file mode 100644 index 0000000..3f9a73e --- /dev/null +++ b/.github/workflows/core_codestyle.yml @@ -0,0 +1,19 @@ +name: Codestyle Checks +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + check-codestyle: + strategy: + fail-fast: false + + runs-on: ubuntu-latest + name: Check Codestyling + steps: + - uses: actions/checkout@v2 + + - name: Check Codestyling + run: source ./apps/ci/ci-codestyle.sh diff --git a/apps/.gitkeep b/apps/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/ci/.gitkeep b/apps/ci/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/ci/ci-codestyle.sh b/apps/ci/ci-codestyle.sh new file mode 100644 index 0000000..c96a31d --- /dev/null +++ b/apps/ci/ci-codestyle.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +echo "Codestyle check script:" +echo + +declare -A singleLineRegexChecks=( + ["LOG_.+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above" + ["[[:blank:]]$"]="Remove whitespace at the end of the lines above" + ["\t"]="Replace tabs with 4 spaces in the lines above" +) + +for check in ${!singleLineRegexChecks[@]}; do + echo " Checking RegEx: '${check}'" + + if grep -P -r -I -n ${check} src; then + echo + echo "${singleLineRegexChecks[$check]}" + exit 1 + fi +done + +declare -A multiLineRegexChecks=( + ["LOG_[^;]+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above" + ["\n\n\n"]="Multiple blank lines detected, keep only one. Check the files above" +) + +for check in ${!multiLineRegexChecks[@]}; do + echo " Checking RegEx: '${check}'" + + if grep -Pzo -r -I ${check} src; then + echo + echo + echo "${multiLineRegexChecks[$check]}" + exit 1 + fi +done + +echo +echo "Everything looks good" diff --git a/conf/.gitkeep b/conf/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/conf/RacialTraitSwap.conf b/conf/RacialTraitSwap.conf deleted file mode 100644 index e727757..0000000 --- a/conf/RacialTraitSwap.conf +++ /dev/null @@ -1,26 +0,0 @@ -[worldserver] - -################################################################################################### -#Azerothcore Racial Trait Swap NPC # -##################################### -# -# Azerothcore Racial Trait NPC Cost -# For a cost, you can swap our you current racial traits for that of another. -# -# Azerothcore.Racial.Trait.Swap.Announce.enable -# Description: Announces Module when player logs in. -# Default: 0 - (Disabled) -# 1 - (Enabled) - -Azerothcore.Racial.Trait.Swap.Announce.enable = 1 - -# -# Racial.Traits.Swap.Gold -# Description: Cost in gold for Racial Trait Exchange. -# Default: 0 - (Zero Gold Free) -# 10 - (Ten Gold Cost) - -Racial.Traits.Swap.Gold = 10 - -# -################################################################################################### diff --git a/conf/conf.sh.dist b/conf/conf.sh.dist deleted file mode 100644 index 862add4..0000000 --- a/conf/conf.sh.dist +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -## Update SQL - -DB_WORLD_CUSTOM_PATHS+=( - "$MOD_RACIAL_TRAIT_SWAP_ROOT"/sql/world/" -) diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/.gitkeep b/data/sql/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-world/.gitkeep b/data/sql/db-world/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/sql/world/world.RTS.sql b/data/sql/db-world/base/world.RTS.sql similarity index 100% rename from sql/world/world.RTS.sql rename to data/sql/db-world/base/world.RTS.sql diff --git a/include.sh b/include.sh index 53fc0ac..e69de29 100644 --- a/include.sh +++ b/include.sh @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -## GETS THE CURRENT MODULE ROOT DIRECTORY -MOD_RACIAL_TRAIT_SWAP_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )" - -source $MOD_RACIAL_TRAIT_SWAP_ROOT"/conf/conf.sh.dist" - -if [ -f $MOD_RACIAL_TRAIT_SWAP_ROOT"/conf/conf.sh" ]; then - source $MOD_RACIAL_TRAIT_SWAP_ROOT"/conf/conf.sh" -fi diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..c3fc1b0 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,25 @@ + + +## Changes Proposed: +- +- + +## Issues Addressed: + +- Closes + +## SOURCE: + + +## Tests Performed: + +- +- + + +## How to Test the Changes: + + +1. +2. +3.