commit 76d04c8dae4978e31edc555a0747495ba8fda029 Author: Dominik Madarász Date: Thu Jun 20 16:13:38 2024 +0200 Initial commit - mod-needs-system diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eb64e2f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +tab_width = 4 +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7ef9001 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,105 @@ +## AUTO-DETECT +## Handle line endings automatically for files detected as +## text and leave all files detected as binary untouched. +## This will handle all files NOT defined below. +* text=auto eol=lf + +# Text +*.conf text +*.conf.dist text +*.cmake text + +## Scripts +*.sh text +*.fish text +*.lua text + +## SQL +*.sql text + +## C++ +*.c text +*.cc text +*.cxx text +*.cpp text +*.c++ text +*.hpp text +*.h text +*.h++ text +*.hh text + + +## For documentation + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +## DOCUMENTATION +*.markdown text +*.md text +*.mdwn text +*.mdown text +*.mkd text +*.mkdn text +*.mdtxt text +*.mdtext text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +*COPYRIGHT* text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +## GRAPHICS +*.ai binary +*.bmp binary +*.eps binary +*.gif binary +*.ico binary +*.jng binary +*.jp2 binary +*.jpg binary +*.jpeg binary +*.jpx binary +*.jxr binary +*.pdf binary +*.png binary +*.psb binary +*.psd binary +*.svg text +*.svgz binary +*.tif binary +*.tiff binary +*.wbmp binary +*.webp binary + + +## ARCHIVES +*.7z binary +*.gz binary +*.jar binary +*.rar binary +*.tar binary +*.zip binary + +## EXECUTABLES +*.exe binary +*.pyc binary 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/README.md b/.github/README.md new file mode 100644 index 0000000..fcfe61f --- /dev/null +++ b/.github/README.md @@ -0,0 +1,25 @@ +# SKELETON - Module template + +[English](README.md) | [Español](README_ES.md) + + +## How to create your own module + +1. Use the script `create_module.sh` located in [`modules/`](https://github.com/azerothcore/azerothcore-wotlk/tree/master/modules) to start quickly with all the files you need and your git repo configured correctly (heavily recommended). +1. You can then use these scripts to start your project: https://github.com/azerothcore/azerothcore-boilerplates +1. Do not hesitate to compare with some of our newer/bigger/famous modules. +1. Edit the `README.md` and other files (`include.sh` etc...) to fit your module. Note: the README is automatically created from `README_example.md` when you use the script `create_module.sh`. +1. Publish your module to our [catalogue](https://github.com/azerothcore/modules-catalogue). + + +## How to test your module? + +Disable PCH (precompiled headers) and try to compile. To disable PCH, set `-DNOPCH=1` with Cmake (more info [here](http://www.azerothcore.org/wiki/CMake-options)). + +If you forgot some headers, it is time to add them! + +## Licensing + +The default license of the skeleton-module template is the MIT but you can use a different license for your own modules. + +So modules can also be kept private. However, if you need to add new hooks to the core, as well as improving existing ones, you have to share your improvements because the main core is released under the AGPL license. Please [provide a PR](https://www.azerothcore.org/wiki/How-to-create-a-PR) if that is the case. diff --git a/.github/README_ES.md b/.github/README_ES.md new file mode 100644 index 0000000..d7d6ddc --- /dev/null +++ b/.github/README_ES.md @@ -0,0 +1,66 @@ + [English](README.md) | [Español](README_ES.md) + +# PARTE 1 - Cómo crear su propio módulo + +Puede utilizar estos scripts para iniciar su proyecto: + +[Ejemplos de scripts](https://github.com/azerothcore/azerothcore-boilerplates) + +### ¿Cómo probar su módulo? + +Desactivar PCH (cabeceras pre-compiladas) e intentar compilar. Si ha olvidado algunas cabeceras, es hora de añadirlas. Para desactivar PCH, siga este [link](https://github.com/azerothcore/azerothcore-wotlk/wiki/CMake-options) y ponga `USE_COREPCH ` a 0 con Cmake. + +------------------------------------------------------- + +# PARTE 2 - EJEMPLO DE UN README.md +Recuerde que el README.md le explica al resto de las personas que es lo que hace su módulo. Recomendamos escribirlo en ingles quizás, aunque puede ser traducido luego a otros idiomas. + +# MI NUEVO MÓDULO (título) + +## Descripción + +Este módulo permite hacer esto y esto. +(Debe explicar para que se va a utilizar el modulo, cuál es su utilidad) + +## Cómo utilizar + +Haz esto y aquello. + +Puedes agregar una carpeta de pantalla: + +[screenshot](/screenshots/my_module.png?raw=true "screenshot") + +O incluso un video donde expliques su uso: + +[Youtube](https://www.youtube.com/watch?v=T6UEX47mPeE) + + +## Requisitos + +Se debe especificar que versión de azerothcore requiere, porque podría ser incompatible con alguna más adelante. Entonces aclarar por las dudas su compatibilidad no está de más. + +Mi nuevo módulo requiere: + +- AzerothCore v4.0.0+ + + +## Instalación + +``` +1) Simplemente coloque el módulo dentro del directorio `modules` de AzerothCore (repositorio), no la compilación. +2) Importe el SQL manualmente a la base de datos correcta (auth, mundo o caracteres) o con el `db_assembler.sh` (si se proporciona `include.sh`). +3) Vuelva a ejecutar el Cmake y genere la compilación necesaria. (Revise la guía) +``` + +## Editar la configuración del módulo (opcional) + +Si necesita cambiar la configuración del módulo, vaya a la carpeta de configuración de su servidor (donde está su `worldserver` o `worldserver.exe`), copie `my_module.conf.dist` a `my_module.conf` y edite ese nuevo archivo. + + +## Créditos + +* [Yo](https://github.com/YOUR_GITHUB_NAME) (autor del módulo) Edite el enlace para que apunte a su github si lo desea. +* [BarbzYHOOL](https://github.com/barbzyhool) +* [Talamortis](https://github.com/talamortis) + +AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd) diff --git a/.github/workflows/core-build.yml b/.github/workflows/core-build.yml new file mode 100644 index 0000000..aad248b --- /dev/null +++ b/.github/workflows/core-build.yml @@ -0,0 +1,15 @@ +name: core-build +on: + push: + branches: + - 'master' + pull_request: + branches: + - 'master' + workflow_dispatch: + +jobs: + build: + uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main + with: + module_repo: ${{ github.event.repository.name }} diff --git a/.github/workflows/core_codestyle.yml b/.github/workflows/core_codestyle.yml new file mode 100644 index 0000000..c6573bb --- /dev/null +++ b/.github/workflows/core_codestyle.yml @@ -0,0 +1,15 @@ +name: Codestyle Checks +on: + push: + pull_request: + +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/.gitignore b/.gitignore new file mode 100644 index 0000000..c6e1299 --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +!.gitignore + +# +#Generic +# + +.directory +.mailmap +*.orig +*.rej +*.*~ +.hg/ +*.kdev* +.DS_Store +CMakeLists.txt.user +*.bak +*.patch +*.diff +*.REMOTE.* +*.BACKUP.* +*.BASE.* +*.LOCAL.* + +# +# IDE & other softwares +# +/.settings/ +/.externalToolBuilders/* +# exclude in all levels +nbproject/ +.sync.ffs_db +*.kate-swp + +# +# Eclipse +# +*.pydevproject +.metadata +.gradle +tmp/ +*.tmp +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.project +.cproject diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d0882e0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 AzerothCore + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. 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/my_custom.conf.dist b/conf/my_custom.conf.dist new file mode 100644 index 0000000..eb614f9 --- /dev/null +++ b/conf/my_custom.conf.dist @@ -0,0 +1,17 @@ +# +# Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 +# + +[worldserver] + +######################################## +# My module configuration +######################################## +# +# MyModule.Enable +# Description: Enable my module and print "Hello World" message at server start +# Default: 0 - Disabled +# 1 - Enabled +# + +MyModule.Enable = 1 diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-auth/base/.gitkeep b/data/sql/db-auth/base/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-auth/updates/.gitkeep b/data/sql/db-auth/updates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-characters/base/.gitkeep b/data/sql/db-characters/base/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-characters/updates/.gitkeep b/data/sql/db-characters/updates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-world/base/.gitkeep b/data/sql/db-world/base/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/sql/db-world/base/skeleton_module_acore_string.sql b/data/sql/db-world/base/skeleton_module_acore_string.sql new file mode 100644 index 0000000..4ac0cce --- /dev/null +++ b/data/sql/db-world/base/skeleton_module_acore_string.sql @@ -0,0 +1,4 @@ +SET @ENTRY:=35410; +DELETE FROM `acore_string` WHERE `entry`=@ENTRY; +INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES +(@ENTRY, 'Hello World from Skeleton-Module!', '', '', '', '', '', '¡Hola Mundo desde Skeleton-Module!', '¡Hola Mundo desde Skeleton-Module!', ''); diff --git a/data/sql/db-world/updates/.gitkeep b/data/sql/db-world/updates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/include.sh b/include.sh new file mode 100644 index 0000000..e69de29 diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..21c9245 --- /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. diff --git a/src/MP_loader.cpp b/src/MP_loader.cpp new file mode 100644 index 0000000..a640a26 --- /dev/null +++ b/src/MP_loader.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 + */ + +// From SC +void AddMyPlayerScripts(); + +// Add all +// cf. the naming convention https://github.com/azerothcore/azerothcore-wotlk/blob/master/doc/changelog/master.md#how-to-upgrade-4 +// additionally replace all '-' in the module folder name with '_' here +void Addskeleton_moduleScripts() +{ + AddMyPlayerScripts(); +} + diff --git a/src/MyPlayer.cpp b/src/MyPlayer.cpp new file mode 100644 index 0000000..e23ed59 --- /dev/null +++ b/src/MyPlayer.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 + */ + +#include "ScriptMgr.h" +#include "Player.h" +#include "Config.h" +#include "Chat.h" + +enum MyPlayerAcoreString +{ + HELLO_WORLD = 35410 +}; + +// Add player scripts +class MyPlayer : public PlayerScript +{ +public: + MyPlayer() : PlayerScript("MyPlayer") { } + + void OnLogin(Player* player) override + { + if (sConfigMgr->GetOption("MyModule.Enable", false)) + { + ChatHandler(player->GetSession()).PSendSysMessage(HELLO_WORLD); + } + } +}; + +// Add all scripts in one +void AddMyPlayerScripts() +{ + new MyPlayer(); +}