Repository navigation
Update EMM-A to 0.9.47B (SDX2 lidar required) - #366
lucakrowinkel123-dot wants to merge 2 commits into
Conversation
viktor-ferenczi
left a comment
There was a problem hiding this comment.
Version-bump review of hub head eb908832d01f3052573c96e125f780ba4f50c990, Plugins/EMM-A.xml:
lucakrowinkel123-dot/EMM-A:2f2f494aa58f2d9cb4e7574b33845d2243b81348(v0.9.40B) →f51a1b7d9eb25fa1804a7c627023906d8ba54e79(v0.9.46B). 155 paths changed, +2851/−37484. Most of it is the removal ofscripts/srcand the old scripts. The hub-compiledplugin/srchas 19 changed files, +405/−123 ignoring line endings (Emma3Controller.Bridge.cswas converted from CRLF to LF).
Summary: this release narrows the 50 km ore detector problem a lot, but it doesn't fix it. Asteroid selection now needs a working detector in range. Once a detector sphere touches an asteroid's bounding box, though, the plugin still reads the ore of the whole asteroid, including ore far outside that range. That is the one change I'd ask for. I found no security issues in the new code.
Findings
1. Medium: ore outside the detector's range is still revealed. CanScan admits an asteroid when the sphere of any working, accessible ore detector or SDX lidar on the carrier overlaps its WorldAABB. The scan itself is unchanged: VoxelScanner.Begin still covers StorageMin..StorageMax and reads content and material for the whole storage box, then refines every ore pocket at 2 m. The README says so too: "Even 5 cm of overlap qualifies the entire asteroid".
Vanilla doesn't work that way. MyOreDepositGroup.UpdateDeposits (SE 1.211.017) clamps its voxel query to the detection sphere's box, in 32-voxel cells, so a 150 m large-grid detector reports only ore within about 150 m. The storage box also includes empty corners. A detector that just reaches a corner of a 1–2 km box gets the ore of the whole rock, buried core included. That ore drives target selection, gets added to the Ores timer by name and is logged per asteroid. On a server, a player still learns which ores an asteroid holds, and where, far beyond what their detector shows. It's a much smaller advantage than before, but it's the same kind.
Fix: read material, or keep ore samples, only inside the detector spheres that cover the asteroid, the same way the vanilla detector limits its query. Content alone (the asteroid's shape) can stay a whole-asteroid read for obstacle and approach geometry, since any player can see that. The tradeoff: a deep pocket only becomes a target once the carrier's detector reaches it, so planning may need another pass after moving closer.
Earlier notes from #343
| Note | Status |
|---|---|
| 50 km ore detector | Partly fixed, see finding 1. Candidate selection, background surveys, cached maps, departure scans and in-flight scans now all check CanScan. Asteroids outside detector range are used only as solid obstacle boxes (BuildCandidateList). |
| Low: planner reply journal never pruned | Fixed. Replies now go to a per-Carrier folder (planner-replies/<carrier id>/), and MaintainHistory keeps the last 16 and moves legacy flat files over in batches of 8. |
Note: <Description> is only a URL |
Unchanged. |
| Note: script source not in the repository | Still open. scripts/src, the old 0.8.56 copy, has been deleted, so no script source is published now. |
A correction to the #343 comment: you were right about the overlay. PlanVisualizer.Draw draws AsteroidMap.Samples, which only holds surface cells (AddSurface), so it doesn't draw crosses for buried ore. Buried ore goes to OreSamples, which is what targeting uses.
Question
The lidar path treats sdx_detectorTargeted_lidar / sdx_detectorTargeted_lidarMes as an ore detector with the WeaponCore "Weapon Range" slider as its radius (the test fixture uses 24 km). Does that SDX2 block reveal ore at that range in the mod's own gameplay? If it only targets grids, this gives ore detection at lidar range on any server that runs SDX2. If it does detect ore, please say so in the README, so other server owners know what the plugin does when they install the mod.
Non-blocking notes
- Note: the README and
docs/index.htmlhave mojibake: "block’s" (README L9) and "·" in the page title. It looks like a Windows-1252 round trip. AllowSeatExitDuringMiningnow defaults to on, and while it is on, leaving the cockpit no longer suspends planning. Scans still stop while the player is out of the seat, becauseCanScanrequiresIsCarrierPilot, so this changes only convenience, not what the plugin can see.
Security
Every changed path in plugin/src was read in full, plus the test, descriptor and doc changes.
- Still no network,
Process,Assembly.Load, reflection-driven activation, P/Invoke,unsafe, Harmony or obfuscated code inplugin/src. - New file I/O stays under
<UserDataPath>/Storage/EMMA3. Journal folders come from a parsedlong. Journal file names are SHA-256 (hex or base64url). Retention deletes only 47-character base64url.txtfiles inside that Carrier's folder. The clean-reset delete targetsfleet-routes-<CarrierPbId>.txt.VisualizationSnapshotStorenow also reads siblingcurrent-visualization-*.txtfiles of the same world, read-only. - Detector checks use
IsWorking,HasPlayerAccessand the carrier's own grid. The ore detector "Range" terminal getter returns metres (Range * MaximumRange * 0.01,MyOreDetectorin SE 1.211.017), as the code comment says. - The five 0.9.46B scripts are minified in-game programmable-block scripts. The hub doesn't compile them (
SourceDirectories=plugin/src) and the game's script whitelist sandboxes them. Their outside communication is IGC broadcast/unicast andCustomData. I didn't decode them line by line this round. - The pinned tree has 87 tracked paths, with no binaries, native files, submodules or symlinks. The new
tests/DetectorCoverageproject references onlyVRage.Mathfrom the game install and isn't compiled by the hub.
Manifest and build
python3 test.py Pluginsat the hub head:All files validated. OnlyTooltip,DescriptionandCommitchanged. The ID is unique.- The pin is tag
v0.9.46Band is reachable frommain.main(15ea9ef) is one commit ahead and changes only a link indocs/index.html. The repository's ownPluginHub/EMM-A.xmlpins65e5941(the parent, which has the sameplugin/src); that's ignored, since the hub manifest decides. - I compiled
plugin/src/**/*.cs(65 files) with .NET SDK 10.0.400 on Linux: net48, latest C#,TRACE;PULSAR, unsafe allowed, against the installed SEBin64. 0 errors. The only compiler warnings are the two known CS0618 (BoundingBoxD.GetCorners()inGeometrySafety.csL120 andRoutePlanner.MinerRoute.csL248). NoNuGetReferencesare needed. - I didn't run the author's tests or test in game.
viktor-ferenczi
left a comment
There was a problem hiding this comment.
Re-review of hub head 55ba12d98d49c8dec3df9fb8e5b6f6542cd75e8a, Plugins/EMM-A.xml. The last review covered eb908832d01f3052573c96e125f780ba4f50c990.
lucakrowinkel123-dot/EMM-A: the pin moved fromf51a1b7d9eb25fa1804a7c627023906d8ba54e79(v0.9.46B) to8328b388646d314cac6905731557227480a7a575(v0.9.47B).8328b38sits directly on the commits reviewed last time, so this re-review coversf51a1b7..8328b38: 13 paths, +235/−54, 9 of them in the hub-compiledplugin/src(one new file,CarrierLidar.cs).
Summary: 0.9.47B makes an SDX2 targeted lidar the only sensor that enables the plugin and qualifies asteroids for scanning. The scan itself didn't change, so the earlier finding is still open, and it got worse: a whole-asteroid ore map now comes from a ship-targeting block at its WeaponCore range instead of from an ore detector. I found no security issues in the new code.
Findings
1. High (was Medium): whole-asteroid ore at lidar range, from a block that doesn't detect ore. CanScan now delegates to CarrierLidar.Available. That method accepts only sdx_detectorTargeted_lidar / sdx_detectorTargeted_lidarMes sorters, takes the radius from the WeaponCore "Weapon Range" slider (the default -1 maps to the slider maximum) and still tests sphere-to-WorldAABB overlap. VoxelScanner.Begin is unchanged and still reads content and material for the whole StorageMin..StorageMax box. The README says so, and the PR description says the per-sample distance limit is still open.
This also answers my question from the last review. The PR description says the SDX2 block describes ship-class and faction pings, and that you haven't verified SDX2 exposes ore at that range. The README adds that the ore map comes from EMM-A's own voxel scan. In 0.9.46B a vanilla ore detector (150 m on a large grid) could still qualify an asteroid; in 0.9.47B no ore sensor is involved at all, and the qualifying range is that of a targeting lidar. Your own test fixture uses a 24,000 m maximum (Hardware.cs L36). On a server running SDX2, a player learns the ore types and positions of every asteroid whose box touches that sphere, buried cores included. That is close to the 50 km ore detector problem from #343 again. The README disclosure helps server owners understand it, but they can't turn it off: the plugin is client-side, and a server that installs SDX2 for ship pings shouldn't also be handing out ore maps.
The severity went up because what qualifies a scan is no longer tied to any ore sensing in the game.
Fix, both parts:
- Base ore qualification on a vanilla ore detector again, or on an SDX2 function that actually reports ore, at that sensor's real range. The lidar can stay as an extra requirement if you want it.
- Read material, or keep ore samples, only inside the qualifying sensor spheres, as asked last time. Content (shape) can stay a whole-asteroid read for obstacles and approach geometry, since any player can see that.
Earlier findings
Finding (review of eb90883) |
Status at 8328b38 |
|---|---|
| Medium: ore outside the detector's range is still revealed | Still open, now High, see finding 1. |
| Question: does the SDX2 lidar reveal ore at its WeaponCore range? | Answered: not verified, and documented as ship pings. That answer is why finding 1 went up. |
Note: mojibake in README and docs/index.html |
Fixed. No †/  sequences left in either file. |
Note: <Description> is only a URL (from #343) |
Unchanged. |
| Note: script source not in the repository (from #343) | Still open. 0.9.47B reuses the minified 0.9.46B scripts. |
Security
Every changed path in f51a1b7..8328b38 was read in full.
plugin/srcstill has no network,Process,Assembly.Load, reflection-driven activation, P/Invoke,unsafe, Harmony or obfuscated code.CarrierLidaronly reads block state (Enabled,IsWorking,HasPlayerAccess, grid ID) and theWeapon Rangeterminal property.- No new file I/O. The only new write is to the carrier's own Plugin Bridge timer
CustomData(surveyPulse,pluginLcdReady, a status message) while no lidar works (WaitForCarrierLidar). The plugin already used that channel. - The lidar list is rebuilt from the carrier grid on every refresh. Scans, departure preparation and planning are cancelled when the last lidar stops working, and out-of-seat services can't start a scan (
occupiedGrid == 0with an asteroid returns false). I found no lifecycle bug in the new gating. - No binaries, native files, submodules or symlinks were added.
tests/DetectorCoveragegained a stub file and isn't compiled by the hub.
Manifest and build
python3 test.py Pluginsat the hub head:All files validated. OnlyTooltipandCommitchanged since the last review. The ID is unique.- The pin is tag
v0.9.47Band is reachable frommain.main(4c08c0a) is one commit ahead and only updates the repository's ownPluginHub/EMM-A.xml, which the hub ignores. - I compiled
plugin/src/**/*.cs(66 files) with .NET SDK 10.0.400 on Linux: net48, latest C#,TRACE;PULSAR, unsafe allowed, against the installed SEBin64. 0 errors. The only compiler warnings are the same two CS0618 as before (GeometrySafety.csL120,RoutePlanner.MinerRoute.csL248). NoNuGetReferencesare needed. - I didn't run the author's tests or test in game.
This updates EMM-A from the catalog's 0.9.40B to 0.9.47B, replacing the 0.9.46B revision previously proposed here. The plugin uses the existing five 0.9.46B programmable-block scripts. Plugin changes since the last review · Compatible scripts
The client plugin requires an enabled, working SDX2 targeted lidar on the carrier's own grid that the local player can access. Switching off or removing the last qualifying lidar suspends services and cancels active scanning and route planning. A vanilla ore detector, an ordinary sorter, or a lidar on a docked grid cannot qualify. Each scan uses the current WeaponCore range setting. Hardware checks
Scan scope for review. Once a qualifying lidar's range touches an asteroid's bounding box, EMM-A reads ore throughout that asteroid, including ore beyond the sphere. The reviewer's proposed per-sample distance limit is still open. The SDX2 block description identifies ship-class and faction pings. I have not verified that unmodified SDX2 exposes the same ore information at this range. The whole-asteroid ore map is produced by EMM-A. Plugin behavior
The plugin built against the installed Space Engineers assemblies. The lidar checks passed for loss of power or access, grid changes, range changes, and a 5 cm overlap or gap. The 18 scan and logging checks, 22 Runtime LCD checks, and PluginHub catalog validator also passed. Verification was offline. Lidar regression tests