AshamaneProject / AshamaneCore

AshamaneCore Open Source MMO Framework (master = 9.0.2.36949, bfa = 8.3.7.35284, legion = 7.3.5.26972)
GNU General Public License v2.0
321 stars 357 forks source link

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

Open TownShip101 opened 4 years ago

TownShip101 commented 4 years ago

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. https://github.com/TrinityCore/TrinityCore/issues/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: https://github.com/TrinityCore/TrinityCore/issues/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

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

cs_learn.cpp could be related, but...

Branch(es):

master = 8.3.0.33775 legion = 7.3.5.26972

TC rev. hash/commit:

Master

Operating system: Windows

Abd-ulRahman commented 3 years ago

Review https://github.com/TrinityCore/TrinityCore/issues/226 Best regards

Abd-ulRahman commented 3 years ago

https://github.com/TrinityCore/TrinityCore/pull/16188#issuecomment-169076168

https://github.com/TrinityCore/TrinityCore/pull/16188/files