@colyseus/schema 3.0.0-alpha.10 → 3.0.0-alpha.11

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.
@@ -946,6 +946,18 @@ const encodeKeyValueOperation = function (encoder, bytes, changeTree, field, ope
946
946
  }
947
947
  const type = changeTree.getType(field);
948
948
  const value = changeTree.getValue(field);
949
+ // try { throw new Error(); } catch (e) {
950
+ // // only print if not coming from Reflection.ts
951
+ // if (!e.stack.includes("src/Reflection.ts")) {
952
+ // console.log("encodeKeyValueOperation -> ", {
953
+ // ref: changeTree.ref.constructor.name,
954
+ // field,
955
+ // operation: OPERATION[operation],
956
+ // value: value?.toJSON(),
957
+ // items: ref.toJSON(),
958
+ // });
959
+ // }
960
+ // }
949
961
  // TODO: inline this function call small performance gain
950
962
  encodeValue(encoder, bytes, ref, type, value, field, operation, it);
951
963
  };
@@ -3396,6 +3408,12 @@ class Encoder {
3396
3408
  const ctor = ref['constructor'];
3397
3409
  const encoder = ctor[$encoder];
3398
3410
  const filter = ctor[$filter];
3411
+ // try { throw new Error(); } catch (e) {
3412
+ // // only print if not coming from Reflection.ts
3413
+ // if (!e.stack.includes("src/Reflection.ts")) {
3414
+ // console.log("ChangeTree:", { ref: ref.constructor.name, });
3415
+ // }
3416
+ // }
3399
3417
  if (hasView) {
3400
3418
  if (!view.items.has(changeTree)) {
3401
3419
  view.invisible.add(changeTree);
@@ -3425,11 +3443,16 @@ class Encoder {
3425
3443
  // view?.invisible.add(changeTree);
3426
3444
  continue;
3427
3445
  }
3428
- // console.log("WILL ENCODE", {
3429
- // ref: changeTree.ref.constructor.name,
3430
- // fieldIndex,
3431
- // operation: OPERATION[operation],
3432
- // });
3446
+ // try { throw new Error(); } catch (e) {
3447
+ // // only print if not coming from Reflection.ts
3448
+ // if (!e.stack.includes("src/Reflection.ts")) {
3449
+ // // console.log("WILL ENCODE", {
3450
+ // // ref: changeTree.ref.constructor.name,
3451
+ // // fieldIndex,
3452
+ // // operation: OPERATION[operation],
3453
+ // // });
3454
+ // }
3455
+ // }
3433
3456
  encoder(this, buffer, changeTree, fieldIndex, operation, it, isEncodeAll, hasView);
3434
3457
  }
3435
3458
  }