diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2025-01-13 13:43:02 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2025-01-13 13:43:02 +0100 |
commit | 9101a9c46689f233495527aaa704e109fb6227dd (patch) | |
tree | a2deb93ec325fed556c3a75e38b01b99a962d1ff /rtt-module.js | |
parent | 0e7af3c6ae2b61a2a02a4a1dfbcd63f714a505a1 (diff) | |
download | fuzzer-9101a9c46689f233495527aaa704e109fb6227dd.tar.gz |
allow dynamic roles list (Tor)
Diffstat (limited to 'rtt-module.js')
-rwxr-xr-x | rtt-module.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rtt-module.js b/rtt-module.js index 5c7e3c6..e035ed7 100755 --- a/rtt-module.js +++ b/rtt-module.js @@ -42,10 +42,14 @@ module.exports.fuzz = function(fuzzerInputData) { // TODO randomize options const options = {} + let roles = RULES.roles + if (typeof roles === "function") + roles = roles(scenario, options) + const ctx = { data: fuzzerInputData, - player_count: RULES.roles.length, - players: RULES.roles.map(r => ({role: r, name: "rtt-fuzzer"})), + player_count: roles.length, + players: roles.map(r => ({role: r, name: "rtt-fuzzer"})), scenario, options, replay: [], @@ -70,7 +74,7 @@ module.exports.fuzz = function(fuzzerInputData) { ctx.active = ctx.state.active if (ctx.active === 'Both' || ctx.active === 'All') { // If multiple players can act, we'll pick a random player to go first. - ctx.active = data.pickValue(RULES.roles) + ctx.active = data.pickValue(roles) } const state_freeze = JSON.stringify(ctx.state) |