fabric-webstreamer icon indicating copy to clipboard operation
fabric-webstreamer copied to clipboard

[Suggestion] Allow placement in survival mode

Open Sirmentio opened this issue 2 years ago • 10 comments

Hello. I run a small 1.18.2 modded server and added a crafting recipe for this to be crafted in survival. However, to my bewilderment, it couldn't be placed anywhere. I think that instead of locking out placement to solely creative mode, it should be an option for those in survival to place and break them on the chance something like this were to happen.

Sirmentio avatar Aug 19 '22 18:08 Sirmentio

Hi! You're right, and the availability in non-creative mode of this block is a question since the beginning of the project.

Let me explain: each different source (live stream or raw images) present near a player (and rendered) are potentially using the network. This is a problem with live streams in particular, a player entering an area with too many different sources might get DDOS-ed just by the fact that the game will try to play all streams concurrently. This is why I didn't allow the block to be placed for non-op/non-creative players. Note that sources are not directly display blocks, for example the same source can be used on many displays and this won't cause much network lag, because the source is downloaded once, processed and then rendered at multiple locations.

To allow it in survival, I'll need to add either a permission system (to allow trusted players to place it) or a rate-limit, the best would be to implement both. The rate-limit is a lot harder to implement.

mindstorm38 avatar Aug 19 '22 22:08 mindstorm38

Honestly, my players would probably just make use of the static image feature before going ahead with full streams, which I assume wouldn't be nearly as taxing on one's network. Maybe streams of that nature could only work when changed via creative mode? Alternatively, it could be a config option with a clear warning.

Sirmentio avatar Aug 29 '22 01:08 Sirmentio

I have made a fork that allows placement and uses and added a recipe as well. Its not very secure all I did was allow placement in survival and for it to be crafted nothing more nothing less. Go to the actions tab and either get the 1.19.2 version, which is master, or 1.18.2 from my fork.

Jacobwasbeast avatar Sep 14 '22 00:09 Jacobwasbeast

@Jacobwasbeast I'm really interested in the workflow you introduced together with the craft (which is fair), could you open a pull request (with all changes to gradle.yml squashed)? However, I'm not sure to keep the 1.18 version because I don't know how I can manage and release multiple MC versions at the same time, if you have any suggestion for this I'm interested.

mindstorm38 avatar Sep 15 '22 08:09 mindstorm38

Alright, I created a pull request.

Jacobwasbeast avatar Sep 15 '22 12:09 Jacobwasbeast

Permissions with LuckPerms could be added to allow none-oped players place a web display, a permission like webstreamer.display.place could be used.

Many servers already use LuckPerms so this would be helpful for them to.

ajh123 avatar Feb 25 '24 10:02 ajh123

I wonder if there is a more standard way of managing per-block permission in vanilla Minecraft? Or maybe with a fabric api?

mindstorm38 avatar Feb 25 '24 11:02 mindstorm38

Looks like LuckPerms have a sub library that does exactly that https://github.com/lucko/fabric-permissions-api/

mindstorm38 avatar Feb 25 '24 11:02 mindstorm38

However, that API has had its last update 7 months ago.

ajh123 avatar Feb 25 '24 11:02 ajh123

LuckPerms keep advertising it as the standard way to interoperate with permissions... I agree that 7 months is a lot for an open source project, but there are no recent issues.

mindstorm38 avatar Feb 25 '24 13:02 mindstorm38