runcode: improved UI, in-game support, JS support

This commit is contained in:
blattersturm
2019-10-21 15:04:55 +02:00
parent 64a26ad1de
commit 54f75bca86
10 changed files with 702 additions and 57 deletions

View File

@@ -0,0 +1,11 @@
exports('runJS', (snippet) => {
if (IsDuplicityVersion() && GetInvokingResource() !== GetCurrentResourceName()) {
return [ 'Invalid caller.', false ];
}
try {
return [ new Function(snippet)(), false ];
} catch (e) {
return [ false, e.toString() ];
}
});