mirror of
https://github.com/skylord123/node-red-contrib-gamedig.git
synced 2026-05-20 14:13:53 -06:00
Compare commits
8 Commits
a5498a4ba9
..
2.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bacdb685d | |||
| 2bf5cc5f48 | |||
| f0d4b8e269 | |||
| 5f80a0dbed | |||
| 787ee61c4e | |||
| 8bdb043923 | |||
| facf77e1fa | |||
| f6078118c0 |
@@ -6,7 +6,9 @@ This package adds the node "Query Game Server" that uses the NPM package [GameDi
|
||||
|
||||
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).
|
||||
|
||||
[Click here](https://github.com/gamedig/node-gamedig#return-value) if you want more information about what this library parses and standardizes from the server response.
|
||||
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
|
||||
|
||||
Generated
+69
-69
@@ -1,21 +1,21 @@
|
||||
{
|
||||
"name": "node-red-contrib-gamedig",
|
||||
"version": "2.1.2",
|
||||
"version": "2.2.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "node-red-contrib-gamedig",
|
||||
"version": "2.1.2",
|
||||
"version": "2.2.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"gamedig": "^4.0.5"
|
||||
"gamedig": "^4.0.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@sindresorhus/is": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz",
|
||||
"integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==",
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz",
|
||||
"integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==",
|
||||
"engines": {
|
||||
"node": ">=14.16"
|
||||
},
|
||||
@@ -74,14 +74,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cacheable-request": {
|
||||
"version": "10.2.8",
|
||||
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.8.tgz",
|
||||
"integrity": "sha512-IDVO5MJ4LItE6HKFQTqT2ocAQsisOoCTUDu1ddCmnhyiwFQjXNPp4081Xj23N4tO+AFEFNzGuNEf/c8Gwwt15A==",
|
||||
"version": "10.2.13",
|
||||
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.13.tgz",
|
||||
"integrity": "sha512-3SD4rrMu1msNGEtNSt8Od6enwdo//U9s4ykmXfA2TD58kcLkCobtCDiby7kNyj7a/Q7lz/mAesAFI54rTdnvBA==",
|
||||
"dependencies": {
|
||||
"@types/http-cache-semantics": "^4.0.1",
|
||||
"get-stream": "^6.0.1",
|
||||
"http-cache-semantics": "^4.1.1",
|
||||
"keyv": "^4.5.2",
|
||||
"keyv": "^4.5.3",
|
||||
"mimic-response": "^4.0.0",
|
||||
"normalize-url": "^8.0.0",
|
||||
"responselike": "^3.0.0"
|
||||
@@ -252,22 +252,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/domutils": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz",
|
||||
"integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz",
|
||||
"integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==",
|
||||
"dependencies": {
|
||||
"dom-serializer": "^2.0.0",
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.1"
|
||||
"domhandler": "^5.0.3"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
|
||||
"integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==",
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
@@ -290,14 +290,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/gamedig": {
|
||||
"version": "4.0.6",
|
||||
"resolved": "https://registry.npmjs.org/gamedig/-/gamedig-4.0.6.tgz",
|
||||
"integrity": "sha512-h0k9n/e5vNrd9Mh2wyFUp2Vo7ABWbDkdBxKC6FNJLOZiU5d9Z29bntGeYbXtOkcRWoV6Q63wSAJ3jLWxYQkpZw==",
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/gamedig/-/gamedig-4.0.7.tgz",
|
||||
"integrity": "sha512-A8bJ23ulAEp8A4ZJAHp5cMkWu4ymf6AQdOPBAa2asHQqAnf2/bIa07ClcQeeCp+bQWYqJAcW7xvUqjruSrCX4A==",
|
||||
"dependencies": {
|
||||
"cheerio": "^1.0.0-rc.10",
|
||||
"compressjs": "^1.0.2",
|
||||
"gbxremote": "^0.2.1",
|
||||
"got": "^12.0.3",
|
||||
"got": "^12.1.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"long": "^5.2.0",
|
||||
"minimist": "^1.2.6",
|
||||
@@ -338,14 +338,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/got": {
|
||||
"version": "12.5.3",
|
||||
"resolved": "https://registry.npmjs.org/got/-/got-12.5.3.tgz",
|
||||
"integrity": "sha512-8wKnb9MGU8IPGRIo+/ukTy9XLJBwDiCpIf5TVzQ9Cpol50eMTpBq2GAuDsuDIz7hTYmZgMgC1e9ydr6kSDWs3w==",
|
||||
"version": "12.6.1",
|
||||
"resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz",
|
||||
"integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==",
|
||||
"dependencies": {
|
||||
"@sindresorhus/is": "^5.2.0",
|
||||
"@szmarczak/http-timer": "^5.0.1",
|
||||
"cacheable-lookup": "^7.0.0",
|
||||
"cacheable-request": "^10.2.1",
|
||||
"cacheable-request": "^10.2.8",
|
||||
"decompress-response": "^6.0.0",
|
||||
"form-data-encoder": "^2.1.2",
|
||||
"get-stream": "^6.0.1",
|
||||
@@ -367,9 +367,9 @@
|
||||
"integrity": "sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w=="
|
||||
},
|
||||
"node_modules/htmlparser2": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz",
|
||||
"integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==",
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz",
|
||||
"integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==",
|
||||
"funding": [
|
||||
"https://github.com/fb55/htmlparser2?sponsor=1",
|
||||
{
|
||||
@@ -379,9 +379,9 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.2",
|
||||
"domhandler": "^5.0.3",
|
||||
"domutils": "^3.0.1",
|
||||
"entities": "^4.3.0"
|
||||
"entities": "^4.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/http-cache-semantics": {
|
||||
@@ -428,17 +428,17 @@
|
||||
"integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="
|
||||
},
|
||||
"node_modules/keyv": {
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz",
|
||||
"integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==",
|
||||
"version": "4.5.3",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz",
|
||||
"integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==",
|
||||
"dependencies": {
|
||||
"json-buffer": "3.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/long": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
|
||||
"integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
|
||||
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
|
||||
},
|
||||
"node_modules/lowercase-keys": {
|
||||
"version": "3.0.0",
|
||||
@@ -667,9 +667,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@sindresorhus/is": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz",
|
||||
"integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw=="
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz",
|
||||
"integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g=="
|
||||
},
|
||||
"@szmarczak/http-timer": {
|
||||
"version": "5.0.1",
|
||||
@@ -713,14 +713,14 @@
|
||||
"integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w=="
|
||||
},
|
||||
"cacheable-request": {
|
||||
"version": "10.2.8",
|
||||
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.8.tgz",
|
||||
"integrity": "sha512-IDVO5MJ4LItE6HKFQTqT2ocAQsisOoCTUDu1ddCmnhyiwFQjXNPp4081Xj23N4tO+AFEFNzGuNEf/c8Gwwt15A==",
|
||||
"version": "10.2.13",
|
||||
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.13.tgz",
|
||||
"integrity": "sha512-3SD4rrMu1msNGEtNSt8Od6enwdo//U9s4ykmXfA2TD58kcLkCobtCDiby7kNyj7a/Q7lz/mAesAFI54rTdnvBA==",
|
||||
"requires": {
|
||||
"@types/http-cache-semantics": "^4.0.1",
|
||||
"get-stream": "^6.0.1",
|
||||
"http-cache-semantics": "^4.1.1",
|
||||
"keyv": "^4.5.2",
|
||||
"keyv": "^4.5.3",
|
||||
"mimic-response": "^4.0.0",
|
||||
"normalize-url": "^8.0.0",
|
||||
"responselike": "^3.0.0"
|
||||
@@ -836,19 +836,19 @@
|
||||
}
|
||||
},
|
||||
"domutils": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz",
|
||||
"integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz",
|
||||
"integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==",
|
||||
"requires": {
|
||||
"dom-serializer": "^2.0.0",
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.1"
|
||||
"domhandler": "^5.0.3"
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
|
||||
"integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA=="
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="
|
||||
},
|
||||
"event-to-promise": {
|
||||
"version": "0.7.0",
|
||||
@@ -861,14 +861,14 @@
|
||||
"integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw=="
|
||||
},
|
||||
"gamedig": {
|
||||
"version": "4.0.6",
|
||||
"resolved": "https://registry.npmjs.org/gamedig/-/gamedig-4.0.6.tgz",
|
||||
"integrity": "sha512-h0k9n/e5vNrd9Mh2wyFUp2Vo7ABWbDkdBxKC6FNJLOZiU5d9Z29bntGeYbXtOkcRWoV6Q63wSAJ3jLWxYQkpZw==",
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/gamedig/-/gamedig-4.0.7.tgz",
|
||||
"integrity": "sha512-A8bJ23ulAEp8A4ZJAHp5cMkWu4ymf6AQdOPBAa2asHQqAnf2/bIa07ClcQeeCp+bQWYqJAcW7xvUqjruSrCX4A==",
|
||||
"requires": {
|
||||
"cheerio": "^1.0.0-rc.10",
|
||||
"compressjs": "^1.0.2",
|
||||
"gbxremote": "^0.2.1",
|
||||
"got": "^12.0.3",
|
||||
"got": "^12.1.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"long": "^5.2.0",
|
||||
"minimist": "^1.2.6",
|
||||
@@ -894,14 +894,14 @@
|
||||
"integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="
|
||||
},
|
||||
"got": {
|
||||
"version": "12.5.3",
|
||||
"resolved": "https://registry.npmjs.org/got/-/got-12.5.3.tgz",
|
||||
"integrity": "sha512-8wKnb9MGU8IPGRIo+/ukTy9XLJBwDiCpIf5TVzQ9Cpol50eMTpBq2GAuDsuDIz7hTYmZgMgC1e9ydr6kSDWs3w==",
|
||||
"version": "12.6.1",
|
||||
"resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz",
|
||||
"integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==",
|
||||
"requires": {
|
||||
"@sindresorhus/is": "^5.2.0",
|
||||
"@szmarczak/http-timer": "^5.0.1",
|
||||
"cacheable-lookup": "^7.0.0",
|
||||
"cacheable-request": "^10.2.1",
|
||||
"cacheable-request": "^10.2.8",
|
||||
"decompress-response": "^6.0.0",
|
||||
"form-data-encoder": "^2.1.2",
|
||||
"get-stream": "^6.0.1",
|
||||
@@ -917,14 +917,14 @@
|
||||
"integrity": "sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w=="
|
||||
},
|
||||
"htmlparser2": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz",
|
||||
"integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==",
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz",
|
||||
"integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==",
|
||||
"requires": {
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.2",
|
||||
"domhandler": "^5.0.3",
|
||||
"domutils": "^3.0.1",
|
||||
"entities": "^4.3.0"
|
||||
"entities": "^4.4.0"
|
||||
}
|
||||
},
|
||||
"http-cache-semantics": {
|
||||
@@ -965,17 +965,17 @@
|
||||
"integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="
|
||||
},
|
||||
"keyv": {
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz",
|
||||
"integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==",
|
||||
"version": "4.5.3",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz",
|
||||
"integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==",
|
||||
"requires": {
|
||||
"json-buffer": "3.0.1"
|
||||
}
|
||||
},
|
||||
"long": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
|
||||
"integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
|
||||
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
|
||||
},
|
||||
"lowercase-keys": {
|
||||
"version": "3.0.0",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-contrib-gamedig",
|
||||
"version": "2.1.2",
|
||||
"version": "2.2.1",
|
||||
"description": "Query for the status of any game server using node-red",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -23,6 +23,6 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"gamedig": "^4.0.6"
|
||||
"gamedig": "^4.0.7"
|
||||
}
|
||||
}
|
||||
|
||||
+57
-60
@@ -14,7 +14,8 @@
|
||||
given_port_only: { value: '' },
|
||||
ip_family: { value: '0' },
|
||||
debug: { value: '' },
|
||||
request_rules: { value: '' }
|
||||
request_rules: { value: '' },
|
||||
output_options: { value: '' }
|
||||
},
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
@@ -32,20 +33,38 @@
|
||||
return 'Query Game Server';
|
||||
},
|
||||
oneditprepare: function() {
|
||||
let server_types = null;
|
||||
|
||||
$.getJSON('/gamedig/types', function(data) {
|
||||
let html = '<table>' +
|
||||
'<thead id="query-game-server-types-table"><tr><td><strong>Type</strong></td><td><strong>Name</strong></td><td><strong>Protocol</strong></td></tr></thead>' +
|
||||
'<tbody id="query-game-server-type-rows">';
|
||||
for(let game of data) {
|
||||
html += "<tr class=\"query-game-server-type-row\">" +
|
||||
"<td>"+game['type']+"</td>" +
|
||||
"<td>"+game['name']+"</td>" +
|
||||
"<td>"+game['protocol']+"</td>" +
|
||||
"</tr>";
|
||||
if(data.result !== 'ok' || !data.hasOwnProperty("server_types"))
|
||||
{
|
||||
console.error("server_types failed to load");
|
||||
return;
|
||||
}
|
||||
|
||||
server_types = data.server_types;
|
||||
});
|
||||
|
||||
$("#node-input-server_type").autoComplete({
|
||||
search: function(val) {
|
||||
if(!server_types) return false; // ignore until we have the types loaded
|
||||
|
||||
let matches = [];
|
||||
server_types.forEach(v => {
|
||||
if (
|
||||
v.name.toLowerCase().indexOf(val.toLowerCase()) > -1 ||
|
||||
v.type.toLowerCase().indexOf(val.toLowerCase()) > -1 ||
|
||||
v.protocol.toLowerCase().indexOf(val.toLowerCase()) > -1
|
||||
) {
|
||||
matches.push({
|
||||
value: v.type,
|
||||
label: `${v.name} (${v.type})`,
|
||||
protocol: v.protocol
|
||||
});
|
||||
}
|
||||
});
|
||||
return matches;
|
||||
}
|
||||
html += '</tbody>' +
|
||||
'</table>';
|
||||
$("#query-game-server-types").html(html);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -68,10 +87,10 @@
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-server_type"><i class="fa fa-cube"></i> Server Type</label>
|
||||
<input type="text" id="node-input-server_type">
|
||||
<input type="text" id="node-input-server_type" placeholder="msg.server_type">
|
||||
</div>
|
||||
<div style="margin-left: 105px;width: 50%;margin-bottom: 10px;margin-top: -10px;">
|
||||
View server types <a href="#gamdig-types" style="color:#0000EE;text-decoration: underline;">below</a>.
|
||||
Recommend visiting the <a href="https://github.com/gamedig/node-gamedig#games-list" target="_blank" style="color:#0000EE;text-decoration: underline;">GameDig GitHub page</a> for more information about the server type you are trying to query. Some types require extra setup.
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
@@ -84,7 +103,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-port"><i class="fa fa-server"></i> Port</label>
|
||||
<input type="text" id="node-input-port" placeholder="msg.host" />
|
||||
<input type="text" id="node-input-port" placeholder="msg.port" />
|
||||
</div>
|
||||
<div style="margin-left: 105px;width: 50%;margin-bottom: 10px;margin-top: -10px;">
|
||||
Query port for the server (join and query port may differ).
|
||||
@@ -106,7 +125,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-max_attempts"><i class="fa fa-cogs"></i> Max Attempts</label>
|
||||
<input type="text" id="node-input-max_attempts" placeholder="1" />
|
||||
<input type="text" id="node-input-max_attempts" placeholder="msg.max_attempts (default: 1)" />
|
||||
</div>
|
||||
<div style="margin-left: 105px;width: 50%;margin-bottom: 10px;margin-top: -10px;">
|
||||
Number of attempts to query server in case of failure.
|
||||
@@ -114,7 +133,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-socket_timeout"><i class="fa fa-cogs"></i> Socket Timeout</label>
|
||||
<input type="text" id="node-input-socket_timeout" placeholder="2000" />
|
||||
<input type="text" id="node-input-socket_timeout" placeholder="msg.socket_timeout (default: 2000)" />
|
||||
</div>
|
||||
<div style="margin-left: 105px;width: 50%;margin-bottom: 10px;margin-top: -10px;">
|
||||
Milliseconds to wait for a single packet. Beware that increasing this will cause many queries to take longer even if the server is online.
|
||||
@@ -122,7 +141,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-attempt_timeout"><i class="fa fa-cogs"></i> Attempt Timeout</label>
|
||||
<input type="text" id="node-input-attempt_timeout" placeholder="10000" />
|
||||
<input type="text" id="node-input-attempt_timeout" placeholder="msg.attempt_timeout (default: 10000)" />
|
||||
</div>
|
||||
<div style="margin-left: 105px;width: 50%;margin-bottom: 10px;margin-top: -10px;">
|
||||
Milliseconds allowed for an entire query attempt. This timeout is not commonly hit, as the socketTimeout typically fires first.
|
||||
@@ -164,6 +183,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-output_options" style="vertical-align: top"><i class="fa fa-server"></i> Output options</label>
|
||||
<div style="width: 50%;display: inline-block;">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="node-input-output_options"
|
||||
style="width: auto; vertical-align: top"
|
||||
/>
|
||||
Outputs <code style="white-space: normal;">msg.options</code> as an object that contains all the options used to query the server using GameDig. Note: If you pass <code style="white-space: normal;">msg.options</code> 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.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-ip_family"><i class="fa fa-server"></i> IP Rules</label>
|
||||
<select
|
||||
@@ -177,35 +208,6 @@
|
||||
<div style="margin-left: 105px;width: 50%;margin-bottom: 10px;margin-top: -10px;">
|
||||
IP family/version returned when looking up hostnames via DNS, can be IPv4 and IPv6, IPv4 only or IPv6 only.
|
||||
</div>
|
||||
|
||||
<h3 id="gamdig-types">Server Types</h3>
|
||||
<p>
|
||||
Search available types below.<br>
|
||||
You can also view the list <a href="https://github.com/gamedig/node-gamedig#games-list" target="_blank" style="color:#0000EE;text-decoration: underline;">here</a>.
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<input type="text" id="query-game-server-types-search" placeholder="Search types.." style="margin-bottom: 10px;" />
|
||||
</div>
|
||||
<div id="query-game-server-types"></div>
|
||||
<script type="text/javascript">
|
||||
$("#query-game-server-types-search").on("input", function(e) {
|
||||
let value = $(this).val();
|
||||
if(value.length) {
|
||||
$(".query-game-server-type-row").each(function(i, elem){
|
||||
console.log('yay', $(elem).text(), value, $(elem).text().indexOf(value));
|
||||
if($(elem).text().toLowerCase().indexOf(value.toLowerCase()) > -1) {
|
||||
$(elem).show();
|
||||
} else {
|
||||
$(elem).hide();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$(".query-game-server-type-row").show();
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="query-game-server">
|
||||
@@ -228,6 +230,11 @@
|
||||
</dt>
|
||||
<dd>Query port of the server. Ignored if configured on the node. Uses default query port for the server type if left empty.</dd>
|
||||
|
||||
<dt class="optional">
|
||||
msg.options <span class="property-type">object | null</span>
|
||||
</dt>
|
||||
<dd>Set additional GameDig options. This overrides all other methods of setting options. Can be used for example to set <code style="white-space: normal;">msg.options.guildId</code> that is required for querying Discord servers.</dd>
|
||||
|
||||
<dt class="optional">
|
||||
msg.max_attempts <span class="property-type">integer | null</span>
|
||||
</dt>
|
||||
@@ -297,18 +304,8 @@
|
||||
<dd>Query port of the server. Ignored if configured on the node.</dd>
|
||||
|
||||
<dt>
|
||||
msg.max_attempts <span class="property-type">integer</span>
|
||||
msg.options <span class="property-type">object | undefined</span>
|
||||
</dt>
|
||||
<dd>Number of attempts to query server in case of failure. Ignored if configured on the node.</dd>
|
||||
|
||||
<dt>
|
||||
msg.socket_timeout <span class="property-type">integer</span>
|
||||
</dt>
|
||||
<dd>Milliseconds to wait for a single packet. Beware that increasing this will cause many queries to take longer even if the server is online. Ignored if configured on the node.</dd>
|
||||
|
||||
<dt>
|
||||
msg.attempt_timeout <span class="property-type">integer</span>
|
||||
</dt>
|
||||
<dd>Milliseconds allowed for an entire query attempt. This timeout is not commonly hit, as the socketTimeout typically fires first. Ignored if configured on the node.</dd>
|
||||
<dd>Only set if configured to do so. Will return all the options passed to GameDig to query the server.</dd>
|
||||
</dl>
|
||||
</script>
|
||||
+39
-57
@@ -4,7 +4,7 @@ module.exports = function(RED) {
|
||||
|
||||
function QueryGameServer(config) {
|
||||
RED.nodes.createNode(this, config);
|
||||
var node = this;
|
||||
let node = this;
|
||||
this.server_type = config.server_type;
|
||||
this.host = config.host;
|
||||
this.port = config.port;
|
||||
@@ -16,67 +16,46 @@ module.exports = function(RED) {
|
||||
this.ip_family = config.ip_family || 0;
|
||||
this.debug = config.debug || false;
|
||||
this.request_rules = config.request_rules || false;
|
||||
this.output_options = config.output_options || false;
|
||||
node.on('input', function(msg) {
|
||||
if(node.server_type) {
|
||||
msg.server_type = node.server_type;
|
||||
let options = {
|
||||
'type': node.server_type || msg.server_type || undefined,
|
||||
'host': node.host || msg.host || undefined,
|
||||
'port': node.port || msg.port || undefined,
|
||||
'maxAttempts': node.max_attempts || msg.max_attempts || undefined,
|
||||
'socketTimeout': node.socket_timeout || msg.socket_timeout || undefined,
|
||||
'attemptTimeout': node.attempt_timeout || msg.attempt_timeout || undefined,
|
||||
'givenPortOnly': node.given_port_only || msg.given_port_only || undefined,
|
||||
'ipFamily': node.ip_family || msg.ip_family || undefined,
|
||||
'debug': node.debug || msg.config || undefined,
|
||||
'requestRules': node.request_rules || msg.request_rules || undefined
|
||||
};
|
||||
|
||||
if(typeof msg.options === 'object' && msg.options)
|
||||
{
|
||||
options = {...options, ...msg.options};
|
||||
}
|
||||
|
||||
if(node.host) {
|
||||
msg.host = node.host;
|
||||
// set the things we want to return
|
||||
msg.server_type = options.type;
|
||||
msg.host = options.host;
|
||||
msg.port = options.port;
|
||||
if(node.output_options)
|
||||
{
|
||||
msg.options = options;
|
||||
}
|
||||
if(!msg.host) {
|
||||
node.error("msg.host missing from input.");
|
||||
|
||||
if(!options.host) {
|
||||
node.error("host missing from input.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(node.port) {
|
||||
msg.port = node.port;
|
||||
}
|
||||
|
||||
if(node.halt_if) {
|
||||
msg.halt_if = node.halt_if;
|
||||
if(!options.type) {
|
||||
node.error("server_type missing from input.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(node.max_attempts) {
|
||||
msg.max_attempts = node.max_attempts;
|
||||
}
|
||||
|
||||
if(node.socket_timeout) {
|
||||
msg.socket_timeout = node.socket_timeout;
|
||||
}
|
||||
|
||||
if(node.attempt_timeout) {
|
||||
msg.attempt_timeout = node.attempt_timeout;
|
||||
}
|
||||
|
||||
if(node.given_port_only) {
|
||||
msg.given_port_only = node.given_port_only;
|
||||
}
|
||||
|
||||
if(node.ip_family) {
|
||||
msg.ip_family = node.ip_family;
|
||||
}
|
||||
|
||||
if(node.debug) {
|
||||
msg.debug = node.debug;
|
||||
}
|
||||
|
||||
if(node.request_rules) {
|
||||
msg.request_rules = node.request_rules;
|
||||
}
|
||||
|
||||
gamedig.query({
|
||||
'type': msg.server_type,
|
||||
'host': msg.host,
|
||||
'port': msg.port,
|
||||
'maxAttempts': msg.max_attempts,
|
||||
'socketTimeout': msg.socket_timeout,
|
||||
'attemptTimeout': msg.attempt_timeout,
|
||||
'givenPortOnly': msg.given_port_only,
|
||||
'ipFamily': msg.ip_family,
|
||||
'debug': msg.debug,
|
||||
'requestRules': msg.request_rules
|
||||
})
|
||||
gamedig.query(options)
|
||||
.then(function(state) {
|
||||
msg.payload = 'online';
|
||||
msg.data = state;
|
||||
@@ -108,7 +87,7 @@ module.exports = function(RED) {
|
||||
// so we just use regex to parse the info from the README
|
||||
// this could break so we also reference the gamedig repo
|
||||
let availableTypesContent = fs.readFileSync(require.resolve("gamedig/games.txt"), 'utf-8')
|
||||
results = [];
|
||||
server_types = [];
|
||||
|
||||
availableTypesContent
|
||||
.split(/\r?\n/)
|
||||
@@ -126,12 +105,15 @@ module.exports = function(RED) {
|
||||
// avp2010|Aliens vs. Predator (2010)|valve|port=27015
|
||||
|
||||
let [game_type, game_name, game_protocol] = line.split('|');
|
||||
results.push({
|
||||
'name': game_type,
|
||||
server_types.push({
|
||||
'name': game_name,
|
||||
'type': game_type,
|
||||
'protocol': game_protocol
|
||||
});
|
||||
});
|
||||
res.json(results);
|
||||
res.json({
|
||||
'result': 'ok',
|
||||
'server_types': server_types
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user