Skip to content

Commit

Permalink
feat(tools/attempt): test against all protocols (#475)
Browse files Browse the repository at this point in the history
* feat: get protocol list from /protocols

* simpler way to call protocols

* adds a services filter
  • Loading branch information
podrivo authored Jan 17, 2024
1 parent b481425 commit 7c23e6c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/attempt_protocols.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Minimist from 'minimist'
import { GameDig } from './../lib/index.js'
import * as protocols from './../protocols/index.js'

const argv = Minimist(process.argv.slice(2), {})

Expand All @@ -15,10 +16,15 @@ if (argv._.length >= 1) {

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 () => {
for (const protocol of protocols) {
for (const protocol of protocolListFiltered) {
try {
const response = await gamedig.query({
...options,
Expand Down

0 comments on commit 7c23e6c

Please sign in to comment.