AnchyDev / HardMode

Adds extra difficulty modes, heavily inspired by mod-challenge-modes.
MIT License
10 stars 12 forks source link

HardMode Player Settings Not Saving Correctly #10

Open Auz-kiee opened 2 weeks ago

Auz-kiee commented 2 weeks ago

When enabling or disabling hard modes for players, the player settings were not being saved correctly in the hardmode_player_settings table. This issue caused players' hard mode statuses not to persist or update as expected. This has occurred only once in perhaps 80 test characters/debug testing attempts.

Steps to Reproduce: Enable a hard mode for a player. Check the hardmode_player_settings table and observe that the player's GUID and mode are not correctly recorded.

Root Cause: The SavePlayerSettings, SavePlayerSetting, and UpdateModeForPlayer methods in the HardModeHandler class did not have proper logging or handling for database operations, leading to failures in saving player settings.

Resolution: Updated the following methods to include proper logging and ensure database operations execute correctly: SavePlayerSettings SavePlayerSetting UpdateModeForPlayer

Fix Details: Added logging after database execution in SavePlayerSetting to confirm data saving. Ensured player settings are correctly fetched and saved in SavePlayerSettings. Validated player mode updates in UpdateModeForPlayer to reflect changes accurately.

This issue occurred once only in all my time using this module but it could be isolated to just me, wanted to raise it in the event you also notice the issue. Cheers mate -Auzkiee

AnchyDev commented 2 weeks ago

I have not been able to to reproduce this, it could be related to the previous issue you opened which is now closed but keep an eye out and see if it happens again.