Total RP 3: Extended

Total RP 3: Extended

903k Downloads

Identify when importing a creation made by an alt

Solanya opened this issue ยท 3 comments

commented

Currently, when importing a creation made on an alt that you exported previously and deleted from your database, the addon cannot recognize that the creator is an alt and locks you out of editing it, forcing you to make a copy of it to edit it again.

We can use the result of GetAutoCompleteResults("", 0, 1, true, AUTO_COMPLETE_ACCOUNT_CHARACTER, 0) to identify if the creator of the import is an alt or not and put the creation in the right array to allow edition.

The function result could be cached (if necessary) to avoid calling it every time and making sure we have a result stored, although it cannot be called before PLAYER_LOGIN.

commented

Keep in mind a rare case of name collision could occur when importing creations from someone using the exact same name on the same server on the US servers versus EU.

commented

Player GUIDs returned by UnitGUID("player") contain the unique server ID, which can be mapped to a region.

Thankfully GetCurrentRegion from LibRealmInfo exists for this purpose, but it has a few caveats. Worth a look perhaps.

commented

Indeed GUIDs would be a better way to go, avoid name collision and also persist through name changes. But it will require some changes in what metadata is saved with the export.