Document persistence/memory

master
Ciaran Gultnieks 2014-04-05 08:44:19 +01:00
parent d3c99773d6
commit a378d4dccf
1 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,17 @@ the player who pressed the button and keep doing that until they log off. Becaus
the code does nothing in response to an "act" event, at that point they will go
into a permanent wait (sleep) state.
### Persistence
The code runs in a sandboxed Lua environment which persists for as long as the
person is active. Therefore, 'local' (actually global to the sandboxed
environment) persist between calls for different events.
Information that needs to persist longer than this (i.e. across deactivations
or server restarts) can be stored in the person's "memory". The 'mem' table
(initially empty) can be used to store anything required. It will persist for
the entire lifetime of the person.
### Presets
Several 'presets' are supplied, which serve as both examples and useful