samolego / FabricTailor

A server-side or singleplayer skin changing mod for fabric.
https://modrinth.com/mod/FabricTailor
GNU Lesser General Public License v3.0
109 stars 17 forks source link

[SUGGESTION] Allow clients to upload skin to server #28

Closed Merith-TK closed 3 years ago

Merith-TK commented 3 years ago

basically, if the client uses the clientside mod, they should beable to upload a skin that they have saved locally, to the server, where it is then stored in /config/fabrictailor/skins/<uuid>/<filename>.png

Which would then allow a /skin set user <list filenames that have been uploaded under your uuid> so the server could have skins stored for faster loading

samolego commented 3 years ago

By uploading the skin to the server, there might be some security issues ... It might be better for the client to generate skin signatures & values and send them to server.

Merith-TK commented 3 years ago

True, maybe have the client parse the image as an array of Hex color code values, (since we know the pixel size of an skin file) and then have the server write it to a file locally using my suggested layout?

samolego commented 3 years ago

I'm against the idea of giving the client abilities to write a skin file. There's other solution (mirroring the server process on client and sending the needed data to server), which would be the best way imo.

Merith-TK commented 3 years ago

I mean. Why are you against it? There are simple checks we can do before any data is written or actually parsed.

Array length, if it exceeds/is less than, the number of pixels in a skin, automatically fail,

If datasent to the server is not a string, fail,

If datasent could not be parsed as a skin, fail.

samolego commented 3 years ago

Giving client ability to essentially write images on disk is not needed in this case, that's why I'm against it. Client can upload the image to mineskin by itself and then send the generated skin data to server.

Merith-TK commented 3 years ago

Well the main reason why I bring this up. Is there is a option from the clienside, and server command, to load a file from disk, which errors out when the client side mod shows a file selector.

Derpitron commented 3 years ago

the client side mod is mainly used on singleplayer worlds, where the player using the mod is running minecraft in the same directory as the integrated server itself (local minecraft in this case)

samolego commented 3 years ago

This has been implemented by client generating the skin data and sending it to server. No images are wtitten on the server itself :)

6781b9191a10006d3c4022add4463a116818fc1b