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.mjs
CHANGED
|
@@ -32,7 +32,7 @@ $.$$ = $
|
|
|
32
32
|
//hyoo/hyoo.ts
|
|
33
33
|
;
|
|
34
34
|
"use strict";
|
|
35
|
-
let $hyoo_sync_revision = "
|
|
35
|
+
let $hyoo_sync_revision = "35aacaf";
|
|
36
36
|
//hyoo/sync/-meta.tree/revision.meta.tree.ts
|
|
37
37
|
;
|
|
38
38
|
"use strict";
|
|
@@ -2949,6 +2949,9 @@ var $;
|
|
|
2949
2949
|
this.pub.promote();
|
|
2950
2950
|
return this._clocks;
|
|
2951
2951
|
}
|
|
2952
|
+
get clocks_bin() {
|
|
2953
|
+
return new Uint8Array($hyoo_crowd_clock_bin.from(this.id(), this._clocks).buffer);
|
|
2954
|
+
}
|
|
2952
2955
|
pub = new $mol_wire_pub;
|
|
2953
2956
|
_clocks = [new $hyoo_crowd_clock, new $hyoo_crowd_clock];
|
|
2954
2957
|
_unit_all = new Map();
|
|
@@ -3948,6 +3951,13 @@ var $;
|
|
|
3948
3951
|
};
|
|
3949
3952
|
this.line_land_neck({ line, land: land_id }, [
|
|
3950
3953
|
handle(this.line_land_neck({ line, land: land_id })[0])
|
|
3954
|
+
.catch(error => {
|
|
3955
|
+
this.$.$mol_log3_fail({
|
|
3956
|
+
place: this,
|
|
3957
|
+
land: land_id,
|
|
3958
|
+
message: String(error?.message ?? error),
|
|
3959
|
+
});
|
|
3960
|
+
})
|
|
3951
3961
|
]);
|
|
3952
3962
|
}
|
|
3953
3963
|
line_send_clocks(line, land) { }
|
|
@@ -4329,7 +4339,7 @@ var $;
|
|
|
4329
4339
|
master() {
|
|
4330
4340
|
this.reconnects();
|
|
4331
4341
|
const link = this.master_link();
|
|
4332
|
-
const line = new $mol_dom_context.WebSocket(link);
|
|
4342
|
+
const line = new $mol_dom_context.WebSocket(link, ['$hyoo_sync']);
|
|
4333
4343
|
line.binaryType = 'arraybuffer';
|
|
4334
4344
|
line.onmessage = async (event) => {
|
|
4335
4345
|
if (event.data instanceof ArrayBuffer) {
|
|
@@ -4377,12 +4387,10 @@ var $;
|
|
|
4377
4387
|
}
|
|
4378
4388
|
line_send_clocks(line, land) {
|
|
4379
4389
|
if (line instanceof WebSocket) {
|
|
4380
|
-
|
|
4381
|
-
line.send(message);
|
|
4390
|
+
line.send(land.clocks_bin);
|
|
4382
4391
|
}
|
|
4383
4392
|
else {
|
|
4384
|
-
|
|
4385
|
-
line.postMessage(['hyoo_sync_clocks', land.id(), message]);
|
|
4393
|
+
line.postMessage(['hyoo_sync_clocks', land.id(), land._clocks]);
|
|
4386
4394
|
}
|
|
4387
4395
|
}
|
|
4388
4396
|
async line_send_units(line, units) {
|