Lots of tweaks

This commit is contained in:
Zef Hemel
2022-05-09 14:59:12 +02:00
parent 35dc75d94e
commit f6758dbbaf
25 changed files with 336 additions and 62 deletions
+15
View File
@@ -0,0 +1,15 @@
import { LogEntry } from "../sandbox";
import { SysCallMapping, System } from "../system";
export default function sandboxSyscalls(system: System<any>): SysCallMapping {
return {
"sandbox.getLogs": async (ctx): Promise<LogEntry[]> => {
let allLogs: LogEntry[] = [];
for (let plug of system.loadedPlugs.values()) {
allLogs = allLogs.concat(plug.sandbox.logBuffer);
}
allLogs = allLogs.sort((a, b) => a.date - b.date);
return allLogs;
},
};
}