research_sync: README for the cluster research queue, review fixes

Document the cluster research queue in the plugin README and the root
README. Review fixes: ipairs for queue order, event annotations on the new
Lua handlers, an IpcQueue type, a test for clearing the queue, and drop the
controller import from test/missing.js.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ILLISISandClaude Opus 5.5 committed 2026-10-18 21:54:10 +11:00
1 parent 7175571d5b
commit 1f6e0519bd
6 files changed
+41 -7

No files matched your search

+3 -2
View File
@@ -21,6 +21,7 @@ type IpcFinished = {
name: string,
level: number,
};
type IpcQueue = { queue: unknown, player?: string };
export default async function(context: InstancePluginContext) {
const { instance, logger, plugin } = context;
@@ -68,14 +69,14 @@ export default async function(context: InstancePluginContext) {
researchFinished(tech).catch(err => unexpectedError(err));
});
instance.server.on("ipc-research_sync:queue", (data: { queue?: unknown, player?: string }) => {
instance.server.on("ipc-research_sync:queue", (data: IpcQueue) => {
try {
instance.sendTo("controller", new QueueUpdateEvent(asArray(data.queue), data.player ?? null));
} catch (err: any) {
unexpectedError(err);
}
});
instance.server.on("ipc-research_sync:follow", (data: { queue?: unknown, player?: string }) => {
instance.server.on("ipc-research_sync:follow", (data: IpcQueue) => {
followQueue(asArray(data.queue), data.player ?? null).catch(err => unexpectedError(err));
});