Warning: session_start(): open(/var/lib/php/sessions/sess_2vps08a38osi19m4lcj0v4fe0h, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
concept GModule {
S moduleID, moduleLibID;
S userID; // e. g. discord user id
S userName;
S shorthand;
}
cmodule GModulesManager > DynCRUD {
// API
S startModuleForUser(S moduleLibID, S userID, S userName, S shorthand) {
Pair p = uniqConcept2(+userID, +shorthand);
if (!p.b) ret "Module already running";
cset(p.a, +userName, +moduleLibID);
print("Starting module: " + moduleLibID);
cset(p.a, moduleID := dm_makeNewModule(moduleLibID));
ret print("Module " + moduleLibID + " started for " + userName + " as " + quote(shorthand));
}
S deleteModuleForUser(S userID, S shorthand) {
GModule mod = conceptWhere GModule(+userID, +shorthand);
if (mod == null) ret "Module not found";
deleteConcept(mod);
ret "Module deleted";
}
}