feat. Update module to work with the latest emulator version (#8)

This commit is contained in:
Walter Pagani
2023-07-17 09:16:06 -03:00
committed by GitHub
parent 9648d7a3e6
commit 426bb0f99c
13 changed files with 328 additions and 65 deletions

8
.editorconfig Normal file
View File

@@ -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

107
.gitattributes vendored
View File

@@ -1,2 +1,105 @@
# Auto detect text files and perform LF normalization ## AUTO-DETECT
* text=auto ## 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

72
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -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

View File

@@ -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

9
.github/README.md vendored Normal file
View File

@@ -0,0 +1,9 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore
## mod-account-mounts
- Latest build status with azerothcore:
[![Build Status](https://github.com/azerothcore/mod-account-mounts/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-account-mounts)
Credits: ConanHun513

View File

@@ -2,44 +2,10 @@ name: core-build
on: on:
push: push:
pull_request: pull_request:
workflow_dispatch:
jobs: jobs:
build: build:
strategy: uses: azerothcore/reusable-workflows/.github/workflows/core_build_modules.yml@main
fail-fast: false
matrix:
compiler: [clang6, clang9, clang10]
runs-on: ubuntu-20.04
name: ${{ matrix.compiler }}
env:
COMPILER: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v2
with: with:
repository: 'azerothcore/azerothcore-wotlk' module_repo: ${{ github.event.repository.name }}
ref: 'master'
submodules: 'recursive'
- uses: actions/checkout@v2
with:
submodules: 'recursive'
path: 'modules/mod-account-mounts'
- name: Cache
uses: actions/cache@v1.1.2
with:
path: /home/runner/.ccache
key: ccache:${{ matrix.compiler }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.compiler }}:${{ github.ref }}
ccache:${{ matrix.compiler }}
- name: Configure OS
run: source ./apps/ci/ci-install.sh
env:
CONTINUOUS_INTEGRATION: true
- name: Import db
run: source ./apps/ci/ci-import-db.sh
- name: Build
run: source ./apps/ci/ci-compile.sh
- name: Dry run
run: source ./apps/ci/ci-worldserver-dry-run.sh
- name: Check startup errors
run: source ./apps/ci/ci-error-check.sh

48
.gitignore vendored Normal file
View File

@@ -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

View File

@@ -1,7 +0,0 @@
CU_SET_PATH("CMAKE_MOD_ACCOUNT_MOUNTS_DIR" "${CMAKE_CURRENT_LIST_DIR}")
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/mod_account_mount.cpp")
AC_ADD_SCRIPT_LOADER("AccountMounts" "${CMAKE_CURRENT_LIST_DIR}/src/loader_account_mount.h")
AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/mod_account_mount.conf.dist")

View File

@@ -1,5 +0,0 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore
## mod-account-mounts
- Latest build status with azerothcore: [![Build Status](https://github.com/azerothcore/mod-account-mounts/workflows/core-build/badge.svg?branch=master&event=push)](https://github.com/azerothcore/mod-account-mounts)
Credits: ConanHun513

25
pull_request_template.md Normal file
View File

@@ -0,0 +1,25 @@
<!-- First of all, THANK YOU for your contribution. -->
## Changes Proposed:
-
-
## Issues Addressed:
<!-- If your fix has a relating issue, link it below -->
- Closes
## SOURCE:
<!-- If you can, include a source that can strengthen your claim -->
## Tests Performed:
<!-- Does it build without errors? Did you test in-game? What did you test? On which OS did you test? Describe any other tests performed -->
-
-
## How to Test the Changes:
<!-- Describe in a detailed step-by-step order how to test the changes -->
1.
2.
3.

View File

@@ -0,0 +1,11 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
*
*/
void AddAccountMountsScripts();
void Addmod_account_mountsScripts()
{
AddAccountMountsScripts();
}

View File

@@ -1 +0,0 @@
void AddAccountMountsScripts();

View File

@@ -6,32 +6,33 @@
class AccountMounts : public PlayerScript class AccountMounts : public PlayerScript
{ {
static const bool limitrace = false; // This set to true will only learn mounts from chars on the same team, do what you want. static const bool limitrace = false; // This set to true will only learn mounts from chars on the same team, do what you want.
public: public:
AccountMounts() : PlayerScript("AccountMounts") { } AccountMounts() : PlayerScript("AccountMounts") { }
void OnLogin(Player* pPlayer) void OnLogin(Player* pPlayer)
{ {
if (sConfigMgr->GetBoolDefault("Account.Mounts.Enable", true)) if (sConfigMgr->GetOption<bool>("Account.Mounts.Enable", true))
{ {
if (sConfigMgr->GetBoolDefault("Account.Mounts.Announce", false)) if (sConfigMgr->GetOption<bool>("Account.Mounts.Announce", false))
{ {
ChatHandler(pPlayer->GetSession()).SendSysMessage("This server is running the |cff4CFF00AccountMounts |rmodule."); ChatHandler(pPlayer->GetSession()).SendSysMessage("This server is running the |cff4CFF00AccountMounts |rmodule.");
} }
std::vector<uint32> Guids; std::vector<uint32> Guids;
uint32 playerGUID = pPlayer->GetGUID().GetCounter(); uint32 playerGUID = pPlayer->GetGUID().GetCounter();
QueryResult result1 = CharacterDatabase.PQuery("SELECT guid, race FROM characters WHERE account = %u", playerGUID); QueryResult result1 = CharacterDatabase.Query("SELECT `guid`, `race` FROM `characters` WHERE `account`={};", playerGUID);
if (!result1) if (!result1)
return; return;
do do
{ {
Field* fields = result1->Fetch(); Field* fields = result1->Fetch();
uint32 race = fields[1].Get<uint8>();
//uint32 guid = fields[0].GetUInt32(); //unused variable
uint32 race = fields[1].GetUInt8();
if ((Player::TeamIdForRace(race) == Player::TeamIdForRace(pPlayer->getRace())) || !limitrace) if ((Player::TeamIdForRace(race) == Player::TeamIdForRace(pPlayer->getRace())) || !limitrace)
Guids.push_back(result1->Fetch()[0].GetUInt32()); Guids.push_back(result1->Fetch()[0].Get<uint32>());
} while (result1->NextRow()); } while (result1->NextRow());
@@ -39,13 +40,13 @@ public:
for (auto& i : Guids) for (auto& i : Guids)
{ {
QueryResult result2 = CharacterDatabase.PQuery("SELECT spell FROM character_spell WHERE guid = %u", i); QueryResult result2 = CharacterDatabase.Query("SELECT `spell` FROM `character_spell` WHERE `guid`={};", i);
if (!result2) if (!result2)
continue; continue;
do do
{ {
Spells.push_back(result2->Fetch()[0].GetUInt32()); Spells.push_back(result2->Fetch()[0].Get<uint32>());
} while (result2->NextRow()); } while (result2->NextRow());
} }
@@ -61,5 +62,5 @@ public:
void AddAccountMountsScripts() void AddAccountMountsScripts()
{ {
new AccountMounts; new AccountMounts();
} }