Skip to content

Dlc multiplayer maintenance#386

Open
JiangNanGenius wants to merge 12 commits into
onimp:mainfrom
JiangNanGenius:dlc-multiplayer-maintenance
Open

Dlc multiplayer maintenance#386
JiangNanGenius wants to merge 12 commits into
onimp:mainfrom
JiangNanGenius:dlc-multiplayer-maintenance

Conversation

@JiangNanGenius

Copy link
Copy Markdown

No description provided.

zed-assistant Bot and others added 12 commits March 19, 2026 17:25
Port the mod to compile against the latest ONI game DLLs (build 21518087).
API changes addressed:
- KObject.GetEventSystem() now returns bool with out parameter
- AccessControl.DefaultPermission → SetDefaultPermission
- SkillListable removed, replaced with IListableOption
- Chore.GetSMI() moved to protected StandardChoreBase, use reflection
- SafeCellMonitor type hierarchy changed (Def instead of object)
- ScheduleGroup constructor gained Color parameter
- PauseScreen.OnQuitConfirm() requires bool saveFirst
- Chore.addToDailyReport/reportType → GetReportType()
- DevTool/DevPanel/DevToolManager not available, excluded via csproj
Adapt test code to ONI API changes:
- PathProber is now static, remove AddComponent<PathProber>()
- Worker renamed to StandardWorker
- MinionConfig.MINION_NAV_GRID_NAME moved to TUNING.DUPLICANTSTATS
…t.Sdk)

Enable dotnet test execution by adding required NuGet packages and
IsTestProject property. Tests now run: 70 pass, 335 fail due to
HarmonyLib mprotect EACCES on macOS ARM64 (W^X security restriction).
Bump OniMinimumSupportedBuild from 577063 to 21518087 to match
the game version this PR was compiled against.
- SensorsPatch: prevent Sensors.Add() from calling sensor.Update() immediately,
  which crashed MingleCellSensor, ClosestEdibleSensor etc. during minion setup
- ScheduleManager: add to test setup so MingleCellSensor.IsAllowed() doesn't NPE
- ChoreConsumerStatePatch: null-safe Schedule resolution in constructor (game
  code bug: GetSchedule() can return null but ctor doesn't check)
- MinionIdentityPatch: suppress Debug.LogError during OnSpawn when Personality
  DB is empty (test environment has no personality data)
- AbstractChoreTest DI: inject ChoreExtensions dependency (was missing,
  causing NPE in chore.Register())
- PlayableGameTest TearDown: comprehensive singleton cleanup (~30 singletons)
  to prevent cross-test contamination
- Unity mock patches: SystemInfo.processorCount, MonoBehaviour stubs,
  Object companion registration
- ChoresPatcher: fix Chore constructor access (became protected),
  handle abstract Cleanup method
…ssion

- Add TestPersonalitiesCsv constant with valid personality entry ("TestDupe")
- Set MinionIdentity.personalityResourceId to match test personality
- Remove MinionIdentityPatch (SuppressErrors hack no longer needed)
- Revert DebugLogHandlerPatch to original behavior (always throw on LogError)
- Revert unnecessary whitespace change in BehaviourPatch
* Fix build compatibility with current ONI version

Port the mod to compile against the latest ONI game DLLs (build 21518087).
API changes addressed:
- KObject.GetEventSystem() now returns bool with out parameter
- AccessControl.DefaultPermission → SetDefaultPermission
- SkillListable removed, replaced with IListableOption
- Chore.GetSMI() moved to protected StandardChoreBase, use reflection
- SafeCellMonitor type hierarchy changed (Def instead of object)
- ScheduleGroup constructor gained Color parameter
- PauseScreen.OnQuitConfirm() requires bool saveFirst
- Chore.addToDailyReport/reportType → GetReportType()
- DevTool/DevPanel/DevToolManager not available, excluded via csproj

* Fix test project build compatibility with current ONI version

Adapt test code to ONI API changes:
- PathProber is now static, remove AddComponent<PathProber>()
- Worker renamed to StandardWorker
- MinionConfig.MINION_NAV_GRID_NAME moved to TUNING.DUPLICANTSTATS

* Add test runner infrastructure (NUnit3TestAdapter + Microsoft.NET.Test.Sdk)

Enable dotnet test execution by adding required NuGet packages and
IsTestProject property. Tests now run: 70 pass, 335 fail due to
HarmonyLib mprotect EACCES on macOS ARM64 (W^X security restriction).

* Update minimum supported game build to current version

Bump OniMinimumSupportedBuild from 577063 to 21518087 to match
the game version this PR was compiled against.

* Fix test infrastructure: 116->331 passing tests (300->85 failures)

- SensorsPatch: prevent Sensors.Add() from calling sensor.Update() immediately,
  which crashed MingleCellSensor, ClosestEdibleSensor etc. during minion setup
- ScheduleManager: add to test setup so MingleCellSensor.IsAllowed() doesn't NPE
- ChoreConsumerStatePatch: null-safe Schedule resolution in constructor (game
  code bug: GetSchedule() can return null but ctor doesn't check)
- MinionIdentityPatch: suppress Debug.LogError during OnSpawn when Personality
  DB is empty (test environment has no personality data)
- AbstractChoreTest DI: inject ChoreExtensions dependency (was missing,
  causing NPE in chore.Register())
- PlayableGameTest TearDown: comprehensive singleton cleanup (~30 singletons)
  to prevent cross-test contamination
- Unity mock patches: SystemInfo.processorCount, MonoBehaviour stubs,
  Object companion registration
- ChoresPatcher: fix Chore constructor access (became protected),
  handle abstract Cleanup method

* Fix personality lookup: provide test CSV data instead of error suppression

- Add TestPersonalitiesCsv constant with valid personality entry ("TestDupe")
- Set MinionIdentity.personalityResourceId to match test personality
- Remove MinionIdentityPatch (SuppressErrors hack no longer needed)
- Revert DebugLogHandlerPatch to original behavior (always throw on LogError)
- Revert unnecessary whitespace change in BehaviourPatch

* Add DedicatedServer with web visualizer (React + TypeScript + Vite)

- .NET 4.8 console app with HttpListener web server
- Mock world state: 64x64 grid with ONI elements, temperature, mass
- React + TypeScript + Vite frontend with Canvas 2D renderer
- Three overlay modes: elements, temperature, mass
- Zoom, pan, cell tooltips, entity markers
- API endpoints: /api/world, /api/entities, /api/state
- Vite proxies /api to backend in dev, builds to wwwroot for production
- Skip AssemblyExposure for DedicatedServer project
- Add /decompiled/ to .gitignore (game IP protection)

* Add visualizer screenshot for PR onimp#384

* fix: address PR onimp#384 review comments

- Remove compiled wwwroot/assets/ from git (add to .gitignore)
- Update web-client README with actual project description

* fix: remove screenshot from repo (keep in PR description only)

---------

Co-authored-by: zed-assistant[bot] <268705864+zed-assistant[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant