261 Commits

Author SHA1 Message Date
Aaron Suen
3b7cbf4142 Fix con/chat sockets with mod security
Now these apparently load correctly, at least under docker, as
long as the mods are in secure.trusted_mods, disabling mod security
is no longer necessary.
2023-04-21 07:25:42 -04:00
Aaron Suen
9da5d074d6 Fix startup warning 2023-04-21 07:23:54 -04:00
Aaron Suen
70ee9bacc7 Restart "always" feature and other improvements
- Always pend a restart on player join, so empty servers are
  always freshly restarted for optimal RAM conservation.  This
  would kill uptime/availability stats for a public server, but is
  ideal for private server that are often empty, e.g. when running
  multiple private servers on "standby" for a smaller pool of
  local players.
- Improve logging of restart triggers.
- Don't announce restarts extremely far into the future, so that
  the "pend restart on join" feature doesn't cause undue chat
  noise and scare players away who habitually quit to restart upon
  seeing a "restart in..." message.
2023-04-21 07:00:48 -04:00
Aaron Suen
ad22551d23 Merge notes 2023-04-04 06:52:05 -04:00
Aaron Suen
49320176e6 Merge notes 2023-04-04 06:32:59 -04:00
Aaron Suen
b1e05064c1 Increase waypoint dedupe distance 2023-01-14 10:52:03 -05:00
Aaron Suen
dc22af9e61 Make cinecam idle waypoints runtime-manageable
Waypoints can be added/removed via chat
commands.  This makes it easier to adapt to
various "points of interest" that may evolve over
time with the world.
2023-01-14 10:43:53 -05:00
Aaron Suen
20d97f7bf4 Fix crash on missing block 2022-12-30 16:23:49 -05:00
Aaron Suen
de4ffb0a29 Migrate szutil_usagesurvey to mod_storage
Finally mod_storage is actually efficient enough,
when using sqlite3, to ditch the old file-based
storage, which is a nightmare for backups.  This
mod now effectively requires that sqlite3-based
mod storage be used for worlds of sufficient
scale, but that's probably a fair requirement for
using this rather obscure mod anyway.
2022-12-30 15:57:43 -05:00
Aaron Suen
f600ae9178 Add simple lag mod
Adapted from methodology used in
hopcheat, which was the first time I
got it working fully reliably.
2022-12-09 17:58:34 -05:00
Aaron Suen
16fa1fc6df Hide status message for cinecams by default
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.
2022-11-05 16:37:40 -04:00
Aaron Suen
c11c2b9956 Fix missing default config values 2022-11-05 16:07:44 -04:00
Aaron Suen
f0062239d1 Add szutil_namehud mod 2022-11-05 16:04:23 -04:00
Aaron Suen
7175f51921 Maintain our own last-seen timestamp for players
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.
2022-11-05 13:52:15 -04:00
Aaron Suen
1a2d41b0b3 Handle authed but not joined players
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.
2022-11-05 13:36:27 -04:00
Aaron Suen
8d607b360c Don't defer account pruning deletion
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.
2022-11-05 13:31:10 -04:00
Aaron Suen
802c0bfda1 Add more checks player deletion races 2022-11-05 13:22:42 -04:00
Aaron Suen
e47ae06561 Don't crash on missing player in pruneplayers
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.
2022-11-05 13:19:48 -04:00
Aaron Suen
83ec874634 Clear up some todo items 2022-11-05 11:50:26 -04:00
Aaron Suen
660a1880c6 Fix missing mod.conf 2022-10-30 13:42:11 -04:00
Aaron Suen
7c776fcff9 New mod to automatically prune old players 2022-10-30 13:36:08 -04:00
Aaron Suen
7665c4d26d Guard against player quitting during login process 2022-10-19 23:16:41 -04:00
Aaron Suen
8de5b84e20 Support multiple cinecam "dummy" foci
Instead of always centering on 0,0,0,
support custom waypoints and use of
static_spawn as a default.
2022-10-14 17:53:32 -04:00
Aaron Suen
6a2969578f Show compact xp level w/ SI prefixes 2022-10-07 07:25:14 -04:00
Aaron Suen
850d7f6a9e Hide hidden players in xplevel command too 2022-10-06 22:50:13 -04:00
Aaron Suen
a8410a4d7a Configurable stealthing of online players 2022-10-06 22:47:37 -04:00
Aaron Suen
74f936860c Add API and command for xplevel 2022-10-06 21:20:31 -04:00
Aaron Suen
f2b930f783 Fix player loop early bailout, standardize kickability logic 2022-10-06 07:21:13 -04:00
Aaron Suen
906cf51cbb Trying to fix some issues
- 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.
2022-10-06 06:42:06 -04:00
Aaron Suen
52d9932173 Add debug command for szutil_idlekick 2022-10-05 07:47:21 -04:00
Aaron Suen
3ea73b50b5 Fix idlekick never kicking players 2022-10-04 21:35:20 -04:00
Aaron Suen
9e9cd6ca48 Ignore constantly-held controls too
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.
2022-10-04 18:38:17 -04:00
Aaron Suen
fa5ba739cf Ignore very small lookdir movements 2022-10-04 18:35:44 -04:00
Aaron Suen
2468bb73f4 Clear privcache on forced recalc 2022-09-29 23:20:18 -04:00
Aaron Suen
92aaf30496 Run grant callbacks and send grant message 2022-09-29 22:53:59 -04:00
Aaron Suen
0cabcf29bc Use standard string_to_privs in xplevel
This shoudl make xplevel implicitly support roles
2022-09-29 22:05:09 -04:00
Aaron Suen
a015e47dbe New experimental szutil_xplevel mod 2022-09-29 22:02:27 -04:00
Aaron Suen
12f4fc4f15 Move cinecam config into settings
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.
2022-09-29 18:09:28 -04:00
Aaron Suen
079c21a58b Don't return player name on craft in idlekick
Apparently this causes games that use engine crafting to replace
the recipe output with an unknown item with the player's name.

Fixes https://gitlab.com/sztest/szutilpack/-/issues/4
2022-07-05 06:44:31 -04:00
Aaron Suen
64f28532f1 Fix and optimize line of sight checks
- 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.
2022-05-03 07:10:15 -04:00
Aaron Suen
0a9ba9c210 Delay setting watching HUD until set camera 2022-04-30 14:15:20 -04:00
Aaron Suen
9a4c3550b1 Fine tuning for bottom margin of watching HUD 2022-04-28 21:28:38 -04:00
Aaron Suen
8b9d42646a Re-show the "watching" HUD periodically 2022-04-27 15:43:29 -04:00
Aaron Suen
6c3a0d1859 Fix saving settings across restarts 2022-04-25 22:45:34 -04:00
Aaron Suen
586e592552 Separately configurable height 2022-04-25 22:43:39 -04:00
Aaron Suen
9de0f9ceec Prefer the camera over the shoulder
Bias camera to behind the player's looking dir
so we see things more from the player's
perspective so we can see what they're doing.
2022-04-25 22:40:16 -04:00
Aaron Suen
65a624096a Fix HUD, runtime-configurable settings 2022-04-25 22:36:45 -04:00
Aaron Suen
59af87466e Clearer, better-proportioned image 2022-04-24 21:09:07 -04:00
Aaron Suen
bafddf2bf6 Allow display dimming/vignette
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.
2022-04-24 21:03:36 -04:00
Aaron Suen
65ad490837 Extract settings, narrow assumed FOV
Assume that the FOV might be as narrow as 72.
2022-04-22 21:32:06 -04:00