unmojang / drasl

Yggdrasil-compatible API server for Minecraft
GNU General Public License v3.0
97 stars 15 forks source link

Default skins #78

Open IkyMax opened 3 months ago

IkyMax commented 3 months ago

When an user hasn't uploading a skin, if you're using only Authlib-Injector there might not be any problem and it will display the default steve skin inside the client itself, but if you try to get into a server with CustomSkinLoader enabled and pointing to the Drasl mojang API, it will throw an error and kick the players arround the player who hasn't uploaded their skin.

IkyMax commented 3 months ago

Also, kinda unrelated to this but idk if this is relevant enought to open a issue by itself, but for some reason, if you're a Geyser player (Bedrock player) who is linked to a drasl player, if you change your skin and try to get into the server with, this will show an untexturized player like this:

image

This can be solved by the player joining with a java account, logging off and then joining with bedrock, the other solution is with a server restart, but i don't think this is efficient because i would need to restart it whenever a drasl-bedrock linked user changes their skin and some players don't have the possibility to join with java edition.

It even crashes java clients with CSL, i was using blessing skins for my server earlier and because i wanted mojang players being able to join too, i downloaded YggdrasilOfficialProxy and sometimes this would throw an error with how Geyser tried to get an unsigned version of the skin whenever the user , so maybe this need a change to the API to allow geyser to download this and apply it to the fake players.

Also, it would be cool if we can get something like the BS skin library, because as far a I know, drasl doesn't erase the skins from the webserver or it does? anyways, a system like that would be cool or if this isn't possible, maybe there can be set up a plugin in BS to allow the site to be used as some sort of skin server or even as a player administrator thanks to the upcoming Drasl API.

IkyMax commented 3 months ago

Quick update on Bedrock Players

i was looking into the code of floodgate (The one who allows linking between Drasl UUID's and Geyser UUID's) and i found this and this, maybe this can have anything to do with the problem? those are the only relevant links what i could find what actually does something with the skins, this doesn't search for a specific link (and with authlib injector is said what it converts the links from official mojang servers to the drasl server links) but searchs indeed for a default skin and a default signature, so maybe this could help you in the implementation

evan-goode commented 3 months ago

When an user hasn't uploading a skin, if you're using only Authlib-Injector there might not be any problem and it will display the default steve skin inside the client itself, but if you try to get into a server with CustomSkinLoader enabled and pointing to the Drasl mojang API, it will throw an error and kick the players arround the player who hasn't uploaded their skin.

I can't reproduce any issue with CustomSkinLoader, maybe you could provide a more detailed reproducer? Here is what I did:

  1. Set up a 1.20.4 server (CSL doesn't support 1.20.6 yet, see https://github.com/xfl03/MCCustomSkinLoader/issues/293), using Drasl for authentication with the -Dminecraft.*.host args. Set online-mode=true and enforce-secure-profile=false in server.properties.
  2. Connect to the server with a 1.20.4 client, signed in with Microsoft (username "unmojang"), no authlib-injector, CSL configured as described here, with Drasl as the only provider in the loadlist.
  3. Connect to the server with a second client, configured the same as the first, but with authlib-injector and signed in with a Drasl account (username "foo") as a user who does not have a skin set or a valid Fallback Player specified.

The setup works as expected for me, both clients correctly see the Microsoft player's skin (CustomSkinLoader loads it from Drasl, which forwards it from Mojang), and both clients see the same client-provided default skin (CustomSkinLoader requests a skin from Drasl, Drasl has no skin for the user and the fallback lookup fails, client gets the following response from /session/session/minecraft/profile/91d223a437794c00af4b45f839ec519b:

{"timestamp":1717362336398327599,"profileId":"91d223a437794c00af4b45f839ec519b","profileName":"foo","textures":{}}
Screenshot ![2024-06-02-17-06-1717362145](https://github.com/unmojang/drasl/assets/7495216/79d1ff1f-04a2-4b0b-a561-402bdd7401cf)
evan-goode commented 3 months ago

Also, it would be cool if we can get something like the BS skin library, because as far a I know, drasl doesn't erase the skins from the webserver or it does? anyways, a system like that would be cool or if this isn't possible, maybe there can be set up a plugin in BS to allow the site to be used as some sort of skin server or even as a player administrator thanks to the upcoming Drasl API.

Skins and capes do get deleted from the server if there's no user using them. I'd rather keep the feature set of Drasl pretty focused, and so I think a skin library is out of scope. But I filed https://github.com/unmojang/drasl/issues/79 so that some other site could allow a user to set their skin by clicking a link.

evan-goode commented 3 months ago

As for the Geyser/Bedrock Edition bug, maybe we could resolve the CSL issue first, and then file a separate issue if the Geyser bug persists, with a detailed reproducer?