diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index efc644d..1217f9b 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -38,6 +38,8 @@ using OpenSim.Framework.Communications; | |||
38 | using OpenSim.Framework.Communications.Cache; | 38 | using OpenSim.Framework.Communications.Cache; |
39 | using OpenSim.Framework.Capabilities; | 39 | using OpenSim.Framework.Capabilities; |
40 | using OpenSim.Region.Framework.Interfaces; | 40 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Services.Interfaces; | ||
42 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
41 | 43 | ||
42 | namespace OpenSim.Region.Framework.Scenes.Hypergrid | 44 | namespace OpenSim.Region.Framework.Scenes.Hypergrid |
43 | { | 45 | { |
@@ -45,11 +47,19 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
45 | { | 47 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 49 | ||
48 | public readonly IHyperlink m_hg; | 50 | private IHyperlinkService m_hg; |
51 | IHyperlinkService HyperlinkService | ||
52 | { | ||
53 | get | ||
54 | { | ||
55 | if (m_hg == null) | ||
56 | m_hg = m_scene.RequestModuleInterface<IHyperlinkService>(); | ||
57 | return m_hg; | ||
58 | } | ||
59 | } | ||
49 | 60 | ||
50 | public HGSceneCommunicationService(CommunicationsManager commsMan, IHyperlink hg) : base(commsMan) | 61 | public HGSceneCommunicationService(CommunicationsManager commsMan) : base(commsMan) |
51 | { | 62 | { |
52 | m_hg = hg; | ||
53 | } | 63 | } |
54 | 64 | ||
55 | 65 | ||
@@ -112,7 +122,10 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
112 | } | 122 | } |
113 | else | 123 | else |
114 | { | 124 | { |
115 | RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); | 125 | uint x = 0, y = 0; |
126 | Utils.LongToUInts(regionHandle, out x, out y); | ||
127 | GridRegion reg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y); | ||
128 | |||
116 | if (reg != null) | 129 | if (reg != null) |
117 | { | 130 | { |
118 | 131 | ||
@@ -125,13 +138,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
125 | /// Hypergrid mod start | 138 | /// Hypergrid mod start |
126 | /// | 139 | /// |
127 | /// | 140 | /// |
128 | bool isHyperLink = m_hg.IsHyperlinkRegion(reg.RegionHandle); | 141 | bool isHyperLink = (HyperlinkService.GetHyperlinkRegion(reg.RegionHandle) != null); |
129 | bool isHomeUser = true; | 142 | bool isHomeUser = true; |
130 | ulong realHandle = regionHandle; | 143 | ulong realHandle = regionHandle; |
131 | CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); | 144 | CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); |
132 | if (uinfo != null) | 145 | if (uinfo != null) |
133 | { | 146 | { |
134 | isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile); | 147 | isHomeUser = HyperlinkService.IsLocalUser(uinfo.UserProfile.ID); |
135 | realHandle = m_hg.FindRegionHandle(regionHandle); | 148 | realHandle = m_hg.FindRegionHandle(regionHandle); |
136 | m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); | 149 | m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); |
137 | } | 150 | } |