You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is this feature about?
I have an issue whereby I would like to query a master server such as Steam or 333networks. However, I only want to query if using the relevant protocol.
I query the master servers to try and identify the query port first to cut down on query guesses (relates this this request #484). I noticed that --debug outputs all the gamedig options for the query before running it. Part of it outputs procotol: valve which is exactly the info I need.
Would it be possible to add a feature that simply outputs to json the gamedig options without running a query? Almost like a dry-run. This way I could check gamedig to confirm the protocol, then query the master server if valve, or gamespy , and finally do an actual query with the query port gathered from the master server.
This will create a lot of flexibility as currently, I would have to manually list all GameSpy games in an if statement to prevent non-gamespy servers from checking 333networks.
Finally it would also be good to add the protocol and type to the query output as I would like to display the protocol type used for users to see.
Thank you
The text was updated successfully, but these errors were encountered:
The library exports publicly the games definitions, one could do their own wrapper around this:
A CLI that takes one argument, a game name, then looks into this object and if it is present output it into the console:
import{games}from'../lib/index.js'// this would be 'gamedig'importprocessfrom'node:process'constrelevantArgs=process.argv.slice(2)// skip 'node options_script.js'constgameName=relevantArgs[0]// get out game name argif(!gameName){console.error('No game name provided.')process.exit(1)}constgameOptions=games[gameName]if(!gameOptions){console.error('Game name not found.')process.exit(1)}constasJson=JSON.stringify(gameOptions)console.log(asJson)
Example usage:
PS D:\GitHub\node-gamedig> node .\tools\lookup_options.js
No game name provided.
PS D:\GitHub\node-gamedig> node .\tools\lookup_options.js non_exitent_game
Game name not found.
PS D:\GitHub\node-gamedig> node .\tools\lookup_options.js teamfortress2
{"name":"Team Fortress 2","release_year":2007,"options":{"port":27015,"protocol":"valve"},"extra":{"old_id":"tf2"}}
This method is limited to the game-defined entry (which as far as I understand this is what you need).
When you run a query there are other default values, they cannot be accesed at this time (but are documented in the readme).
But nevertheless, I do think this might come in handy, will look into it.
What is this feature about?
I have an issue whereby I would like to query a master server such as Steam or 333networks. However, I only want to query if using the relevant protocol.
I query the master servers to try and identify the query port first to cut down on query guesses (relates this this request #484). I noticed that
--debug
outputs all the gamedig options for the query before running it. Part of it outputsprocotol: valve
which is exactly the info I need.Would it be possible to add a feature that simply outputs to json the gamedig options without running a query? Almost like a dry-run. This way I could check gamedig to confirm the protocol, then query the master server if
valve
, orgamespy
, and finally do an actual query with the query port gathered from the master server.This will create a lot of flexibility as currently, I would have to manually list all GameSpy games in an if statement to prevent non-gamespy servers from checking 333networks.
Finally it would also be good to add the protocol and type to the query output as I would like to display the protocol type used for users to see.
Thank you
The text was updated successfully, but these errors were encountered: