@woosh/meep-engine 3.71.0 → 3.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Advanced 3D game engine",
7
7
  "type": "module",
8
8
  "author": "Alexander Goldring",
9
- "version": "3.71.0",
9
+ "version": "3.71.1",
10
10
  "exports": {
11
11
  "./build/*": "./build/*",
12
12
  "./src/*": "./src/*",
@@ -57,7 +57,18 @@ export class PointerDevice {
57
57
  */
58
58
  private isRunning;
59
59
  /**
60
- * The {@link MouseEvent.buttons} is a 32bit field, which means we can encode up to 32 buttons
60
+ * One switch per button, indexed by {@link MouseEvent.button} ordinal (see {@link MouseButtons}).
61
+ * A touch or a pen in contact is button 0.
62
+ *
63
+ * A pointer presses buttons here once its first press lands on {@link #domElement}: that
64
+ * button, and any other it presses over the element while it still holds one. A button it
65
+ * pressed comes up when the pointer releases it, anywhere on the page, or is cancelled. A switch
66
+ * held by several pointers, two fingers say, stays down until the last of them lets go. Every
67
+ * switch comes up when the window loses focus and when the device stops.
68
+ *
69
+ * A button pressed or released while the pointer holds another is reported by the browser as a
70
+ * `pointermove` naming the changed button, not as a `pointerdown` or `pointerup`. Both forms
71
+ * are followed.
61
72
  * @readonly
62
73
  * @type {InputDeviceSwitch[]}
63
74
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PointerDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/PointerDevice.js"],"names":[],"mappings":"AAgPA;;;;;GAKG;AACH,mDAJW,OAAO,SACP,UAAU,GAAC,KAAK,WAChB,OAAO,QAejB;AAED;;;;;GAKG;AACH;IAyFI;;;;OAIG;IACH,wBAHW,WAAW,EA+BrB;IAtHD;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;IAEzB;;OAEG;IACH;;;QAGI;;;;;;WAMG;;;QAGH;;WAEG;;;;;;;;;MASL;IAeF;;;OAGG;IACH,kBAAkB;IAElB;;;;OAIG;IACH,kBAFU,iBAAiB,EAAE,CAEL;IAExB;;;OAGG;IACH,yCAEC;IAED;;;OAGG;IACH,0CAEC;IAED;;;OAGG;IACH,2CAEC;IA2ID;;;OAGG;IACH,oBAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,4BAsBC;IAED,0BAEC;IAED;;;;OAIG;IACH,qCAHW,OAAO,SACP,UAAU,GAAC,KAAK,QAI1B;IAED,cAiCC;IAED,aA4BC;;CACJ;oBA5lBmB,+BAA+B;mBADhC,uCAAuC;kCAOxB,wBAAwB"}
1
+ {"version":3,"file":"PointerDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/PointerDevice.js"],"names":[],"mappings":"AAiPA;;;;;GAKG;AACH,mDAJW,OAAO,SACP,UAAU,GAAC,KAAK,WAChB,OAAO,QAejB;AAED;;;;;GAKG;AACH;IAuHI;;;;OAIG;IACH,wBAHW,WAAW,EA+BrB;IApJD;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;IAEzB;;OAEG;IACH;;;QAGI;;;;;;WAMG;;;QAGH;;WAEG;;;;;;;;;MASL;IAeF;;;OAGG;IACH,kBAAkB;IAElB;;;;;;;;;;;;;;;OAeG;IACH,kBAFU,iBAAiB,EAAE,CAEL;IAqBxB;;;OAGG;IACH,yCAEC;IAED;;;OAGG;IACH,0CAEC;IAED;;;OAGG;IACH,2CAEC;IA8VD;;;OAGG;IACH,oBAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,4BAsBC;IAED,0BAEC;IAED;;;;OAIG;IACH,qCAHW,OAAO,SACP,UAAU,GAAC,KAAK,QAI1B;IAED,cAiCC;IAED,aA4BC;;CACJ;oBA90BmB,+BAA+B;mBADhC,uCAAuC;kCAOxB,wBAAwB"}
@@ -8,6 +8,7 @@ import { MouseEvents } from "./events/MouseEvents.js";
8
8
  import { PointerEvents } from "./events/PointerEvents.js";
9
9
  import { InputDeviceSwitch } from "./InputDeviceSwitch.js";
10
10
  import { LocationalInteractionMetadata } from "./LocationalInteractionMetadata.js";
11
+ import { mouseButtonToEventButtonsMask } from "./mouse/mouseButtonToEventButtonsMask.js";
11
12
  import { suppressContextMenu } from "./mouse/suppressContextMenu.js";
12
13
 
13
14
 
@@ -324,12 +325,42 @@ export class PointerDevice {
324
325
  isRunning = false;
325
326
 
326
327
  /**
327
- * The {@link MouseEvent.buttons} is a 32bit field, which means we can encode up to 32 buttons
328
+ * One switch per button, indexed by {@link MouseEvent.button} ordinal (see {@link MouseButtons}).
329
+ * A touch or a pen in contact is button 0.
330
+ *
331
+ * A pointer presses buttons here once its first press lands on {@link #domElement}: that
332
+ * button, and any other it presses over the element while it still holds one. A button it
333
+ * pressed comes up when the pointer releases it, anywhere on the page, or is cancelled. A switch
334
+ * held by several pointers, two fingers say, stays down until the last of them lets go. Every
335
+ * switch comes up when the window loses focus and when the device stops.
336
+ *
337
+ * A button pressed or released while the pointer holds another is reported by the browser as a
338
+ * `pointermove` naming the changed button, not as a `pointerdown` or `pointerup`. Both forms
339
+ * are followed.
328
340
  * @readonly
329
341
  * @type {InputDeviceSwitch[]}
330
342
  */
331
343
  buttons = new Array(32);
332
344
 
345
+ /**
346
+ * Pointers whose first press landed on {@link #domElement} and whose last button has not come
347
+ * up yet, {@link #pointer_count} of them, by {@link PointerEvent.pointerId}.
348
+ * @type {Int32Array}
349
+ */
350
+ #pointer_ids = new Int32Array(4);
351
+
352
+ /**
353
+ * Per pointer of {@link #pointer_ids}, the switches it holds down: bit `i` is `buttons[i]`.
354
+ * A switch is down exactly while some pointer here holds it.
355
+ * @type {Uint32Array}
356
+ */
357
+ #pointer_held = new Uint32Array(4);
358
+
359
+ /**
360
+ * @type {number}
361
+ */
362
+ #pointer_count = 0;
363
+
333
364
  /**
334
365
  *
335
366
  * @returns {InputDeviceSwitch}
@@ -398,16 +429,192 @@ export class PointerDevice {
398
429
  this.readPointerPositionFromEvent(this.position, event);
399
430
 
400
431
  // update button state and dispatch specific signal
401
- const button_index = event.button;
432
+ let pointer = this.#pointerIndexOf(event.pointerId);
402
433
 
403
- const button = this.buttons[button_index];
434
+ if (pointer === -1) {
435
+ pointer = this.#pointerAdd(event.pointerId);
436
+ }
404
437
 
405
- button?.press();
438
+ this.#pointerPress(pointer, event.button);
406
439
 
407
440
  this.on.down.send2(this.position, event);
408
441
 
409
442
  }
410
443
 
444
+ /**
445
+ * @param {number} pointer_id
446
+ * @returns {number} index into {@link #pointer_ids}, -1 for a pointer that is not followed
447
+ */
448
+ #pointerIndexOf(pointer_id) {
449
+ const ids = this.#pointer_ids;
450
+ const count = this.#pointer_count;
451
+
452
+ for (let i = 0; i < count; i++) {
453
+ if (ids[i] === pointer_id) {
454
+ return i;
455
+ }
456
+ }
457
+
458
+ return -1;
459
+ }
460
+
461
+ /**
462
+ * Start following a pointer, holding nothing. Its chorded releases can happen anywhere on the
463
+ * page, so the window is listened to for as long as any pointer is followed.
464
+ *
465
+ * @param {number} pointer_id must not be followed already
466
+ * @returns {number} index into {@link #pointer_ids}
467
+ */
468
+ #pointerAdd(pointer_id) {
469
+ const index = this.#pointer_count;
470
+
471
+ if (index === this.#pointer_ids.length) {
472
+ const ids = new Int32Array(index * 2);
473
+ const held = new Uint32Array(index * 2);
474
+
475
+ ids.set(this.#pointer_ids);
476
+ held.set(this.#pointer_held);
477
+
478
+ this.#pointer_ids = ids;
479
+ this.#pointer_held = held;
480
+ }
481
+
482
+ this.#pointer_ids[index] = pointer_id;
483
+ this.#pointer_held[index] = 0;
484
+ this.#pointer_count = index + 1;
485
+
486
+ if (index === 0) {
487
+ window.addEventListener(PointerEvents.Move, this.#eventHandlerGlobalPointerMove);
488
+ }
489
+
490
+ return index;
491
+ }
492
+
493
+ /**
494
+ * Stop following a pointer. The switches it held come up, unless another pointer holds them.
495
+ *
496
+ * @param {number} index into {@link #pointer_ids}
497
+ */
498
+ #pointerRemove(index) {
499
+ const ids = this.#pointer_ids;
500
+ const held = this.#pointer_held;
501
+
502
+ const released = held[index];
503
+ const last = this.#pointer_count - 1;
504
+
505
+ ids[index] = ids[last];
506
+ held[index] = held[last];
507
+ this.#pointer_count = last;
508
+
509
+ if (last === 0) {
510
+ window.removeEventListener(PointerEvents.Move, this.#eventHandlerGlobalPointerMove);
511
+ }
512
+
513
+ this.#releaseUnheld(released);
514
+ }
515
+
516
+ /**
517
+ * @param {number} index into {@link #pointer_ids}
518
+ * @param {number} button_index {@link MouseEvent.button} of the button that went down
519
+ */
520
+ #pointerPress(index, button_index) {
521
+ const button = this.buttons[button_index];
522
+
523
+ if (button === undefined) {
524
+ // not a button there is a switch for
525
+ return;
526
+ }
527
+
528
+ this.#pointer_held[index] |= 1 << button_index;
529
+
530
+ button.press();
531
+ }
532
+
533
+ /**
534
+ * Release those of the given switches that no followed pointer holds.
535
+ * Runs switch handlers, so call it with the pointer records already up to date.
536
+ *
537
+ * @param {number} switches bit `i` is `buttons[i]`
538
+ */
539
+ #releaseUnheld(switches) {
540
+ const held = this.#pointer_held;
541
+ const count = this.#pointer_count;
542
+
543
+ let remaining = switches;
544
+
545
+ for (let i = 0; i < count; i++) {
546
+ remaining &= ~held[i];
547
+ }
548
+
549
+ const buttons = this.buttons;
550
+
551
+ for (let i = 0; remaining !== 0; i++) {
552
+ const bit = 1 << i;
553
+
554
+ if ((remaining & bit) !== 0) {
555
+ remaining &= ~bit;
556
+ buttons[i].release();
557
+ }
558
+ }
559
+ }
560
+
561
+ /**
562
+ * A button pressed while the pointer holds another: `event.button` is that button, -1 on a
563
+ * plain move, and `event.buttons` holds it. Only a followed pointer presses, so a pointer whose
564
+ * first press went elsewhere, or was kept from the element, presses nothing here either.
565
+ *
566
+ * @param {PointerEvent} event a `pointermove` over the element
567
+ */
568
+ #chordedPress(event) {
569
+ const button_index = event.button;
570
+
571
+ if (button_index < 0 || (event.buttons & mouseButtonToEventButtonsMask(button_index)) === 0) {
572
+ return;
573
+ }
574
+
575
+ const pointer = this.#pointerIndexOf(event.pointerId);
576
+
577
+ if (pointer === -1) {
578
+ return;
579
+ }
580
+
581
+ this.#pointerPress(pointer, button_index);
582
+ }
583
+
584
+ /**
585
+ * A button released while the pointer still holds another: `event.button` is that button, -1 on
586
+ * a plain move, and `event.buttons` no longer holds it. A release that leaves no button held is
587
+ * a `pointerup`, so a move that holds none is not one.
588
+ *
589
+ * @param {PointerEvent} event a `pointermove` anywhere on the page
590
+ */
591
+ #chordedRelease(event) {
592
+ const button_index = event.button;
593
+ const event_held = event.buttons;
594
+
595
+ if (
596
+ button_index < 0
597
+ || button_index >= this.buttons.length
598
+ || event_held === 0
599
+ || (event_held & mouseButtonToEventButtonsMask(button_index)) !== 0
600
+ ) {
601
+ return;
602
+ }
603
+
604
+ const pointer = this.#pointerIndexOf(event.pointerId);
605
+
606
+ if (pointer === -1) {
607
+ return;
608
+ }
609
+
610
+ const bit = 1 << button_index;
611
+
612
+ // a button that went down where it did not count as a press is not held, and nothing comes up
613
+ this.#pointer_held[pointer] &= ~bit;
614
+
615
+ this.#releaseUnheld(bit);
616
+ }
617
+
411
618
  /**
412
619
  *
413
620
  * @param {PointerEvent} event
@@ -425,31 +632,59 @@ export class PointerDevice {
425
632
  this.readPointerPositionFromEvent(this.position, event);
426
633
  this.on.globalUp.send2(this.position, event);
427
634
 
428
- // update button state and dispatch specific signal
429
- const button_index = event.button;
635
+ // A pointer sends `pointerup` once, when its last button comes up, so `event.button` names
636
+ // only that one. Everything the pointer still holds here comes up with it, including a
637
+ // button whose own release never reached the page.
638
+ const pointer = this.#pointerIndexOf(event.pointerId);
430
639
 
431
- const button = this.buttons[button_index];
432
-
433
- button?.release();
640
+ if (pointer !== -1) {
641
+ this.#pointerRemove(pointer);
642
+ }
434
643
  }
435
644
 
436
645
  /**
437
- * Let go of every pressed button.
646
+ * Attached only while a pointer is followed, see {@link #pointerAdd}.
438
647
  *
439
- * A button is pressed on `pointerdown` and released only on a window-level `pointerup`, so a
440
- * window that loses focus mid-drag - alt-tab - or a touch stolen by a system edge-swipe, which
441
- * delivers `pointercancel` and no `pointerup`, left the button latched down for ever.
442
- * `InputMapSystem` keeps the interned index in its held set, so any chord containing it stays
443
- * satisfied; and because `press()` is idempotent, the first real click after coming back
444
- * produced no rising edge and was swallowed entirely.
648
+ * @param {PointerEvent} event
649
+ */
650
+ #eventHandlerGlobalPointerMove = (event) => {
651
+ this.#chordedRelease(event);
652
+ }
653
+
654
+ /**
655
+ * A pointer the system took away, a touch stolen by an edge-swipe say: no `pointerup` follows.
656
+ * Its buttons come up as they do on its last release, and its pending tap and drag are dropped
657
+ * without firing.
445
658
  *
446
- * `KeyboardDevice` handles exactly this case on `blur`, and `GamepadDevice.stop()` releases
447
- * every button for the same reason. The pointer was the one device of the three that did not,
448
- * with `PointerEvents.Cancel` sitting unused in the event table as the tell.
659
+ * @param {PointerEvent} event
660
+ */
661
+ #eventHandlerPointerCancel = (event) => {
662
+ this.#resetTap(event.pointerId);
663
+ this.#resetDrag();
664
+
665
+ const pointer = this.#pointerIndexOf(event.pointerId);
666
+
667
+ if (pointer !== -1) {
668
+ this.#pointerRemove(pointer);
669
+ }
670
+ }
671
+
672
+ /**
673
+ * Let go of every button and stop following every pointer. For a window that lost focus and a
674
+ * device that stops: a press that ends there ends with no pointer event to say so, and a switch
675
+ * left down keeps every binding on it held and swallows the button's next press, as
676
+ * {@link InputDeviceSwitch#press} raises no edge on a switch that is already down.
677
+ * Pending taps and drags are dropped without firing.
449
678
  */
450
- #releaseAllButtons = event => {
451
- this.#resetTap(event?.type === PointerEvents.Cancel ? event.pointerId : undefined);
679
+ #releaseAllButtons = () => {
680
+ this.#resetTap();
452
681
  this.#resetDrag();
682
+
683
+ if (this.#pointer_count !== 0) {
684
+ this.#pointer_count = 0;
685
+ window.removeEventListener(PointerEvents.Move, this.#eventHandlerGlobalPointerMove);
686
+ }
687
+
453
688
  const buttons = this.buttons;
454
689
 
455
690
  for (let i = 0; i < buttons.length; i++) {
@@ -488,6 +723,13 @@ export class PointerDevice {
488
723
 
489
724
  this.readPointerPositionFromEvent(this.position, event);
490
725
 
726
+ // a button changed while the pointer held another one: apply it ahead of the move signal,
727
+ // whose handlers read the switches
728
+ if (this.#pointer_count !== 0) {
729
+ this.#chordedPress(event);
730
+ this.#chordedRelease(event);
731
+ }
732
+
491
733
  this.on.move.send3(this.position, event, new Vector2(event.movementX, event.movementY));
492
734
  }
493
735
 
@@ -561,9 +803,9 @@ export class PointerDevice {
561
803
 
562
804
  window.addEventListener(PointerEvents.Up, this.#eventHandlerGlobalPointerUp);
563
805
 
564
- // the two ways a press ends without a pointerup ever arriving - see #releaseAllButtons
806
+ // the two ways a press ends without a pointerup ever arriving
565
807
  window.addEventListener('blur', this.#releaseAllButtons);
566
- domElement.addEventListener(PointerEvents.Cancel, this.#releaseAllButtons);
808
+ domElement.addEventListener(PointerEvents.Cancel, this.#eventHandlerPointerCancel);
567
809
 
568
810
  /*
569
811
  In some cases wheel event gets registered as "passive" by default. This interferes with "preventDefault()"
@@ -594,7 +836,7 @@ export class PointerDevice {
594
836
  window.removeEventListener(PointerEvents.Up, this.#eventHandlerGlobalPointerUp);
595
837
 
596
838
  window.removeEventListener('blur', this.#releaseAllButtons);
597
- domElement.removeEventListener(PointerEvents.Cancel, this.#releaseAllButtons);
839
+ domElement.removeEventListener(PointerEvents.Cancel, this.#eventHandlerPointerCancel);
598
840
 
599
841
  domElement.removeEventListener(MouseEvents.Wheel, this.#eventHandlerWheel);
600
842
 
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Button indices for a pointing device.
3
3
  *
4
- * These are {@link MouseEvent.button } ORDINALS, which is how {@link PointerDevicebuttons } is indexed - see
5
- * `PointerDevice.js`, where both the down and the up handler read `event.button` directly.
4
+ * These are {@link MouseEvent.button } ORDINALS, which is how {@link PointerDevicebuttons } is indexed.
6
5
  *
7
6
  * NOTE: deliberately NOT the {@link MouseEvent.buttons } bitmask order, which is left(1), right(2), middle(4).
8
7
  * Using the bitmask order here would resolve a right-click to `buttons[1]`, which is the middle button, and
@@ -1 +1 @@
1
- {"version":3,"file":"MouseButtons.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/devices/mouse/MouseButtons.js"],"names":[],"mappings":";;;;;;;;;;;;2BAaU,MAAM"}
1
+ {"version":3,"file":"MouseButtons.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/devices/mouse/MouseButtons.js"],"names":[],"mappings":";;;;;;;;;;;2BAYU,MAAM"}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Button indices for a pointing device.
3
3
  *
4
- * These are {@link MouseEvent.button} ORDINALS, which is how {@link PointerDevice#buttons} is indexed - see
5
- * `PointerDevice.js`, where both the down and the up handler read `event.button` directly.
4
+ * These are {@link MouseEvent.button} ORDINALS, which is how {@link PointerDevice#buttons} is indexed.
6
5
  *
7
6
  * NOTE: deliberately NOT the {@link MouseEvent.buttons} bitmask order, which is left(1), right(2), middle(4).
8
7
  * Using the bitmask order here would resolve a right-click to `buttons[1]`, which is the middle button, and
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The bit of {@link MouseEvent.buttons} that stands for one button, given that button's
3
+ * {@link MouseEvent.button} ordinal (see {@link MouseButtons}).
4
+ *
5
+ * The two orders differ in the middle and the right button only: ordinals run left 0, middle 1, right 2,
6
+ * and bits run left 1, right 2, middle 4. From the fourth button on (back, forward, a pen's eraser) the bit
7
+ * is `1 << ordinal`.
8
+ *
9
+ * @param {number} button ordinal, 0..15: {@link MouseEvent.buttons} is 16 bits wide
10
+ * @returns {number} a single bit
11
+ */
12
+ export function mouseButtonToEventButtonsMask(button: number): number;
13
+ //# sourceMappingURL=mouseButtonToEventButtonsMask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mouseButtonToEventButtonsMask.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/devices/mouse/mouseButtonToEventButtonsMask.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,sDAHW,MAAM,GACJ,MAAM,CAYlB"}
@@ -0,0 +1,24 @@
1
+ import { MouseEventButtons } from "./MouseEventButtons.js";
2
+
3
+ /**
4
+ * The bit of {@link MouseEvent.buttons} that stands for one button, given that button's
5
+ * {@link MouseEvent.button} ordinal (see {@link MouseButtons}).
6
+ *
7
+ * The two orders differ in the middle and the right button only: ordinals run left 0, middle 1, right 2,
8
+ * and bits run left 1, right 2, middle 4. From the fourth button on (back, forward, a pen's eraser) the bit
9
+ * is `1 << ordinal`.
10
+ *
11
+ * @param {number} button ordinal, 0..15: {@link MouseEvent.buttons} is 16 bits wide
12
+ * @returns {number} a single bit
13
+ */
14
+ export function mouseButtonToEventButtonsMask(button) {
15
+ if (button === 1) {
16
+ return MouseEventButtons.auxiliary;
17
+ }
18
+
19
+ if (button === 2) {
20
+ return MouseEventButtons.secondary;
21
+ }
22
+
23
+ return 1 << button;
24
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ServerAuthoritativeClient.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/ServerAuthoritativeClient.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH;IAgGI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,kXA/CW;QACV,KAAS,yBAAyB;QAClC,eAAmB,8BAA8B;QACjD,qBAAyB,EAAE,UAAU,CAAC;QACtC,cAAkB,EAAE,UAAU,CAAC;QAC/B,YAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,cAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,mBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,mBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,eAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,iBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,aAAiB,CAAC,EAAE,YAAY,CAAC;QACjC,oBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,cAAkB,CAAC,EAAE,OA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IG;IACH,qBAFU,MAAM,CAEuB;IAEvC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,sBAFU,MAAM,CAEwB;IAmB5C;;;;OAIG;IACH,2BAHW,MAAM,aACN,MAAM,QAIhB;IAED;;;OAGG;IACH,gCAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAFW,MAAM,8DAIhB;IAUD;;;;;;;;;;;OAWG;IACH,oBAFW,MAAM,QAKhB;IAED;;;;;;OAMG;IACH,0BAFW,MAAM,QAShB;IAED;;;OAGG;IACH,iBAEC;IAED;;;OAGG;IACH,4BAEC;IAED;;;;;;;OAOG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;OAMG;IACH,iBAHW,MAAM,GACJ,YAAY,CAIxB;IAED;;;;;;;;OAQG;IACH,wBAJW,MAAM,cACN,MAAM,UACN,YAAY,QAItB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,wBAIC;IAkhBD;;;;;OAKG;IACH,oBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,oBAFW,MAAM,QAIhB;;CACJ;4BAppC2B,kBAAkB;0BAFpB,uBAAuB;6BAFpB,wBAAwB;6BAGxB,yBAAyB;mBANnC,uCAAuC;6BAH7B,sCAAsC"}
1
+ {"version":3,"file":"ServerAuthoritativeClient.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/ServerAuthoritativeClient.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH;IAgGI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,kXA/CW;QACV,KAAS,yBAAyB;QAClC,eAAmB,8BAA8B;QACjD,qBAAyB,EAAE,UAAU,CAAC;QACtC,cAAkB,EAAE,UAAU,CAAC;QAC/B,YAAgB,CAAC,EAAE,MAAM,C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1B;;;;;;;;;OASG;IACH,WAFU,MAAM,CAEa;IAE7B;;;;;;;;;OASG;IACH,UAFU,MAAM,CAEY;IAE5B;;;;;;;;;;;;;;;;;;OAkBG;IACH,mBAFU,MAAM,CAEqB;IAErC;;;;;OAKG;IACH,kBAFU,MAAM,CAEoB;IAEpC;;;;;;;OAOG;IACH,mBAFU,MAAM,CAEqB;IAErC;;;;;;;;;;;;;;;;OAgBG;IACH,kBAFU,MAAM,CAEoB;IAEpC;;;;OAIG;IACH,qBAFU,MAAM,CAEuB;IAEvC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,sBAFU,MAAM,CAEwB;IAmB5C;;;;OAIG;IACH,2BAHW,MAAM,aACN,MAAM,QAIhB;IAED;;;OAGG;IACH,gCAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAFW,MAAM,8DAIhB;IAUD;;;;;;;;;;;OAWG;IACH,oBAFW,MAAM,QAKhB;IAED;;;;;;OAMG;IACH,0BAFW,MAAM,QAShB;IAED;;;OAGG;IACH,iBAEC;IAED;;;OAGG;IACH,4BAEC;IAED;;;;;;;OAOG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;OAMG;IACH,iBAHW,MAAM,GACJ,YAAY,CAIxB;IAED;;;;;;;;OAQG;IACH,wBAJW,MAAM,cACN,MAAM,UACN,YAAY,QAItB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,wBAIC;IAohBD;;;;;OAKG;IACH,oBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,oBAFW,MAAM,QAIhB;;CACJ;4BAtpC2B,kBAAkB;0BAFpB,uBAAuB;6BAFpB,wBAAwB;6BAGxB,yBAAyB;mBANnC,uCAAuC;6BAH7B,sCAAsC"}
@@ -904,7 +904,9 @@ export class ServerAuthoritativeClient {
904
904
  for (let i = 0; i < cursor.prior_count; i++) {
905
905
  const entity_id = buffer.readUintVar();
906
906
  const component_type_id = buffer.readUint8();
907
- buffer.position += buffer.readUint32();
907
+ // read first: `position += read()` would add to the position from before the read
908
+ const prior_length = buffer.readUint32();
909
+ buffer.position += prior_length;
908
910
 
909
911
  if (later.has(entity_id, component_type_id)) return true;
910
912
  }