@colyseus/schema 3.0.31 → 3.0.33
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/build/cjs/index.js +12 -2
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +12 -2
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +12 -2
- package/lib/bench_encode.d.ts +1 -0
- package/lib/bench_encode.js +130 -0
- package/lib/bench_encode.js.map +1 -0
- package/lib/debug.d.ts +1 -0
- package/lib/debug.js +51 -0
- package/lib/debug.js.map +1 -0
- package/lib/encoder/ChangeTree.js +8 -2
- package/lib/encoder/ChangeTree.js.map +1 -1
- package/lib/utils.js +4 -0
- package/lib/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/bench_encode.ts +108 -0
- package/src/debug.ts +55 -0
- package/src/encoder/ChangeTree.ts +7 -2
- package/src/utils.ts +3 -0
package/build/esm/index.mjs
CHANGED
|
@@ -1101,8 +1101,14 @@ class ChangeTree {
|
|
|
1101
1101
|
operation(op) {
|
|
1102
1102
|
// operations without index use negative values to represent them
|
|
1103
1103
|
// this is checked during .encode() time.
|
|
1104
|
-
this.
|
|
1105
|
-
|
|
1104
|
+
if (this.filteredChanges !== undefined) {
|
|
1105
|
+
this.filteredChanges.operations.push(-op);
|
|
1106
|
+
enqueueChangeTree(this.root, this, 'filteredChanges');
|
|
1107
|
+
}
|
|
1108
|
+
else {
|
|
1109
|
+
this.changes.operations.push(-op);
|
|
1110
|
+
enqueueChangeTree(this.root, this, 'changes');
|
|
1111
|
+
}
|
|
1106
1112
|
}
|
|
1107
1113
|
change(index, operation = OPERATION.ADD) {
|
|
1108
1114
|
const metadata = this.ref.constructor[Symbol.metadata];
|
|
@@ -3129,6 +3135,10 @@ function dumpChanges(schema) {
|
|
|
3129
3135
|
};
|
|
3130
3136
|
// for (const refId in $root.changes) {
|
|
3131
3137
|
$root.changes.forEach(changeTree => {
|
|
3138
|
+
// skip if ChangeTree is undefined
|
|
3139
|
+
if (changeTree === undefined) {
|
|
3140
|
+
return;
|
|
3141
|
+
}
|
|
3132
3142
|
const changes = changeTree.indexedOperations;
|
|
3133
3143
|
dump.refs.push(`refId#${changeTree.refId}`);
|
|
3134
3144
|
for (const index in changes) {
|