Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Core/EventMgr): Align code to Code standard & improve LoadFromDB function #21151

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Exitare
Copy link
Member

@Exitare Exitare commented Jan 13, 2025

The EventMgr uses a lot of raw sqls and has a pretty bloated LoadFromDB function that might be better split into functions e.g. for reloading purposes in the future. Code Standards of AC are also not followed and will be addressed with this PR.

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

Issues Addressed:

  • Closes

SOURCE:

The changes have been validated through:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Sniffs (remember to share them with the open source community!)
  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.

Known Issues and TODO List:

  • [ ]
  • [ ]

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

@Exitare Exitare marked this pull request as draft January 13, 2025 01:55
@github-actions github-actions bot added CORE Related to the core file-cpp Used to trigger the matrix build labels Jan 13, 2025
@Exitare Exitare marked this pull request as ready for review January 13, 2025 04:29
@Exitare Exitare changed the title chore(Core/EventMgr) Align code to Code standard & improve LoadFromDB function chore(Core/EventMgr): Align code to Code standard & improve LoadFromDB function Jan 13, 2025
Copy link
Member

@sogladev sogladev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. The new log messages taught me there are a few unused tables 😄

https://github.com/azerothcore/azerothcore-wotlk/actions/runs/12774666231/job/35609278291?pr=21151#step:3:3600

...
Loading Game Event Saves Data...
>> Loaded 0 Game Event Saves In Game Events. DB Table `game_event_save` Is Empty.
 
Loading Game Event Prerequisite Data...
>> Loaded 0 Game Rvent Prerequisites in Game Events. DB Table `game_event_prerequisite` Is Empty.
 
Loading Game Event Creature Data...
>> Loaded 9982 Creatures In Game Events in 5 ms
 
Loading Game Event GO Data...
>> Loaded 30711 Gameobjects In Game Events in 12 ms
 
Loading Game Event Model/Equipment Change Data...
>> Loaded 0 Model/Equipment Changes In Game Events. DB Table `game_event_model_equip` Is Empty.
 
Loading Game Event Quest Data...
>> Loaded 242 Quests Additions In Game Events in 0 ms
 
Loading Game Event GO Quest Data...
>> Loaded 78 Quests Additions In Game Events in 1 ms
 
Loading Game Event Quest Condition Data...
>> Loaded 0 quest event Conditions In Game Events. DB Table `game_event_quest_condition` Is Empty.
 
Loading Game Event Condition Data...
>> Loaded 0 Conditions In Game Events. DB table `game_event_condition` Is Empty.
 
Loading Game Event Condition Save Data...
>> Loaded 0 Condition Saves In Game Events. DB Table `game_event_condition_save` Is Empty.
 ...

@TheSCREWEDSoftware
Copy link
Contributor

@Exitare how can I test this PR?

@Exitare
Copy link
Member Author

Exitare commented Jan 26, 2025

  1. Compile the core
  2. Start the server.
  3. Start & end events to check the functionality.
  4. Otherwise let the server run for a few hours

The PR doesnt change functionality, but rather just code alignments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE Related to the core file-cpp Used to trigger the matrix build Ready to be Reviewed Script Waiting to be Tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants