Skip to content

Theseus skin selector backend #3525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: alex/auth-profile-extensions
Choose a base branch
from

Conversation

AlexTMjugador
Copy link
Member

@AlexTMjugador AlexTMjugador commented Apr 17, 2025

Overview

This pull request introduces the required backend logic for a skin selector feature, building upon the profile fetching groundwork proposed in #3491. Some highlights include:

  • Added new Tauri commands to the new minecraft-skins plugin for the frontend to use (see apps/app/src/api/minecraft_skins.rs):
    • get_available_capes: fetches the list of available capes for the current player.
    • get_available_skins: fetches the list of available skins for the current player.
    • add_and_equip_custom_skin: adds a custom skin to the locally stored list of available skins for the current player, and equips it in their Mojang player profile.
    • set_default_cape: sets the default cape for the current player.
    • equip_skin: equips a skin in the Mojang player profile of the current player.
    • remove_custom_skin: removes a custom skin from the locally stored list of available skins for the current player.
    • unequip_skin: unequips any skin in the Mojang player profile of the current player, resetting them to their default skin.
  • The commands above interact with the profile cache and fetching put in place by Extend Theseus auth subsystem to fetch complete user profiles #3491 to ensure that skin and cape selections are done efficiently and correctly, even if players change their skins through external means (e.g., the Minecraft website, other launchers).
  • Similarly to the vanilla launcher, a total of 18 default Minecraft skins are also hardcoded in the application as available. This number comes from the 9 default skins (Alex, Ari, Efe, Kai, Makena, Noor, Steve, Sunny, and Zuri), where each skin has two variations (slim and wide arms).
  • Data storage of custom capes is done with new SQLite state DB tables, whose definitions can be read in the new 20250413162050_skin-selector.sql sqlx migration.

Testing

I've successfully conducted a basic verification of most of the new minecraft-skins commands through manual invoke calls in the app web development console, and did manual unit tests for the underlying data access and store mechanisms. It's still possible that actual use by frontend code will reveal further areas of improvement, however.

@AlexTMjugador AlexTMjugador added enhancement New feature or request app Relates to Modrinth App labels Apr 17, 2025
@AlexTMjugador AlexTMjugador self-assigned this Apr 17, 2025
@AlexTMjugador AlexTMjugador changed the base branch from main to alex/auth-profile-extensions April 17, 2025 20:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 23 out of 34 changed files in this pull request and generated 1 comment.

Files not reviewed (11)
  • apps/app/capabilities/plugins.json: Language not supported
  • apps/app/tauri.conf.json: Language not supported
  • packages/app-lib/.sqlx/query-1937e191a7815a55274bb39a035e02a39bb04b45dbd727e5db5b5308deda4e04.json: Language not supported
  • packages/app-lib/.sqlx/query-27a4ca00ab9d1647bf63287169f6dd3eed86ba421c83e74fe284609a8020bd22.json: Language not supported
  • packages/app-lib/.sqlx/query-3d15e7eb66971e70500e8718236fbdbd066d51f88cd2bcfed613f756edbd2944.json: Language not supported
  • packages/app-lib/.sqlx/query-3f3d3c2d77c1bcaf4044b612c3822546583aa19ea7088682d718c64ed5d5f1c5.json: Language not supported
  • packages/app-lib/.sqlx/query-545b01d8cc1e79ff5d4136887fbb712aba58908a66dd7bbd64c293b9ee7a1523.json: Language not supported
  • packages/app-lib/.sqlx/query-957f184e28e4921ff3922f3e74aae58e2d7a414e76906700518806e494cd0246.json: Language not supported
  • packages/app-lib/.sqlx/query-9c2522e4518067192539ad270253ae1b3d75e80e52529e491e86ff370d6424b3.json: Language not supported
  • packages/app-lib/.sqlx/query-aae88809ada53e13441352e315f68169cfd8226b57bacd8c270d7777fc6883ac.json: Language not supported
  • packages/app-lib/migrations/20250413162050_skin-selector.sql: Language not supported

@AlexTMjugador AlexTMjugador changed the title Skin selector backend Theseus skin selector backend Apr 17, 2025
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from 134317d to f37ddda Compare April 21, 2025 11:55
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from 26fd06a to b30fc6d Compare April 21, 2025 11:55
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from f37ddda to 143a60f Compare April 26, 2025 16:07
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch 2 times, most recently from eb0de0c to 6353588 Compare April 26, 2025 18:50
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from 8440ddc to c3d75f9 Compare April 27, 2025 13:22
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from c1eb8c1 to b95a321 Compare April 27, 2025 13:39
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from c3d75f9 to 0288ce2 Compare May 1, 2025 17:01
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from b95a321 to 07273d2 Compare May 1, 2025 17:01
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from 0288ce2 to 5566ecc Compare May 2, 2025 13:11
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from 07273d2 to 00b3e02 Compare May 2, 2025 13:34
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from 5566ecc to cd19d78 Compare May 3, 2025 13:32
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from 00b3e02 to d92b1ce Compare May 3, 2025 13:33
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from cd19d78 to e95a31a Compare May 5, 2025 22:51
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from d92b1ce to 05379b4 Compare May 5, 2025 22:51
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from e95a31a to adcccbc Compare May 8, 2025 21:18
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from 05379b4 to 8f11f2c Compare May 8, 2025 21:18
@AlexTMjugador AlexTMjugador force-pushed the alex/auth-profile-extensions branch from adcccbc to 965de5c Compare May 9, 2025 23:08
This may help with issues reported by users where the access token is
invalid and can't be used to join servers over long periods of time.
@AlexTMjugador AlexTMjugador force-pushed the alex/skin-selector-backend branch from 8f11f2c to c553c62 Compare May 9, 2025 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Relates to Modrinth App enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

1 participant