Carpet

Carpet

2M Downloads

events in player scoped apps that are dynamically set, should be independent from other players.

gnembon opened this issue ยท 6 comments

commented

Events are shared between app instances in per player apps. This means that one player will affect handling of events of other player. Since handlers can be dynamically added / removed, that breaks apps isolation.

Fixing it means all events should be keyed with host AND target and acted upon appropriately.

This entails that creating a new player host for apps requires copying of all events to the child host.

It probably makes sense that global host events in player apps are not executed as irrelevant.

This also means that all 'global' events, like 'tick' should now be able to execute on player hosts, making global events somewhat more useful, with a warning that with multiple players on, that will execute multiple times, once for each player.

commented

like can u give an example?

commented

how could it be dynamically set?

commented

this is the example:

handle_event('player_places_block', null);

right now if one player changes that, it affects all players using this app.

commented

I want all settings apps, that should be turned on by default (like distance), to have no effect by themselves on the game, so like with the distance, it can be loaded, but it should not be listening to any events, only when a player requests that.

commented

ah makes sense.

commented

But in this specific case (distance), wouldn't the events (eg places block) be toggled globally since they depend in a rule, that is already global?

(not against the issue)