diff --git a/lib/QueryRunner.js b/lib/QueryRunner.js index 4e54805..c74af84 100644 --- a/lib/QueryRunner.js +++ b/lib/QueryRunner.js @@ -45,18 +45,21 @@ export default class QueryRunner { }) } + let portOffsetArray = gameQueryPortOffset + if (!Array.isArray(portOffsetArray)) { + gameQueryPortOffset ? portOffsetArray = [gameQueryPortOffset] : portOffsetArray = [0] + } + if (userOptions.port) { if (!userOptions.givenPortOnly) { - if (gameQueryPortOffset) { addAttemptWithPort(userOptions.port + gameQueryPortOffset) } - + portOffsetArray.forEach((portOffset) => { addAttemptWithPort(userOptions.port + portOffset) }) if (userOptions.port === gameOptions.port && gameQueryPort) { addAttemptWithPort(gameQueryPort) } } - attempts.push(optionsCollection) } else if (gameQueryPort) { addAttemptWithPort(gameQueryPort) } else if (gameOptions.port) { - addAttemptWithPort(gameOptions.port + (gameQueryPortOffset || 0)) + portOffsetArray.forEach((portOffset) => { addAttemptWithPort(gameOptions.port + portOffset) }) } else { // Hopefully the request doesn't need a port. If it does, it'll fail when making the request. attempts.push(optionsCollection)