cuberite/cuberite

Request to add cClientHandle::SetSkin(AString & a_SkinJson) function to the api

wildrun0 opened this issue · 3 comments

Some time ago, a request to create a "skin restorer" appeared in the plugin requests. During the discussion, it turned out that the api does not have access to the client's m_Properties. In the same thread, 12xx12 said that it is possible to create something like a function cClientHandle::SetSkin(Asstring & a_SkinJson)
I hope this feature will be added soon?

Duplicate #4421

cc @12xx12
I looked a bit a that and you proposed to add cClientHandle::SetSkin(Asstring & a_SkinJson) I would like more precission can you tell me if i'm on the same path?

the json fileld would be of the type of the decoded base 64 values's field on https://wiki.vg/Mojang_API#UUID_to_Profile_and_Skin.2FCape

the thing i'm not sure is if cuberite uses pseudo from this input too or is it only for skin and capes...

In such case the function should maybe not be limited to skin but also to change playername and cape...

if cuberite takes his name from anywhere else (I think I remember that cuberite stores name in a sqlite db or something) then maybe the easier methode would be to input just the url of the skin or maybe the uuid/pseudo of the skin you want to personify (same for capes as a second method) and just alter thes fields in the json encoded value got from mojang api before reencoding it in base64 ( the thing is I thik that the 'value' field is signed and maybe it would require some tweak? I don't really know, I browse the code on my mini laptop just to get an idea) using a url/usernane/uuid would be easier for plugin developers I think?!
rfc

I have no idea how skins are processed. The only thing I know is that the json string is sent to the client(s) and we should be able to replace that