Plugins: a command ReSkate does not know goes to the game thread, where plugins have theirs

The console answered every command missing from ReSkate's own list itself, as unknown, so a
plugin's command (ptest) never reached the plugins on the game thread. Now only ReSkate's local
commands run there; anything else is queued, and the game thread tries the plugins first and
answers unknown as before when none has it. Checked in game: ptest all, 45 passed, 0 failed.
This commit is contained in:
AyeZeeBB committed 2026-10-19 12:19:39 -05:00
1 parent a3e75ba10e
commit fc4308b682
3 files changed
+6 -2

No files matched your search

+2
View File
@@ -188,6 +188,8 @@ template <class Context> class Registry {
const auto [entry, consumed] = resolve(words);
return !entry || entry->echo_input || consumed != words.size();
}
// Whether the words start with one of its commands.
bool knows(std::span<const std::string> words) const { return resolve(words).first != nullptr; }
bool local(std::span<const std::string> words, const Context &context) const {
const auto [entry, consumed] = resolve(words);
return !entry || entry->execution == Execution::local ||
+3 -1
View File
@@ -220,7 +220,9 @@ void submit_console_command() {
try {
const auto& registry = dingosdk::console::game_commands();
if (registry.echoes(parsed.arguments)) output("> " + command);
if (!parsed || registry.local(parsed.arguments, s.model)) {
// A command ReSkate does not know may be a plugin's, which run on the game thread
// (Extension/Plugins); one no plugin has either is answered there as unknown.
if (!parsed || (registry.knows(parsed.arguments) && registry.local(parsed.arguments, s.model))) {
registry.execute(command, s.model, output);
return;
}
@@ -2,7 +2,7 @@ local h = require("harness")
local t = h.module("console")
-- Try it by hand: ptest echo a b c
reskate.console.command("ptest echo", "Prints its words back (reskate-test)", function(args)
reskate.console.command("ptest echo", "Prints its words back", function(args)
reskate.console.print("ptest echo: " .. table.concat(args, " "))
end)