@rithien/comfy_adapter 0.1.1 → 0.1.2
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/CHANGELOG.md +4 -0
- package/controller.js +14 -9
- package/dist/web/manifest.json +2 -2
- package/dist/web/static/{comfy_adapter.d4e7b110a214b7665a30.js → comfy_adapter.e593ec53fe47f48d8273.js} +1 -1
- package/dist/web/static/{package_json.87c73881df7eaa860989.js → package_json.e650ba10073abbad50e8.js} +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.1.2 — 2026-05-18
|
|
4
|
+
|
|
5
|
+
- **Bug fix**: `buildSingleCallback` wysyłał `pcall(Token.get(<n>)(d)); pcall(Server.raise_data_set(d))` (dual-path). Gdy backend nie miał record dla zapytanego key (świeży gracz), `d.value=nil`, a handler `on_data_set_changed` w `scenario/lib/sessions.lua` interpretował to jako DELETE i nullował `storage.sessions[name]` + `storage.trusted[name]` świeżo ustawione przez `try_upload_data_token`. Effect runtime: gracz online > threshold, ale `/sessionsstatus` pokazywał `sessions=0, trusted=false`. Pozostawiono tylko Token callback path; `Server.raise_data_set` nadal wywoływany w `broadcastDataSet` (cross-instance push, intencjonalny). Anuluje decyzję dual-path z [2026-05-17][22:54].
|
|
6
|
+
|
|
3
7
|
## v0.1.1 — 2026-05-18
|
|
4
8
|
|
|
5
9
|
- **Bug fix**: `/cc` RCON callbacks (`buildSingleCallback`, `buildAllCallback`, `broadcastDataSet`) used `require('lib.token')` / `require('lib.server')` to access scenario modules. Factorio disables `require` outside of `control.lua` parsing — runtime calls raised `"Require can't be used outside of control.lua parsing"` and dropped the DATA-GET response, leaving `storage.sessions` empty. Switched to `_G.Token` / `_G.Server` (globals exposed by `scenario/control.lua` from v0.1.1+). **Requires** `factorio-polska` scenario v0.1.1 or newer.
|
package/controller.js
CHANGED
|
@@ -375,13 +375,20 @@ class ControllerPlugin extends BaseControllerPlugin {
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
|
-
* Buduje `/cc local d={...}; Token.get(<token>)(d)
|
|
379
|
-
* Oba paths są wywoływane: per-request closure (Token) i broadcast (raise_data_set).
|
|
378
|
+
* Buduje `/cc local d={...}; Token.get(<token>)(d)`.
|
|
380
379
|
*
|
|
381
|
-
*
|
|
380
|
+
* Single-path: tylko per-request closure (Token callback). NIE wywołujemy
|
|
381
|
+
* `Server.raise_data_set(d)` na DATA-GET response — to powodowało race condition
|
|
382
|
+
* w `scenario/lib/sessions.lua`: gdy backend nie ma record (świeży gracz),
|
|
383
|
+
* `d.value=nil`, a handler `on_data_set_changed` interpretuje to jako DELETE
|
|
384
|
+
* i nuluje `storage.sessions[name]` + `storage.trusted[name]` świeżo ustawione
|
|
385
|
+
* przez Token callback (try_upload_data_token). Cross-instance broadcast
|
|
386
|
+
* pozostaje w `broadcastDataSet` (wywoływany z `handleDataSet`, nie z odpowiedzi
|
|
387
|
+
* na DATA-GET). Patrz DECISIONS.md [2026-05-18] (anuluje dual-path z [2026-05-17][22:54]).
|
|
388
|
+
*
|
|
389
|
+
* Używa globala `Token` eksponowanego przez scenario/control.lua —
|
|
382
390
|
* `require` jest wyłączone w runtime Factorio ("Require can't be used outside of
|
|
383
|
-
* control.lua parsing")
|
|
384
|
-
* Wymaga scenariusza factorio-polska v0.1.1+ (eksponuje _G.Server, _G.Token).
|
|
391
|
+
* control.lua parsing"). Wymaga scenariusza factorio-polska v0.1.1+.
|
|
385
392
|
*/
|
|
386
393
|
buildSingleCallback(token, dataSet, key, value, toPrint = null) {
|
|
387
394
|
const fields = [
|
|
@@ -397,10 +404,8 @@ class ControllerPlugin extends BaseControllerPlugin {
|
|
|
397
404
|
const data = `{${fields.join(",")}}`;
|
|
398
405
|
return (
|
|
399
406
|
`/cc local d=${data} ` +
|
|
400
|
-
`local
|
|
401
|
-
`
|
|
402
|
-
`if not ok1 then log('[comfy_adapter Token callback] '..tostring(err1)) end ` +
|
|
403
|
-
`if not ok2 then log('[comfy_adapter raise_data_set] '..tostring(err2)) end`
|
|
407
|
+
`local ok,err=pcall(function() Token.get(${token})(d) end) ` +
|
|
408
|
+
`if not ok then log('[comfy_adapter Token callback] '..tostring(err)) end`
|
|
404
409
|
);
|
|
405
410
|
}
|
|
406
411
|
|
package/dist/web/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"main.js": "static/main.761df12d5815fb8e02fa.js",
|
|
3
|
-
"comfy_adapter.js": "static/comfy_adapter.
|
|
3
|
+
"comfy_adapter.js": "static/comfy_adapter.e593ec53fe47f48d8273.js",
|
|
4
4
|
"static/info_js.js": "static/info_js.9ad5f016be3454c1a255.js",
|
|
5
|
-
"static/package_json.js": "static/package_json.
|
|
5
|
+
"static/package_json.js": "static/package_json.e650ba10073abbad50e8.js"
|
|
6
6
|
}
|
|
@@ -123,7 +123,7 @@ __webpack_require__.d(exports, {
|
|
|
123
123
|
/******/ // This function allow to reference async chunks
|
|
124
124
|
/******/ __webpack_require__.u = (chunkId) => {
|
|
125
125
|
/******/ // return url for filenames based on template
|
|
126
|
-
/******/ return "static/" + chunkId + "." + {"info_js":"9ad5f016be3454c1a255","package_json":"
|
|
126
|
+
/******/ return "static/" + chunkId + "." + {"info_js":"9ad5f016be3454c1a255","package_json":"e650ba10073abbad50e8"}[chunkId] + ".js";
|
|
127
127
|
/******/ };
|
|
128
128
|
/******/ })();
|
|
129
129
|
/******/
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
\**********************/
|
|
16
16
|
(module) {
|
|
17
17
|
|
|
18
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rithien/comfy_adapter","version":"0.1.
|
|
18
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rithien/comfy_adapter","version":"0.1.2","description":"Clusterio plugin: parses Comfy/factorio-polska scenario stdout tags ([DISCORD*], [ANTIGRIEF-LOG], [DATA-SET/GET]) and bridges to Discord + JSON datastore","main":"info.js","scripts":{"test":"echo \\"Error: no test specified\\" && exit 1","prepare":"webpack-cli --env production"},"keywords":["clusterio","clusterio-plugin","factorio","factorio-polska","discord","comfyfactorio"],"author":"rithien <jacek@zaluzje.bialystok.pl>","license":"MIT","peerDependencies":{"@clusterio/lib":"^2.0.0-alpha.14"},"devDependencies":{"@clusterio/lib":"^2.0.0-alpha.14","@clusterio/web_ui":"^2.0.0-alpha.14","webpack":"^5.88.2","webpack-cli":"^5.1.4","webpack-merge":"^5.9.0"},"publishConfig":{"access":"public"}}');
|
|
19
19
|
|
|
20
20
|
/***/ }
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rithien/comfy_adapter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Clusterio plugin: parses Comfy/factorio-polska scenario stdout tags ([DISCORD*], [ANTIGRIEF-LOG], [DATA-SET/GET]) and bridges to Discord + JSON datastore",
|
|
5
5
|
"main": "info.js",
|
|
6
6
|
"scripts": {
|