Using the total number of users in the connection set
is not correct since those users may not be logged in
yet. Instead, track separately the number of users
who have passed the slot check.
Fixes https://github.com/PaperMC/Folia/issues/205
This may be invoked by a worldgen thread, in which case the
region data would be null and cause a crash. Returning true
is the default state of shouldSignal, so this should maintain
expected behavior.
The world tick will synchronise block data to clients. If
the connection tick is ran before, then the server will
send the block ack before the block updates - which causes
the client to think that any blocks it broke/placed
were rejected.
Fixes https://github.com/PaperMC/Folia/issues/194
The delta position packet instructs the client to update
the entity position by a position difference. However, this position
difference is relative to the last position in the entity tracker
state, not the last position which has been sent to the player. As
a result, if the last position the player has recorded is different
than the one stored in the entity tracker (which occurs when a new
player is added to an existing entity tracker state) then the sent
position difference will cause a position desync for the client.
We can resolve this problem by either tracking the last position
sent per-player, or by simply resetting the last sent position
in the entity tracker state every time a new player is added.
Resetting the last sent position every time a new player is
added to the tracker is just easier to do, so that is what
this patch does.
Fixes https://github.com/PaperMC/Folia/issues/197
The data both store are caches which are cleared after updates,
which means that there is no block/position data being tracked
across ticks. As long as each region has its own instance, there
should be no cross-region data access.
Fixes https://github.com/PaperMC/Folia/issues/202
It doesn't really make sense to use this as most of the features
involve stopping/stepping the world, which do not make much sense
given the nature of multiple parallel ticking regions.
Additionally, fix ActivationRange using global state to store
the AABBs it checks entities against. This fixes an issue where
entities would not be activated when they should be.
The non-game type implementation will not guard against double calls,
which means that any invocation of disconnect() would immediately
call onDisconnect and then later the connection handler would
also call onDisconnect.
Fixes https://github.com/PaperMC/Folia/pull/181
The region shift is configurable under `grid-exponent`, which
allows setting the region shift to any value in [0, 31]. Note
that values above 6 affect the lock shift, as the lock shift
currently is computed as max(ticket shift = 6, region shift).
The shift is left configurable for now as the lower default
shift of 2 may have negative performance impacts.
The default region shift has been adjusted to 2 from 4, and
the empty chunk buffer has been reduced to 8 from 16. These
changes reduce, but do not eliminate, player spread
requirements. The previous block range was around ~1500 blocks
at VD = 10, but is now closer to ~900 blocks at VD = 10. This
roughly reduces the area that each player uses in the regioniser
by 2.5x.
Currently, /tick is disabled but is planned to be re-added.
It's unlikely that support for sprinting can be implemented
precisely due to the fact that Folia ticks many regions
independently. However, a best-effort approach will be used.