Repository navigation
Add scotlandsyard plugins: Doorman, Radar Tech, Hush, Quiet Skies, Tally, Digby - #380
scotlandsyard wants to merge 3 commits into
Conversation
…lly, Digby Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
viktor-ferenczi
left a comment
There was a problem hiding this comment.
Review: Doorman, Radar Tech, Hush, Quiet Skies, Tally, Digby
Scope: hub PR head 12a266e9d8bbcd00854519f2c1f9e2e4ed9462fe. All six manifests pin e31f251c951251fed606934e3cac5cdf92285164 of scotlandsyard/SpaceEngineersPlugins. These are new registrations, so this is a full-repository review of all 285 tracked paths at the pin. The six projects, Shared/, the build files and the top-level files were read in full. The other nine projects were inventoried and scanned: BaR Maid, Fat Albert, OreScout, Sacrificial Stockpile Manager, Script to Plugin and Wilson are reviewed in #379 at the same pin, and Tripwire, Drill Sergeant and Shipwright aren't registered.
Summary: two changes are needed before merge.
- Doorman sends close requests for doors the server considers out of reach. An honest player ends up in the admin's failed-validation log, and the closes never happen.
- Tally's Copy button throws on Linux (Pulsar Interim).
Everything else is Low. I found no networking, process execution, dynamic code loading, telemetry, obfuscation or committed binaries in any of the six.
Manifest
- The hub validator (
test.py Pluginsat the PR head) passes. All sixIds and friendly names are new to the hub. - Each
SourceDirectoriesmatches its project'sSource/folder plus exactly theShared/*.csfiles its csproj links. Radar Tech'sScript/(the PB version), tests and other projects are left out. - No
NuGetReferencesare needed. Hush'sLib.Harmony2.4.2 isExcludeAssets="runtime", and Pulsar adds0Harmonyto plugin compilation itself.
Repository and pin provenance
- The repository is public and not a fork, licensed GPL-3.0-or-later (LICENSE plus a README statement). It is the renamed
scotlandsyard/SpaceEngineers, and the hub already uses the new name for the six #227 plugins. - The pin is
main's HEAD (comparereports identical). - Project references: game assemblies from
$(Bin64)(Private=False),Microsoft.NETFramework.ReferenceAssemblies1.0.3 (net481 build only) andLib.Harmony2.4.2 (Hush only). Radar Tech referencesHavokWrapper, but nothing uses it. The loader compile reads none of these. - Binaries and native files: none, no submodules, symlinks or LFS. The only non-text file is
Projects/Radar Tech/Script/thumb.png, a 512×512 PNG with valid chunks and no trailing data, outside everySourceDirectories. - Each
Personality.txt.csis the generated copy of itsPersonality.txt(Shared/EmbedText.targets), with no quote characters, so the text can't break out of the verbatim string.
Security
- Reflection uses only fixed names:
- Hush reads
MySoundPairfields and properties of block definitions plusMyWeaponDefinition.WeaponAmmoDatas[].ShootSound, read-only. Shared/Toolbox.csreadsMyGuiScreenTerminal.m_terminalTabs, type-checked, and leaves the tab out if the field changes.Personalityreads its own embedded constant.
- Hush reads
- Harmony (Hush): a postfix on the only
MyEntity3DSoundEmitterconstructor and a prefix on the privatePlaySoundInternal(bool, bool, bool, bool, bool?), which runs when a sound starts, not every frame. The prefix fails open. Voice chat (PlaySound(byte[])) and HUD warnings (MyGuiAudio) don't pass through it.UnpatchAll("Hush")runs on unload. - Files: settings go through
Shared/PluginStorage.csintoUserDataPath\Storage\<plugin>\, with the path checked and atomic replace. Two plugins read other files, read-only, with sanitized world names:- Digby reads Fat Albert's
PlanetNamesand OreScout's marker XML.SerializeFromXMLuses a defaultXmlReader, so DTDs are off. - Tally walks only the local blueprint folder (
MyBlueprintUtils).
- Digby reads Fat Albert's
- Mod messages:
SendModMessageis in-process only. A newFunc<string>status line (Toolbox) is called once a second while that tab is visible. Tally's SSM handler is registered only during one synchronous call. Another mod can at most change displayed text or close our window. - Chat: every chat command sets
sendToOthers = false, and the character lines go only to local chat.
Server requests
Checked against the decompiled game (1.211.017):
| Plugin | Request | Server validation | Plugin gate |
|---|---|---|---|
| Doorman | MyDoorBase.OpenRequest |
[Server(ValidationType.Access)] |
access, power, alive. No reach, see below |
| Tally | MyProductionBlock.OnAddQueueItemRequest / OnRemoveQueueItemRequest |
Access | Ownership |
access + reach (15 m or antenna), after a YES/NO confirm |
| Tally, Digby | MyInventory.ModifyDatapad |
[Server] |
own character inventory only, size limits kept |
| Quiet Skies, Digby | MyGpsCollection add / modify / delete / show-on-HUD / always-visible |
[Server], sender's own list |
5/s queue (Quiet Skies). Digby only on "As server GPS" |
| Radar Tech, Hush | none |
Radar Tech uses only IMyCameraBlock.Raycast: the angle limit, charge, range and CheckIsWorking apply. It checks EnableIngameScripts before each reading and requires a camera you have access to and within reach (Reach.cs mirrors MyReplicableRightsValidator.GetAccess). Closing speed is the hit entity's velocity, which vanilla returns too. It casts against the client's physics, which holds less than the server has.
Digby's terrain height comes from MyPlanet.GetClosestSurfacePointGlobal, which reads the procedural heightmap, not voxel storage: nothing under the surface and no ore.
Quiet Skies only acts on markers with a non-zero entity id and a game-set flag (IsGlobalEncounterGPS, IsJumpSignatureGPS, or IsContainerGPS without contract or objective). Player-made GPS have entity id 0, so they never qualify.
Findings
Doorman
Medium: closes are sent for doors out of the server's reach, so they fail validation and the doors stay open.
Doors.SkipReason checks access, power and that the character is alive, but not reach (Doors.cs#L478-L517). Then SetOpenRequest(false, OwnerId) is sent for every open door on an owned grid in sync range (L453-L455; README L12, L34). The gate was removed on purpose in 1810a1b.
MyDoorBase.OpenRequest is [Server(ValidationType.Access)]. MyReplicableRightsValidator.GetAccess passes only when the character is within 3 × DEFAULT_INTERACTIVE_DISTANCE (15 m) of a grid in the door's logical group, or when that grid is among the character's antenna-linked dependencies. Sync range is about 3 km.
So with a player 500 m from their base and no antenna link, every door a sensor, timer or faction member opens gets three refused closes (MaxSends, 3 s apart). Each one is ValidationFailed under that player's Steam ID, the list admins check. After that, the door shows "Server didn't close it" and stays open. Doorman runs with no player input and is on by default, so a busy base produces a steady stream. The server enforces reach, so this isn't a bypass. It is the same issue #227 raised for Sacrificial Stockpile Manager, and the feature as described can't work past 15 m in multiplayer.
Fix: skip doors whose grid fails the reach test, using the same rule as Radar Tech's Reach.InReachCached, which is already written for this ("every door on a grid asks"). Show "Open (out of reach)", don't count a send for those doors, and reword the README and manifest. Making auto-close opt-in, as you offered, would also help, but on its own it doesn't fix this.
Tally
Medium: Copy throws on Linux.
Text.Copy calls thread.SetApartmentState(ApartmentState.STA) outside its try block (Text.cs#L118-L137), and the button handler has no try either (TallyScreen.cs#L454-L462). On .NET 5+ under Linux, setting STA always throws PlatformNotSupportedException, and Pulsar Interim runs SE1 on Linux. The manifest doesn't restrict platforms, and the csproj comment "The game only runs on Windows" (Tally.csproj#L8-L9) is no longer true. I didn't run it, so whether this crashes the game or only fails the click is unverified.
Fix: set MyVRage.Platform.System.Clipboard directly inside a try. The game's Windows implementation already does its own STA hop. Fat Albert's ReadClipboard (#379) has the same pattern.
Low: Reach.Check returns true when it throws (Reach.cs#L63-L67). It should fail closed. Send/Undo re-check reach but not access after the confirm dialog. The docs' "the server never sees a refused request" and "Undo never touches other orders" are too strong: Undo removes by queue index from a client snapshot, the same race the vanilla terminal has.
Quiet Skies
Low: a mod or scenario marker named "Unknown Signal …" can be permanently deleted.
After a world load, MyGpsCollection.LoadGpss sets IsContainerGPS on every GPS with an entity id, including markers made by MyVisualScriptLogicProvider.AddGPSToEntity. The name path (Signals.cs#L121-L128) accepts any such marker whose name starts with the drop name. The colour fallback below it already requires the " " shape. Delete all or Keep newest would then delete that marker, which contradicts README L27. Fix: require EndsInNumber(name) on the name path too, and the drop colour where the definition is available.
Radar Tech
Low: grids beyond sync distance read as "nothing there". The range is clamped to ViewDistance (15 km by default), but a client only has grids within sync distance (3 km by default on a DS). A ship 5 km ahead gets "Nothing within 15 km" and no collision warning. The top-level README says "only measures what your game has loaded", but the plugin README (L21) and Help don't. Also, EnableRaycast isn't synced, so the charging power is drawn only in the client's simulation, not on the server as README L19 says.
Hush
Low: s_definitionSounds (Mutes.cs#L46) is keyed by definition objects and never cleared in UnloadWorld (L458-L466), so each world load keeps the previous world's definitions alive. Also, "unmuting lets the sound come back on its own" (README.md#L39) holds only for blocks that were already looping when muted. A loop that first started while muted never set Loop, so it stays silent until the block asks for a sound again.
Digby
Low: Auto takes any datapad named Dig: <depth> m under <target> as "this plan" and overwrites it without asking (Datapads.cs#L155-L175). Two plans from different starts to the same target share that name, and so does a pad a teammate gave you. Compare the start GPS line before treating it as the same plan.
Non-blocking notes
- Doorman's
Rescanwalks every owned grid's fat blocks and groups every 3 s. Radar Tech'sCameraForscans all slim blocks of the ship group every 10 ticks while the readout is on. Both are fine for normal ships, but caching the door and camera lists per grid would help on large ones. - Toolbox: mods can now register a status
Func<string>that is called without a player action (disclosed in the PR). It is in-process, sandboxed mod code that is already running, so it doesn't widen anything. A hang in it would freeze the frame. - Per-world files are still keyed by world name (carried over from #227, acknowledged).
…1 (review fixes); Doorman description: only doors in reach
|
Thanks for the thorough review. All six manifests are re-pinned to Medium
Low
Tested on Legacy and Interim (Windows), including a hub build of |
viktor-ferenczi
left a comment
There was a problem hiding this comment.
Re-review: Doorman, Radar Tech, Hush, Quiet Skies, Tally, Digby
Scope: hub PR head 1e40e1df467bc236d6b7f01931263bb881303583. All six manifests now pin 5c03cb22b33eb0cb2fd8489eb90a46d9dcdff631 of scotlandsyard/SpaceEngineersPlugins, which is main's HEAD. The previous review covered all 285 tracked paths at e31f251. This one reads the full git diff e31f251..5c03cb2 (2 commits, 25 files, +210/−36), which adds one path (Projects/Doorman/Source/Doorman/Reach.cs, 286 in total). The only change outside the six projects is Fat Albert's clipboard fix, which belongs to #379/#384.
Summary: both Mediums and all five Lows are fixed. No agent-detected blockers.
Manifest
test.py Pluginspasses at the PR head. Compared with12a266e, the only manifest changes are the six<Commit>pins and Doorman's description, which now describes the reach rule.- Doorman's
SourceDirectories(Projects/Doorman/Source/) includes the newReach.cs. No other selection changed. - No new package or project references (the two csproj edits only change a comment) and no binaries. I didn't repeat a build at
5c03cb2. Your hub build of1e9d5b1on Windows covers the code, since5c03cb2only changesAssemblyInfo.csversions on top of it.
Prior findings
| Plugin | Finding | Status |
|---|---|---|
| Doorman | Medium: closes sent for doors out of the server's reach | Fixed |
| Tally | Medium: Copy throws on Linux | Fixed |
| Tally | Low: Reach.Check fails open; no access re-check after confirm; docs overclaim |
Fixed |
| Quiet Skies | Low: name path accepts mod markers without the drop number | Fixed |
| Radar Tech | Low: sync-distance and raycast-switch wording | Fixed |
| Hush | Low: definition cache kept across worlds; loop started while muted stays silent | Fixed |
| Digby | Low: Auto overwrites any same-name plan pad | Fixed |
Doorman. SkipReason now returns "Open (out of reach)" when Reach.InReachCached fails (Doors.cs#L511-L520). A skipped door returns before Sends/ClosesSent are touched and its OpenSince is reset, so a door that comes back into reach waits its full delay again. The new Reach.cs matches Radar Tech's Reach.cs at the same pin except for the namespace and one comment line. I checked it again against MyReplicableRightsValidator.GetAccess (1.211.017): world AABB distance from each grid of the logical group ≤ DEFAULT_INTERACTIVE_DISTANCE * 3 (15 m), otherwise an antenna-linked dependency. The per-grid result is cached for 1 s and cleared in Doors.Reset. Single player and the host skip the check, like the server does. README, Help and the manifest now say the same thing.
Tally Copy. thread.TrySetApartmentState(ApartmentState.STA) (Text.cs#L133-L134). I verified this on Linux with .NET SDK 10.0.400: TrySetApartmentState(STA) returns False and the thread runs as Unknown, while SetApartmentState(STA) throws PlatformNotSupportedException. The clipboard write was already inside the thread's try. As you said, the Linux clipboard path hasn't been run in game, but a failure there is caught and logged instead of thrown.
Tally Lows. Reach.Check now returns false and gives a reason when it throws (Reach.cs#L63-L69). Send and Undo check Usable (access) again before the reach check, after the confirm (Assemblers.cs#L323-L328, L397-L401). README and Help now describe the remove-by-position race and drop "the server never sees a refused request".
Quiet Skies. EndsInNumber(name) now gates the name path (Signals.cs#L120-L126). That matches MySessionComponentContainerDropSystem, which names drops text + " " + m_containerId{Small,Large}. A marker that only starts with "Unknown Signal" no longer qualifies. One named exactly like a drop ("Unknown Signal 7") still would, but that needs a deliberate imitation, and the entity-id/flag gates still apply.
Radar Tech. README L19 and L21, and the Help text, now cover the sync-distance limit and that the raycast switch only applies in the client's copy of the ship.
Hush. s_definitionSounds.Clear() is in UnloadWorld (Mutes.cs#L465). When the prefix skips a sound, MarkLoop (Patches.cs#L66-L93) sets Loop through the private setter (AccessTools.PropertySetter, a fixed member resolved once in Apply). It uses the same condition as PlaySoundInternal (IsLoopable && !skipToEnd && CanPlayLoopSounds) without CheckForSynchronizedSounds. That difference doesn't matter: after unmute, the next PlaySoundInternal resets Loop to false and re-evaluates it in full. StopSound(cleanUp: true) clears Loop when no sound is playing, so a block that stops its loop while muted doesn't come back. If the setter call throws, it is disabled and behavior falls back to the old one. A muted loop now keeps asking to play on each emitter Update, the same as a loop that was already playing when muted. Each request costs one prefix call into Mutes.OnPlay.
Digby. Choose now reuses a same-name set only if one of its pads holds this plan's coloured start GPS line, grouping pages by SetName (which strips (n/m)) (Datapads.cs#L166-L180). Only the first page carries the start line, so this grouping is what makes the rest of the set count. Any other set is excluded from chosen, so Assign treats its name as taken and moves on to #2, #3, and so on. A later Auto run for the #2 plan finds its own set again, because IsThisPlan accepts baseName + " #" and the start line matches. Gps formats with InvariantCulture, so the comparison doesn't depend on locale. One narrow case remains: grouping is by name only, so a pad with the same set name and a different plan, received after your set was written, joins your set and gets overwritten. Digby never writes two sets with the same name, so this needs a pad from someone else.
Security (delta)
The delta adds no networking, process execution, file access, dynamic code loading or new Harmony patches. The only new reflection is Hush's fixed Loop setter. Doorman's server request is unchanged: it still sends SetOpenRequest(false, OwnerId), now for fewer doors. Earlier conclusions that depend on unchanged code still hold.
Non-blocking notes
Unchanged from the previous review: Doorman's 3 s Rescan and Radar Tech's 10-tick slim-block scan on very large grids, the Toolbox status Func<string> running on the frame, and per-world files keyed by world name.
Six more client-side plugins from the same repo (GPL-3.0), pinned at e31f251, the same pin as the update PR. Same layout as #227: each entry lists its project's
Source/folder plus exactly theShared/*.csits project links; settings go throughShared/PluginStorage.cs; nothing depends on the assembly name. All six have the Toolbox tab and Esc fix (see Shared).MyDoorBase.OpenRequestviaSetOpenRequest(Access), the terminal's own Open switch, for loaded doors (sync range); only doors you have access to, re-checked right before each close; nothing while you're dead or respawning; at most five a second, three tries per doorSendChangeShowOnHudRequest,SendChangeAlwaysVisibleRequest,SendDeleteGpsRequest([Server], no block; the player's own GPS list), the G menu's own requests, at most five a second. Jump Signatures are only hidden locally, so none is made permanentAddQueueItemRequest/RemoveQueueItemRequest(Access, Ownership);MyInventory.ModifyDatapad([Server], datapads in your own inventory only)[Server], own GPS list);ModifyDatapad(own inventory)Harmony (Hush only): compile-only reference (
Lib.Harmony 2.4.2,ExcludeAssets=runtime, Pulsar's own copy at run time);UnpatchAll("Hush")on unload. Two patches onMyEntity3DSoundEmitter: a constructor postfix (to know each emitter's block) and aPlaySoundInternalprefix that skips the sound for a muted block (fails open). The bufferedPlaySound(byte[])patch was dropped, so voice chat is never touched. Hush also readsMySoundPairfields of block definitions by reflection to find each block's sounds (read only).Mod messages: Tally sends its list to SSM's bill API (see the update PR); SSM only opens a preview.
We'd change on request: Doorman's default (opt-in), Radar Tech in multiplayer.
Shared code changed since #227 (linked by every entry; one pin for both PRs, so a fix in Shared re-pins both):
Shared/Toolbox.cs(new): a Toolbox tab in the terminal (K or I) listing our loaded plugins with an Open button. No patch: it adds the page fromMyScreenManager.BeforeScreenDraw, with page key = the game's page count, and only when the existing keys are exactly 0..N-1 (so Ctrl+Tab, Ctrl+Shift+Tab and gamepad bumpers keep working). It finds the tab control with reflection onMyGuiScreenTerminal.m_terminalTabs(null- and type-checked; fails closed, the tab is then left out).TIM_SWITmessage) can register aFunc<string>status line. While the Toolbox tab is visible, it is called about once a second on the game thread without a player action. In-process only; nothing is sent anywhere; exceptions are caught (a hang is not). Before, a mod's code ran only when the player clicked its entry.Shared/PluginSwitcher.cs: one of our windows at a time (a window opened from chat or a toolbar while another was up used to stack, so Esc closed them one by one).Shared/ListSearch.cs(new): the Find box text match.Shared/AssemblerModes.cs: assemblers without advanced functions (survival kits) are never set to Co-op.Not submitted: Tripwire, Drill Sergeant and Shipwright are in the repo but not registered; Seamless Unload Fix has left the public repo.
Known limitation carried from #227: per-world files are keyed by world name. Quiet Skies' Keep newest makes this matter a little more (same world name on two servers shares the setting); we kept it per world name on purpose.
Tests: built with 0 warnings for net481 and net10.0; our automated in-game test suite passes at e31f251 on Pulsar Legacy and Interim against game 1.211.017 (Warfare 3), including a Ctrl+Tab check of the Toolbox tab; and again after the push as hub builds (Pulsar compiling e31f251 from GitHub through a local hub source) on both loaders. Windows only; Linux not tested. Reach-gated paths can't be exercised in single player and were checked by a multiplayer hand test only where noted.
🤖 Generated with Claude Code