Multiple accounts for the same player when cache is turned on
Puremin0rez opened this issue ยท 8 comments
Lowercase accounts are "created" after some time during a server session, this account will have the same amount of cash as the normal account and users can even send it money.
The lowercase duplicate account will not appear in the database, and when the server is restarted, the money it has will be merged with the main account. This can lead to duplicating money and otherwise confusing other players since money top will show the normal account (Puremin0rez) and the lowercase account (puremin0rez).
This was tested by compiling the latest source as of 8/16/2014.
Turning cache off fixes the problem.
Also have this problem. Had to turn off Caching but now the sql server has to work harder.
Found out the problem(very beginning stage of investigation), that is the plugin doesn't pair if the account is exist or not, causing auto-creation of different variant of accounts, like "lifehome", "Lifehome", "LifeHome", "lifeHome", etc.
Thoughts: fetch username via UUID, instead of matching displayname or getName().
@lifehome Did you got any further with your investigation? So I am able to fix this and get a pull request ready. Thanks.
Sorry, not really dug into the plugin since I got tons of things to do lately. But the way to fix this is rather simple, just need to put a check on account existence before command execution, and let UUIDFetcher handle the getUserName() part, also not to forget to store UUID instead of username in the database.
@lifehome Thanks man, I will go and try this. I hope that this will fix the problem.
To anyone who are experiencing the DBCache issue, you can compile from my master fork, as it disabled the DBCache feature till it will be fixed in the near future. Tho, it's not really near.
@lifehome That will have huge performance issues under certain circumstances especially with a huge database and player base. There a setting in the config to disable the caching anyway.
@externo6 Thanks for the warm reminder, but seems I can't really tell how the hell the plugin gets the username wrong...