You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Add managed recycler state and lifecycle API #297
Add a managed registry and read-only wrapper for the native world recycler.
The initial surface should expose:
discovery of active recyclers;
a managed recycler-state enum;
hatch-open state;
processing-started and processing-stopped events;
position/GameObject access;
optional authority-safe interaction methods only where they can reuse the native flow.
Why would this help?
Trash and economy mods can now use S1API trash containers and trash creation, but observing the native ScheduleOne.ObjectScripts.Recycler still requires game types or Harmony patches. A small wrapper would support cleanup quests, status UI, automation feedback, and world-event integrations.
Extra Context (Optional)
Keep payout replacement, cash spawning, custom recycler prefabs, replacement UI, and direct RPC access out of the first version. Do not expose the recycler's internal UI, animation, audio, or collider components as public API.
Validate state/event transitions, authority behavior, scene reload, and stale-wrapper cleanup separately on Mono and IL2CPP.
The issue is actionable and needs no rewrite. Plan a read-only S1API.Trash.Recycler wrapper and RecyclerRegistry with direct state, hatch, position, and GameObject access, plus registry-level ProcessingStarted and ProcessingStopped events bridged from native UnityEvents. Do not expose SendState, payout, cash, internal UI, or interaction methods until Mono and IL2CPP runtime evidence proves safe native forwarding. Native declarations match, but method bodies and serialized recycler prefabs are unavailable, so event timing, eligibility rules, and late-instantiation behavior require human validation.
Recommended next steps
Place the API in S1API.Trash as RecyclerState, Recycler, and RecyclerRegistry. Use RecyclerRegistry.GetAll() for an immutable active-object snapshot and cache wrappers by native GetInstanceID within a scene.
Forward State, IsHatchOpen, transform.position, and gameObject directly through the native component. Keep the wrapper sealed, internally constructed, and free of native types, setters, UI, animation, audio, collider, payout, and cash members.
Bridge native onStart and onStop to registry-level Action events using the existing cross-runtime event path. Keep SendState and other mutating entry points private to the wrapper; add an interaction method only after native guard and authority behavior are verified on both runtimes.
Open questions
Does native onStart fire after State becomes Processing, and does onStop fire before or after the final state change? Verify the ordering before documenting event guarantees.
Should registration use Start, Awake, or another runtime seam to catch every active and late-instantiated recycler without observing partially initialized UnityEvents?
Do HandleInteracted or ButtonInteracted preserve all native player, eligibility, and server-authority checks when called through a managed wrapper? If not proven, omit interaction methods from v1.
Evidence and validation
Evidence inspected
GitHub issue [FEATURE] Add managed recycler state and lifecycle API #297 defines active-recycler discovery, managed state, hatch state, processing lifecycle events, position/GameObject access, and explicit exclusions for payout, cash, prefabs, UI, animation, audio, colliders, and direct RPC access.
The alternate and alternate-beta Recycler declarations are byte-identical. Both expose EState values HatchClosed, HatchOpen, and Processing; State; IsHatchOpen; UnityEvent onStart/onStop; public HandleInteracted, ButtonInteracted, CashInteracted, and SendState; and private Process, SetState, SetHatchOpen, and OnDestroy members.
S1API.Casino.CasinoGameRegistry and S1API.Audio.JukeboxManager establish active-scene discovery, immutable snapshots, instance-ID wrapper caching, and scene cleanup. S1API.Trash.TrashContainer establishes the existing Trash namespace and cross-runtime Unity event handling patterns.
AssetRipper path search found recycler animation clips and materials but no recycler prefab or scene YAML. Searches found no Recycler references under the stripped persistence sources, so persistence remains unconfirmed rather than an API requirement.
Validation performed
Read the repository AGENTS.md, CONTRIBUTING.md, and CODING_STANDARDS.md instructions.
Read the schedule-one-modding, review-issue, and human-writing guidance required for this investigation.
Inspected the existing Casino, Jukebox, TrashContainer, GameLifecycle, and scene-cleanup implementations and tests in the checkout. No repository files were modified; the working tree remains clean. Compared the alternate and alternate-beta Recycler declarations and searched the private AssetRipper corpus for recycler assets and serialized event data.
Runtime validation remaining
No build or unit test was run because this request is investigation and planning only.
Run the documented MonoMelon and Il2CppMelon restore, build, and test commands after implementation.
Run DocFX, the 80% public API documentation coverage check, and ApiCompat against the exact target branch.
Human validation is still required in a live Schedule One environment for native event ordering, processing eligibility, authority behavior, scene reload, stale-wrapper cleanup, and late-instantiated recyclers on both Mono and IL2CPP. Confirm whether recycler state is entirely scene-owned during save/load before documenting that boundary.
Create a pull request to implement this plan and close this issue when merged.
Activity
ifBars commentedon Sep 2, 2026
@Diffuin Research this and create an implementation plan
diffuin commentedon Sep 2, 2026
Issue investigation
Confidence: Medium
The issue is actionable and needs no rewrite. Plan a read-only S1API.Trash.Recycler wrapper and RecyclerRegistry with direct state, hatch, position, and GameObject access, plus registry-level ProcessingStarted and ProcessingStopped events bridged from native UnityEvents. Do not expose SendState, payout, cash, internal UI, or interaction methods until Mono and IL2CPP runtime evidence proves safe native forwarding. Native declarations match, but method bodies and serialized recycler prefabs are unavailable, so event timing, eligibility rules, and late-instantiation behavior require human validation.
Recommended next steps
Open questions
Evidence and validation
Evidence inspected
Validation performed
Runtime validation remaining
Diffuin run details
codexgpt-5.6-lunaxhigh(Luna advisor: complexity (high); baseline coupled source-backed request)01a06014-a13b-7fb1-b4c0-8e7a03052ef0AI notice: Generated with AI assistance and not guaranteed accurate. Verify findings and plans against the current source and runtime.
diffuin commentedon Oct 14, 2026
I opened #363