!7 concept Entry { S computerID, shortName, comment; S controllableByMe; } compact module ComputerNames > DynCRUD { bool automaticallyAddOnlineComputers = true; *() { super(Entry); } start { indexConceptField(Entry, 'computerID); // Add myself cset(uniq_returnIfNew(Entry, computerID := computerID()), comment := "This computer"); dm_vmBus_onMessage('onlineComputerIDs, voidfunc(Collection ids) { if (automaticallyAddOnlineComputers) slurpIDs(ids) }); dm_requireModule("#1016578/AllOnlineComputers"); // Add currently online computers pcall { slurpIDs((LS) dm_callModuleOpt(dm_findModule("#1016578/AllOnlineComputers"), 'onlineComputerIDs)); } } // API svoid slurpIDs(Collection ids) { for (S id : unnull(ids)) uniq_lock(Entry, computerID := id); } S nameForID(S computerID) { ret cget(conceptWhere(Entry, +computerID), 'shortName); } }