hyoo_sync_client 0.0.12 → 0.0.14
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/node.d.ts +1 -0
- package/node.deps.json +1 -1
- package/node.js +14 -6
- package/node.js.map +1 -1
- package/node.mjs +14 -6
- package/node.mjs.map +1 -1
- package/node.test.js +14 -6
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +1 -0
- package/web.deps.json +1 -1
- package/web.js +14 -6
- package/web.js.map +1 -1
- package/web.mjs +14 -6
- package/web.mjs.map +1 -1
package/node.test.js
CHANGED
|
@@ -24,7 +24,7 @@ $.$$ = $
|
|
|
24
24
|
//hyoo/hyoo.ts
|
|
25
25
|
;
|
|
26
26
|
"use strict";
|
|
27
|
-
let $hyoo_sync_revision = "
|
|
27
|
+
let $hyoo_sync_revision = "35aacaf";
|
|
28
28
|
//hyoo/sync/-meta.tree/revision.meta.tree.ts
|
|
29
29
|
;
|
|
30
30
|
"use strict";
|
|
@@ -2941,6 +2941,9 @@ var $;
|
|
|
2941
2941
|
this.pub.promote();
|
|
2942
2942
|
return this._clocks;
|
|
2943
2943
|
}
|
|
2944
|
+
get clocks_bin() {
|
|
2945
|
+
return new Uint8Array($hyoo_crowd_clock_bin.from(this.id(), this._clocks).buffer);
|
|
2946
|
+
}
|
|
2944
2947
|
pub = new $mol_wire_pub;
|
|
2945
2948
|
_clocks = [new $hyoo_crowd_clock, new $hyoo_crowd_clock];
|
|
2946
2949
|
_unit_all = new Map();
|
|
@@ -3940,6 +3943,13 @@ var $;
|
|
|
3940
3943
|
};
|
|
3941
3944
|
this.line_land_neck({ line, land: land_id }, [
|
|
3942
3945
|
handle(this.line_land_neck({ line, land: land_id })[0])
|
|
3946
|
+
.catch(error => {
|
|
3947
|
+
this.$.$mol_log3_fail({
|
|
3948
|
+
place: this,
|
|
3949
|
+
land: land_id,
|
|
3950
|
+
message: String(error?.message ?? error),
|
|
3951
|
+
});
|
|
3952
|
+
})
|
|
3943
3953
|
]);
|
|
3944
3954
|
}
|
|
3945
3955
|
line_send_clocks(line, land) { }
|
|
@@ -4321,7 +4331,7 @@ var $;
|
|
|
4321
4331
|
master() {
|
|
4322
4332
|
this.reconnects();
|
|
4323
4333
|
const link = this.master_link();
|
|
4324
|
-
const line = new $mol_dom_context.WebSocket(link);
|
|
4334
|
+
const line = new $mol_dom_context.WebSocket(link, ['$hyoo_sync']);
|
|
4325
4335
|
line.binaryType = 'arraybuffer';
|
|
4326
4336
|
line.onmessage = async (event) => {
|
|
4327
4337
|
if (event.data instanceof ArrayBuffer) {
|
|
@@ -4369,12 +4379,10 @@ var $;
|
|
|
4369
4379
|
}
|
|
4370
4380
|
line_send_clocks(line, land) {
|
|
4371
4381
|
if (line instanceof WebSocket) {
|
|
4372
|
-
|
|
4373
|
-
line.send(message);
|
|
4382
|
+
line.send(land.clocks_bin);
|
|
4374
4383
|
}
|
|
4375
4384
|
else {
|
|
4376
|
-
|
|
4377
|
-
line.postMessage(['hyoo_sync_clocks', land.id(), message]);
|
|
4385
|
+
line.postMessage(['hyoo_sync_clocks', land.id(), land._clocks]);
|
|
4378
4386
|
}
|
|
4379
4387
|
}
|
|
4380
4388
|
async line_send_units(line, units) {
|