From 7766a98d11e89402d00daca33f24f1a24076cd7b Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Sat, 6 Sep 2025 14:46:38 +0200 Subject: [PATCH] Add a switch to not connect to neighbouring regions - An experimental and not officially supported function (therefore not exposed in preferences), may or may not stay in the source; Potentially addresses FIRE-2325 and its duplicates - Prevents the viewer from connecting to neighbouring regions. When enabled, only the current region (login/teleport destination) is connected, while adjacent simulators are ignored. This effectively isolates the region, similar to how private estates behave. - This may improve performance for users with weaker computers or slower connections, reduce unintended neighbour interactions, and assist multi-region event setups by lowering client overhead. It can also be useful for residents who prefer not to see or interact with neighbouring land. - Limitations: region crossings will not function normally, as neighbouring regions are not visible or connected. Only direct teleports and logins to regions will work reliably. The sense of world scale and continuity is reduced, and travellers or explorers may find it unsuitable. - TO-DO: Detect when avatar is crossing by foot/vehicle and load only that one region? - I was not able to find an equivalent of WebRTC's updateNeighboringRegions() in Vivox code; updatePosition() is not that helpful, and channelFromRegion() seems to be detached? --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llvoicewebrtc.cpp | 8 ++++++++ indra/newview/llworld.cpp | 12 ++++++++++++ 3 files changed, 31 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3a76db24af..d3c4e3f57c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -26982,5 +26982,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSDisableNeighbourRegionConnections + + Comment + Do not connect to neighbouring regions, only to the current region (limits region crossing) - experimental + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index bf1b71825a..59e27956a1 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -610,6 +610,14 @@ void LLWebRTCVoiceClient::updateNeighboringRegions() // add current region. mNeighboringRegions.insert(gAgent.getRegion()->getRegionID()); + // Do not connect to neighbouring regions + static LLCachedControl fsDisableNeighbourRegionConnections(gSavedSettings, "FSDisableNeighbourRegionConnections"); + if (fsDisableNeighbourRegionConnections) + { + return; + } + // + // base off of speaker position as it'll move more slowly than camera position. // Once we have hysteresis, we may be able to track off of speaker and camera position at 50m // TODO: Add hysteresis so we don't flip-flop connections to neighbors diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index cd2b666613..2d73045f72 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1594,6 +1594,18 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data) msg->getIPAddrFast(_PREHASH_SimulatorInfo, _PREHASH_IP, ip_u32); msg->getIPPortFast(_PREHASH_SimulatorInfo, _PREHASH_Port, port); + // Only connect if neighbour connections are not disabled, or if this is the current region being established (login/teleport target) + static LLCachedControl fsDisableNeighbourRegionConnections(gSavedSettings, "FSDisableNeighbourRegionConnections"); + if (fsDisableNeighbourRegionConnections) + { + LLViewerRegion* current_region = gAgent.getRegion(); + if (current_region && current_region->getHandle() != handle) + { + return; + } + } + // + // which simulator should we modify? LLHost sim(ip_u32, port);