Publish AdaScript runtime, multiplayer, and editor updates - #124
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 588024882a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| frame: NetworkFrame(kind: .protocolError, payload: try runtime.codec.encode(failure)), | ||
| to: runtime.configuration.role == .host ? .peer(peer) : .host | ||
| ) | ||
| await session.end(.incompatiblePeer(peer)) |
There was a problem hiding this comment.
Reject only the incompatible joining peer
When a host receives a handshake with a mismatched game, build, schema, or role, this call marks the entire MultiplayerSession as ended. Since MultiplayerSession.send subsequently rejects every snapshot and RPC, one incompatible or stale client can stop networking for all already-compatible peers even though their transports remain connected; the host should reject/disconnect only the offending peer.
Useful? React with 👍 / 👎.
| try await send(snapshot, to: .peer(peer)) | ||
| runtime.peersNeedingBaseline.remove(peer) | ||
| } | ||
| let delta = makeDelta(previous: runtime.hostEntities, current: current) |
There was a problem hiding this comment.
Track replication visibility separately for each peer
When ReplicationPolicy.shouldReplicate changes for an existing entity, computing one global delta against runtime.hostEntities loses that visibility transition. A peer newly granted visibility receives no spawn unless the entity changes again, while a peer whose visibility is revoked receives no despawn and retains the last replicated state; maintain per-peer visible state and generate peer-specific spawn/despawn deltas.
Useful? React with 👍 / 👎.
| guard configuration.role == .peer else { | ||
| throw MultiplayerError.peerOnly | ||
| } | ||
| let payload = try JSONNetworkCodec().encode(command) |
There was a problem hiding this comment.
Encode RPC payloads with the configured codec
When MultiplayerPlugin is initialized with any non-JSON NetworkCodec, sendCommand still encodes with a fresh JSONNetworkCodec, while receiveRPC decodes with the configured runtime codec, so otherwise-valid commands fail to decode. The same hard-coded JSON path is used by events and requests/responses; the session's typed APIs need to use the plugin-provided codec consistently.
Useful? React with 👍 / 👎.
| ) | ||
|
|
||
| private static func peerID(role: NetworkRole, index: Int) -> PeerID { | ||
| let suffix = UInt8(clamping: role == .host ? 1 : max(1, index)) |
There was a problem hiding this comment.
Give the host and first peer distinct identifiers
With the default peerIndex == 1, both .host and .peer select suffix 1, producing exactly the same UUID. Thus changing the shipped/default project configuration from host to peer creates a remote participant with the host's identity; the session and AdaScript bridge cannot distinguish them, and Medieval Arena's peer-keyed player state collapses both participants into one.
Useful? React with 👍 / 👎.
Publishes the accumulated runtime and editor work: generated component reflection and @AdaScriptInit constructors, native typed AdaScript spawn backed by gravity-lang 0.9.9, shared runtime/LSP constructor catalog, AdaMultiplayer, MedievalArena AdaScript demo, editor source tooling and project UX, plus UI/render/tilemap fixes and coverage.\n\nValidation:\n- gravity-lang 0.9.9 CI: Linux gcc/clang, macOS gcc/clang, ASan+UBSan all passed\n- root swift test --parallel: 933 tests in 158 suites passed\n- AdaECSTests: 89 passed\n- MedievalArena source/runtime suite: 4 passed\n- AdaEditor target build passed\n- GravityLanguageSemanticTests: 3 passed\n- GravityLanguageServerTests: 12 passed\n\nThe full AdaEditor parallel suite still has unrelated runtime/UI test failures in package configuration, image tooling, keyframe UI, and style logging, plus a parallel index crash; focused production and LSP gates pass.