Merge uploads by the components they were serialized with

The controller merged uploads using the uploading instance's current config. An upload serialized under different settings, for example one sent from the save right after an admin turned on sync_inventories and restarted the instance, was then merged as if it held a character and wiped the stored one. Uploads now carry the components they were serialized with, the controller merges by those and drops the key before storing.

The scenario keeps the components a player's synced session started with and serializes their upload with them, so changing the options while a player is online takes effect the next time they join. A player whose session lacks a component that is now synced downloads again even if the generation matches. Downloads snapshot the components when they start, so a change during a download can't mix two sets.

A failed acquire unsyncs the player again regardless of the inventories setting, as before this branch.

The god and dead player inventories move from the inventories component to the controller one, matching what the scenario syncs, which removes the special case in mergePlayerData.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-17 15:25:06 +00:00
1 parent 8487c6d923
commit b0e07ea73b
11 files changed
+150 -58

No files matched your search

+5 -3
View File
@@ -55,6 +55,8 @@ Should an error occur during this process the player is given the option to use
Instances can leave parts of the player out of the sync with the `player_sync.sync_*` options below.
A part which is not synced is left as it is when the player joins, and the instance's copy of it is not uploaded, so the stored copy from other instances stays as it was.
A player online when the options change keeps the old ones until they leave and join again, and a part that was turned on is downloaded when they join.
Turning off `player_sync.sync_inventories` leaves the items players have on the instance in place while the stored inventory still holds them too.
Communication between the server and instance goes over stdout or rcon, depending on the size of the data.
Communication between the instance and the controller goes over websockets.
@@ -83,7 +85,7 @@ Defaults to `1000`.
### player_sync.sync_controller
Sync whether the player is a character, god or spectator, their respawn timer and cheat mode.
Sync whether the player is a character, god or spectator, their respawn timer, cheat mode, the god inventory and the inventory filters of a dead player.
Switching controller can destroy the character holding the inventory, so this only takes effect while `player_sync.sync_inventories` is also enabled.
Defaults to `true`.
@@ -102,8 +104,8 @@ Defaults to `true`.
### player_sync.sync_inventories
Sync the character and god inventories, the character bonuses and the crafting queue.
While the controller is not synced only the inventory of a character is synced, a player without a character keeps the inventory they have on the instance and does not change the stored one.
Sync the character inventories, the character bonuses and the crafting queue.
While the controller is not synced a player without a character keeps what they have on the instance and does not change the stored character.
A player waiting to respawn is respawned straight away if there is a synced character to give them.
Defaults to `true`.