Name changes cause hsp 2.0 homes to disappear
SmallSansSerif opened this issue ยท 2 comments
I just had 2 players that changed their minecraft names today lose their previous homes. If I use /homelistother with their old name you can't find the old name as well. I was under the impression the UUIDs were being tracked with the 2.0 versions of HSP.
Any suggestions or a fix would be awesome. Thanks!
HSP 2.0 does track UUIDs, but it does not store them as the unique key. I did a local test of this scenario and can confirm that the homes are not available to the user, but they are still in the database. It looks like I can add some code to convert them when I see the UUID mismatch so that on next login everything will match up. I'll give this some work and local testing.
This should be fixed in build 608 on Jenkins.
You will see a log entry similar to the following when a player logs in who has changed their name:
[22:43:21 INFO]: [HomeSpawnPlus] Updated 8 rows in database from oldName (Bob) to newName (Anduune) (uid=XXX)
From the player's perspective, they won't see anything at all, but all of their previous HSP data, including Homes, HomeInvites, etc, will now be available to them again. Behind the scenes, HSP is noticing the UUID mismatch when they login and is updating all the existing rows to the new name.
Cleaner would be to re-implement the entire DB to use UUIDs as the primary key, but that's a nightmare upgrade scenario for existing servers so this keeps things simple.