18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-28 20:53:22 +01:00

fix(scripting): typed scenery handles, sandbox keys from eu07.ini only, GCC 13 build

- 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
This commit is contained in:
jerrrrycho
2026-11-16 08:54:00 +01:00
parent fde6d10f32
commit 3ae8d4e72e
13 changed files with 571 additions and 35 deletions

View File

@@ -362,8 +362,9 @@ state_serializer::deserialize_camera( cParser &Input, scene::scratch_data &Scrat
void
state_serializer::deserialize_config( cParser &Input, scene::scratch_data &Scratchpad ) {
// config parameters (re)definition
Global.ConfigParse( Input );
// config parameters (re)definition, but for what only eu07.ini sets: programs to run, connections, the sandbox of
// the scripts (utilities/inionlysettings.h)
Global.ConfigParse( Input, config_source::scenery );
if( Global.test.enabled ) {
// a scenery doesn't get to turn on what a test keeps off
simulation::apply_test_mode_settings();