Skip to content

Add managed trash container state and event APIs - #284

Merged
ifBars merged 2 commits into
stablefrom
diffuin/240-348c2029
Aug 16, 2026
Merged

Add managed trash container state and event APIs#284
ifBars merged 2 commits into
stablefrom
diffuin/240-348c2029

Conversation

@diffuin

@diffuin diffuin Bot commented Aug 16, 2026

Copy link
Copy Markdown

Closes #240.

Summary

  • add a managed TrashContainer wrapper for existing native containers
  • expose capacity, current and normalized level, immutable content snapshots, eligibility, direct lookup, and scene enumeration
  • forward trash-added and level-changed events with duplicate and cross-wrapper unsubscribe semantics
  • gate TryBagTrash on server authority and native eligibility, then use the native replicated bagging path
  • keep custom-container persistence and replacement replication out of scope

Review repairs

  • track native event registrations per native container instead of per wrapper, preventing abandoned wrappers from retaining listeners and allowing removal through a separately obtained wrapper
  • preserve one-at-a-time removal for duplicate subscriptions
  • use runtime-native Unity delegate identity on IL2CPP while retaining the established Mono event bridge
  • add managed API-shape and immutability contract coverage

Validation

  • MonoMelon build: 0 warnings, 0 errors
  • Mono contract suite: 662 passed
  • Il2CppMelon build: 0 warnings, 0 errors
  • IL2CPP contract suite: 648 passed
  • DocFX: succeeded; public API documentation coverage 81.84% (minimum 80%)
  • git diff --check: clean

In-game Mono

Passed on Schedule I 0.4.6f13 Alternate using a copied disposable completed save. Verified direct lookup, no hierarchy fallback, active/inactive enumeration, duplicate and cross-wrapper removal for both events, immutable snapshots, live off-server rejection, authoritative bagging, level-change forwarding, and native clearing.

In-game IL2CPP

Passed on Schedule I 0.4.6f13 using a copied disposable completed save. Verified direct lookup, no hierarchy fallback, active/inactive enumeration, duplicate and cross-wrapper removal for both events, immutable snapshots, authoritative bagging, level-change forwarding, and native clearing. The non-server branch is source-gated by InstanceFinder.IsServer; the live non-server rejection was exercised in Mono before world load.

Both game installations were restored after testing, no probe remained installed, and the source save fixtures were not modified.

Compatibility

Additive public API only. No existing source, binary, save, or network payload contract is changed. Bagging delegates to the native server-authoritative implementation.

@ifBars ifBars added this to the v3.2.0 milestone Aug 16, 2026
@ifBars ifBars self-assigned this Aug 16, 2026
@ifBars ifBars added the enhancement New feature or request label Aug 16, 2026
@ifBars
ifBars merged commit 29273ad into stable Aug 16, 2026
6 checks passed
@ifBars
ifBars deleted the diffuin/240-348c2029 branch August 16, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add trash container state and event APIs

1 participant