Repository navigation
Add Protogen Systems Docking Solutions - #361
viktor-ferenczi merged 4 commits into
Conversation
viktor-ferenczi
left a comment
There was a problem hiding this comment.
Review: Protogen Systems Docking Solutions (new registration)
Scope: hub PR head f538f31b1bfc8735806b49eb6e2368cdf275d7df, manifest Plugins/ProtogenDockingSolutions.xml, source ryancrimsonrd-ux/ProtogenDockingSolutions@4b20829 (version 1.2.0). Full-repository review: I accounted for all 75 tracked paths. The hub compiles ClientPlugin (15 .cs) and Shared (11 .cs), 6,713 lines in total.
Summary: One Medium fairness finding: the dock camera's spot can be moved anywhere through the settings file and is never kept out of other grids or voxels, which turns it into a free camera in survival. One Low filesystem finding. Security otherwise looks clean: no network, no process launch, no assembly loading, no binaries.
Manifest
GitHubPluginwith a GUIDId,RepoId,SourceDirectoriesClientPlugin+Shared,RuntimesCLR,CoreCLR, and noNuGetReferences.python3 test.py Plugins/at the PR head:All files validated. No other hub entry uses thisId.Api/(the copy-me client for other mods),Tests/,Tools/and the PowerShell scripts are outsideSourceDirectories, so the hub doesn't compile them.ClientPlugindoesn't depend onApi/.- The repository's own
ProtogenDockingSolutions.xmlmatches the hub entry, apart from its placeholder<Commit>and the comments.
Repository and pin provenance
- Public, MIT, created 2026-11-15.
4b20829is the currentmainHEAD (comparereportsidentical). There are no tags yet. - No submodules, symlinks, LFS objects, archives, DLLs or native files. The 31 images under
Tests/are well-formed PNG/JPEG files with nothing appended after the image data. They are generated test previews and are not compiled or loaded. ClientPlugin.csprojreferences game DLLs from$(Bin64)withPrivate=false, plusLib.Harmony2.4.2 (Pulsar supplies Harmony) andKrafs.Publicizer2.3.0 (local builds only). The hub path doesn't read either package reference. It publicizesVRage.RenderandVRage.Render11from theIgnoresAccessChecksToattributes inGameAssembliesToPublicize.cs, which also defines the attribute class whenLOCAL_BUILDisn't set.
Security
- Not present in the compiled sources: network access, process launch, assembly loading, P/Invoke, encoded payloads, self-update.
Shared/uses onlySystemand is pure geometry and drawing. - Files: only
Storage/ProtogenDockingSolutions/DockingSolutions.iniunder the game's user data path, which is read and written as text byDockConfig(see finding 2 for its fallback path). - Reflection: fixed member names only. I checked each one against decompiled SE 1.211.017:
MyCockpit's explicitIMyCameraController.ControlCamera/HandleUse,MyTextSurfaceScriptFactory.m_scripts,MyShipConnector.m_connectorMode,MyDefinitionManagerBase.m_definitions,MyDefinitionManager.DefinitionSet.m_definitionsById, andMyTextPanelComponent.Render/m_area/m_textureSize/m_screenAspectRatio/m_renderLayers.System.Reflection.Emitis used only forOpCodesin the depth-stencil transpiler. - Renderer hooks (
DockPip.Init): a reverse patch ofMyRender11.DrawGameScenere-renders the scene into the plugin's own textures. The postfix and the skip prefixes only act whileDrawingis set.RenderScenesaves and restores the camera, resolution and debug overrides in afinally. TheCreateDepthStenciltranspiler lets the depth-stencil pool grow instead of returning null, and it does so for the whole session, not only while the PiP is on. - Mod API:
SendModMessage/RegisterMessageHandlerstay inside the client process. Any client-side mod can callCommand,SetThemeandSetOffsetand so change the saved settings.SetOffsetgoes through the clamp inDockTrack.SetOffset. - Multiplayer: nothing is sent to the server. Moving the main camera doesn't change replication, because while you sit in a seat,
MyClientState.WriteSharedreports only the controlled entity's id. The server uses a spectator position only from a player with creative rights. The Docking Assist LCD script id is saved on the block and shows blank to players without the plugin, as the README says.
From-source build
I compiled the 26 ClientPlugin + Shared files with the installed Pulsar Compiler process (Pulsar 013a108 RoslynCompiler, C# 14) over its IPC protocol. References were the SpaceEngineers*/VRage*/Sandbox*/ProtoBuf* DLLs from SE 1.211.017 Bin64 and Harmony 2.4.2, the same list Pulsar passes.
- Interim flags
TRACE;NETCOREAPP;LINUX;PULSARwith the .NET 10.0.11 runtime: Release and Debug succeed, 0 errors. The compiler log showsUsing publicized VRage.RenderandVRage.Render11. - Legacy flags
TRACE;NETFRAMEWORK;PULSARwith the net48 reference assemblies: Release and Debug succeed, 0 errors.
I didn't load the plugin in a game.
Findings
1. Medium: the dock camera's spot is unbounded from the settings file and passes through other grids and voxels, so it works as a free camera in survival.
DockTrack.SetOffset clamps /dock offset to −2..20 m forward and ±10 m up/right. But DockSettings.Parse keeps DockCamOffsets exactly as written (DockSettings.cs#L153), and DockTrack.Offsets applies the parsed numbers unclamped in Frame. DockConfig.Poll reloads the file within a second of an edit. A line such as DockCamOffsets=<connectorId>:2000:0:0 therefore puts the full-screen dock camera, the PiP and the LCD feeds 2 km ahead of the ship, aimed by turning the ship. That is a spectator camera on servers that disable spectator. Even inside the clamp, nothing keeps the spot out of other entities. Park the connector against another ship or an asteroid with a few metres of offset and the camera sits inside it, showing the interior. Vanilla's third-person camera raycasts against occluders to prevent that (MyThirdPersonSpectator.RaycastOccludingObjects). The client only shows entities it already has, so this isn't a server-authority bypass. It does give views that no vanilla view gives in survival.
Fix: apply the SetOffset limits when the offsets are parsed, in Offsets() or Parse. Then pull the spot back to the first hit along the segment from the connector face to the offset position, using MyPhysics.CastRay and ignoring your own mechanical group. Tradeoff: a moved camera stops short of whatever is in the way, which is also what keeps it docking-only.
2. Low: the settings folder can fall back to %AppData%\SpaceEngineers.
DockConfig.Folder uses Environment.GetFolderPath(SpecialFolder.ApplicationData) when MyFileSystem.UserDataPath is empty. EnsureLoaded returns early in that case, but Change still calls Save, which would write there. The game supports -appdata, so that would be the wrong folder. It's unlikely to be reached in practice. Please drop the fallback and skip saving until UserDataPath is set.
Non-blocking notes
- The PR description still says 1.1.0 and commit
45b02ff. The manifest pins4b20829(1.2.0). - The hub description names "Protogen Systems - Virtual Displays" as an API user. That plugin isn't on PluginHub, so players can't install it from there.
|
Thanks for the thorough review. Both findings are fixed in 9778cce, which the manifest now pins:
I also dropped the Virtual Displays mention from the hub description and updated the PR description to 1.2.0 and the new commit. |
|
Updated to 1.2.1 ( |
viktor-ferenczi
left a comment
There was a problem hiding this comment.
Re-review: Protogen Systems Docking Solutions (new registration)
Scope: hub PR head 91d8f165da983b6ff91d34923d183031b06b4dd2, manifest Plugins/ProtogenDockingSolutions.xml, source ryancrimsonrd-ux/ProtogenDockingSolutions@c92d2a6 (version 1.2.1). My last review covered hub head f538f31b with source 4b20829. The tree at c92d2a6 has 76 tracked paths. Compared with 4b20829, 16 paths changed (+251/−25), one of them new (ClientPlugin/PlayGuard.cs), and the other 60 are byte-identical. I read every changed file in full. The hub compiles 16 ClientPlugin and 11 Shared .cs files.
Summary: Both earlier findings are fixed. The 1.2.1 additions only switch the plugin off or rebuild objects; they add no new authority, network, file or process access. No agent-detected blockers.
Earlier findings
1. Medium, dock camera spot unbounded and passing through obstacles: fixed.
DockSettings.ClampOffsetholds the limits (−2..20 m forward, ±10 m up/right, non-finite → 0). Both the settings-file path (Offsets, L363) andSetOffset(L385) go through it, andOffset()reads only fromOffsets().DockCamOffsets=<id>:2000:0:0now ends up at 20 m. The Tests project checks the clamp.DockTrack.Framepasses the final spot throughUnblocked, which casts from the connector's constraint point to the spot on layer 30 (CollisionLayerWithoutCharacter) and stops 0.25 m short of the first hit. Your own grid and its mechanical group don't count. In SE 1.211.017,MyPhysicsdisables layer 30 only against characters and layers 5, 6, 19 and 31, so other grids and voxels block the ray. Every consumer takes the spot fromFrame/FrameFor: the full-screen camera,DockCam.Draw, the PiP, the LCD feed,DockScreensand the API'sCameraFrame.- Threading: every
Framecaller runs on the game thread (theControlCamerapostfix, the gameplay-screen draw postfix, and LCD scriptRunfromMyTextPanelComponent.UpdateSpritesTexture). The render-thread hooks only use the matrices computed there, soCastRaynever runs on the render thread. Each call is one short ray of at most about 25 m, a few times a frame. - What's left: a camera up to 20 m out in free space, stopped by obstacles. That's within what vanilla's third-person camera shows, so I have no remaining fairness concern.
2. Low, %AppData% fallback: fixed. DockConfig.Folder is null until MyFileSystem.UserDataPath is set. Until then Save only marks the settings dirty. Neither SpecialFolder nor GetFolderPath appears anywhere in the repository now.
1.2.1 additions
PlayGuardpauses the plugin for creative tools, anyAdminSettingsflag, an openMyGuiScreenAdminMenu, the spectator camera, and, in multiplayer, after 30 s without keyboard, mouse or controller input. It only reads local input and session state. If the check throws, the plugin stays paused. While paused,Plugin.Updatestops the camera and clears the PiP, then returns early. TheControlCamerapostfix, the draw postfixes and the render-scene postfix return before doing anything, so no extra scene is rendered. The LCD script draws only a "paused" line, and the commands, toolbar actions and the API's frame and draw calls do nothing. Each update iterates over the cached joystick enum arrays and checks the screen stack, which is cheap.- Toolbar actions per world:
DockActions.Unregisternow clears the list, andRegistercreates freshIMyTerminalActionobjects in the next world'sBeforeStart. Toolbar slots refer to the action ids, which haven't changed. That matches your explanation of the Build Info crash. I didn't reproduce the crash. Release-PluginHub.ps1can now open the hub PR withgh. It's a developer tool outsideSourceDirectories, its only external calls aregh auth statusandgh pr create, and it isn't compiled or shipped.
Repository, manifest and build
-
Repository public, MIT, no tags.
mainis one commit ahead of the pin (d145a4b), and that commit only editsIN-GAME-TESTS.md. Still no submodules, symlinks, LFS objects, DLLs or native files. -
Manifest is unchanged apart from the pin and the shorter description (Virtual Displays mention dropped).
python3 -I test.py Plugins/at91d8f165:All files validated. No other entry uses thisId. The repository's backup manifest matches the hub entry apart from line wrapping and its placeholder<Commit>. -
From-source build: the 27 selected files compile with the installed Pulsar
Compilerprocess (Pulsar013a108RoslynCompiler, C# 14) over its IPC protocol. References are SE1Bin64(Steam build 26329893)SpaceEngineers*/VRage*/Sandbox*/ProtoBuf*plus Pulsar's common list:- Interim (
TRACE;NETCOREAPP;LINUX;PULSAR, .NET 10.0.11): Release and Debug succeed with 0 errors. The log showsUsing publicized VRage.RenderandVRage.Render11. - Legacy (
TRACE;NETFRAMEWORK;PULSAR, net48 reference assemblies, Harmony 2.4.2 net48): Release and Debug succeed with 0 errors.
I didn't load the plugin in a game.
- Interim (
Non-blocking notes
- The PR description still says 1.2.0 and commit
9778cce. The manifest pinsc92d2a6(1.2.1).
Adds Protogen Systems Docking Solutions 1.2.1, a client plugin that helps with docking: a full-screen dock camera on the connector's face with guidance, a movable picture-in-picture dock camera, and the "DOCK - Docking Assist" LCD script. It also offers a mod message API so other plugins and mods can show the docking pictures.
🤖 Generated with Claude Code