diff options
author | UbitUmarov | 2016-12-14 04:00:48 +0000 |
---|---|---|
committer | UbitUmarov | 2016-12-14 04:00:48 +0000 |
commit | 50842347ace4f9ada316364d08ccc0675901f84b (patch) | |
tree | 027322910be822966f8f2b9ee57d7b9e8d9e32b9 /OpenSim/Region/CoreModules/World/Land | |
parent | avoid a null ref (diff) | |
download | opensim-SC-50842347ace4f9ada316364d08ccc0675901f84b.zip opensim-SC-50842347ace4f9ada316364d08ccc0675901f84b.tar.gz opensim-SC-50842347ace4f9ada316364d08ccc0675901f84b.tar.bz2 opensim-SC-50842347ace4f9ada316364d08ccc0675901f84b.tar.xz |
fix: check for region_handle before region_id, viewers are so funny..
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 98f1f3b..bec5322 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -72,8 +72,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
72 | 72 | ||
73 | public const int LandUnit = 4; | 73 | public const int LandUnit = 4; |
74 | 74 | ||
75 | private static readonly string remoteParcelRequestPath = "0009/"; | ||
76 | |||
77 | private LandChannel landChannel; | 75 | private LandChannel landChannel; |
78 | private Scene m_scene; | 76 | private Scene m_scene; |
79 | 77 | ||
@@ -1682,12 +1680,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1682 | 1680 | ||
1683 | private void EventManagerOnRegisterCaps(UUID agentID, Caps caps) | 1681 | private void EventManagerOnRegisterCaps(UUID agentID, Caps caps) |
1684 | { | 1682 | { |
1683 | //string capsBase = "/CAPS/" + UUID.Random(); | ||
1685 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 1684 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
1686 | caps.RegisterHandler( | 1685 | caps.RegisterHandler( |
1687 | "RemoteParcelRequest", | 1686 | "RemoteParcelRequest", |
1688 | new RestStreamHandler( | 1687 | new RestStreamHandler( |
1689 | "POST", | 1688 | "POST", |
1690 | capsBase + remoteParcelRequestPath, | 1689 | capsBase, |
1691 | (request, path, param, httpRequest, httpResponse) | 1690 | (request, path, param, httpRequest, httpResponse) |
1692 | => RemoteParcelRequest(request, path, param, agentID, caps), | 1691 | => RemoteParcelRequest(request, path, param, agentID, caps), |
1693 | "RemoteParcelRequest", | 1692 | "RemoteParcelRequest", |
@@ -1807,24 +1806,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1807 | ArrayList list = (ArrayList)hash["location"]; | 1806 | ArrayList list = (ArrayList)hash["location"]; |
1808 | uint x = (uint)(double)list[0]; | 1807 | uint x = (uint)(double)list[0]; |
1809 | uint y = (uint)(double)list[1]; | 1808 | uint y = (uint)(double)list[1]; |
1810 | if(hash.ContainsKey("region_id")) | 1809 | if (hash.ContainsKey("region_handle")) |
1811 | { | ||
1812 | UUID regionID = (UUID)hash["region_id"]; | ||
1813 | if (regionID == m_scene.RegionInfo.RegionID) | ||
1814 | { | ||
1815 | // a parcel request for a local parcel => no need to query the grid | ||
1816 | parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); | ||
1817 | } | ||
1818 | else | ||
1819 | { | ||
1820 | // a parcel request for a parcel in another region. Ask the grid about the region | ||
1821 | GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID); | ||
1822 | if (info != null) | ||
1823 | parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); | ||
1824 | } | ||
1825 | } | ||
1826 | |||
1827 | else if (hash.ContainsKey("region_handle")) | ||
1828 | { | 1810 | { |
1829 | // if you do a "About Landmark" on a landmark a second time, the viewer sends the | 1811 | // if you do a "About Landmark" on a landmark a second time, the viewer sends the |
1830 | // region_handle it got earlier via RegionHandleRequest | 1812 | // region_handle it got earlier via RegionHandleRequest |
@@ -1847,6 +1829,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1847 | } | 1829 | } |
1848 | } | 1830 | } |
1849 | } | 1831 | } |
1832 | else if(hash.ContainsKey("region_id")) | ||
1833 | { | ||
1834 | UUID regionID = (UUID)hash["region_id"]; | ||
1835 | if (regionID == m_scene.RegionInfo.RegionID) | ||
1836 | { | ||
1837 | // a parcel request for a local parcel => no need to query the grid | ||
1838 | parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); | ||
1839 | } | ||
1840 | else | ||
1841 | { | ||
1842 | // a parcel request for a parcel in another region. Ask the grid about the region | ||
1843 | GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID); | ||
1844 | if (info != null) | ||
1845 | parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); | ||
1846 | } | ||
1847 | } | ||
1848 | |||
1849 | |||
1850 | } | 1850 | } |
1851 | } | 1851 | } |
1852 | catch (LLSD.LLSDParseException e) | 1852 | catch (LLSD.LLSDParseException e) |