This is needed (for now) in order to parallelize ingame_chat, because
one of the handled messages updates this value on the server. It turns
out that the value is not actually used on the server, only the client,
so this was mostly a matter of threading this back to the correct place.
Additionally, we took the opportunity to modify the UI to not log you
into the game until your character was confirmed to be loaded, which
was a todo item that lets us simplify some error handling logic and
remove stuff from global state.
As a side effect, this moves the initial game server sync message into
the login code, since that's the first place we can check for admin
permissions and we want to avoid sending large messages to users who are
not authenticated (especially if the player cap has been reached;
previously, the player cap check limited the damage that could be done
by unauthenticated players).
Some fallout from this is that we don't synchronize the Player component
anymore, which had some minor effects on voxygen. This update also
breaks Torvus, since Client::new now expects the username and password
to be provided from the getgo--an accompanying MR will be submitted to
fix it.
Messes up water somewhat and is incomplete for glow lighting, but should
be a fair amount faster in general. Also reduces stuttering during
chunk generation by moving atlas creation and "clearing" off the main
thread (in fact, we don't even clear it except for the very first
allocated terrain atlas).
This mostly come out of optimizing BlocksOfInterest to (empirically)
minimize redundant computations, use a more efficient RNG, use a faster
verion of iter_changed, and optimize water block handling (theoretically
the iter_changed difference might mean we missed some water blocks, but
in practice it's unlikely to matter for fast-moving rivers).
Also did some microoptimizations of meshing etc. that seem to result in
pretty good improvements in practice, and also added another set of
optimizations to improve tree performance (special casing "easy" segment
approaches, which got a few percent, and inlining block_from_structure
for tree leaves and branches, which got us considerably more; I think
the total improvement is around 5%).