Use SharedArrayBuffer tile state and ring buffer for worker updates

- Share GameMapImpl tile state between worker and main via SharedArrayBuffer
- Add SAB-backed tile update ring buffer to stream tile changes instead of postMessage payloads
- Wire shared state/ring through WorkerClient, Worker.worker, GameRunner, and ClientGameRunner
- Update GameView to skip updateTile when shared state is enabled and consume tile refs from the ring
This commit is contained in:
scamiv
2025-11-26 21:35:14 +01:00
parent fa6d445f46
commit 15531806fa
8 changed files with 75 additions and 9 deletions
+1
View File
@@ -37,6 +37,7 @@ export interface InitMessage extends BaseWorkerMessage {
clientID: ClientID;
sharedTileRingHeader?: SharedArrayBuffer;
sharedTileRingData?: SharedArrayBuffer;
sharedStateBuffer?: SharedArrayBuffer;
}
export interface TurnMessage extends BaseWorkerMessage {