feat(tools/attempt): test against all protocols (#475)
* feat: get protocol list from /protocols * simpler way to call protocols * adds a services filter
This commit is contained in:
parent
b481425dbf
commit
7c23e6c9e4
|
@ -1,5 +1,6 @@
|
||||||
import Minimist from 'minimist'
|
import Minimist from 'minimist'
|
||||||
import { GameDig } from './../lib/index.js'
|
import { GameDig } from './../lib/index.js'
|
||||||
|
import * as protocols from './../protocols/index.js'
|
||||||
|
|
||||||
const argv = Minimist(process.argv.slice(2), {})
|
const argv = Minimist(process.argv.slice(2), {})
|
||||||
|
|
||||||
|
@ -15,10 +16,15 @@ if (argv._.length >= 1) {
|
||||||
|
|
||||||
const gamedig = new GameDig(options)
|
const gamedig = new GameDig(options)
|
||||||
|
|
||||||
const protocols = ['valve', 'gamespy1', 'gamespy2', 'gamespy3', 'goldsrc', 'minecraft', 'quake1', 'quake2', 'quake3', 'unreal2', 'valve']
|
let protocolList = []
|
||||||
|
Object.keys(protocols).forEach((key) => protocolList.push(key))
|
||||||
|
|
||||||
|
const services = ['discord', 'beammpmaster', 'beammp', 'teamspeak2', 'teamspeak3']
|
||||||
|
const protocolListFiltered = protocolList.filter((protocol) => !services.includes(protocol))
|
||||||
|
|
||||||
|
|
||||||
const run = async () => {
|
const run = async () => {
|
||||||
for (const protocol of protocols) {
|
for (const protocol of protocolListFiltered) {
|
||||||
try {
|
try {
|
||||||
const response = await gamedig.query({
|
const response = await gamedig.query({
|
||||||
...options,
|
...options,
|
||||||
|
|
Loading…
Reference in New Issue