mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-28 18:26:57 +01:00
Plugins: sandboxed Luau plugins in mods, phase 1 (the host, and the base, console and storage APIs)
A mod with a reskate-plugin.json is a plugin: Luau scripts that run in their own VM, with only
the reskate API ReSkate registers for them. Luau 0.741 is vendored in External/luau (the VM and
compiler only: no native code generation, no loadstring, io or C modules).
- Limits: 64 MB of memory, 50 ms a call, 2 ms a tick on average (over it for 3 s stops it),
more than 5 errors in 10 s stops it, 50 log lines a second. A plugin over a limit cannot catch
it in a pcall and carry on.
- API: reskate.log, on (load, unload, tick, level_loaded, level_unloading), timers, the level,
its own package's files and JSON, require inside the package; console.command and print
("console"); storage get, set, add and keys ("storage"), 1 MB in
%LOCALAPPDATA%\ReSkate\Plugins\<mod>\storage.json.
- Found every 2 s among the mods mods.json leaves on: switching a mod, or changing a plugin's
files, loads, unloads or reloads it without a restart. A package holding a program is refused.
- plugin list, commands, reload, off and on in the console. A plugin cannot take a name of
ReSkate's own commands.
- Tests: DINGOSDK_BUILD_PLUGIN_TESTS, including plugins written to break the sandbox.
This commit is contained in:
1 parent
fffd34ca80
commit
6d542536e1
155 files changed
+75395
-4
No files matched your search
@@ -30,6 +30,7 @@
|
||||
#include "Extension/Assets/map_download.h"
|
||||
#include "Extension/Boot/offline_boot.h"
|
||||
#include "Extension/HallOfMeat/hall_of_meat.h"
|
||||
#include "Extension/Plugins/plugin_runtime.h"
|
||||
#include "Extension/RoadRash/road_rash.h"
|
||||
#include "Extension/BoardBreak/board_break.h"
|
||||
#include "Extension/Skater/grind_exit_control.h"
|
||||
@@ -444,6 +445,8 @@ extern "C" __declspec(dllexport) BOOL WINAPI DingoSDKDebugInitialize() {
|
||||
const bool camera_hook = dingosdk::start_camera_observer(r.base);
|
||||
record("{\"event\":\"camera_observer_initialized\",\"active\":" + std::string(camera_hook ? "true" : "false") + "}");
|
||||
(void)dingosdk::start_no_bail(r.base);
|
||||
const bool plugins = dingosdk::plugins::start();
|
||||
record("{\"event\":\"plugins_initialized\",\"active\":" + std::string(plugins ? "true" : "false") + "}");
|
||||
const bool meat = dingosdk::hall_of_meat::start(r.base);
|
||||
record("{\"event\":\"hall_of_meat_initialized\",\"active\":" + std::string(meat ? "true" : "false") + "}");
|
||||
const bool rash = dingosdk::road_rash::start(r.base);
|
||||
|
||||
Reference in new issue
Block a user