Sandbox
Every resource runs in its own Lua 5.4 state. A resource that crashes, hangs or uses too much memory is stopped; the others keep running.
Available
Section titled “Available”- Lua 5.4 language features: integers,
//,<const>,<close>,goto. - Libraries:
string,table,math,utf8,coroutine, and fromosonlytime,clock,dateanddifftime. - The GAMPEON Lua API.
Not available
Section titled “Not available”| Missing | Why |
|---|---|
io, os.execute, os.getenv, os.remove … |
No access to files or the machine |
require, package, dofile, loadfile |
Scripts come from the manifest only |
debug |
Could break out of the sandbox |
string.dump, bytecode in load |
Bytecode can break the Lua VM |
Limits
Section titled “Limits”| Limit | Default |
|---|---|
| Memory | 64 MB per resource |
| Instructions | 50 million per run of a handler, thread step or export call |
When a limit is hit, the current run stops with an error in the log, for example script exceeded instruction budget.
Client scripts
Section titled “Client scripts”Client scripts come from the server and run on players’ computers. They have no PerformHttpRequest, no MySQL, no SaveResourceFile, and convars are read-only.
The client sandbox has not had its security review yet. Until it has, the game only runs client scripts from trusted servers. See Client scripts.