Lea-fish / Leafish

A minecraft-like multi version client implemented in Rust.
Apache License 2.0
809 stars 46 forks source link

Implement our own capes in the client #33

Open terrarier2111 opened 3 years ago

terrarier2111 commented 3 years ago

This is a nice to have, low prio feature as well: Implement capes and distribute them via client settings (especially the skin layer or other stuff if it gets sent to other clients)

PureTryOut commented 3 years ago

That would indeed be fun to have, I know mods like Optifine have that to show Optifine patreon's.

I own 2 Minecon capes myself so would very much like to have the option to display those as well, so I guess the client-side option would be an override.

terrarier2111 commented 3 years ago

That would indeed be fun to have, I know mods like Optifine have that to show Optifine patreon's.

I own 2 Minecon capes myself so would very much like to have the option to display those as well, so I guess the client-side option would be an override.

But the best part is - we don't even need an own server to show the local cape to other clients, meaning the cape distribution is decentralized :)

PureTryOut commented 3 years ago

Oh we don't? How does it send the info to other Leafish clients then?

terrarier2111 commented 3 years ago

Oh we don't? How does it send the info to other Leafish clients then?

As i stated it (ab)uses the client settings and can send 1 byte of information per client setting packet, the only down side is that the skin will rapidly change and it could be detected by anticheats as skin derp

terrarier2111 commented 3 years ago

There is one unset bit in each client setting packet so we can mark our packets by setting this bit to 1

terrarier2111 commented 3 years ago

But some hacked clients might send clientsettings packets with that bit as well, so we have to send a verification header constant first, i think a size of 2-4 bytes should do

terrarier2111 commented 3 years ago

another downside is, that we are effectively sending like 10-20 bytes to the server in the middle to transport 1 byte to another client, so theres ALOT of overhead

terrarier2111 commented 3 years ago

Oh we don't? How does it send the info to other Leafish clients then?

So the most basic explanation is, we are using the server in the middle to transport the information

PureTryOut commented 3 years ago

Yeah that doesn't sound too great. Maybe a centralized server would be better after all. Clients would be able to announce themselves their and retrieve the other logged in players. But then that should definitely be made optional.

terrarier2111 commented 3 years ago

Yeah that doesn't sound too great. Maybe a centralized server would be better after all. Clients would be able to announce themselves their and retrieve the other logged in players. But then that should definitely be made optional.

But having a centralized server involves trust, money and other issues like DDOS protection and a monetary model which has to be worked out

PureTryOut commented 3 years ago

I know :cry:

terrarier2111 commented 3 years ago

So we have to look at the advantages/disadvantages of each of these options there is also a third option, which is to let the servers in the middle be able to handle capes better, by letting them know which cape you have (with a plugin message) and let them (with a custom plugin) send this info to the other leafish clients