branchrust_reboot/main/item_poolingcancel
12 Commits over 0 Days - ∞cph!
Update: ItemManager is available on the client
- Like server, ticks in the background and cleans up items
- when creating/loading items can optionally specify whether it's client-side or server-side item (checked in exclusive modes)
- Made EnablePooling a replicated var, it disables clientside effects
We have a bunch of client-side item allocations that we don't correctly clean up - this will help deal with that.
Tests: built all modes in editor
Bugfix: don't leak an item if creation request was invalid
Tests: none, trivial change
Bugfix: don't create and access a dangling Item when Pooling is enabled
- at the same time it also optimizes inventory processing by batching the update as a result of multiple equipment events.
Tests: Tested by loadinga a save that borked the inventory by spawning NPCs - passed. Also validated that in multiplayer, wearables update when the player sleeps if they got changed by a different player.
Update: adding a server "itemmanager.enablepooling" convar to control item pooling
- starts off by default
Item pooling is too unstable to not have a dynamic switch - already got bit 2 times by it. Who knows what other horrors are hiding out there.
Tests: enabled after loading craggy, gave an ak - saw an uptick in pool.print_memory telemetry. disabled, despawned ak - no changes in telemetry.
Bugfix: disabling Item pooling
This causes issues on the server which prevents playing.
Tests: loaded a save that consistently produced exceptions - not anymore.
Merge: from main
Tests: none
Merge: from main
Tests: none (no conflicts)
Bugfix: Don't throw when cancelling partially finished crafting queue work item
Tests: Got 2 stacks of 300wood, scheduled 2 single doors as a single crafting operation, cancelled after first door crafted - no exceptions
Bugfix: avoid sending consumed-0 telemetry events when crafting
Tests: Had a queue of 2 items with perfect resource allocation - hit breakpoint once on first item craft instead of twice as before
Merge: from main
Tests: none
Update: Bringing back Item pooling
- Added a couple extra fields that were missed
Still need to reproduce the NRE we encountered earlier.
Tests: built all modes in editor. Spawned an AK, put an ext-mag on it, threw away to despawn, spawned a new one - didn't have attachments
Merge: from main
Tests: default editor build