Standard Lua Libraries
The following standard Lua libraries are included:
- basic functions
- Loading of binary lua files is not supported and search paths are limited to the module folder.
- Binary lua modules and native C libraries are not supported
- Search paths are limited to the module folder and bundled library path
The following libraries are bundled and can be
- cgilua/lp – Implementation of LuaPages to allow HTML pages to be built dynamically (any pages served will be subsequently sanitised).
Certain calls made to the game via the mod API are capable of generating HTML output for messages and help dialogs that can be displayed by the client. The LuaPages library can be used as a convenient way to generate these pages from template files.
For security reasons, the HTML you can display is limited to the contents of the
<body> section, and only the following tags and attributes are permitted:
- Basic formatting tags
<h1> - <h6>, <p>, <div>,<blockquote>,<pre>,<b>,<i>,<b>,<em>
- Unordered and ordered list tags, definition lists, simple tables
<a>anchors, with the
actionset to an allowed URL)
The URLs that can be returned are restricted to
Files served from the lp/ folder have access to the following globals
url_constants.static_content_path– path to the mod
is_game_running– true if the game is running, false if the content is displayed in the lobby before starting the game
In addition, files served as part of in-game dialogs and contextual help also have access to
url_constants.game_endpoint_path– path to the game REST endpoint for submitting the results of any message dialogs
The above list of allowed HTML features may be extended in future.