Repository navigation
Shared container storage and server-tracked dropped items - #926
Closed
gherman7755 wants to merge 2 commits into
Closed
gherman7755 wants to merge 2 commits into
gherman7755 wants to merge 2 commits into
Conversation
Container inventories used to be dropped from the server as soon as the last player left a cell. The next player to enter then registered their own local copy as the truth, so items another player had stored were wiped, most noticeably when the host entered after a guest had used a chest. - Keep container entities alive for the whole server session, only doors are still dropped when a cell empties. - Player home (NoResetZone) chests merge each player's local contents into the server state the first time that player sees them, and players already in the cell receive the added items. bSyncPlayerHomes now defaults to true. - Never store negative entries in container inventories on the server. - Client: dedupe object entities by form id and clear them on disconnect, so inventory changes are no longer sent with a stale server id and dropped.
Item drops were an opt-in experiment (bEnableItemDrops, off by default) because every client created its own unrelated copy of a dropped item, so it could be picked up once per player and duplicated. Dropped items are now tracked by a new DroppedItemService on both sides: - The dropping client waits for the item to come to rest and reports its cell and position; the server gives it an id and sends it to players in range, and to anyone entering that area later. - Other clients place their copy at the same position and map it to the id. - Pickups go through the server: the first request wins, everyone else's copy is removed, and a player who lost the race has the item taken back. - uMaxDroppedItems caps how many dropped items the server remembers. - bEnableItemDrops now defaults to true. Also give the game an explicit drop location for local actors. Without one, single items dropped by the player sometimes ended up near the world origin instead of in front of them. Adds encoding tests for the new messages and the container merge helpers.
Collaborator
|
Hi. I'm already working on item drops #913 Please write PR descriptions by hand instead of using ai, and discuss submitting such big changes with the team first in our discord |
Collaborator
|
Sorry, closing for the following reasons:
You're still welcome to contribute (and use AI too, we don't mind), just pick a small-scope task. We will soon have AGENTS.md that should help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two long-standing issues when playing together:
bEnableItemDropsbut was off by default because each client created an unrelated copy, so a dropped item could be picked up once per player.Changes
Containers (first commit)
Inventory::MergeMissing), and players already in the cell receive the added entries.bSyncPlayerHomesnow defaults totrue.AddOrRemoveEntryClamped).Dropped items (second commit)
DroppedItemServiceon client and server, plusDropItemRequest/DropItemResponse,NotifyDroppedItems,NotifyDroppedItemRemoved,PickupDroppedItemRequest/PickupDroppedItemResponse.uMaxDroppedItems(default 1000) caps how many dropped items the server tracks.bEnableItemDropsnow defaults totrue.Droprelay throughNotifyInventoryChangesis no longer used; the item simply leaves the dropper's inventory there.HookDropObjectnow passes an explicit location in front of local actors when the game provides none. Without it, single items dropped by the player sometimes landed near the world origin instead of in front of them.Testing
TPTestspass, including new round-trip tests for the messages and tests for the merge/clamp helpers.Notes / open points
STServer.inifiles keep their old values forbEnableItemDrops/bSyncPlayerHomes.