By default, players joining the server who are
configured to act as cinematic cameras only
should not see the server status message ...
unless specifically configured to see it.
We actually want to prune accounts based on the
last time they were used or seen online at all, not
just the last time they successfully joined the
world. Keeping track of our own timestamp should
catch scenarios like players sucessfully authing
but failing to complete joining the world, or players
who log in and then play for a long time after
login. This also makes it safer to use with much
shorter timeout periods and longer-running
servers.
Further tighten the race condition gap between
players authing and finishing joining. The
meaning of last_login is apparently officially the
last join time, but if the last successful auth time
was later, use that as the known account age.
It's possible for a player to log in right as the
check scan is happening, causing the decision to
delete the account happening, then the player
successfully authing, then the account being
actually deleted from the queue, and then the
player completing emerge and running joinplayer
callbacks. One of the joinplayer callbacks tries to
update the last_login, which fails if the account
was deleted while the player was emerging.
Rather than redo the checks, just perform all the
deletion stuff inline.
pruneplayers can race with other mods (e.g.
motdagree) to delete a player. If the player was
already deleted when the check runs, don't crash,
just skip the player this pass.
- In some cases, players are not being kicked, even though their
status clearly indicates they should be. Make sure the "should we
kick them" logic in the status check command matches the logic in
the thing that actually does the kick.
- Clean up the way we handle event hooks to reduce the code mess.
- Don't rely on the bump/bumpn functions returning pname; always
return nil with them and determine pname at the outer layers and
pass it in as necessary. This is how we should have fixed the
earlier bug that caused players digging things not to get the node.
Things like auto-forward or a taped down mining key also count
as "idle" for this system's purposes as well, to avoid players
trivially exploiting to avoid being kicked, or to prevent
false positives caused by stuck controls.
Instead of using mod_storage and privs to control
cinecam, just use settings. The priv checks every
globalstep per player, in particular, were expensive,
and using "/grantme all" with the mod installed
would cause the player to teleport as a camera
player.
- Check destination medium against source, since it's possible
to transition from a fluid to air and raycast will NOT collide
with the air, causing from-fluid-to-air transitions not to be
detected.
- Pre-cache fluid medium data for all node defs instead of running
through logic at runtime.
Deeper dimming/vignette when server is empty
to make it a little more visually interesting, plus
add a clearer indication that the server is in
a different state than normal play.
If only one player is online and they are idling in
darkness, it makes the "Watching: " caption show
up too frequently. Instead, only show the caption
when we change to a different player.
See if we can get rid of that one step worth of jank after
moving the player before their lookdir is set correctly, which
might be due to the delay involved in the work of moving the
player's position.
If no player is connected, just show random views around "spawn"
(the origin for now, not actually testing to find the real spawn
location or honoring static_spawn setting yet) every ~10s.
Make sure the camera is never placed inside a solid; if it is,
then it needs to be moved immediately.
This leads to uneven times between cycling to
a particular player; it's probably best to just use
the naive order and let players rotate through
deterministically.
This was especially noticeable when a player
was last in the queue and then first in the next
queue, so you'd see a "Watching: ..." HUD
announcement but no actual change in perspective
and the player would just run twice as long.