-
-
Notifications
You must be signed in to change notification settings - Fork 143
fix(engine): enforce event-bound forced blocks #6613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d9a0236
cc6c080
5b36972
d8248ce
03a6d8e
aeb1ff0
9d2e929
24c1bc1
f83c4df
b9b65a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| import type { ObjectId, PlayerId } from "../../adapter/types.ts"; | ||
|
|
||
| export type BlockerAssignmentPair = [ObjectId, ObjectId]; | ||
|
|
||
| export function filterVisibleBlockerPairs( | ||
| pairs: Map<ObjectId, ObjectId>, | ||
| pairs: readonly BlockerAssignmentPair[], | ||
| objects: Record<string, { controller: PlayerId }> | null, | ||
| visiblePlayerIds: ReadonlySet<PlayerId>, | ||
| ): Map<ObjectId, ObjectId> { | ||
| if (!objects) return pairs; | ||
| return new Map( | ||
| Array.from(pairs.entries()).filter(([blockerId]) => { | ||
| const blockerController = objects[String(blockerId)]?.controller; | ||
| return blockerController == null || visiblePlayerIds.has(blockerController); | ||
| }), | ||
| ); | ||
| ): BlockerAssignmentPair[] { | ||
| if (!objects) return [...pairs]; | ||
| return pairs.filter(([blockerId]) => { | ||
| const blockerController = objects[String(blockerId)]?.controller; | ||
| return blockerController == null || visiblePlayerIds.has(blockerController); | ||
|
Comment on lines
+11
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Move assignment-visibility filtering into the engine. Lines 11-13 derive which blocker assignments are visible from game-object controller data in the client. Expose viewer-filtered blocker pairs through the engine/adapters instead, so every transport renders the same authorized state. As per coding guidelines and path instructions, the frontend must only render engine-provided state and must not calculate, filter, derive, or reinterpret game data. 🤖 Prompt for AI AgentsSources: Coding guidelines, Path instructions |
||
| }); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.