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
612 stars 145 forks source link

7d2d - A20 update broke gamedig (switched to undocumented query protocol) #268

Closed eebssk1 closed 1 year ago

eebssk1 commented 2 years ago

I have setup a 7daystodie dedicated server,visibility is set to 2(friends only),enabled SteamNetworking,direct connect works also fine. However gamedig can't get the information. Gamedig seems using the port 26901 but after lsof -i I found the server only listen on 26900 and 26902 (no players at this time).

mmorrisontx commented 2 years ago

What's the ip address? I guess it's also possible that 7d2d servers limited to friends only might not respond to query pings.

eebssk1 commented 2 years ago

What's the ip address? I guess it's also possible that 7d2d servers limited to friends only might not respond to query pings.

It looks like the version A20 's issue. I have tried set the visibility to {0,1,2} ,however it does not listen on 26901 at all.

mmorrisontx commented 2 years ago

The a20 update notes contain this, which is suspicious. I wonder if they totally ripped out the steam server browser as a side effect.

To future-proof our game, including allowing us to use the latest anti-cheat and expanding to other platforms later on for future crossplay capabilities, we added Epic Online Services (EOS) to the game. For regular players this should not have any noticeable effect, you do NOT need an account on Epics platforms. EOS only knows your SteamID which is public anyway and matches that to an ID for EOS that is only valid for 7 Days to Die.

The change for server administration is in the user IDs that are used to store data and reference players, i.e. the filenames of user files, IDs in the serveradmin.xml or console output / commands which now refer to the user’s EOS ID.

eebssk1 commented 2 years ago

If you send a http get or simple GET message using tcp socket to the main game port, You can still get some basic game information.

eebssk1 commented 2 years ago
function sd(callback) {
  const port = 26900;
  const host = 'REDACTED';
  const rawHttpRequest = 'GET';
  const socket = new net.Socket();
  socket.connect(port, host);
  socket.on('connect', () => {
    socket.write(rawHttpRequest);
  });
  socket.on('data', data => {
    const st = data.toString();
    const sta = st.split(';');
    var dict = new Object();
    for (let sts of sta) {
      let stsa = sts.split(':');
      dict[stsa[0]] = stsa[1];
    }
   var mys = "游戏状态>\n";
   mys += "游戏模式:" + dict["GameMode"] +'\n';
   mys += "服务器解释:" + dict["ServerDescription"] +'\n';
   mys += "等级名称:" + dict["LevelName"] +'\n';
   mys += "游戏主机:" + dict["GameHost"] +'\n';
   mys += "版本:" + dict["Version"] +'\n';
   mys += "最大玩家数:" + dict["MaxPlayers"] +'\n';
   mys += "当前玩家数:" + dict["CurrentPlayers"] +'\n';
   mys += "游戏难度:" + dict["GameDifficulty"] +'\n';
   const time = parseInt(dict["CurrentServerTime"]);
   const timem = (time % 24000) * 0.06;
   mys += "游戏内时间:" + Math.floor(time/24000) + " " + Math.floor(timem / 60) + ':' + Math.floor(timem % 60);
   callback(mys);
   socket.destroy();
 });
}

Currently retrieves something

cetteup commented 1 year ago

I just stumbled upon this while messing with the 7d2d server list. It seems the servers are now all responding on what seems to be both the game and query port.

@eebssk1 Not sure if you have checked recently, but can you try to query your server on the game port?

gamedig --type protocol-valve [ip]:[port]

Here are some servers from the list, all of which responded to a normal valve-protocol query on the listed port.

IP:Port Protocol Version
5.182.88.182:26900 17 00.20.06
46.83.7.233:26900 17 00.20.06
84.168.234.228:27015 17 00.20.06
193.30.120.133:26900 17 00.20.06
46.84.139.30:26900 17 00.20.06
93.211.34.210:26900 17 00.20.06
155.133.91.5:26900 17 00.20.06
155.133.91.5:27900 17 00.20.06
193.30.120.90:27015 17 00.20.06
84.188.56.33:26900 17 00.20.06
2.59.28.141:27015 17 00.20.06
195.201.196.178:26900 17 00.20.06
87.168.244.149:26900 17 00.20.06
84.177.134.25:26900 17 00.20.06
84.181.162.21:26900 17 00.19.03
217.250.101.148:26900 17 00.20.06
78.46.203.193:26900 17 00.20.06
94.130.10.233:26110 17 00.20.06
94.130.51.183:28000 17 00.20.06
178.63.83.115:28900 17 00.20.06
CosminPerRam commented 1 year ago

Hey, bumping this, @eebssk1 have you tried querying games recently? I was reading the comments here and as @cetteup said, servers now seem to respond to protocol-valve queries (also have tried many random servers which were on 00.21.01 and they did worked normally).

eebssk1 commented 1 year ago

Hey, bumping this, @eebssk1 have you tried querying games recently? I was reading the comments here and as @cetteup said, servers now seem to respond to protocol-valve queries (also have tried many random servers which were on 00.21.01 and they did worked normally).

Haven't tried this. But server stats from steam chat does able to query now so I think it's fixed.

CosminPerRam commented 1 year ago

Feel free to reopen if problems arise.