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.

D2R VR works on D2R 3.4.95032 (#195)

Mikek10a098fc514f
diff --git a/docs/VR.md b/docs/VR.md
index e288da1e962..a9544d7b2fa 100644
--- a/docs/VR.md
+++ b/docs/VR.md
@@ -41,6 +41,13 @@ Simulator on the Mac for testing. The Mac and the headset need to be on the same
Status (November 2026): verified on M4 Pro / macOS 26.5 with the OXRSys Simulator: first-person view in Act 1 at
72 fps. **Not yet tested on a real headset.** Physical Quest controller input therefore has not been checked.
+D2R 3.4.95032 (the Battle.net build since November 2026) is accepted too, listed under `extra_builds` in
+`resources/d2r-vr.json`. Checked 2026-11-25 on the same Mac with the simulator: setup, the title, the VR character
+list and first-person play in the Rogue Encampment at 58-74 fps, with the same mod release; its game hooks and
+combat checks all found their code. One thing is not found on this build: the see-through wall fade, so walls fade
+as the game has them. Setup also answers D2RLoader's "This D2R version hasn't been fully tested yet" window for
+that version (`d2rloader/data/loader-state.json`), which nobody in a headset could press.
+
## Create an offline character inside VR
Connect the OXRSys headset/client or Simulator **before `soju vr play`**. If the
@@ -109,5 +116,6 @@ version. Setup deliberately cannot substitute an unpatched or unchecked DLL.
- Use **offline characters** only. Characters you make in VR live in the copy; `--refresh` keeps them.
- D2R requires an online sign-in within the last 30 days even for offline play. If it says so, play D2R online once
from Battle.net, then run `soju vr setup --refresh`.
-- The mod supports D2R 3.3.93847. Setup refuses other builds.
+- Setup accepts D2R 3.3.93847 (the mod release's own build) and 3.4.95032 (checked by Soju, above), and refuses
+ other builds.
- Modding is your choice and the mod is not Blizzard's. Online play is never used by this mode.
diff --git a/resources/d2r-vr.json b/resources/d2r-vr.json
index 661b53c49df..25cd84b3ae4 100644
--- a/resources/d2r-vr.json
+++ b/resources/d2r-vr.json
@@ -1,6 +1,12 @@
{
"schema": 1,
"game_build": "3.3.93847",
+ "extra_builds": [
+ {
+ "build": "3.4.95032",
+ "checked": "2026-11-25, M4 Pro, macOS 26.5, OXRSys Simulator: setup, title, VR character list and first-person play in the Rogue Encampment at 58-74 fps with mod 0.3.31; its game hooks and combat checks all found their code. Not found on this build: the see-through wall fade (walls fade as the game has them). Not tried on a headset."
+ }
+ ],
"note": "Offline only: D2R VR Unleashed runs through D2RLoader with -mod, which keeps D2R off Battle.net game servers.",
"runtime": {
"url": "https://github.com/BCD1210/soju/releases/download/vr-runtime-v1/soju-vr-runtime.tar.xz",
diff --git a/scripts/d2r-vr.py b/scripts/d2r-vr.py
index 364c6216534..03338a31233 100644
--- a/scripts/d2r-vr.py
+++ b/scripts/d2r-vr.py
@@ -82,9 +82,16 @@ def fetch(entry, name, label):
raise VRError(label + ' is not published yet for this Soju version.')
say('Downloading ' + label + ' (' + str(max(1, entry['size'] // 1000000)) + ' MB)…')
part = dest.with_suffix(dest.suffix + '.part')
- subprocess.run(['/usr/bin/curl', '--fail', '--silent', '--show-error', '--location', '--proto', '=https',
- '--proto-redir', '=https', '--retry', '3', '--connect-timeout', '20', '--max-time', '1800',
- entry['url'], '--output', str(part)], check=True)
+ got = subprocess.run(['/usr/bin/curl', '--fail', '--silent', '--show-error', '--location', '--proto', '=https',
+ '--proto-redir', '=https', '--retry', '3', '--connect-timeout', '20', '--max-time', '1800',
+ entry['url'], '--output', str(part)], capture_output=True, text=True)
+ if got.returncode:
+ part.unlink(missing_ok=True)
+ host = entry['url'].split('/')[2]
+ # Seen 2026-11-25: an internet provider's security filter (Spectrum) answers d2rloader.net
+ # with its own warning page, so the TLS connection fails ("wrong version number").
+ raise VRError('Could not download ' + label + ' from ' + host + ': ' + (got.stderr.strip() or 'curl failed')
+ + '. If your network or internet provider filters websites, allow ' + host + ' and run setup again.')
if part.stat().st_size != entry['size'] or digest(part) != entry['sha256']:
part.unlink(missing_ok=True)
raise VRError(label + ' did not match its pinned checksum; nothing was installed.')
@@ -261,6 +268,48 @@ def write_runtime_routing(m):
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True)
+def builds(m):
+ """The D2R builds setup accepts: the one the mod release was verified on, then the ones
+ Soju checked it on since (manifest "extra_builds", each with what was checked)."""
+ return [m['game_build']] + [b['build'] for b in m.get('extra_builds', [])]
+
+
+def allow_installer_build(mod, build):
+ """The mod's own installer (0.3.31) refuses every Battle.net build but 3.3.93847 before it
+ installs anything. For a build listed in extra_builds, add it to that list in the extracted copy."""
+ gate = mod / 'steamvr/game_install.py'
+ text = gate.read_text(encoding='utf-8', newline='')
+ old = "BATTLENET_VERSIONS = ('3.3.93847',)"
+ if build and build not in text and old in text:
+ gate.write_text(text.replace(old, "BATTLENET_VERSIONS = ('" + build + "', '3.3.93847',)"),
+ encoding='utf-8', newline='')
+
+
+def quiet_loader_warning(game, build):
+ """D2RLoader 1.3.1 stops before the game on a D2R it has not been tested with ("This D2R version
+ hasn't been fully tested yet", OK to go on), a window nobody in a headset can press. Its
+ "Don't remind me again" choice is kept per major.minor version in d2rloader/data/loader-state.json;
+ set it for a build listed in extra_builds."""
+ parts = str(build or '').split('.')
+ if len(parts) < 2:
+ return
+ version = parts[0] + '.' + parts[1] + '.0'
+ state_file = game / 'd2rloader/data/loader-state.json'
+ try:
+ state = json.loads(state_file.read_text())
+ except (OSError, ValueError):
+ state = {}
+ if not isinstance(state, dict):
+ state = {}
+ ignored = state.get('ignored_unsupported_versions')
+ if not isinstance(ignored, list):
+ ignored = []
+ if version not in ignored:
+ state['ignored_unsupported_versions'] = ignored + [version]
+ state_file.parent.mkdir(parents=True, exist_ok=True)
+ state_file.write_text(json.dumps(state, indent=2) + '\n')
+
+
def setup(refresh=False):
m = manifest()
if not (ENGINE / 'bin/wine').is_file():
@@ -275,9 +324,9 @@ def setup(refresh=False):
# Check the new source first: a D2R update the mod does not support
# must not cost the copy that still works.
build = game_build(SOURCE)
- if build != m['game_build']:
+ if build not in builds(m):
raise VRError('Battle.net now has D2R ' + str(build) + '; D2R VR Unleashed supports '
- + m['game_build'] + '. Your current VR copy was kept.')
+ + ', '.join(builds(m)) + '. Your current VR copy was kept.')
if running(['Battle.net.exe']):
raise VRError('Close Battle.net first, so the copy is consistent.')
stop_bottle(BOTTLE)
@@ -291,8 +340,8 @@ def setup(refresh=False):
STATE.unlink(missing_ok=True)
if not BOTTLE.exists():
build = game_build(SOURCE)
- if build != m['game_build']:
- raise VRError('D2R VR Unleashed supports D2R ' + m['game_build'] + '; this install is '
+ if build not in builds(m):
+ raise VRError('D2R VR Unleashed supports D2R ' + ', '.join(builds(m)) + '; this install is '
+ str(build) + '.')
if running(['Battle.net.exe']):
raise VRError('Close Battle.net first, so the copy is consistent.')
@@ -310,9 +359,9 @@ def setup(refresh=False):
saves.parent.mkdir(parents=True, exist_ok=True)
kept.rename(saves)
say('Kept the saves and settings of the previous VR copy.')
- elif game_build(BOTTLE) != m['game_build']:
+ elif game_build(BOTTLE) not in builds(m):
raise VRError('The VR copy has D2R ' + str(game_build(BOTTLE)) + '; D2R VR Unleashed supports '
- + m['game_build'] + '.')
+ + ', '.join(builds(m)) + '.')
state = {}
try:
@@ -336,6 +385,7 @@ def setup(refresh=False):
safe_extract_zip(python_zip, VR / 'python')
safe_extract_zip(mod_zip, VR / 'mod')
mod = VR / 'mod' / m['mod']['folder']
+ allow_installer_build(mod, game_build(BOTTLE))
stage_mod_patch(mod, patched_plugin, m['mod_patch'])
deps = VR / 'deps'
(deps / 'reshade-6.8').mkdir(parents=True)
@@ -374,6 +424,8 @@ def setup(refresh=False):
patch_reshade(game / 'mods' / m['mod']['mod_name'] / 'reshade/ReShade64.dll', m['reshade'])
if (game / 'd3d12.dll').exists():
(game / 'd3d12.dll').rename(off)
+ if game_build(BOTTLE) != m['game_build']:
+ quiet_loader_warning(game, game_build(BOTTLE))
fix_settings(BOTTLE / SAVES_REL)
isolate_user_folders(BOTTLE)
write_runtime_routing(m)
@@ -399,7 +451,7 @@ def status():
'installed': BOTTLE.is_dir() and (BOTTLE / GAME_REL / 'D2RLoader.exe').is_file(),
'current': state.get('recipe') == recipe(m),
'game_build': game_build(BOTTLE) if BOTTLE.is_dir() else None,
- 'supported_build': m['game_build'],
+ 'supported_build': ', '.join(builds(m)),
'source_build': game_build(SOURCE),
'mod': m['mod']['name'],
'path': str(VR),
diff --git a/tests/test_d2r_vr.py b/tests/test_d2r_vr.py
index 0aa3d7f9b3a..2e2ef425a4a 100644
--- a/tests/test_d2r_vr.py
+++ b/tests/test_d2r_vr.py
@@ -188,6 +188,38 @@ class HelperTests(unittest.TestCase):
self.assertIn('was kept', str(caught.exception))
self.assertTrue((bottle / vr.GAME_REL / 'D2R.exe').exists())
+ def test_builds_checked_since_are_accepted(self):
+ m = vr.manifest()
+ self.assertEqual(vr.builds(m)[0], m['game_build'])
+ self.assertIn('3.4.95032', vr.builds(m))
+ for extra in m['extra_builds']:
+ self.assertTrue(extra['checked'].strip()) # every added build says what was checked
+
+ def test_the_mods_installer_takes_a_listed_build(self):
+ with tempfile.TemporaryDirectory() as d:
+ mod = Path(d)
+ (mod / 'steamvr').mkdir()
+ gate = mod / 'steamvr/game_install.py'
+ gate.write_bytes(b"BATTLENET_VERSIONS = ('3.3.93847',)\r\nSTEAM = 1\r\n")
+ for _ in range(2):
+ vr.allow_installer_build(mod, '3.4.95032')
+ self.assertEqual(gate.read_bytes(),
+ b"BATTLENET_VERSIONS = ('3.4.95032', '3.3.93847',)\r\nSTEAM = 1\r\n")
+ vr.allow_installer_build(mod, '3.3.93847') # already there: unchanged
+ self.assertEqual(gate.read_bytes().count(b'3.3.93847'), 1)
+
+ def test_loader_warning_is_answered_for_the_new_version(self):
+ with tempfile.TemporaryDirectory() as d:
+ game = Path(d)
+ for _ in range(2):
+ vr.quiet_loader_warning(game, '3.4.95032')
+ state = json.loads((game / 'd2rloader/data/loader-state.json').read_text())
+ self.assertEqual(state['ignored_unsupported_versions'], ['3.4.0'])
+ (game / 'd2rloader/data/loader-state.json').write_text('{"ignored_unsupported_versions": ["3.3.0"], "x": 1}')
+ vr.quiet_loader_warning(game, '3.4.95032')
+ state = json.loads((game / 'd2rloader/data/loader-state.json').read_text())
+ self.assertEqual(state, {'ignored_unsupported_versions': ['3.3.0', '3.4.0'], 'x': 1})
+
def test_windows_paths_go_through_z(self):
self.assertTrue(vr.winpath('/tmp').startswith('Z:\\'))