diff options
author | Adam Frisby | 2009-05-23 06:29:08 +0000 |
---|---|---|
committer | Adam Frisby | 2009-05-23 06:29:08 +0000 |
commit | 6b312d934085caf1add5e6081f55c9944ab01aa9 (patch) | |
tree | ffe59622f1e810479a79b8865355b3a0ce909997 /OpenSim/Region | |
parent | * Pipes IPEndPoint through all Login methods, including LLSD/OSD login paths. (diff) | |
download | opensim-SC_OLD-6b312d934085caf1add5e6081f55c9944ab01aa9.zip opensim-SC_OLD-6b312d934085caf1add5e6081f55c9944ab01aa9.tar.gz opensim-SC_OLD-6b312d934085caf1add5e6081f55c9944ab01aa9.tar.bz2 opensim-SC_OLD-6b312d934085caf1add5e6081f55c9944ab01aa9.tar.xz |
* Implements automatic loopback handling for standalone regions.
* This /should/ make OpenSim behave properly when hosting behind a NAT router and utilizing port forwarding (but the router doesn't support Loopback)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 85a3d96..b89a5f2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -812,17 +812,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
812 | 812 | ||
813 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 813 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
814 | { | 814 | { |
815 | capsPath | 815 | #region IP Translation for NAT |
816 | = "http://" | 816 | IClientIPEndpoint ipepClient; |
817 | + reg.ExternalHostName | 817 | if (avatar.ClientView.TryGet(out ipepClient)) |
818 | + ":" | 818 | { |
819 | + reg.HttpPort | 819 | capsPath |
820 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | 820 | = "http://" |
821 | + NetworkUtil.GetHostFor(ipepClient.EndPoint, reg.ExternalHostName) | ||
822 | + ":" | ||
823 | + reg.HttpPort | ||
824 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
825 | } | ||
826 | else | ||
827 | { | ||
828 | capsPath | ||
829 | = "http://" | ||
830 | + reg.ExternalHostName | ||
831 | + ":" | ||
832 | + reg.HttpPort | ||
833 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
834 | } | ||
835 | #endregion | ||
821 | 836 | ||
822 | if (eq != null) | 837 | if (eq != null) |
823 | { | 838 | { |
824 | #region IP Translation for NAT | 839 | #region IP Translation for NAT |
825 | IClientIPEndpoint ipepClient; | 840 | // Uses ipepClient above |
826 | if (avatar.ClientView.TryGet(out ipepClient)) | 841 | if (avatar.ClientView.TryGet(out ipepClient)) |
827 | { | 842 | { |
828 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | 843 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); |