diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2025-01-13 13:44:12 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2025-01-13 13:44:12 +0100 |
commit | cd85889387a046bdd55561951d355243a871017d (patch) | |
tree | 595ceb72f60b860247e574601ff0e04e41fc373b | |
parent | 9101a9c46689f233495527aaa704e109fb6227dd (diff) | |
download | fuzzer-cd85889387a046bdd55561951d355243a871017d.tar.gz |
automatically deduce title from rules.js path (Tor)
-rwxr-xr-x | rtt-module.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rtt-module.js b/rtt-module.js index e035ed7..0dfa642 100755 --- a/rtt-module.js +++ b/rtt-module.js @@ -4,6 +4,7 @@ const Ajv = require("ajv") const ajv = new Ajv({allowUnionTypes: true}) const crypto = require('crypto') const fs = require("fs") +const path = require("path") const { FuzzedDataProvider } = require("@jazzer.js/core") const RULES_JS_FILE = process.env.RTT_RULES || "rules.js" @@ -19,6 +20,7 @@ if (!fs.existsSync(RULES_JS_FILE)) { throw Error("rules.js not found, specify via RTT_RULES environment variable.") } const RULES = require(RULES_JS_FILE) +const TITLE_ID = path.basename(path.dirname(RULES_JS_FILE)) let rules_view_schema = null if (!NO_SCHEMA && RULES.VIEW_SCHEMA) { @@ -195,6 +197,7 @@ function log_crash(error, ctx, action=undefined, args=undefined) { } const game = { setup: { + title_id: TITLE_ID, scenario: ctx.scenario, player_count: ctx.player_count, options: ctx.options, |