diff --git a/README.md b/README.md index 94dcb7a..799df4b 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,23 @@ # node-red-contrib-gamedig -Query for the status of most game/voice servers using Node-RED. +Query for server information of most game/voice servers using Node-RED. This package adds the node "Query Game Server" that uses the NPM package [GameDig](https://www.npmjs.com/package/gamedig) to query if a server is online or not and if so returns the data of the server. You can pass the server type, host, and port on the input message or define them on the node (settings defined on the node will override msg values). +You can also specify manual GameDig options using `msg.options` as an input. This will override any other options. For example: you can set `msg.options.guildId` that is required for querying Discord servers. + +Visit the [GameDig GitLab page](https://github.com/gamedig/node-gamedig#return-value) if you want more information about what this library parses and standardizes from the server response. + ### Usage Examples -#### Inserting query data into InfluxDB and using Grafana to view results - -I created a post on my website about how to use this node to query gameservers and store the results in InfluxDB. I then give a dashboard in Grafana that can be used to display the data. Check it out here: -https://skylar.tech/tracking-game-server-statistics-using-node-red-influxdb-and-grafana/ +- #### Inserting query data into InfluxDB and using Grafana to view results +  + I created a post on my website about how to use this node to query gameservers and store the results in InfluxDB. I then give a dashboard in Grafana that can be used to display the data. Check it out here: + https://skylar.tech/tracking-game-server-statistics-using-node-red-influxdb-and-grafana/ + +- #### Automatically restarting servers when unavailable + Ever host a server and have it stop responding but the process doesn't crash so it doesn't auto restart? If you pair this with something like [node-red-contrib-dockerode](https://flows.nodered.org/node/node-red-contrib-dockerode) you can automatically restart the container/process if the query fails X times to respond. ### Other Packages diff --git a/query-game-server.html b/query-game-server.html index bd9f010..cce5d32 100644 --- a/query-game-server.html +++ b/query-game-server.html @@ -11,6 +11,11 @@ max_attempts: { value: '' }, socket_timeout: { value: '' }, attempt_timeout: { value: '' }, + given_port_only: { value: '' }, + ip_family: { value: '0' }, + debug: { value: '' }, + request_rules: { value: '' }, + output_options: { value: '' } }, inputs:1, outputs:1, @@ -28,20 +33,38 @@ return 'Query Game Server'; }, oneditprepare: function() { + let server_types = null; + $.getJSON('/gamedig/types', function(data) { - let html = '
Type | Name | Protocol |
"+game['type']+" | " + - ""+game['name']+" | " + - ""+game['protocol']+" | " + - "
- Search available types below.
- You can also view the list here.
-
msg.options
as an object that contains all the options used to query the server using GameDig. Note: If you pass msg.options
as an input it will override all set options so make sure you unset it if chaining multiple server query nodes together unless that is what you want.
+