aclist / dztui

DayZ GUI server browser and frontend for Linux
https://aclist.github.io/dzgui/dzgui
GNU General Public License v3.0
89 stars 10 forks source link

ERROR 97 Failed to fetch mod list. #59

Closed AWARR31 closed 1 year ago

AWARR31 commented 1 year ago

This just randomly happened after it decided to close my game.

JakePunk commented 1 year ago

im having the same issue on arch

aclist commented 1 year ago

Hello, you need to provide more information:

marcusdotnet commented 1 year ago

I've been encountering the same issue while connecting to a server through "My servers"

aclist commented 1 year ago

@makud3v

Thanks for the details. Is this problem intermittent or constant? I wasn't able to reproduce it. My current hypothesis is that the third party API periodically goes down and is unavailable.

marcusdotnet commented 1 year ago

@makud3v

Thanks for the details. Is this problem intermittent or constant? I wasn't able to reproduce it. My current hypothesis is that the third party API periodically goes down and is unavailable.

It's completely consistent and the quick-connect option seems to work perfectly so I'm not sure about the API going down - I also forgot a crucial detail: Upon trying to reproduce the error, my terminal would give off a parseerror so maybe the API works fine but the data itself is corrupt?

aclist commented 1 year ago

Quick Connect and My Servers use two different APIs, which is why the problem appears to be localized to the (old) BM API. Can you paste the error here? It does seem as though some data is getting mangled during the handoff. This seems straightforward enough to fix with the addition of some debug code, just need to isolate where exactly it is happening. Depending on what you post, I may also push a hotfixed version that generates more debug output.

aclist commented 1 year ago

OK, stand by: I was able to reproduce the issue on specific servers, but not the one you listed. This is a variant of a longstanding problem/limitation associated with stale information on the BM database.

Your server, ID 15266545 https://www.battlemetrics.com/servers/dayz/15266545

 {
    "addr": "5.252.100.116:2305",
    "gameport": 2302,
    "steamid": "90169621433033735",
    "name": "Basically Vanilla #1 - 1PP|PVP|Loot+|Party|FreshWipe",
    "appid": 221100,
    "gamedir": "dayz",
    "version": "1.20.155766",
    "product": "dayz",
    "region": -1,
    "players": 43,
    "max_players": 100,
    "bots": 0,
    "map": "chernarusplus",
    "secure": true,
    "dedicated": true,
    "os": "w",
    "gametype": "battleye,no3rd,external,privHive,shard,lqs0,etm4.000000,entm9.000000,allowedFilePatching,mod,09:34"
  }

Server I tested, ID 18098930 https://www.battlemetrics.com/servers/dayz/18098930

{
    "addr": "103.193.80.106:27016",
    "gameport": 2602,
    "steamid": "90169624350284802",
    "name": "1SK [AUS] 1PP-5MAN-PVP-XPSYSTEM-DRUGS-VAULTS-SPAWNSELECT-EXTRAC",
    "appid": 221100,
    "gamedir": "dayz",
    "version": "1.20.155766",
    "product": "dayz",
    "region": -1,
    "players": 37,
    "max_players": 100,
    "bots": 0,
    "map": "chernarusplus",
    "secure": true,
    "dedicated": true,
    "os": "w",
    "gametype": "battleye,no3rd,external,privHive,shard,lqs0,etm4.000000,entm12.000000,mod,07:44"
  }

Notice that for the second server, the gameport reported by BM (2302) is incorrect. The Valve master server returns 2602 as the actual game port. BM's data is out of date.

We have a few options here:

  1. Sanitize BM results before preparing the My Servers list

    • Continue allowing to add servers by BM ID, but explicitly reject as untrustworthy the gameports BM returns. Only accept the IPs as valid, and double-check IPs to find the correct ports.
    • Because servers can have multiple maps behind different ports, the user would need to select the right one via a dialog (this is how connect by IP currently works)
  2. Only allow adding to My Servers via IP

    • Same as above, just skips the BM API entirely
    • Servers would have to be stored as IP:PORT combinations in the config file after the user selects the right one
  3. Stop using third party APIs altogether and write a custom API using A2S

    • Problem is Bohemia obfuscated server responses using an encryption algorithm, so it's not easy to get the modlist using a native method
    • This would be a considerably large investment/undertaking of time

Some combination of 1 & 2 would look like:

aclist commented 1 year ago

For the time being, I recommend using connect-by-IP as the guaranteed method of connecting.

aclist commented 1 year ago

I have a working fix that will go live into the Testing branch tomorrow.

We can short-circuit the My Servers menu to point to the connect-by-IP menu and ensure we are always using the sanitized IPs instead of the stale ID info. This will be transparent to the user, unless you select a "My Server" that has multiple maps on it, in which case you'll be prompted to select the right map (inheriting the logic of the connect-by-IP menu).

The code around this is getting rather ungainly at this point and we are due for a refactor, but will focus on releasing the hotfix first.

aclist commented 1 year ago

@makud3v

This fix is now live on Testing.

Via the Options menu, select Advanced Options > Toggle branch to switch to the Testing branch. The testing branch will download and update.

After relaunching, verify that My Servers works as intended with all of your servers. Once this is confirmed working, will release it into the Stable branch.

aclist commented 1 year ago

Since I didn't hear back from any reporters about this, I've merged the fix into the Stable branch as well.