* feat(odometer): stamp the states with the day they were last updated, drop those not updated for a year
The odometer store kept every vehicle ever run. Each state now carries the
day it was last updated, written as a comment line "# updated <yyyy-mm-dd>"
before the states of that day, which the builds without the stamps skip.
A state with no stamp counts as updated the day it is read. A save drops
the states not updated for more than 365 days, those the other simulations
saved included. Refs #283.
* test(odometer): cover the stamps of the states and their expiry
* fix(odometer): a wrong clock doesn't drop the states, odometer.expiry sets the period
Review of #435. A stamp later than today was taken as today on every read, so a session with the clock set back
rewrote every state with that day, and the next session with the right clock dropped them all. The stamps are now
kept as written and a recorded state keeps its later day, so a day never goes back.
The expiry was measured from today, so a clock set forward, or the first save after a break of a year, dropped every
state not run in that session. It is now measured from the latest day of the states read at the start of the
session when that is earlier than today. The states this session records are stamped today, so the newest day of
the merged store would always be today in a save that writes.
The period is odometer.expiry <days> in eu07.ini, 365 unless set, 0 for never. A scenery's config block doesn't
change it, it would drop the player's states.
The states dropped are logged by the save that writes the file without them, not at every save while the write
fails. as_written() reads with the day given to save().
keep() put python.enabled, luascreens.enabled, wasm.enabled and lua.fulllibraries back in either
direction, so a scenery with config python.enabled no endconfig, which the release honoured, was
overridden and got an error in the log. They are put back now only when the scenery turned them
on; switched off they stay so, silently.
- the scenery API (eu07.events) hands out a full userdata of its own locked
metatable for each kind of object (event, track, isolated, vehicle,
memcell), checked with luaL_checkudata: a handle of another kind, a light
userdata or any other value is a Lua error, not an object taken for
another. nil stays "no object". one object has one handle while the
script holds it, so handles compare and key tables as before. event
handlers get their handles built inside lua_cpcall, and nil for no
activator
- memcell_values keeps its text as a std::string: the text of a number was
read from a stack slot popped before use
- newproxy is gone from the sandboxed libraries
- a config block of a scenery no longer changes what only eu07.ini sets
(lua.fulllibraries, execonexit, extcam.cmd/rec, screenshotsdir,
network.server/client, zmq.address, motiontelemetry, uart, feedbackmode,
feedbackport, python/luascreens/wasm.enabled): kept before its keys are
read, put back before FinalizeConfig(), each attempt logged
- open_file_library() iterates luaL_Reg instead of a std::pair GCC 13
deduces as a pair of an array and a function