Made the datatype a little more consistent when it comes to the ReportTypes enum (change them from uint16 and uint32 to uint8 and when I was able to, I simply used ReportTypes).
Stop setting the many uint32 latency to zero then on the very next line, change their values to the player's latency. Instead, set them immediately to the player's latency.
Change the moveType type's (uint8) to UnitMoveType.
Many std::string(player->GetName().c_str()) changed to player->GetName() because GetName() is already an std::string.
Many WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); had their redundant parenthesis removed.
Remove redundant player->GetSession()->GetPlayer() because GetPlayer() gave the very same player as player.
Add some backticks in some queries.
Add static Optional<PlayerIdentifier> TrySolvePlayer(ChatHandler* handler, Optional<PlayerIdentifier> player) which remplaces a handful of copy-paste code.
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.
Changes Proposed:
ReportTypes
enum (change them fromuint16
anduint32
touint8
and when I was able to, I simply usedReportTypes
).uint32 latency
to zero then on the very next line, change their values to the player's latency. Instead, set them immediately to the player's latency.moveType
type's (uint8
) toUnitMoveType
.std::string(player->GetName().c_str())
changed toplayer->GetName()
becauseGetName()
is already anstd::string
.WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1));
had their redundant parenthesis removed.player->GetSession()->GetPlayer()
becauseGetPlayer()
gave the very same player asplayer
.static Optional<PlayerIdentifier> TrySolvePlayer(ChatHandler* handler, Optional<PlayerIdentifier> player)
which remplaces a handful of copy-paste code.Issues Addressed:
SOURCE:
Tests Performed:
.anticheat player
command still seem to work.TrySolvePlayer
also seem to work.How to Test the Changes:
1.Fun!
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.