Handle authenticated room instance takeover
CI/CD / test_and_check_app (push) Failing after 2m7s
CI/CD / Publish immutable image (push) Skipped

This commit is contained in:
2026-09-10 16:33:13 +02:00
parent 2ab95cebdf
commit 640a2970c3
18 changed files with 351 additions and 22 deletions
+6 -1
View File
@@ -22,6 +22,7 @@ class RoomStateChanged implements ShouldBroadcastNow
public readonly RoomStateChange $change,
public readonly ?array $state = null,
public readonly ?int $affectedPlayerId = null,
public readonly ?string $affectedInstanceId = null,
) {}
public function broadcastOn(): Channel
@@ -35,7 +36,7 @@ class RoomStateChanged implements ShouldBroadcastNow
}
/**
* @return array{version: int, change: string, state: array<string, mixed>|null, affected_player_id?: int}
* @return array{version: int, change: string, state: array<string, mixed>|null, affected_player_id?: int, affected_instance_id?: string}
*/
public function broadcastWith(): array
{
@@ -49,6 +50,10 @@ class RoomStateChanged implements ShouldBroadcastNow
$payload['affected_player_id'] = $this->affectedPlayerId;
}
if ($this->affectedInstanceId !== null) {
$payload['affected_instance_id'] = $this->affectedInstanceId;
}
return $payload;
}
}