Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

Anti-cheat note for Unreal games that keep it under Binaries/Win64 (#194)

Mikek16ac051e6509
diff --git a/scripts/soju_anticheat.py b/scripts/soju_anticheat.py
index abac67b7449..aec5c102944 100644
--- a/scripts/soju_anticheat.py
+++ b/scripts/soju_anticheat.py
@@ -15,19 +15,25 @@ ANTICHEAT = (("eac", "Easy Anti-Cheat", ("easyanticheat", "easyanticheat_eos", "
def anticheat(path):
- """Its short name ("eac", "battleye", ...) or "": the game folder and the folders right under it are looked at."""
+ """Its short name ("eac", "battleye", ...) or "": the game folder, the folders right under it, and the
+ <project>/Binaries/Win64 folder of an Unreal game, where those keep it (Fortnite's EasyAntiCheat is
+ Fortnite/FortniteGame/Binaries/Win64/EasyAntiCheat), are looked at."""
root = Path(str(path or ""))
if len(str(root)) < 8 or not root.is_dir():
return ""
names = set()
+
+ def add(folder):
+ try:
+ names.update(e.name.lower() for e in os.scandir(folder))
+ except OSError:
+ pass
try:
for entry in os.scandir(root):
names.add(entry.name.lower())
if entry.is_dir(follow_symlinks=False) and len(names) < 4000:
- try:
- names.update(e.name.lower() for e in os.scandir(entry.path))
- except OSError:
- pass
+ add(entry.path)
+ add(os.path.join(entry.path, "Binaries", "Win64"))
except OSError:
return ""
for name, _, marks in ANTICHEAT:
diff --git a/tests/test_play_stats.py b/tests/test_play_stats.py
index 77684e49325..d9046a9a545 100644
--- a/tests/test_play_stats.py
+++ b/tests/test_play_stats.py
@@ -176,6 +176,13 @@ class PlayStats(unittest.TestCase):
(game / 'EasyAntiCheat').mkdir(parents=True)
self.assertEqual(ps.anticheat(game), 'eac')
self.assertEqual(ps.anticheat(Path(d) / 'nowhere-at-all'), '')
+ # Unreal games keep it under <project>/Binaries/Win64 (Fortnite from Epic, 2026-11-24).
+ fn = Path(d) / 'Epic Games' / 'Fortnite'
+ (fn / 'FortniteGame' / 'Binaries' / 'Win64' / 'EasyAntiCheat').mkdir(parents=True)
+ self.assertEqual(ps.anticheat(fn), 'eac')
+ plain = Path(d) / 'Epic Games' / 'Plain'
+ (plain / 'PlainGame' / 'Binaries' / 'Win64').mkdir(parents=True)
+ self.assertEqual(ps.anticheat(plain), '')
with mock.patch.object(ps, 'BASE', Path(d)):
(Path(d) / 'logs').mkdir()
log = Path(d) / 'logs/desktop-steam.log'