AshamaneProject/AshamaneCore

More than 2 professions are not retained after character log out and log in

Opened this issue · 2 comments

Description:

More than 2 professions are not retained after character log out and log in.

TrinityCore supports up to 11 character professions via the MaxPrimaryTradeSkill. TrinityCore/TrinityCore#15575

Also, I attempted to open a new issue directly with TrinityCore and they said this issue has already been addressed "a log time ago" on the master branch. So this issue is either new with AshamaneCore or needs additional upstream updates.

Reference: TrinityCore/TrinityCore#25073

Expected Behavior:

The WorldServer should retain the character_skills of a player after logging off and logging in, especially if the config is setup to allow for more than 2.

Steps to reproduce the problem:
Tested With:

  1. Ensure that worldserver.conf is set to MaxPrimaryTradeSkill = 11 (or anything above 2)
  2. Create a new character
  3. Learn any two professions (in one test I used Blacksmithing and Alchemy)
  4. -- Notice that you cannot manually learn a third profession from a trainer (Separate issue, I think)
  5. [A] Seperate issue, but the standard GUI blocks a character from learning more than two by graying out the button.
    [B] Manually learn the skill via GM Command .learn 7411 (Enchanting)
    [C] -- The DBLog shows the following "[1 ms] SQL(p): REPLACE INTO character_skills (guid, skill, value, max) VALUES (1363318, 333, 1, 75)"
  6. [A] /cast enchanting
    [B] /cast disenchant and disenchant an item. The DBLog shows the following "UPDATE character_skills SET value = 2, max = 75 WHERE guid = 1363318 AND skill = 333"
  7. -- Notice how it works correctly
  8. -- Notice how in the DB the "character_skills" table has an entry for 333
  9. -- Another verify step, Disenchant an item, notice how your character_skills value for 333 correctly increases to 2
  10. -- Another verify step, run "/cast enchanting" Notice how the UI correctly shows a skill level of 2 for enchanting.
  11. Log out of the character
  12. -- Notice how in the DB the "character_skills" table has an entry for 333 with a value of 2
  13. Log in to the same character
  14. Wait ~1 minute for database to be updated
  15. Open the Skill Book and check the professions tab on your character
  16. [A] ** Notice how in the DB the "character_skills" table no longer has an entry for 333
    [B] The DBLog shows the following: "[0 ms] SQL(p): DELETE FROM character_skills WHERE guid = 1363318 AND skill = 333"
  17. -- Another verify step, "/cast enchanting", Notice how nothing happens

Additional Details

  • Anticheat.Enable = 0 (Anti cheat is disabled)

  • No messages in the log files related to this, both client and server

  • (For Control) If enchanting is one of the two primary professions, and the steps above are followed, enchanting (333) works fine, but the other profession is not retained.

  • ?Clue? If you unlearn "Enchanting" as one of your two primary professions, (leaving one profession remaining) log off and log on, the same issue occurs, the "character_skills" will have Enchanting 333, until you log into the character, then it will be removed.

"Player.cpp" looks like it might be a candidate, but cannot confirm.

  • Reviewing the "void Player::SetSkill" function,
    -- Around Line 5787 "// mark as deleted so the next save will delete the data from the database"
    -- Around Line 5811 "// We are about to learn a skill that has been added outside of normal circumstances (Game Master command, scripts etc.)"

cs_learn.cpp could be related, but...

  • If you use the .learn command for your first two professions, they correctly work and are not deleted after login

Branch(es):

master = 8.3.0.33775
legion = 7.3.5.26972

TC rev. hash/commit:

Master

Operating system:
Windows