diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
13 files changed, 228 insertions, 152 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index d221d68..9f58175 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
322 | // a copy of the local asset. | 322 | // a copy of the local asset. |
323 | m_Cache.Cache(asset); | 323 | m_Cache.Cache(asset); |
324 | 324 | ||
325 | if (asset.Temporary || asset.Local) | 325 | if (asset.Local) |
326 | { | 326 | { |
327 | if (m_Cache != null) | 327 | if (m_Cache != null) |
328 | m_Cache.Cache(asset); | 328 | m_Cache.Cache(asset); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index 480cd69..52b1039 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -258,7 +258,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
258 | if (m_Cache != null) | 258 | if (m_Cache != null) |
259 | m_Cache.Cache(asset); | 259 | m_Cache.Cache(asset); |
260 | 260 | ||
261 | if (asset.Temporary || asset.Local) | 261 | if (asset.Local) |
262 | { | 262 | { |
263 | // m_log.DebugFormat( | 263 | // m_log.DebugFormat( |
264 | // "[LOCAL ASSET SERVICE CONNECTOR]: Returning asset {0} {1} without querying database since status Temporary = {2}, Local = {3}", | 264 | // "[LOCAL ASSET SERVICE CONNECTOR]: Returning asset {0} {1} without querying database since status Temporary = {2}, Local = {3}", |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs index 1982473..4f75191 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs | |||
@@ -42,7 +42,7 @@ using OpenSim.Tests.Common; | |||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests |
43 | { | 43 | { |
44 | [TestFixture] | 44 | [TestFixture] |
45 | public class AssetConnectorsTests : OpenSimTestCase | 45 | public class AssetConnectorTests : OpenSimTestCase |
46 | { | 46 | { |
47 | [Test] | 47 | [Test] |
48 | public void TestAddAsset() | 48 | public void TestAddAsset() |
@@ -77,7 +77,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests | |||
77 | // TODO: Add cache and check that this does receive a copy of the asset | 77 | // TODO: Add cache and check that this does receive a copy of the asset |
78 | } | 78 | } |
79 | 79 | ||
80 | [Test] | ||
81 | public void TestAddTemporaryAsset() | 80 | public void TestAddTemporaryAsset() |
82 | { | 81 | { |
83 | TestHelpers.InMethod(); | 82 | TestHelpers.InMethod(); |
@@ -93,8 +92,45 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests | |||
93 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); | 92 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); |
94 | lasc.Initialise(config); | 93 | lasc.Initialise(config); |
95 | 94 | ||
95 | // If it is remote, it should be stored | ||
96 | AssetBase a2 = AssetHelpers.CreateNotecardAsset(); | ||
97 | a2.Local = false; | ||
98 | a2.Temporary = true; | ||
99 | |||
100 | lasc.Store(a2); | ||
101 | |||
102 | AssetBase retreivedA2 = lasc.Get(a2.ID); | ||
103 | Assert.That(retreivedA2.ID, Is.EqualTo(a2.ID)); | ||
104 | Assert.That(retreivedA2.Metadata.ID, Is.EqualTo(a2.Metadata.ID)); | ||
105 | Assert.That(retreivedA2.Data.Length, Is.EqualTo(a2.Data.Length)); | ||
106 | |||
107 | AssetMetadata retrievedA2Metadata = lasc.GetMetadata(a2.ID); | ||
108 | Assert.That(retrievedA2Metadata.ID, Is.EqualTo(a2.ID)); | ||
109 | |||
110 | byte[] retrievedA2Data = lasc.GetData(a2.ID); | ||
111 | Assert.That(retrievedA2Data.Length, Is.EqualTo(a2.Data.Length)); | ||
112 | |||
113 | // TODO: Add cache and check that this does receive a copy of the asset | ||
114 | } | ||
115 | |||
116 | [Test] | ||
117 | public void TestAddLocalAsset() | ||
118 | { | ||
119 | TestHelpers.InMethod(); | ||
120 | // TestHelpers.EnableLogging(); | ||
121 | |||
122 | IConfigSource config = new IniConfigSource(); | ||
123 | config.AddConfig("Modules"); | ||
124 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); | ||
125 | config.AddConfig("AssetService"); | ||
126 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); | ||
127 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | ||
128 | |||
129 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); | ||
130 | lasc.Initialise(config); | ||
131 | |||
96 | AssetBase a1 = AssetHelpers.CreateNotecardAsset(); | 132 | AssetBase a1 = AssetHelpers.CreateNotecardAsset(); |
97 | a1.Temporary = true; | 133 | a1.Local = true; |
98 | 134 | ||
99 | lasc.Store(a1); | 135 | lasc.Store(a1); |
100 | 136 | ||
@@ -106,7 +142,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests | |||
106 | } | 142 | } |
107 | 143 | ||
108 | [Test] | 144 | [Test] |
109 | public void TestAddLocalAsset() | 145 | public void TestAddTemporaryLocalAsset() |
110 | { | 146 | { |
111 | TestHelpers.InMethod(); | 147 | TestHelpers.InMethod(); |
112 | // TestHelpers.EnableLogging(); | 148 | // TestHelpers.EnableLogging(); |
@@ -121,8 +157,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests | |||
121 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); | 157 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); |
122 | lasc.Initialise(config); | 158 | lasc.Initialise(config); |
123 | 159 | ||
160 | // If it is local, it should not be stored | ||
124 | AssetBase a1 = AssetHelpers.CreateNotecardAsset(); | 161 | AssetBase a1 = AssetHelpers.CreateNotecardAsset(); |
125 | a1.Local = true; | 162 | a1.Local = true; |
163 | a1.Temporary = true; | ||
126 | 164 | ||
127 | lasc.Store(a1); | 165 | lasc.Store(a1); |
128 | 166 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index c0c2ca7..31ef79b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -56,6 +56,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
56 | 56 | ||
57 | public LocalGridServicesConnector() | 57 | public LocalGridServicesConnector() |
58 | { | 58 | { |
59 | m_log.Debug("[LOCAL GRID SERVICE CONNECTOR]: LocalGridServicesConnector no parms."); | ||
59 | } | 60 | } |
60 | 61 | ||
61 | public LocalGridServicesConnector(IConfigSource source) | 62 | public LocalGridServicesConnector(IConfigSource source) |
@@ -142,10 +143,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
142 | 143 | ||
143 | scene.RegisterModuleInterface<IGridService>(this); | 144 | scene.RegisterModuleInterface<IGridService>(this); |
144 | 145 | ||
145 | if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID)) | 146 | lock (m_LocalCache) |
146 | m_log.ErrorFormat("[LOCAL GRID SERVICE CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!"); | 147 | { |
147 | else | 148 | if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID)) |
148 | m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene)); | 149 | m_log.ErrorFormat("[LOCAL GRID SERVICE CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!"); |
150 | else | ||
151 | m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene)); | ||
152 | } | ||
149 | } | 153 | } |
150 | 154 | ||
151 | public void RemoveRegion(Scene scene) | 155 | public void RemoveRegion(Scene scene) |
@@ -153,8 +157,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
153 | if (!m_Enabled) | 157 | if (!m_Enabled) |
154 | return; | 158 | return; |
155 | 159 | ||
156 | m_LocalCache[scene.RegionInfo.RegionID].Clear(); | 160 | lock (m_LocalCache) |
157 | m_LocalCache.Remove(scene.RegionInfo.RegionID); | 161 | { |
162 | m_LocalCache[scene.RegionInfo.RegionID].Clear(); | ||
163 | m_LocalCache.Remove(scene.RegionInfo.RegionID); | ||
164 | } | ||
158 | } | 165 | } |
159 | 166 | ||
160 | public void RegionLoaded(Scene scene) | 167 | public void RegionLoaded(Scene scene) |
@@ -191,12 +198,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
191 | 198 | ||
192 | // First see if it's a neighbour, even if it isn't on this sim. | 199 | // First see if it's a neighbour, even if it isn't on this sim. |
193 | // Neighbour data is cached in memory, so this is fast | 200 | // Neighbour data is cached in memory, so this is fast |
194 | foreach (RegionCache rcache in m_LocalCache.Values) | 201 | |
202 | lock (m_LocalCache) | ||
195 | { | 203 | { |
196 | region = rcache.GetRegionByPosition(x, y); | 204 | foreach (RegionCache rcache in m_LocalCache.Values) |
197 | if (region != null) | ||
198 | { | 205 | { |
199 | return region; | 206 | region = rcache.GetRegionByPosition(x, y); |
207 | if (region != null) | ||
208 | { | ||
209 | return region; | ||
210 | } | ||
200 | } | 211 | } |
201 | } | 212 | } |
202 | 213 | ||
@@ -224,6 +235,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
224 | return m_GridService.GetDefaultRegions(scopeID); | 235 | return m_GridService.GetDefaultRegions(scopeID); |
225 | } | 236 | } |
226 | 237 | ||
238 | public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID) | ||
239 | { | ||
240 | return m_GridService.GetDefaultHypergridRegions(scopeID); | ||
241 | } | ||
242 | |||
227 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) | 243 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) |
228 | { | 244 | { |
229 | return m_GridService.GetFallbackRegions(scopeID, x, y); | 245 | return m_GridService.GetFallbackRegions(scopeID, x, y); |
@@ -245,12 +261,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
245 | { | 261 | { |
246 | System.Text.StringBuilder caps = new System.Text.StringBuilder(); | 262 | System.Text.StringBuilder caps = new System.Text.StringBuilder(); |
247 | 263 | ||
248 | foreach (KeyValuePair<UUID, RegionCache> kvp in m_LocalCache) | 264 | lock (m_LocalCache) |
249 | { | 265 | { |
250 | caps.AppendFormat("*** Neighbours of {0} ({1}) ***\n", kvp.Value.RegionName, kvp.Key); | 266 | foreach (KeyValuePair<UUID, RegionCache> kvp in m_LocalCache) |
251 | List<GridRegion> regions = kvp.Value.GetNeighbours(); | 267 | { |
252 | foreach (GridRegion r in regions) | 268 | caps.AppendFormat("*** Neighbours of {0} ({1}) ***\n", kvp.Value.RegionName, kvp.Key); |
253 | caps.AppendFormat(" {0} @ {1}-{2}\n", r.RegionName, r.RegionLocX / Constants.RegionSize, r.RegionLocY / Constants.RegionSize); | 269 | List<GridRegion> regions = kvp.Value.GetNeighbours(); |
270 | foreach (GridRegion r in regions) | ||
271 | caps.AppendFormat(" {0} @ {1}-{2}\n", r.RegionName, r.RegionLocX / Constants.RegionSize, r.RegionLocY / Constants.RegionSize); | ||
272 | } | ||
254 | } | 273 | } |
255 | 274 | ||
256 | MainConsole.Instance.Output(caps.ToString()); | 275 | MainConsole.Instance.Output(caps.ToString()); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index b2646ba..6a57d1f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -277,6 +277,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
277 | return rinfo; | 277 | return rinfo; |
278 | } | 278 | } |
279 | 279 | ||
280 | public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID) | ||
281 | { | ||
282 | List<GridRegion> rinfo = m_LocalGridService.GetDefaultHypergridRegions(scopeID); | ||
283 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultHypergridRegions {0} found {1} regions", name, rinfo.Count); | ||
284 | List<GridRegion> grinfo = m_RemoteGridService.GetDefaultHypergridRegions(scopeID); | ||
285 | |||
286 | if (grinfo != null) | ||
287 | { | ||
288 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultHypergridRegions {0} found {1} regions", name, grinfo.Count); | ||
289 | foreach (GridRegion r in grinfo) | ||
290 | { | ||
291 | m_RegionInfoCache.Cache(r); | ||
292 | if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null) | ||
293 | rinfo.Add(r); | ||
294 | } | ||
295 | } | ||
296 | |||
297 | return rinfo; | ||
298 | } | ||
299 | |||
280 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) | 300 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) |
281 | { | 301 | { |
282 | List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y); | 302 | List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 221f815..e05d186 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs | |||
@@ -81,6 +81,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
81 | 81 | ||
82 | public void OnConnectionClose(IClientAPI client) | 82 | public void OnConnectionClose(IClientAPI client) |
83 | { | 83 | { |
84 | if (client == null) | ||
85 | return; | ||
86 | if (client.SceneAgent == null) | ||
87 | return; | ||
88 | |||
84 | if (client.SceneAgent.IsChildAgent) | 89 | if (client.SceneAgent.IsChildAgent) |
85 | return; | 90 | return; |
86 | 91 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index e474ef6..77a3c82 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -233,6 +233,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
233 | if (sp != null) | 233 | if (sp != null) |
234 | { | 234 | { |
235 | AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 235 | AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
236 | if (aCircuit == null) | ||
237 | return; | ||
238 | if (aCircuit.ServiceURLs == null) | ||
239 | return; | ||
240 | |||
236 | if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI")) | 241 | if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI")) |
237 | { | 242 | { |
238 | inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString(); | 243 | inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString(); |
@@ -254,7 +259,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
254 | if (sp == null) | 259 | if (sp == null) |
255 | { | 260 | { |
256 | inventoryURL = UserManagementModule.GetUserServerURL(userID, "InventoryServerURI"); | 261 | inventoryURL = UserManagementModule.GetUserServerURL(userID, "InventoryServerURI"); |
257 | if (inventoryURL != null && inventoryURL != string.Empty) | 262 | if (!string.IsNullOrEmpty(inventoryURL)) |
258 | { | 263 | { |
259 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); | 264 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); |
260 | m_InventoryURLs.Add(userID, inventoryURL); | 265 | m_InventoryURLs.Add(userID, inventoryURL); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 1e434b9..2fc8ee3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -1,11 +1,41 @@ | |||
1 | using System; | 1 | /* |
2 | using System.Collections.Generic; | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
3 | 27 | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Threading; | ||
4 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
5 | using OpenMetaverse; | 32 | using OpenMetaverse; |
6 | 33 | ||
7 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 34 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
8 | { | 35 | { |
36 | /// <summary> | ||
37 | /// Cache root and system inventory folders to reduce number of potentially remote inventory calls and associated holdups. | ||
38 | /// </summary> | ||
9 | public class InventoryCache | 39 | public class InventoryCache |
10 | { | 40 | { |
11 | private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour | 41 | private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour |
@@ -16,8 +46,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
16 | 46 | ||
17 | public void Cache(UUID userID, InventoryFolderBase root) | 47 | public void Cache(UUID userID, InventoryFolderBase root) |
18 | { | 48 | { |
19 | lock (m_RootFolders) | 49 | m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS); |
20 | m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS); | ||
21 | } | 50 | } |
22 | 51 | ||
23 | public InventoryFolderBase GetRootFolder(UUID userID) | 52 | public InventoryFolderBase GetRootFolder(UUID userID) |
@@ -31,14 +60,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
31 | 60 | ||
32 | public void Cache(UUID userID, AssetType type, InventoryFolderBase folder) | 61 | public void Cache(UUID userID, AssetType type, InventoryFolderBase folder) |
33 | { | 62 | { |
34 | lock (m_FolderTypes) | 63 | Dictionary<AssetType, InventoryFolderBase> ff = null; |
64 | if (!m_FolderTypes.TryGetValue(userID, out ff)) | ||
65 | { | ||
66 | ff = new Dictionary<AssetType, InventoryFolderBase>(); | ||
67 | m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS); | ||
68 | } | ||
69 | |||
70 | // We need to lock here since two threads could potentially retrieve the same dictionary | ||
71 | // and try to add a folder for that type simultaneously. Dictionary<>.Add() is not described as thread-safe in the SDK | ||
72 | // even if the folders are identical. | ||
73 | lock (ff) | ||
35 | { | 74 | { |
36 | Dictionary<AssetType, InventoryFolderBase> ff = null; | ||
37 | if (!m_FolderTypes.TryGetValue(userID, out ff)) | ||
38 | { | ||
39 | ff = new Dictionary<AssetType, InventoryFolderBase>(); | ||
40 | m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS); | ||
41 | } | ||
42 | if (!ff.ContainsKey(type)) | 75 | if (!ff.ContainsKey(type)) |
43 | ff.Add(type, folder); | 76 | ff.Add(type, folder); |
44 | } | 77 | } |
@@ -50,8 +83,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
50 | if (m_FolderTypes.TryGetValue(userID, out ff)) | 83 | if (m_FolderTypes.TryGetValue(userID, out ff)) |
51 | { | 84 | { |
52 | InventoryFolderBase f = null; | 85 | InventoryFolderBase f = null; |
53 | if (ff.TryGetValue(type, out f)) | 86 | |
54 | return f; | 87 | lock (ff) |
88 | { | ||
89 | if (ff.TryGetValue(type, out f)) | ||
90 | return f; | ||
91 | } | ||
55 | } | 92 | } |
56 | 93 | ||
57 | return null; | 94 | return null; |
@@ -59,8 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
59 | 96 | ||
60 | public void Cache(UUID userID, InventoryCollection inv) | 97 | public void Cache(UUID userID, InventoryCollection inv) |
61 | { | 98 | { |
62 | lock (m_Inventories) | 99 | m_Inventories.AddOrUpdate(userID, inv, 120); |
63 | m_Inventories.AddOrUpdate(userID, inv, 120); | ||
64 | } | 100 | } |
65 | 101 | ||
66 | public InventoryCollection GetUserInventory(UUID userID) | 102 | public InventoryCollection GetUserInventory(UUID userID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index ec5751d..99913a9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -196,7 +196,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
196 | Util.FireAndForget(delegate | 196 | Util.FireAndForget(delegate |
197 | { | 197 | { |
198 | foreach (InventoryItemBase item in items) | 198 | foreach (InventoryItemBase item in items) |
199 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 199 | if (!string.IsNullOrEmpty(item.CreatorData)) |
200 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | ||
200 | }); | 201 | }); |
201 | } | 202 | } |
202 | 203 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 2d3ba82..7f78076 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -195,18 +195,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
195 | { | 195 | { |
196 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID); | 196 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID); |
197 | 197 | ||
198 | if (invCol != null && UserManager != null) | 198 | // Commenting this for now, because it's causing more grief than good |
199 | { | 199 | //if (invCol != null && UserManager != null) |
200 | // Protect ourselves against the caller subsequently modifying the items list | 200 | //{ |
201 | List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | 201 | // // Protect ourselves against the caller subsequently modifying the items list |
202 | 202 | // List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items); | |
203 | if (items != null && items.Count > 0) | 203 | |
204 | Util.FireAndForget(delegate | 204 | // if (items != null && items.Count > 0) |
205 | { | 205 | // //Util.FireAndForget(delegate |
206 | foreach (InventoryItemBase item in items) | 206 | // //{ |
207 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 207 | // foreach (InventoryItemBase item in items) |
208 | }); | 208 | // if (!string.IsNullOrEmpty(item.CreatorData)) |
209 | } | 209 | // UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
210 | // //}); | ||
211 | //} | ||
210 | 212 | ||
211 | return invCol; | 213 | return invCol; |
212 | } | 214 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index 172bea1..516ad40 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
79 | 79 | ||
80 | public void OnConnectionClose(IClientAPI client) | 80 | public void OnConnectionClose(IClientAPI client) |
81 | { | 81 | { |
82 | if (!client.SceneAgent.IsChildAgent) | 82 | if (client != null && client.SceneAgent != null && !client.SceneAgent.IsChildAgent) |
83 | { | 83 | { |
84 | // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | 84 | // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); |
85 | m_PresenceService.LogoutAgent(client.SessionId); | 85 | m_PresenceService.LogoutAgent(client.SessionId); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 8b8bb37..7a6a174 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -46,9 +46,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Version of this service | 49 | /// Version of this service. |
50 | /// </summary> | 50 | /// </summary> |
51 | private const string m_Version = "SIMULATION/0.1"; | 51 | /// <remarks> |
52 | /// Currently valid versions are "SIMULATION/0.1" and "SIMULATION/0.2" | ||
53 | /// </remarks> | ||
54 | public string ServiceVersion { get; set; } | ||
52 | 55 | ||
53 | /// <summary> | 56 | /// <summary> |
54 | /// Map region ID to scene. | 57 | /// Map region ID to scene. |
@@ -62,28 +65,39 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
62 | 65 | ||
63 | #region Region Module interface | 66 | #region Region Module interface |
64 | 67 | ||
65 | public void Initialise(IConfigSource config) | 68 | public void Initialise(IConfigSource configSource) |
66 | { | 69 | { |
67 | IConfig moduleConfig = config.Configs["Modules"]; | 70 | IConfig moduleConfig = configSource.Configs["Modules"]; |
68 | if (moduleConfig != null) | 71 | if (moduleConfig != null) |
69 | { | 72 | { |
70 | string name = moduleConfig.GetString("SimulationServices", ""); | 73 | string name = moduleConfig.GetString("SimulationServices", ""); |
71 | if (name == Name) | 74 | if (name == Name) |
72 | { | 75 | { |
73 | //IConfig userConfig = config.Configs["SimulationService"]; | 76 | InitialiseService(configSource); |
74 | //if (userConfig == null) | ||
75 | //{ | ||
76 | // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpenSim.ini"); | ||
77 | // return; | ||
78 | //} | ||
79 | 77 | ||
80 | m_ModuleEnabled = true; | 78 | m_ModuleEnabled = true; |
81 | 79 | ||
82 | m_log.Info("[SIMULATION CONNECTOR]: Local simulation enabled"); | 80 | m_log.Info("[LOCAL SIMULATION CONNECTOR]: Local simulation enabled."); |
83 | } | 81 | } |
84 | } | 82 | } |
85 | } | 83 | } |
86 | 84 | ||
85 | public void InitialiseService(IConfigSource configSource) | ||
86 | { | ||
87 | ServiceVersion = "SIMULATION/0.2"; | ||
88 | IConfig config = configSource.Configs["SimulationService"]; | ||
89 | if (config != null) | ||
90 | { | ||
91 | ServiceVersion = config.GetString("ConnectorProtocolVersion", ServiceVersion); | ||
92 | |||
93 | if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2") | ||
94 | throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion)); | ||
95 | |||
96 | m_log.InfoFormat( | ||
97 | "[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion); | ||
98 | } | ||
99 | } | ||
100 | |||
87 | public void PostInitialise() | 101 | public void PostInitialise() |
88 | { | 102 | { |
89 | } | 103 | } |
@@ -160,7 +174,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
160 | 174 | ||
161 | #endregion | 175 | #endregion |
162 | 176 | ||
163 | #region ISimulation | 177 | #region ISimulationService |
164 | 178 | ||
165 | public IScene GetScene(UUID regionId) | 179 | public IScene GetScene(UUID regionId) |
166 | { | 180 | { |
@@ -221,7 +235,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
221 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | 235 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", |
222 | // destination.RegionName, destination.RegionID); | 236 | // destination.RegionName, destination.RegionID); |
223 | 237 | ||
224 | return m_scenes[destination.RegionID].IncomingChildAgentDataUpdate(cAgentData); | 238 | return m_scenes[destination.RegionID].IncomingUpdateChildAgent(cAgentData); |
225 | } | 239 | } |
226 | 240 | ||
227 | // m_log.DebugFormat( | 241 | // m_log.DebugFormat( |
@@ -231,7 +245,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
231 | return false; | 245 | return false; |
232 | } | 246 | } |
233 | 247 | ||
234 | public bool UpdateAgent(GridRegion destination, AgentPosition cAgentData) | 248 | public bool UpdateAgent(GridRegion destination, AgentPosition agentPosition) |
235 | { | 249 | { |
236 | if (destination == null) | 250 | if (destination == null) |
237 | return false; | 251 | return false; |
@@ -243,37 +257,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
243 | foreach (Scene s in m_scenes.Values) | 257 | foreach (Scene s in m_scenes.Values) |
244 | { | 258 | { |
245 | // m_log.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate"); | 259 | // m_log.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate"); |
246 | s.IncomingChildAgentDataUpdate(cAgentData); | 260 | s.IncomingUpdateChildAgent(agentPosition); |
247 | } | 261 | } |
248 | 262 | ||
249 | //m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate"); | 263 | //m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate"); |
250 | return true; | 264 | return true; |
251 | } | 265 | } |
252 | 266 | ||
253 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | ||
254 | { | ||
255 | agent = null; | ||
256 | |||
257 | if (destination == null) | ||
258 | return false; | ||
259 | |||
260 | if (m_scenes.ContainsKey(destination.RegionID)) | ||
261 | { | ||
262 | // m_log.DebugFormat( | ||
263 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | ||
264 | // s.RegionInfo.RegionName, destination.RegionHandle); | ||
265 | |||
266 | return m_scenes[destination.RegionID].IncomingRetrieveRootAgent(id, out agent); | ||
267 | } | ||
268 | |||
269 | //m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate"); | ||
270 | return false; | ||
271 | } | ||
272 | |||
273 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) | 267 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) |
274 | { | 268 | { |
275 | reason = "Communications failure"; | 269 | reason = "Communications failure"; |
276 | version = m_Version; | 270 | version = ServiceVersion; |
277 | if (destination == null) | 271 | if (destination == null) |
278 | return false; | 272 | return false; |
279 | 273 | ||
@@ -306,12 +300,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
306 | return false; | 300 | return false; |
307 | } | 301 | } |
308 | 302 | ||
309 | public bool CloseChildAgent(GridRegion destination, UUID id) | 303 | public bool CloseAgent(GridRegion destination, UUID id, string auth_token) |
310 | { | ||
311 | return CloseAgent(destination, id); | ||
312 | } | ||
313 | |||
314 | public bool CloseAgent(GridRegion destination, UUID id) | ||
315 | { | 304 | { |
316 | if (destination == null) | 305 | if (destination == null) |
317 | return false; | 306 | return false; |
@@ -322,7 +311,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
322 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | 311 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", |
323 | // s.RegionInfo.RegionName, destination.RegionHandle); | 312 | // s.RegionInfo.RegionName, destination.RegionHandle); |
324 | 313 | ||
325 | Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id, false); }); | 314 | m_scenes[destination.RegionID].CloseAgent(id, false, auth_token); |
326 | return true; | 315 | return true; |
327 | } | 316 | } |
328 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); | 317 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); |
@@ -363,7 +352,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
363 | return false; | 352 | return false; |
364 | } | 353 | } |
365 | 354 | ||
366 | #endregion /* IInterregionComms */ | 355 | #endregion |
367 | 356 | ||
368 | #region Misc | 357 | #region Misc |
369 | 358 | ||
@@ -383,4 +372,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
383 | 372 | ||
384 | #endregion | 373 | #endregion |
385 | } | 374 | } |
386 | } | 375 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index c8698ca..ab912ed 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -50,9 +50,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteSimulationConnectorModule")] | 50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteSimulationConnectorModule")] |
51 | public class RemoteSimulationConnectorModule : ISharedRegionModule, ISimulationService | 51 | public class RemoteSimulationConnectorModule : ISharedRegionModule, ISimulationService |
52 | { | 52 | { |
53 | private bool initialized = false; | ||
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 54 | ||
55 | private bool initialized = false; | ||
56 | protected bool m_enabled = false; | 56 | protected bool m_enabled = false; |
57 | protected Scene m_aScene; | 57 | protected Scene m_aScene; |
58 | // RemoteSimulationConnector does not care about local regions; it delegates that to the Local module | 58 | // RemoteSimulationConnector does not care about local regions; it delegates that to the Local module |
@@ -64,27 +64,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
64 | 64 | ||
65 | #region Region Module interface | 65 | #region Region Module interface |
66 | 66 | ||
67 | public virtual void Initialise(IConfigSource config) | 67 | public virtual void Initialise(IConfigSource configSource) |
68 | { | 68 | { |
69 | 69 | IConfig moduleConfig = configSource.Configs["Modules"]; | |
70 | IConfig moduleConfig = config.Configs["Modules"]; | ||
71 | if (moduleConfig != null) | 70 | if (moduleConfig != null) |
72 | { | 71 | { |
73 | string name = moduleConfig.GetString("SimulationServices", ""); | 72 | string name = moduleConfig.GetString("SimulationServices", ""); |
74 | if (name == Name) | 73 | if (name == Name) |
75 | { | 74 | { |
76 | //IConfig userConfig = config.Configs["SimulationService"]; | 75 | m_localBackend = new LocalSimulationConnectorModule(); |
77 | //if (userConfig == null) | 76 | |
78 | //{ | 77 | m_localBackend.InitialiseService(configSource); |
79 | // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpenSim.ini"); | ||
80 | // return; | ||
81 | //} | ||
82 | 78 | ||
83 | m_remoteConnector = new SimulationServiceConnector(); | 79 | m_remoteConnector = new SimulationServiceConnector(); |
84 | 80 | ||
85 | m_enabled = true; | 81 | m_enabled = true; |
86 | 82 | ||
87 | m_log.Info("[SIMULATION CONNECTOR]: Remote simulation enabled"); | 83 | m_log.Info("[REMOTE SIMULATION CONNECTOR]: Remote simulation enabled."); |
88 | } | 84 | } |
89 | } | 85 | } |
90 | } | 86 | } |
@@ -142,8 +138,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
142 | } | 138 | } |
143 | 139 | ||
144 | protected virtual void InitOnce(Scene scene) | 140 | protected virtual void InitOnce(Scene scene) |
145 | { | 141 | { |
146 | m_localBackend = new LocalSimulationConnectorModule(); | ||
147 | m_aScene = scene; | 142 | m_aScene = scene; |
148 | //m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); | 143 | //m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); |
149 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); | 144 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); |
@@ -151,7 +146,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
151 | 146 | ||
152 | #endregion | 147 | #endregion |
153 | 148 | ||
154 | #region IInterregionComms | 149 | #region ISimulationService |
155 | 150 | ||
156 | public IScene GetScene(UUID regionId) | 151 | public IScene GetScene(UUID regionId) |
157 | { | 152 | { |
@@ -194,7 +189,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
194 | return false; | 189 | return false; |
195 | 190 | ||
196 | // Try local first | 191 | // Try local first |
197 | if (m_localBackend.IsLocalRegion(destination.RegionHandle)) | 192 | if (m_localBackend.IsLocalRegion(destination.RegionID)) |
198 | return m_localBackend.UpdateAgent(destination, cAgentData); | 193 | return m_localBackend.UpdateAgent(destination, cAgentData); |
199 | 194 | ||
200 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 195 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
@@ -206,30 +201,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
206 | return false; | 201 | return false; |
207 | 202 | ||
208 | // Try local first | 203 | // Try local first |
209 | if (m_localBackend.IsLocalRegion(destination.RegionHandle)) | 204 | if (m_localBackend.IsLocalRegion(destination.RegionID)) |
210 | return m_localBackend.UpdateAgent(destination, cAgentData); | 205 | return m_localBackend.UpdateAgent(destination, cAgentData); |
211 | 206 | ||
212 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
213 | } | 208 | } |
214 | 209 | ||
215 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | ||
216 | { | ||
217 | agent = null; | ||
218 | |||
219 | if (destination == null) | ||
220 | return false; | ||
221 | |||
222 | // Try local first | ||
223 | if (m_localBackend.RetrieveAgent(destination, id, out agent)) | ||
224 | return true; | ||
225 | |||
226 | // else do the remote thing | ||
227 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | ||
228 | return m_remoteConnector.RetrieveAgent(destination, id, out agent); | ||
229 | |||
230 | return false; | ||
231 | } | ||
232 | |||
233 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) | 210 | public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) |
234 | { | 211 | { |
235 | reason = "Communications failure"; | 212 | reason = "Communications failure"; |
@@ -262,34 +239,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
262 | return false; | 239 | return false; |
263 | } | 240 | } |
264 | 241 | ||
265 | public bool CloseChildAgent(GridRegion destination, UUID id) | 242 | public bool CloseAgent(GridRegion destination, UUID id, string auth_token) |
266 | { | ||
267 | if (destination == null) | ||
268 | return false; | ||
269 | |||
270 | // Try local first | ||
271 | if (m_localBackend.CloseChildAgent(destination, id)) | ||
272 | return true; | ||
273 | |||
274 | // else do the remote thing | ||
275 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | ||
276 | return m_remoteConnector.CloseChildAgent(destination, id); | ||
277 | |||
278 | return false; | ||
279 | } | ||
280 | |||
281 | public bool CloseAgent(GridRegion destination, UUID id) | ||
282 | { | 243 | { |
283 | if (destination == null) | 244 | if (destination == null) |
284 | return false; | 245 | return false; |
285 | 246 | ||
286 | // Try local first | 247 | // Try local first |
287 | if (m_localBackend.CloseAgent(destination, id)) | 248 | if (m_localBackend.CloseAgent(destination, id, auth_token)) |
288 | return true; | 249 | return true; |
289 | 250 | ||
290 | // else do the remote thing | 251 | // else do the remote thing |
291 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 252 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
292 | return m_remoteConnector.CloseAgent(destination, id); | 253 | return m_remoteConnector.CloseAgent(destination, id, auth_token); |
293 | 254 | ||
294 | return false; | 255 | return false; |
295 | } | 256 | } |
@@ -311,12 +272,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
311 | } | 272 | } |
312 | 273 | ||
313 | // else do the remote thing | 274 | // else do the remote thing |
314 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 275 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
315 | return m_remoteConnector.CreateObject(destination, newPosition, sog, isLocalCall); | 276 | return m_remoteConnector.CreateObject(destination, newPosition, sog, isLocalCall); |
316 | 277 | ||
317 | return false; | 278 | return false; |
318 | } | 279 | } |
319 | 280 | ||
320 | #endregion /* IInterregionComms */ | 281 | #endregion |
321 | } | 282 | } |
322 | } | 283 | } |