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 148 forks source link

bug: Squad now using EOS instead of Valve #545

Open dgibbs64 opened 7 months ago

dgibbs64 commented 7 months ago

Describe the bug It appears that Squad is now using EOS for server management and valve protocol appears to no longer be working. I dont have much experiance in the EOS system yet so unsure how to test it currently.

dgibbs64 commented 7 months ago

Side node: Satisfactory is also using EOS. If squad gets up and running I can raise an issue for it as well

podrivo commented 7 months ago

Other EOS protocols use data extracted from game files:

// OAuth2 credentials extracted from ARK: Survival Ascended files.
this.clientId = 'xyza7891muomRmynIIHaJB9COBKkwj6n'
this.clientSecret = 'PP5UGxysEieNfSrEicaD1N2Bb3TdXuD7xHYcsdUHZ7s'
this.deploymentId = 'ad9a8feffb3b4b2ca315546f038c3ae2'

If someone provide these Squad credentials, I can update the implementation. (:

podrivo commented 7 months ago

It seems Squad v6 is using Valve's protocol, but Squad v7 is using EOS. Tried querying one server and got a response. It looks like you can grab version from: state.raw.rules.GameVersion_s.

Not sure how to proceed with the same game having 2 protocols depending on the version. @CosminPerRam Do you know if other games have this situation? If not, how do you think we should do this?

state.raw.rules.GameVersion_s = "V6.0.1.185689.536"
gamedig --type squad 94.130.34.113:7787

{
  "name": "FG | Team Server",
  "map": "Anvil_AAS_v1",
  "password": false,
  "raw": {
    "protocol": 17,
    "folder": "squad",
    "game": "Squad",
    "appId": 393380,
    "numbots": 0,
    "listentype": "d",
    "environment": "l",
    "secure": 0,
    "steamid": "90177454318635016",
    "tags": [
      "BUILDID:185689",
      "OWNINGID:90177454318635016",
      "OWNINGNAME:FG | Team Server",
      "NUMOPENPRIVCONN:0",
      "NUMOPENPUBCONN:100",
      "SESSIONFLAGS:171"
    ],
    "players": [],
    "rules": {
      "AllModsWhitelisted_b": "false",
      "CONMETHOD": "P2P",
      "CurrentModLoadedCount_i": "0",
      "Flags_i": "7",
      "GameMode_s": "AAS",
      "GameVersion_s": "V6.0.1.185689.536",
      "MatchTimeout_f": "120.000000",
      "NextLayer_s": "Anvil Invasion v1",
      "NUMOPENPRIVCONN": "0",
      "NUMOPENPUBCONN": "100",
      "NUMPRIVCONN": "0",
      "NUMPUBCONN": "100",
      "OWNINGID": "90177454318635016",
      "OWNINGNAME": "FG | Team Server",
      "P2PADDR": "90177454318635016",
      "P2PPORT": "7787",
      "Password_b": "false",
      "PlayerCount_i": "0",
      "PlayerReserveCount_i": "0",
      "PLAYTIME_i": "4600",
      "PublicQueueLimit_i": "25",
      "PublicQueue_i": "0",
      "ReservedQueue_i": "0",
      "SEARCHKEYWORDS_s": "Custom",
      "SESSIONFLAGS": "171",
      "TeamOne_s": "Anvil_AAS_v1_ADF",
      "TeamTwo_s": "Anvil_AAS_v1_PLA"
    }
  },
  "version": "dev",
  "maxplayers": 100,
  "numplayers": 0,
  "players": [],
  "bots": [],
  "queryPort": 27165,
  "connect": "94.130.34.113:7787",
  "ping": 213
}
CosminPerRam commented 7 months ago

We should always prefer the newer version, meaning that we should default it to EOS and provide another game entry for the 'older' version (that eventually will be removed).

widetrace commented 5 months ago

Hi there

any news about squad servers? or can i offer some help?

CosminPerRam commented 5 months ago

Adding support for EOS games is a bit tricky (1, 2) as it requires searching around for the keys.

lonelyicer commented 3 months ago

If someone provide these Squad credentials, I can update the implementation. (:

I'm not sure this is working, this is from squad's official editor

clientId = xyza7891J7d3GU8ZIwCoC5xdBsdoqVWA clientSecret = 4SLVBqAm09q776SIlQRTD6moM/bnGAWhDSqOxJAIS0s deploymentId = 7685429b6da24082a63fcbb5f0f90e18

xCausxn commented 3 months ago

I believe its due to the fact the Squad Game Client details require player authentication.

The Squad Dedicated Server clientId/secret is different but doesnt have the required permissions on the API to query for servers,