adding non-standard server option 'fix_chest_missing_inventory_window' to fix chest bug #3134
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.
This is a relatively simple server modification to fix a bug in acclient / odd network protocol. It does some very non-standard things with ObjectDescriptionFlags.Openable for Chests though.
Repro steps:
Expected:
Chest opens, and chest inventory window is displayed
Actual:
Chest opens, but no chest inventory window is displayed. Effectively wastes a key for the player
acclient:
ClientUISystem::OnViewContents:
When R is pressed before the unlock sound is heard, requestGroundObject == 0. Normally, this should be the id of the chest, ie. when R is pressed after the unlock sound
Tracing backwards, in ItemHolder::AttemptSetGroundObject:
pwd._bitfield & 1 is ObjectDescriptionFlags.Openable. If the chest is locked, the client automatically displays the message "The chest is locked", but then continues to send the request to the server to open the chest (presumably so the server can play the 'locked' sound)
This bug happens in the small window of time when there is a state difference for PropertyBool.IsLocked for the chest, between the client and the server. After the server has sent PropertyBool.IsLocked=false, but before the client has received it. If the client still thinks the chest is locked, but then the request to open it on the server succeeds (server state is unlocked, unlock state not yet received by client), it results in this bug.
Tracing the usage of ObjectDescriptionFlags.Openable in acclient, I haven't seen it used for much directly, aside from displaying this message automatically on the client. The client automatically updates its version of ObjectDescriptionFlags.Openable when it receives a PropertyBool.IsLocked update from the server, so that has been suppressed. However, when appraising the chest, it still correctly shows the 'Locked' status message, as PropertyBool.IsLocked can still be sent in the Appraisal properties, without the client updating the ObjectDescriptionFlags.
I have seen no anomalies from this patch yet. The only issue is that it goes off course for ObjectDescriptionFlags.Openable for chests. Other than that, I have seen no side effects in-game yet.
This is a non-standard server option, and not recommended generally.