Skip to content

Split Player properties into individual types that are dynamically serialized - #2894

Open
Measurity wants to merge 6 commits into
SubnauticaNitrox:masterfrom
Measurity:server-player-properties
Open

Measurity wants to merge 6 commits into
SubnauticaNitrox:masterfrom
Measurity:server-player-properties

Conversation

@Measurity

@Measurity Measurity commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Dynamic serialization of player properties based on IPlayerProperty and IConnectedPlayerProperty.
  • Player properties will now fallback to a default value if missing in PlayerData.json.
  • Player properties that have default values will not persist to save space and make PlayerData.json easier to read.
  • Player properties are now part of the DI framework and scoped together. See VisibleCellsProperty for example.
  • System.Text.Json used in PlayerService for performance / future-proofing reasons.
  • PlayerData.json will be migrated to a new format automatically, with full backward compatibility thanks to ListLikeNewtonsoftJsonConverter and DictionaryLikeNewtonsoftJsonConverter converters.
  • Made player properties thread-safe. Necessary in some cases when accessed by both services and packet processing.
  • Removed Player.cs. Code that used it for player references now uses SessionId and PlayerService.GetProperty<TProp>(sessionId) API.

TODO

@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Test Results

  1 files   -   1    1 suites   - 1   10s ⏱️ -15s
275 tests +  6  270 ✅ +  6  5 💤 ±0  0 ❌ ±0 
275 runs   - 263  270 ✅  - 258  5 💤  - 5  0 ❌ ±0 

Results for commit 376414f. ± Comparison against base commit 7815b4e.

♻️ This comment has been updated with latest results.

@Measurity
Measurity marked this pull request as draft September 14, 2026 21:29
@Measurity
Measurity force-pushed the server-player-properties branch 12 times, most recently from 3883e4f to 8199816 Compare September 15, 2026 18:13
@Measurity
Measurity marked this pull request as ready for review September 15, 2026 18:16
@Measurity
Measurity force-pushed the server-player-properties branch from 8199816 to 2c29213 Compare September 15, 2026 20:31
@Measurity
Measurity marked this pull request as draft September 15, 2026 21:09
@Measurity
Measurity force-pushed the server-player-properties branch from 2c29213 to 7aac86e Compare September 16, 2026 19:16
@Measurity
Measurity marked this pull request as ready for review September 16, 2026 19:18
@Measurity
Measurity requested a lite review from Copilot September 16, 2026 19:18

This comment was marked as resolved.

@Measurity
Measurity force-pushed the server-player-properties branch 7 times, most recently from efb536b to bb05bf3 Compare September 17, 2026 01:09

This comment was marked as resolved.

@Measurity
Measurity force-pushed the server-player-properties branch 2 times, most recently from c8074db to 4fd9768 Compare September 17, 2026 18:10
@Measurity
Measurity force-pushed the server-player-properties branch 2 times, most recently from 61b07b3 to 39ff2d0 Compare September 24, 2026 06:37
Removed now obsolete Player.cs code.
@Measurity
Measurity force-pushed the server-player-properties branch from 39ff2d0 to 2b6540a Compare September 27, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants