Page 1 of 1

Client Based Skins

PostPosted: Fri May 17, 2013 15:20
by Jordach
To improve on the skins system, I thought a little in-depth last night.

Basically, instead of the server having a file, the client uploads it to the server and caches it until it is changed on the client side, which works in the following directory:

minetestx.x.x/textures/personal/skins

Which then you can place your skins in there and then you just add this line to the conf:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
player_skin = <this is the name>.png
skin_2d = false

To use the default skin, use:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
player_skin =

When the string is empty, Minetest will use the default skin.
To have classic 2D skins, you do this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
player_skin = <this is the name>.png
player_skin_back = <name>.png
skin_2d = true

This would make a skin system completely de-centralised, and the server holds a cache'd version, unless the client reminds the server to update the cache'd copy.

Because there maybe questionable content, I assume that someone may want to disable the custom skins locally, so you would add to the conf:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
see_custom_skins = false
To disable, and to enable:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
see_custom_skins = true
Viewing custom skins is enabled by default.

The Minetest server can disable the custom skins with the following line:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
enable_player_skins = false

Enabling them is simple:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
enable_player_skins = true

But, by default, the setting is classed as true.

Also: You could do the same method with texture packs:
minetest.x.x.x/textures/personal/packs/<names of texture packs, essentially the all folder but with different names.>

Which you could then switch pack with the conf line:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
texture_pack = sphax
texture_pack = misa
texture_pack =

^ The above indicates that no texture pack will be used. If it's empty.

The Good:
- Great for people who want custom skins, 2D and 3D, but don't want to use the finite selection from Zeg's Skins Mod.
- No risk of the skin system going offline.
- You could in theory have one skin on one server and another skin on another.

The BAD:
- Possible chance of infected .png files, but I suspect doing this is probably difficult.
- If the Minetest server is using remote_media, then skins might not be written there and therefore skins might not be displayed.

PostPosted: Fri May 17, 2013 15:23
by PilzAdam
The bad:
- Too high security risks for the server
- Inappropriate skins
- More / slower traffic for the server and client (upload of clients is usually slower than download)

PostPosted: Fri May 17, 2013 15:25
by Jordach
PilzAdam wrote:The bad:
- Too high security risks for the server
- Inappropriate skins
- More / slower traffic for the server and client (upload of clients is usually slower than download)

Just finished it. Most skin files weigh in the kilobytes.

EDIT: Reminder, most servers are Linux based, so their infection rate is probably reduced.

PostPosted: Fri May 17, 2013 15:31
by rubenwardy
There could be a minetest.get_texture call that retrieves a texture from a player's texture manager.

PostPosted: Tue May 28, 2013 04:25
by deasanta
Can the image be uploaded to the server by the client then reprocessed by the server to sanitize it using safer code? The vulnerability normally lies in the viewer / image handler or its related libraries.
Are there safer formats that can be used – example - bmp can upload then the server can resave and served as a png?
See below:
http://irrlicht.sourceforge.net/changes.txt
- Updated to latest PNG library (1.2.18), fixing a vulnerability.
Also changed some data structures which should make the library 64bit
compatible.

PostPosted: Tue May 28, 2013 05:10
by tinoesroho
What I'd be concerned about is inappropriate skins being displayed in a game that attracts a very young audience. :-(

PostPosted: Tue May 28, 2013 05:14
by sfan5
PilzAdam wrote:- Too high security risks for the server

I don't see a security risk there, MC also uses png and didn't have any problems
PilzAdam wrote:- More / slower traffic for the server and client (upload of clients is usually slower than download)

I selected 29 Skins, they were 28,8 KB which means that one skin < 1 KB.
Also Skins need to be 64x32, there could also be a size limit of e.g. 2.5 KB

PostPosted: Tue May 28, 2013 10:41
by Jordach
tinoesroho wrote:What I'd be concerned about is inappropriate skins being displayed in a game that attracts a very young audience. :-(
tinoesroho, in MC you rarely see them, its usually about 1-4 players per server who have that, and then they get a ban warning if they continue to use it. If they don't they end up banned.

PostPosted: Tue May 28, 2013 11:07
by Evergreen
Jordach wrote:
tinoesroho wrote:What I'd be concerned about is inappropriate skins being displayed in a game that attracts a very young audience. :-(
tinoesroho, in MC you rarely see them, its usually about 1-4 players per server who have that, and then they get a ban warning if they continue to use it. If they don't they end up banned.

Very true. I hope this feature gets worked on.

PostPosted: Tue May 28, 2013 18:35
by tinoesroho
Rapid skin swapping for the win!

... um, yeah. Should there be an option to upload it to a moderation queue the server admins can see? Yes. Should it be enabled by default? I don't think so. Great idea, but-

PostPosted: Tue May 28, 2013 19:30
by Calinou
Jordach wrote:
tinoesroho wrote:What I'd be concerned about is inappropriate skins being displayed in a game that attracts a very young audience. :-(
tinoesroho, in MC you rarely see them, its usually about 1-4 players per server who have that, and then they get a ban warning if they continue to use it. If they don't they end up banned.


+1, I've played on a lot of Minecraft servers, very few players use inappropriate skins.

Note that skins must be 64×32 in Minecraft, so it limits the impact of that kind of skins.

Re: Client Based Skins

PostPosted: Mon Apr 04, 2016 13:26
by snowflake
i done everything u told but when i join a sever , i dont get that skin , how am i able to put the skin on in server?

Re: Client Based Skins

PostPosted: Mon Apr 04, 2016 13:40
by benrob0329
It's a feature discussion, not a how to.

Re: Client Based Skins

PostPosted: Mon Apr 25, 2016 16:27
by azekill_DIABLO
imagine somone load a GIANT skin!! it does lot of lag!

Re: Client Based Skins

PostPosted: Mon Apr 25, 2016 19:49
by MineYoshi
azekill_DIABLO wrote:imagine somone load a GIANT skin!! it does lot of lag!

IF there is a limit of size to a skin, that trouble don't going to exist :F

Re: Client Based Skins

PostPosted: Tue Apr 26, 2016 10:56
by azekill_DIABLO
MineYoshi wrote:
azekill_DIABLO wrote:imagine somone load a GIANT skin!! it does lot of lag!

IF there is a limit of size to a skin, that trouble don't going to exist :F


you're true