openvibers/source.openvibe.games Commits

Fix: Use correct loopback IP (127.0.1.1) for local server connections

CO Copilot committed 28 Jun 2026 · cf0e540317 · 1 file, +7 −5

- Changed server map IPs from 127.0.0.1 to 127.0.1.1
- The Source engine binds to the hostname's loopback address (127.0.1.1)
  instead of the standard localhost (127.0.0.1) due to /etc/hosts mapping
- This allows the Electron launcher to correctly connect to local SRCDS instances
- Fixes 'Connection failed after 4 retries' errors

Co-authored-by: Copilot <[email protected]>

Changes

ddiff --git a/launcher/main.js b/launcher/main.js
iindex 92071a7..153d45e 100644
---- a/launcher/main.js
++++ b/launcher/main.js
@@@ -137,12 +137,14 @@ ipcMain.handle('game:launch', (_e, { ip, port }) => {
ipcMain.handle('game:launch-direct', (_e, mode) => {
// Look up the mode's port from local server list
++ // Use 127.0.1.1 (workstation hostname) instead of 127.0.0.1 since that's where
++ // the Source engine binds the server when resolving localhost via /etc/hosts
const serverMap = {
-- hub: { ip: '127.0.0.1', port: 27015 },
-- prophunt: { ip: '127.0.0.1', port: 27016 },
-- deathrun: { ip: '127.0.0.1', port: 27017 },
-- fortwars: { ip: '127.0.0.1', port: 27018 },
-- traitortown: { ip: '127.0.0.1', port: 27019 },
++ hub: { ip: '127.0.1.1', port: 27015 },
++ prophunt: { ip: '127.0.1.1', port: 27016 },
++ deathrun: { ip: '127.0.1.1', port: 27017 },
++ fortwars: { ip: '127.0.1.1', port: 27018 },
++ traitortown: { ip: '127.0.1.1', port: 27019 },
};
const srv = serverMap[mode] || serverMap.hub;
return launchGame(srv.ip, srv.port);