10 Commits

Author SHA1 Message Date
Aaron Suen
39fc1ea626 Support teleporting to offline players
The YCTIWY mod is already keeping track of offline player
positions, so allow admins to use those for teleportation.  This
is sort of like the szutil_offlinepos mod, but as a standard
game feature now.  It can be useful for admins to quickly locate
players who are trapped and need rescue, or suspected of griefing
and need to be confirmed.
2023-06-10 23:01:14 -04:00
Aaron Suen
b8bffd8a77 Don't crash on deleting player w/o YCTIWY data
Some players may not have YCTIWY database
entries, this should not trigger an error.
2022-10-30 13:23:54 -04:00
Aaron Suen
ba39e9998d Cleaner, safer boolean expression 2022-10-23 14:35:01 -04:00
Aaron Suen
6fef1d9035 Fix importing mechanism
We can't check initial conditions because the legacy mod would
load after this one (to detect that it needs to be disabled), so
we have to provide an API entry point for it instead.
2022-10-23 14:24:33 -04:00
Aaron Suen
20fdb7e907 Path for auto importing from old external mod 2022-10-23 14:21:38 -04:00
Aaron Suen
adc8710a91 Shrink empty mod storage, earlier recheck on join/leave
When a player joins or leaves, schedule a recheck on the next
tick to prevent entities from lingering out of date by several
seconds.
2022-10-23 14:00:29 -04:00
Aaron Suen
ee7bc90ba9 Fix bug in disabled db pruning 2022-10-23 13:56:06 -04:00
Aaron Suen
d123dbded9 Fix core mod registration, settings 2022-10-23 13:44:59 -04:00
Aaron Suen
0673f3094a Add options to disable YCTIWY
There's a "soft disable" that just hides the entities
but keeps the database up to date, and a "hard
disable" that clears the database, keeping only
minimal data, until existing transactions (taken
items, dumped inventories) are flushed to the
world.
2022-10-23 13:22:14 -04:00
Aaron Suen
941d1545f2 Import YCTIWY mod nearly unaltered
I had wanted this to be a standard feature of the
game for a while but put off merging it because:
- I had hoped to find a better visual design for the
  ghost player entities that matched the bandolier
  in nc_player_wield better, and
- I had scalability concerns with large servers with
  thousands of offline players.

However, in practice it seems like the scalability
issues are not as critical, and the visuals are
acceptable as they are for now.

In making this a standard game feature, it
will probably also make sense to add an option
to effectively disable parts of it (e.g. avoiding
creating the ents, or even avoiding filling the
database except where players' items are already
taken).
2022-10-23 12:44:25 -04:00