Skip to content

Property Observation & API Exposure#46

Open
Liparakis wants to merge 16 commits intoExtremelyd1:mainfrom
Liparakis:main
Open

Property Observation & API Exposure#46
Liparakis wants to merge 16 commits intoExtremelyd1:mainfrom
Liparakis:main

Conversation

@Liparakis
Copy link
Copy Markdown
Contributor

@Liparakis Liparakis commented Mar 31, 2026

What Changed

This PR adds addon-facing client/server API hooks around shared multiplayer state and removes a couple of rough edges from the initial implementation.

Main changes since 4d6c01f:

  • Added IClientManager.Id so addons can access the local player's assigned network ID on the client.
  • Added IClientManager.ServerSettings so addons can read the current shared gameplay settings on the client.
  • Exposed change notifications on IServerSettings through OnChanged, which is now the single client-side settings change hook.
  • Added OnTeamChanged to both IClientPlayer and IServerPlayer.
  • Updated ClientPlayerData and ServerPlayerData so team property changes raise OnTeamChanged.
  • Updated the client connect path to create/store the local ClientPlayerData using SelfId.
  • Updated the local team-change path so the local player's ClientPlayerData.Team is also updated, making IClientPlayer.OnTeamChanged work for self as well as remote players.

Why

The goal of the PR is to support four addon use cases cleanly:

  • read server settings on the client
  • react when server settings change
  • react when a player changes team
  • read the local player's own ID on the client

- Add `Id` property to `IClientManager` for local player identification.
- Add `OnChanged` event to `IServerSettings` to track server-side setting updates on the client.
- Add `OnTeamChanged` event to `IClientPlayer` for per-player team tracking.
- Update `ServerManager` to include the connecting player's ID and username in the initial `ServerInfo` handshake.
- Implement automatic local ID resolution in `ClientManager` upon successful connection.
@Liparakis Liparakis marked this pull request as draft March 31, 2026 09:42
@Liparakis Liparakis closed this Mar 31, 2026
@Liparakis Liparakis reopened this Mar 31, 2026
@Liparakis Liparakis marked this pull request as ready for review March 31, 2026 12:51
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.

1 participant