gamedig / node-gamedig

Query game servers and not only! Node.JS/Deno/Bun or Bash (via the CLI).
https://www.npmjs.com/package/gamedig
MIT License
606 stars 146 forks source link

The Isle - Add Support #189

Closed fastslvblkcar closed 1 year ago

fastslvblkcar commented 4 years ago

This is a game growing in popularity available on steam.

xCausxn commented 4 years ago

You should be able to use the protocol-valve. However this should be easy to add.

https://api.xcausxn.com/v1/game/?type=protocol-valve&host=104.206.80.154&port=28115

Only thing is the players array doesnt contain any info from first glance.

menix1337 commented 4 years ago

You should be able to use the protocol-valve. However this should be easy to add.

https://api.xcausxn.com/v1/game/?type=protocol-valve&host=104.206.80.154&port=28115

Only thing is the players array doesnt contain any info from first glance.

I am in the same boat as topic creator above. I tried to add our own isle server using the protocol-valve

const Gamedig = require('gamedig');

Gamedig.query({
    type: 'protocol-valve',
    host: '138.201.27.46:7782',
}).then((state) => {
    console.log(state);
}).catch((error) => {
    console.log(error)
    console.log("Server is offline");
});

This however results in:

Starting.. Error: Could not determine port to query. Did you provide a port or gameid? at QueryRunner.run (J:\Coding related stuff\DiscordBots\personalStuff\playground\node_modules\gamedig\lib\QueryRunner.js:69:19) at Gamedig.query (J:\Coding related stuff\DiscordBots\personalStuff\playground\node_modules\gamedig\lib\index.js:11:39) at Function.query (J:\Coding related stuff\DiscordBots\personalStuff\playground\node_modules\gamedig\lib\index.js:19:44) at Object. (J:\Coding related stuff\DiscordBots\personalStuff\playground\index.js:13:9) at Module._compile (internal/modules/cjs/loader.js:1176:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10) at Module.load (internal/modules/cjs/loader.js:1040:32) at Function.Module._load (internal/modules/cjs/loader.js:929:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 Server is offline

But using your link, as you provided above - returns useful data. https://api.xcausxn.com/v1/game/?type=protocol-valve&host=138.201.27.46&port=7782

Could i have defined something wrong? Edit: i forgot to specify port - instead of in host; adding it seperately for port.

Works now lol. sorry.

mmorrisontx commented 4 years ago

Looks like this game doesn't return any useful player information at all. All of the returned names are empty, and all scores are zero:

Q#0 Requesting player list ...
Q#0 138.201.27.46:7782 UDP-->
Q#0 Buffer length: 9 bytes
ff ff ff ff 55 ff ff ff ff
            U

138.201.27.46:7782 <--UDP
Buffer length: 9 bytes
ff ff ff ff 41 2d 9c 1b 08
            A  -

Q#0 Registered RTT: 174ms
Q#0 Received full packet
Q#0 Received 41 expected 44
Q#0 Received new challenge key: 136027181
Q#0 Challenge key changed -- allowing query retry if needed
Q#0 UDP send finished by callback
Q#0 138.201.27.46:7782 UDP-->
Q#0 Buffer length: 9 bytes
ff ff ff ff 55 2d 9c 1b 08
            U  -

138.201.27.46:7782 <--UDP
Buffer length: 1076 bytes
ff ff ff ff 44 6b 00 00 00 00 00 00 3d 17 6a 46 00 00 00 00 00
            D  k                    =     j  F
00 a3 58 69 46 00 00 00 00 00 00 21 6c 62 46 00 00 00 00 00 00
      X  i  F                    !  l  b  F
6e 70 1e 46 00 00 00 00 00 00 b6 f2 08 46 00 00 00 00 00 00 4b
n  p     F                             F                    K
d4 00 46 00 00 00 00 00 00 f9 52 fc 45 00 00 00 00 00 00 e6 88
      F                       R     E
fb 45 00 00 00 00 00 00 c9 06 f5 45 00 00 00 00 00 00 02 9a f4
   E                             E
45 00 00 00 00 00 00 78 51 f4 45 00 00 00 00 00 00 b0 02 ec 45
E                    x  Q     E                             E
00 00 00 00 00 00 4c cc eb 45 00 00 00 00 00 00 0e 98 e8 45 00
                  L        E                             E
00 00 00 00 00 63 c1 e2 45 00 00 00 00 00 00 69 1f e0 45 00 00
               c        E                    i        E
00 00 00 00 97 9a de 45 00 00 00 00 00 00 05 9e d7 45 00 00 00
                     E                             E
00 00 00 08 eb ce 45 00 00 00 00 00 00 d6 21 cc 45 00 00 00 00
                  E                       !     E
00 00 4d 32 c8 45 00 00 00 00 00 00 aa 67 b7 45 00 00 00 00 00
      M  2     E                       g     E
00 a4 4e b4 45 00 00 00 00 00 00 83 31 b3 45 00 00 00 00 00 00
      N     E                       1     E
fb a4 a9 45 00 00 00 00 00 00 ca 96 9d 45 00 00 00 00 00 00 86
         E                             E
05 90 45 00 00 00 00 00 00 aa f6 8e 45 00 00 00 00 00 00 87 f7
      E                             E
8d 45 00 00 00 00 00 00 80 46 82 45 00 00 00 00 00 00 fc 27 7f
   E                       F     E                       '
45 00 00 00 00 00 00 d0 f9 78 45 00 00 00 00 00 00 8a 43 78 45
E                          x  E                       C  x  E
00 00 00 00 00 00 88 53 74 45 00 00 00 00 00 00 29 cc 72 45 00
                     S  t  E                    )     r  E
00 00 00 00 00 9d c0 5e 45 00 00 00 00 00 00 95 e9 5a 45 00 00
                     ^  E                          Z  E
00 00 00 00 bd b7 59 45 00 00 00 00 00 00 7d 9e 55 45 00 00 00
                  Y  E                    }     U  E
00 00 00 31 98 4c 45 00 00 00 00 00 00 e8 05 4c 45 00 00 00 00
         1     L  E                          L  E
00 00 ab 29 46 45 00 00 00 00 00 00 53 12 39 45 00 00 00 00 00
         )  F  E                    S     9  E
00 3b 35 36 45 00 00 00 00 00 00 1a 1c 35 45 00 00 00 00 00 00
   ;  5  6  E                          5  E
5f 02 24 45 00 00 00 00 00 00 c2 e6 1f 45 00 00 00 00 00 00 01
_     $  E                             E
d8 1f 45 00 00 00 00 00 00 44 5d 1f 45 00 00 00 00 00 00 bb 71
      E                    D  ]     E                       q
1e 45 00 00 00 00 00 00 19 48 1e 45 00 00 00 00 00 00 67 c1 1b
   E                       H     E                    g
45 00 00 00 00 00 00 dd 9f 10 45 00 00 00 00 00 00 ec e6 0d 45
E                             E                             E
00 00 00 00 00 00 39 8a 0a 45 00 00 00 00 00 00 7f cb 07 45 00
                  9        E                             E
00 00 00 00 00 7c ec 05 45 00 00 00 00 00 00 73 90 00 45 00 00
               |        E                    s        E
00 00 00 00 33 e8 ff 44 00 00 00 00 00 00 9e c1 f9 44 00 00 00
            3        D                             D
00 00 00 61 7e f8 44 00 00 00 00 00 00 70 20 f2 44 00 00 00 00
         a  ~     D                    p        D
00 00 72 3c dd 44 00 00 00 00 00 00 56 a9 db 44 00 00 00 00 00
      r  <     D                    V        D
00 71 f7 da 44 00 00 00 00 00 00 cf 02 c3 44 00 00 00 00 00 00
   q        D                             D
db 2a bb 44 00 00 00 00 00 00 06 25 ba 44 00 00 00 00 00 00 99
   *     D                       %     D
43 b3 44 00 00 00 00 00 00 83 e2 ab 44 00 00 00 00 00 00 e0 f0
C     D                             D
a6 44 00 00 00 00 00 00 ac f2 9f 44 00 00 00 00 00 00 0e d3 9a
   D                             D
44 00 00 00 00 00 00 95 b8 94 44 00 00 00 00 00 00 36 b9 8e 44
D                             D                    6        D
00 00 00 00 00 00 2f 77 84 44 00 00 00 00 00 00 60 67 83 44 00
                  /  w     D                    `  g     D
00 00 00 00 00 f8 3a 81 44 00 00 00 00 00 00 ce 72 75 44 00 00
                  :     D                       r  u  D
00 00 00 00 2c 6e 71 44 00 00 00 00 00 00 71 4d 63 44 00 00 00
            ,  n  q  D                    q  M  c  D
00 00 00 6f d5 61 44 00 00 00 00 00 00 48 4b 59 44 00 00 00 00
         o     a  D                    H  K  Y  D
00 00 53 f3 57 44 00 00 00 00 00 00 31 ff 42 44 00 00 00 00 00
      S     W  D                    1     B  D
00 7f e2 37 44 00 00 00 00 00 00 24 7f 35 44 00 00 00 00 00 00
         7  D                    $     5  D
55 3a 13 44 00 00 00 00 00 00 37 28 13 44 00 00 00 00 00 00 ce
U  :     D                    7  (     D
ed 12 44 00 00 00 00 00 00 66 68 0e 44 00 00 00 00 00 00 a4 f0
      D                    f  h     D
0d 44 00 00 00 00 00 00 df 96 fe 43 00 00 00 00 00 00 f1 2c d9
   D                             C                       ,
43 00 00 00 00 00 00 5b 51 cf 43 00 00 00 00 00 00 45 5a b3 43
C                    [  Q     C                    E  Z     C
00 00 00 00 00 00 f7 f0 b0 43 00 00 00 00 00 00 0e 26 aa 43 00
                           C                       &     C
00 00 00 00 00 fb df 8c 43 00 00 00 00 00 00 df d3 75 43 00 00
                        C                          u  C
00 00 00 00 7e 8d 69 43 00 00 00 00 00 00 f3 f4 5e 43 00 00 00
            ~     i  C                          ^  C
00 00 00 48 29 5a 43 00 00 00 00 00 00 98 6c 40 43 00 00 00 00
         H  )  Z  C                       l  @  C
00 00 e0 7e 35 43 00 00 00 00 00 00 28 0b e8 42 00 00 00 00 00
         ~  5  C                    (        B
00 80 b4 d3 42
            B

Q#0 Registered RTT: 152ms
Q#0 Received full packet
Q#0 Received 44 expected 44
Q#0 UDP send finished by callback
Q#0 Found player:  0 14981.8095703125
Q#0 Found player:  0 14934.1591796875
Q#0 Found player:  0 14491.0322265625
Q#0 Found player:  0 10140.107421875
Q#0 Found player:  0 8764.677734375
Q#0 Found player:  0 8245.0732421875
Q#0 Found player:  0 8074.37158203125
Q#0 Found player:  0 8049.1123046875
Q#0 Found player:  0 7840.84814453125
Q#0 Found player:  0 7827.2509765625
Q#0 Found player:  0 7818.18359375
Q#0 Found player:  0 7552.3359375
Q#0 Found player:  0 7545.537109375
Q#0 Found player:  0 7443.0068359375
Q#0 Found player:  0 7256.17333984375
Q#0 Found player:  0 7171.92626953125
Q#0 Found player:  0 7123.32373046875
Q#0 Found player:  0 6899.75244140625
Q#0 Found player:  0 6621.37890625
Q#0 Found player:  0 6532.2294921875
Q#0 Found player:  0 6406.28759765625
Q#0 Found player:  0 5868.9580078125
Q#0 Found player:  0 5769.830078125
Q#0 Found player:  0 5734.18896484375
Q#0 Found player:  0 5428.62255859375
Q#0 Found player:  0 5042.8486328125
Q#0 Found player:  0 4608.6904296875
Q#0 Found player:  0 4574.8330078125
Q#0 Found player:  0 4542.94091796875
Q#0 Found player:  0 4168.8125
Q#0 Found player:  0 4082.4990234375
Q#0 Found player:  0 3983.61328125
Q#0 Found player:  0 3972.22119140625
Q#0 Found player:  0 3909.220703125
Q#0 Found player:  0 3884.760009765625
Q#0 Found player:  0 3564.038330078125
Q#0 Found player:  0 3502.598876953125
Q#0 Found player:  0 3483.483642578125
Q#0 Found player:  0 3417.905517578125
Q#0 Found player:  0 3273.511962890625
Q#0 Found player:  0 3264.369140625
Q#0 Found player:  0 3170.604248046875
Q#0 Found player:  0 2961.145263671875
Q#0 Found player:  0 2915.326904296875
Q#0 Found player:  0 2897.75634765625
Q#0 Found player:  0 2624.148193359375
Q#0 Found player:  0 2558.42236328125
Q#0 Found player:  0 2557.500244140625
Q#0 Found player:  0 2549.8291015625
Q#0 Found player:  0 2535.108154296875
Q#0 Found player:  0 2532.506103515625
Q#0 Found player:  0 2492.087646484375
Q#0 Found player:  0 2313.991455078125
Q#0 Found player:  0 2270.4326171875
Q#0 Found player:  0 2216.638916015625
Q#0 Found player:  0 2172.718505859375
Q#0 Found player:  0 2142.7802734375
Q#0 Found player:  0 2057.028076171875
Q#0 Found player:  0 2047.2562255859375
Q#0 Found player:  0 1998.050537109375
Q#0 Found player:  0 1987.9493408203125
Q#0 Found player:  0 1937.013671875
Q#0 Found player:  0 1769.888916015625
Q#0 Found player:  0 1757.291748046875
Q#0 Found player:  0 1751.7325439453125
Q#0 Found player:  0 1560.0877685546875
Q#0 Found player:  0 1497.3392333984375
Q#0 Found player:  0 1489.156982421875
Q#0 Found player:  0 1434.1124267578125
Q#0 Found player:  0 1375.0784912109375
Q#0 Found player:  0 1335.52734375
Q#0 Found player:  0 1279.58349609375
Q#0 Found player:  0 1238.595458984375
Q#0 Found player:  0 1189.7681884765625
Q#0 Found player:  0 1141.787841796875
Q#0 Found player:  0 1059.7244873046875
Q#0 Found player:  0 1051.23046875
Q#0 Found player:  0 1033.8427734375
Q#0 Found player:  0 981.7938232421875
Q#0 Found player:  0 965.721435546875
Q#0 Found player:  0 909.2100219726562
Q#0 Found player:  0 903.3348999023438
Q#0 Found player:  0 869.17626953125
Q#0 Found player:  0 863.8019409179688
Q#0 Found player:  0 779.9873657226562
Q#0 Found player:  0 735.5390014648438
Q#0 Found player:  0 725.986572265625
Q#0 Found player:  0 588.9114379882812
Q#0 Found player:  0 588.6283569335938
Q#0 Found player:  0 587.7156982421875
Q#0 Found player:  0 569.6312255859375
Q#0 Found player:  0 567.760009765625
Q#0 Found player:  0 509.1786804199219
Q#0 Found player:  0 434.3511047363281
Q#0 Found player:  0 414.6355895996094
Q#0 Found player:  0 358.7052307128906
Q#0 Found player:  0 353.8825378417969
Q#0 Found player:  0 340.29730224609375
Q#0 Found player:  0 281.7498474121094
Q#0 Found player:  0 245.82762145996094
Q#0 Found player:  0 233.55270385742188
Q#0 Found player:  0 222.9568328857422
Q#0 Found player:  0 218.1612548828125
Q#0 Found player:  0 192.4241943359375
Q#0 Found player:  0 181.49560546875
Q#0 Found player:  0 116.02178955078125
Q#0 Found player:  0 105.8525390625

, so the data that node-gamedig is providing (player count only) is probably the best you'll get.