turt2live / matrix-appservice-minecraft

A Matrix <--> Minecraft bridge
GNU General Public License v3.0
1 stars 0 forks source link

Better profile updates #13

Closed turt2live closed 7 years ago

turt2live commented 7 years ago

The current system is unreliable and not great. Need to have a better, more robust way, of handling username changes, skin updates, etc.

turt2live commented 7 years ago

Will probably need a custom handler for this, but crafatar provides this as a header:

So if we check for downloaded then we'll be able to tell if the user's avatar changed.

Some incremental timer is probably needed, here's a rough outline:

  1. Loop over users to check for update (next 50 every 30 min?)
  2. Read profile data from store (username and avatar)
  3. Get profile data from Mojang (for username)
  4. Read avatar into memory (store header)
  5. If no previous username, or username has changed, update
  6. If no previous avatar, or avatar is downloaded, update
  7. Flag user as updated, if required.