Skip to content

Conversation

@XenHat
Copy link

@XenHat XenHat commented Mar 13, 2025

This is a re-implementation of #92 with additional fixes for more games, and should be compatible with #130 as I have validated the code against the current upstream database.

The following games have been verified to be correctly detected on Linux:

  • Factorio
  • Final Fantasy XIV Online
  • Genshin Impact
  • Grand Theft Auto: Vice City
  • Heaven Burns Red
  • Helldivers 2
  • Honkai: Star Rail
  • Horizon Zero Dawn
  • Journey
  • Mafia: The Old Country
  • Minecraft
  • Satisfactory
  • Snowrunner
  • STAR WARS™ Battlefront™ II
  • The Elder Scrolls IV: Oblivion Remastered
  • Wuthering Waves

KNOWN ISSUES:

  • Red Dead Redemption 2 (Broken)
  • Zenless Zone Zero
  • Untested on Windows

Main changes:

  • several performance improvements
  • match against more (malformed?) game database entries
  • logging improvements

Additional credit:

@XenHat XenHat marked this pull request as draft March 13, 2025 16:41
XenHat

This comment was marked as outdated.

@XenHat XenHat marked this pull request as ready for review March 13, 2025 17:02
@XenHat
Copy link
Author

XenHat commented Mar 17, 2025

I've been using this for a few days, seems to be working as intended.
Testing needs to be done on Windows by users of this operating system.

@XenHat XenHat marked this pull request as draft April 14, 2025 19:01
@XenHat XenHat force-pushed the improved-detection-fixes branch 2 times, most recently from 4f79e57 to 4de0038 Compare April 20, 2025 04:15
@XenHat XenHat marked this pull request as ready for review April 22, 2025 19:34
@XenHat XenHat marked this pull request as draft April 25, 2025 05:28
@XenHat
Copy link
Author

XenHat commented Apr 25, 2025

Known issue: The Elder Scrolls IV: Oblivion Remastered isn't detected properly in the new code. An up-to-date detectable.json works with the code prior to this PR but does not with my new code. Fixed

@XenHat XenHat force-pushed the improved-detection-fixes branch 2 times, most recently from dfea808 to 10d9750 Compare April 25, 2025 23:45
@ikaikahub
Copy link

fixes my issue with running thcrap patched touhou 7, cool pr

@XenHat XenHat changed the title Improved detection fixes Improved Linux detection fixes Jul 5, 2025
@XenHat
Copy link
Author

XenHat commented Aug 31, 2025

As of today, I cannot reconnect the standalone arrpc to vesktop anymore after clearing the settings, and thus will be unable to keep working on this for the time being.
I have found how to resume development.

@XenHat XenHat marked this pull request as ready for review August 31, 2025 02:54
Copy link

@konovalov-nk konovalov-nk Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we refactor this file to something like this?

https://jsfiddle.net/jsq76fyc/ <-- much easier to reason about than quadruple nested if blocks 🙂

Then you can also keep the file minimal and export the methods outside of index.js to keep it sane for the mind.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This turned out to break detection again, so I'll need more time to fiddle with it.

Copy link

@konovalov-nk konovalov-nk Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XenHat the approach I'd use for major refactors like this is:

  • Cover existing code with tests
  • Make sure when you change logic in the code it makes tests red (some tests can be green all the time, that's a useless test 🙂)
  • Now, refactor and keep tests green

Much easier in the long run to maintain it this way. Plus you can abstract the tests from actual OS/processes via fakes or mocks.

If I'd have some time I'll give you an example how to write tests for these. But it seems the maintainer didn't add any testing framework for this repo 🙂
So I guess we'd have to ask whether or not we should. E.g. jest/vitest @CanadaHonk

@XenHat XenHat force-pushed the improved-detection-fixes branch 4 times, most recently from 57721dc to 2aba85d Compare September 10, 2025 18:32
const path = _path.toLowerCase().replaceAll('\\', '/');
if (path.startsWith('c:/windows')) continue // system processes (wine)
if (_path.includes('webhelper')) continue; // CEF Processes
// TODO: add 'dolphin-emu' to database for linux executable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for(var entry of DetectableDB) {
  if(entry.id == "356943187589201930") {
    entry.executables.push({ is_launcher: false, name: "dolphin-emu", os: "linux" })
    break;
  }
}

Copy link

@neptuwunium neptuwunium Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should have a less hacky mechanism to patch existing entries or add/remove them. Vesktop adds one for OBS to enable streamer mode by patching the source as well: https://github.com/Vencord/Vesktop/blob/7b5e1ed4da50c02c9ed3dd976066364d1f19c106/patches/arrpc%403.5.0.patch

@XenHat XenHat force-pushed the improved-detection-fixes branch from 42b80ec to ddd283e Compare January 3, 2026 20:33
Some games are listed in the discord game database with their parent directories
but their launched processes on linux don't always have this included in cmdline.
This fixes that by checking processes with their working directories as well.
For example, this will now detect DOOM Eternal running through proton.
@XenHat XenHat force-pushed the improved-detection-fixes branch from ddd283e to 88e1b34 Compare January 3, 2026 20:36
This entry gets detected wrongly, resort to a local fixup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants