diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-11-16 00:58:16 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-11-16 00:58:16 +0100 |
commit | b35636f00fa0710125e0ae4569fbdf6f14806763 (patch) | |
tree | 595ceb72f60b860247e574601ff0e04e41fc373b /rtt-module.js | |
parent | e1dc03774b9efec0df14bdf59159bcb597cd0a82 (diff) | |
download | fuzzer-b35636f00fa0710125e0ae4569fbdf6f14806763.tar.gz |
automatically deduce title from rules.js path
Diffstat (limited to 'rtt-module.js')
-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, |