aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs28
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs27
4 files changed, 55 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index d6ad07e..c74584c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -859,6 +859,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
859 859
860 InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID); 860 InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID);
861 item = m_scene.InventoryService.GetItem(item); 861 item = m_scene.InventoryService.GetItem(item);
862 if (item == null)
863 return;
864
862 bool changed = sp.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); 865 bool changed = sp.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID);
863 if (changed && m_scene.AvatarFactory != null) 866 if (changed && m_scene.AvatarFactory != null)
864 { 867 {
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 0b386d3..a6698e6 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -150,6 +150,34 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
150 150
151 if (m_Enabled) 151 if (m_Enabled)
152 scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); 152 scene.RegisterModuleInterface<IUserAgentVerificationModule>(this);
153
154 scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject;
155 }
156
157 void OnIncomingSceneObject(SceneObjectGroup so)
158 {
159 if (!so.IsAttachment)
160 return;
161
162 if (so.Scene.UserManagementModule.IsLocalGridUser(so.AttachedAvatar))
163 return;
164
165 // foreign user
166 AgentCircuitData aCircuit = so.Scene.AuthenticateHandler.GetAgentCircuitData(so.AttachedAvatar);
167 if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0)
168 {
169 if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
170 {
171 string url = aCircuit.ServiceURLs["AssetServerURI"].ToString();
172 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Incoming attachement {0} for HG user {1} with asset server {2}", so.Name, so.AttachedAvatar, url);
173 Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>();
174 HGUuidGatherer uuidGatherer = new HGUuidGatherer(so.Scene.AssetService, url);
175 uuidGatherer.GatherAssetUuids(so, ids);
176
177 foreach (KeyValuePair<UUID, AssetType> kvp in ids)
178 uuidGatherer.FetchAsset(kvp.Key);
179 }
180 }
153 } 181 }
154 182
155 protected override void OnNewClient(IClientAPI client) 183 protected override void OnNewClient(IClientAPI client)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index a0cad40..80257bd 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -263,8 +263,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
263 //} 263 //}
264 264
265 // OK, we're done fetching. Pass it up to the default RezObject 265 // OK, we're done fetching. Pass it up to the default RezObject
266 return base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, 266 SceneObjectGroup sog = base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
267 RezSelected, RemoveItem, fromTaskID, attachment); 267 RezSelected, RemoveItem, fromTaskID, attachment);
268
269 if (sog == null)
270 remoteClient.SendAgentAlertMessage("Unable to rez: problem accessing inventory or locating assets", false);
271
272 return sog;
268 273
269 } 274 }
270 275
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index 383604d..28cd09f 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -377,6 +377,8 @@ namespace OpenSim.Region.Framework.Scenes
377 : base(assetService) 377 : base(assetService)
378 { 378 {
379 m_assetServerURL = assetServerURL; 379 m_assetServerURL = assetServerURL;
380 if (!m_assetServerURL.EndsWith("/") && !m_assetServerURL.EndsWith("="))
381 m_assetServerURL = m_assetServerURL + "/";
380 } 382 }
381 383
382 protected override AssetBase GetAsset(UUID uuid) 384 protected override AssetBase GetAsset(UUID uuid)
@@ -384,22 +386,27 @@ namespace OpenSim.Region.Framework.Scenes
384 if (string.Empty == m_assetServerURL) 386 if (string.Empty == m_assetServerURL)
385 return base.GetAsset(uuid); 387 return base.GetAsset(uuid);
386 else 388 else
387 return FetchAsset(m_assetServerURL, uuid); 389 return FetchAsset(uuid);
388 } 390 }
389 391
390 public AssetBase FetchAsset(string url, UUID assetID) 392 public AssetBase FetchAsset(UUID assetID)
391 { 393 {
392 if (!url.EndsWith("/") && !url.EndsWith("="))
393 url = url + "/";
394 394
395 AssetBase asset = m_assetService.Get(url + assetID.ToString()); 395 // Test if it's already here
396 396 AssetBase asset = m_assetService.Get(assetID.ToString());
397 if (asset != null) 397 if (asset == null)
398 { 398 {
399 m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server. ", asset.ID, url); 399 // It's not, so fetch it from abroad
400 return asset; 400 asset = m_assetService.Get(m_assetServerURL + assetID.ToString());
401 if (asset != null)
402 m_log.DebugFormat("[HGUUIDGatherer]: Copied asset {0} from {1} to local asset server", assetID, m_assetServerURL);
403 else
404 m_log.DebugFormat("[HGUUIDGatherer]: Failed to fetch asset {0} from {1}", assetID, m_assetServerURL);
401 } 405 }
402 return null; 406 //else
407 // m_log.DebugFormat("[HGUUIDGatherer]: Asset {0} from {1} was already here", assetID, m_assetServerURL);
408
409 return asset;
403 } 410 }
404 } 411 }
405} 412}