diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 290 |
1 files changed, 232 insertions, 58 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index b188741..fa23590 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -31,6 +31,7 @@ using System.Reflection; | |||
31 | 31 | ||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Client; | 33 | using OpenSim.Framework.Client; |
34 | using OpenSim.Framework.Monitoring; | ||
34 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Services.Connectors.Hypergrid; | 37 | using OpenSim.Services.Connectors.Hypergrid; |
@@ -55,6 +56,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
55 | private int m_levelHGTeleport = 0; | 56 | private int m_levelHGTeleport = 0; |
56 | 57 | ||
57 | private GatekeeperServiceConnector m_GatekeeperConnector; | 58 | private GatekeeperServiceConnector m_GatekeeperConnector; |
59 | private IUserAgentService m_UAS; | ||
58 | 60 | ||
59 | protected bool m_RestrictAppearanceAbroad; | 61 | protected bool m_RestrictAppearanceAbroad; |
60 | protected string m_AccountName; | 62 | protected string m_AccountName; |
@@ -109,6 +111,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
109 | } | 111 | } |
110 | } | 112 | } |
111 | 113 | ||
114 | /// <summary> | ||
115 | /// Used for processing analysis of incoming attachments in a controlled fashion. | ||
116 | /// </summary> | ||
117 | private JobEngine m_incomingSceneObjectEngine; | ||
118 | |||
112 | #region ISharedRegionModule | 119 | #region ISharedRegionModule |
113 | 120 | ||
114 | public override string Name | 121 | public override string Name |
@@ -152,39 +159,33 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
152 | if (m_Enabled) | 159 | if (m_Enabled) |
153 | { | 160 | { |
154 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); | 161 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); |
155 | scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; | 162 | //scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; |
156 | } | 163 | |
157 | } | 164 | m_incomingSceneObjectEngine |
158 | 165 | = new JobEngine( | |
159 | void OnIncomingSceneObject(SceneObjectGroup so) | 166 | string.Format("HG Incoming Scene Object Engine ({0})", scene.Name), |
160 | { | 167 | "HG INCOMING SCENE OBJECT ENGINE"); |
161 | if (!so.IsAttachment) | 168 | |
162 | return; | 169 | StatsManager.RegisterStat( |
163 | 170 | new Stat( | |
164 | if (so.Scene.UserManagementModule.IsLocalGridUser(so.AttachedAvatar)) | 171 | "HGIncomingAttachmentsWaiting", |
165 | return; | 172 | "Number of incoming attachments waiting for processing.", |
166 | 173 | "", | |
167 | // foreign user | 174 | "", |
168 | AgentCircuitData aCircuit = so.Scene.AuthenticateHandler.GetAgentCircuitData(so.AttachedAvatar); | 175 | "entitytransfer", |
169 | if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) | 176 | Name, |
170 | { | 177 | StatType.Pull, |
171 | if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) | 178 | MeasuresOfInterest.None, |
172 | { | 179 | stat => stat.Value = m_incomingSceneObjectEngine.JobsWaiting, |
173 | string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); | 180 | StatVerbosity.Debug)); |
174 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Incoming attachement {0} for HG user {1} with asset server {2}", so.Name, so.AttachedAvatar, url); | 181 | |
175 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); | 182 | m_incomingSceneObjectEngine.Start(); |
176 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(so.Scene.AssetService, url); | ||
177 | uuidGatherer.GatherAssetUuids(so, ids); | ||
178 | |||
179 | foreach (KeyValuePair<UUID, AssetType> kvp in ids) | ||
180 | uuidGatherer.FetchAsset(kvp.Key); | ||
181 | } | ||
182 | } | 183 | } |
183 | } | 184 | } |
184 | 185 | ||
185 | protected override void OnNewClient(IClientAPI client) | 186 | protected override void OnNewClient(IClientAPI client) |
186 | { | 187 | { |
187 | client.OnTeleportHomeRequest += TeleportHome; | 188 | client.OnTeleportHomeRequest += TriggerTeleportHome; |
188 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | 189 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; |
189 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); | 190 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); |
190 | } | 191 | } |
@@ -194,34 +195,44 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
194 | base.RegionLoaded(scene); | 195 | base.RegionLoaded(scene); |
195 | 196 | ||
196 | if (m_Enabled) | 197 | if (m_Enabled) |
198 | { | ||
197 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); | 199 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); |
200 | m_UAS = scene.RequestModuleInterface<IUserAgentService>(); | ||
201 | if (m_UAS == null) | ||
202 | m_UAS = new UserAgentServiceConnector(m_ThisHomeURI); | ||
203 | |||
204 | } | ||
198 | } | 205 | } |
199 | 206 | ||
200 | public override void RemoveRegion(Scene scene) | 207 | public override void RemoveRegion(Scene scene) |
201 | { | 208 | { |
202 | base.AddRegion(scene); | 209 | base.RemoveRegion(scene); |
203 | 210 | ||
204 | if (m_Enabled) | 211 | if (m_Enabled) |
212 | { | ||
205 | scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this); | 213 | scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this); |
214 | m_incomingSceneObjectEngine.Stop(); | ||
215 | } | ||
206 | } | 216 | } |
207 | 217 | ||
208 | #endregion | 218 | #endregion |
209 | 219 | ||
210 | #region HG overrides of IEntiryTransferModule | 220 | #region HG overrides of IEntityTransferModule |
211 | 221 | ||
212 | protected override GridRegion GetFinalDestination(GridRegion region) | 222 | protected override GridRegion GetFinalDestination(GridRegion region, UUID agentID, string agentHomeURI, out string message) |
213 | { | 223 | { |
214 | int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID); | 224 | int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID); |
215 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags); | 225 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags); |
226 | message = null; | ||
216 | 227 | ||
217 | if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) | 228 | if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) |
218 | { | 229 | { |
219 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink"); | 230 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink"); |
220 | GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); | 231 | GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID, agentID, agentHomeURI, out message); |
221 | if (real_destination != null) | 232 | if (real_destination != null) |
222 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI); | 233 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination: ServerURI={0}", real_destination.ServerURI); |
223 | else | 234 | else |
224 | m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI); | 235 | m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion of region {0} from Gatekeeper {1} failed: {2}", region.RegionID, region.ServerURI, message); |
225 | return real_destination; | 236 | return real_destination; |
226 | } | 237 | } |
227 | 238 | ||
@@ -272,12 +283,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
272 | if (agentCircuit.ServiceURLs.ContainsKey("HomeURI")) | 283 | if (agentCircuit.ServiceURLs.ContainsKey("HomeURI")) |
273 | { | 284 | { |
274 | string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); | 285 | string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); |
275 | IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver); | 286 | IUserAgentService connector; |
276 | bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); | 287 | |
288 | if (userAgentDriver.Equals(m_ThisHomeURI) && m_UAS != null) | ||
289 | connector = m_UAS; | ||
290 | else | ||
291 | connector = new UserAgentServiceConnector(userAgentDriver); | ||
292 | |||
293 | GridRegion source = new GridRegion(Scene.RegionInfo); | ||
294 | source.RawServerURI = m_GatekeeperURI; | ||
295 | |||
296 | bool success = connector.LoginAgentToGrid(source, agentCircuit, reg, finalDestination, false, out reason); | ||
277 | logout = success; // flag for later logout from this grid; this is an HG TP | 297 | logout = success; // flag for later logout from this grid; this is an HG TP |
278 | 298 | ||
279 | if (success) | 299 | if (success) |
280 | sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout); | 300 | Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout); |
281 | 301 | ||
282 | return success; | 302 | return success; |
283 | } | 303 | } |
@@ -409,7 +429,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
409 | // return base.UpdateAgent(reg, finalDestination, agentData, sp); | 429 | // return base.UpdateAgent(reg, finalDestination, agentData, sp); |
410 | //} | 430 | //} |
411 | 431 | ||
412 | public override void TeleportHome(UUID id, IClientAPI client) | 432 | public override void TriggerTeleportHome(UUID id, IClientAPI client) |
433 | { | ||
434 | TeleportHome(id, client); | ||
435 | } | ||
436 | |||
437 | public override bool TeleportHome(UUID id, IClientAPI client) | ||
413 | { | 438 | { |
414 | m_log.DebugFormat( | 439 | m_log.DebugFormat( |
415 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); | 440 | "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId); |
@@ -420,8 +445,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
420 | { | 445 | { |
421 | // local grid user | 446 | // local grid user |
422 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); | 447 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); |
423 | base.TeleportHome(id, client); | 448 | return base.TeleportHome(id, client); |
424 | return; | ||
425 | } | 449 | } |
426 | 450 | ||
427 | // Foreign user wants to go home | 451 | // Foreign user wants to go home |
@@ -431,17 +455,27 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
431 | { | 455 | { |
432 | client.SendTeleportFailed("Your information has been lost"); | 456 | client.SendTeleportFailed("Your information has been lost"); |
433 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information"); | 457 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information"); |
434 | return; | 458 | return false; |
435 | } | 459 | } |
436 | 460 | ||
437 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); | 461 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); |
438 | Vector3 position = Vector3.UnitY, lookAt = Vector3.UnitY; | 462 | Vector3 position = Vector3.UnitY, lookAt = Vector3.UnitY; |
439 | GridRegion finalDestination = userAgentService.GetHomeRegion(aCircuit.AgentID, out position, out lookAt); | 463 | |
464 | GridRegion finalDestination = null; | ||
465 | try | ||
466 | { | ||
467 | finalDestination = userAgentService.GetHomeRegion(aCircuit.AgentID, out position, out lookAt); | ||
468 | } | ||
469 | catch (Exception e) | ||
470 | { | ||
471 | m_log.Debug("[HG ENTITY TRANSFER MODULE]: GetHomeRegion call failed ", e); | ||
472 | } | ||
473 | |||
440 | if (finalDestination == null) | 474 | if (finalDestination == null) |
441 | { | 475 | { |
442 | client.SendTeleportFailed("Your home region could not be found"); | 476 | client.SendTeleportFailed("Your home region could not be found"); |
443 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found"); | 477 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found"); |
444 | return; | 478 | return false; |
445 | } | 479 | } |
446 | 480 | ||
447 | ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId); | 481 | ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId); |
@@ -449,7 +483,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
449 | { | 483 | { |
450 | client.SendTeleportFailed("Internal error"); | 484 | client.SendTeleportFailed("Internal error"); |
451 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be"); | 485 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be"); |
452 | return; | 486 | return false; |
453 | } | 487 | } |
454 | 488 | ||
455 | GridRegion homeGatekeeper = MakeRegion(aCircuit); | 489 | GridRegion homeGatekeeper = MakeRegion(aCircuit); |
@@ -460,6 +494,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
460 | DoTeleport( | 494 | DoTeleport( |
461 | sp, homeGatekeeper, finalDestination, | 495 | sp, homeGatekeeper, finalDestination, |
462 | position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); | 496 | position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); |
497 | return true; | ||
463 | } | 498 | } |
464 | 499 | ||
465 | /// <summary> | 500 | /// <summary> |
@@ -484,35 +519,174 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
484 | // Local region? | 519 | // Local region? |
485 | if (info != null) | 520 | if (info != null) |
486 | { | 521 | { |
487 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, | 522 | Scene.RequestTeleportLocation( |
523 | remoteClient, info.RegionHandle, lm.Position, | ||
488 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); | 524 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); |
489 | |||
490 | return; | ||
491 | } | 525 | } |
492 | else | 526 | else |
493 | { | 527 | { |
494 | // Foreign region | 528 | // Foreign region |
495 | Scene scene = (Scene)(remoteClient.Scene); | ||
496 | GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); | 529 | GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); |
497 | GridRegion gatekeeper = new GridRegion(); | 530 | GridRegion gatekeeper = new GridRegion(); |
498 | gatekeeper.ServerURI = lm.Gatekeeper; | 531 | gatekeeper.ServerURI = lm.Gatekeeper; |
499 | GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID)); | 532 | string homeURI = Scene.GetAgentHomeURI(remoteClient.AgentId); |
533 | |||
534 | string message; | ||
535 | GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), remoteClient.AgentId, homeURI, out message); | ||
500 | 536 | ||
501 | if (finalDestination != null) | 537 | if (finalDestination != null) |
502 | { | 538 | { |
503 | ScenePresence sp = scene.GetScenePresence(remoteClient.AgentId); | 539 | ScenePresence sp = Scene.GetScenePresence(remoteClient.AgentId); |
504 | IEntityTransferModule transferMod = scene.RequestModuleInterface<IEntityTransferModule>(); | ||
505 | 540 | ||
506 | if (transferMod != null && sp != null) | 541 | if (sp != null) |
507 | transferMod.DoTeleport( | 542 | { |
543 | if (message != null) | ||
544 | sp.ControllingClient.SendAgentAlertMessage(message, true); | ||
545 | |||
546 | // Validate assorted conditions | ||
547 | string reason = string.Empty; | ||
548 | if (!ValidateGenericConditions(sp, gatekeeper, finalDestination, 0, out reason)) | ||
549 | { | ||
550 | sp.ControllingClient.SendTeleportFailed(reason); | ||
551 | return; | ||
552 | } | ||
553 | |||
554 | DoTeleport( | ||
508 | sp, gatekeeper, finalDestination, lm.Position, Vector3.UnitX, | 555 | sp, gatekeeper, finalDestination, lm.Position, Vector3.UnitX, |
509 | (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); | 556 | (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); |
557 | } | ||
558 | } | ||
559 | else | ||
560 | { | ||
561 | remoteClient.SendTeleportFailed(message); | ||
510 | } | 562 | } |
511 | 563 | ||
512 | } | 564 | } |
565 | } | ||
566 | |||
567 | private void RemoveIncomingSceneObjectJobs(string commonIdToRemove) | ||
568 | { | ||
569 | List<JobEngine.Job> jobsToReinsert = new List<JobEngine.Job>(); | ||
570 | int jobsRemoved = 0; | ||
513 | 571 | ||
514 | // can't find the region: Tell viewer and abort | 572 | JobEngine.Job job; |
515 | remoteClient.SendTeleportFailed("The teleport destination could not be found."); | 573 | while ((job = m_incomingSceneObjectEngine.RemoveNextJob()) != null) |
574 | { | ||
575 | if (job.CommonId != commonIdToRemove) | ||
576 | jobsToReinsert.Add(job); | ||
577 | else | ||
578 | jobsRemoved++; | ||
579 | } | ||
580 | |||
581 | m_log.DebugFormat( | ||
582 | "[HG ENTITY TRANSFER]: Removing {0} jobs with common ID {1} and reinserting {2} other jobs", | ||
583 | jobsRemoved, commonIdToRemove, jobsToReinsert.Count); | ||
584 | |||
585 | if (jobsToReinsert.Count > 0) | ||
586 | { | ||
587 | foreach (JobEngine.Job jobToReinsert in jobsToReinsert) | ||
588 | m_incomingSceneObjectEngine.QueueJob(jobToReinsert); | ||
589 | } | ||
590 | } | ||
591 | |||
592 | public override bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition) | ||
593 | { | ||
594 | // FIXME: We must make it so that we can use SOG.IsAttachment here. At the moment it is always null! | ||
595 | if (!so.IsAttachmentCheckFull()) | ||
596 | return base.HandleIncomingSceneObject(so, newPosition); | ||
597 | |||
598 | // Equally, we can't use so.AttachedAvatar here. | ||
599 | if (so.OwnerID == UUID.Zero || Scene.UserManagementModule.IsLocalGridUser(so.OwnerID)) | ||
600 | return base.HandleIncomingSceneObject(so, newPosition); | ||
601 | |||
602 | // foreign user | ||
603 | AgentCircuitData aCircuit = Scene.AuthenticateHandler.GetAgentCircuitData(so.OwnerID); | ||
604 | if (aCircuit != null) | ||
605 | { | ||
606 | if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) == 0) | ||
607 | { | ||
608 | // We have already pulled the necessary attachments from the source grid. | ||
609 | base.HandleIncomingSceneObject(so, newPosition); | ||
610 | } | ||
611 | else | ||
612 | { | ||
613 | if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) | ||
614 | { | ||
615 | m_incomingSceneObjectEngine.QueueJob( | ||
616 | string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), | ||
617 | () => | ||
618 | { | ||
619 | string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); | ||
620 | // m_log.DebugFormat( | ||
621 | // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", | ||
622 | // so.Name, so.AttachedAvatar, url); | ||
623 | |||
624 | IDictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); | ||
625 | HGUuidGatherer uuidGatherer | ||
626 | = new HGUuidGatherer(Scene.AssetService, url, ids); | ||
627 | uuidGatherer.AddForInspection(so); | ||
628 | |||
629 | while (!uuidGatherer.Complete) | ||
630 | { | ||
631 | int tickStart = Util.EnvironmentTickCount(); | ||
632 | |||
633 | UUID? nextUuid = uuidGatherer.NextUuidToInspect; | ||
634 | uuidGatherer.GatherNext(); | ||
635 | |||
636 | // m_log.DebugFormat( | ||
637 | // "[HG ENTITY TRANSFER]: Gathered attachment asset uuid {0} for object {1} for HG user {2} took {3} ms with asset service {4}", | ||
638 | // nextUuid, so.Name, so.OwnerID, Util.EnvironmentTickCountSubtract(tickStart), url); | ||
639 | |||
640 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); | ||
641 | |||
642 | if (ticksElapsed > 30000) | ||
643 | { | ||
644 | m_log.WarnFormat( | ||
645 | "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as gather of {1} from {2} took {3} ms to respond (> {4} ms)", | ||
646 | so.OwnerID, so.Name, url, ticksElapsed, 30000); | ||
647 | |||
648 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); | ||
649 | |||
650 | return; | ||
651 | } | ||
652 | } | ||
653 | |||
654 | // m_log.DebugFormat( | ||
655 | // "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", | ||
656 | // ids.Count, so.Name, so.OwnerID, url); | ||
657 | |||
658 | foreach (KeyValuePair<UUID, sbyte> kvp in ids) | ||
659 | { | ||
660 | int tickStart = Util.EnvironmentTickCount(); | ||
661 | |||
662 | uuidGatherer.FetchAsset(kvp.Key); | ||
663 | |||
664 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); | ||
665 | |||
666 | if (ticksElapsed > 30000) | ||
667 | { | ||
668 | m_log.WarnFormat( | ||
669 | "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as fetch of {1} from {2} took {3} ms to respond (> {4} ms)", | ||
670 | so.OwnerID, kvp.Key, url, ticksElapsed, 30000); | ||
671 | |||
672 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); | ||
673 | |||
674 | return; | ||
675 | } | ||
676 | } | ||
677 | |||
678 | base.HandleIncomingSceneObject(so, newPosition); | ||
679 | |||
680 | // m_log.DebugFormat( | ||
681 | // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", | ||
682 | // so.Name, so.OwnerID, url); | ||
683 | }, | ||
684 | so.OwnerID.ToString()); | ||
685 | } | ||
686 | } | ||
687 | } | ||
688 | |||
689 | return true; | ||
516 | } | 690 | } |
517 | 691 | ||
518 | #endregion | 692 | #endregion |
@@ -549,12 +723,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
549 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) | 723 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) |
550 | { | 724 | { |
551 | // local grid user | 725 | // local grid user |
726 | m_UAS.LogoutAgent(obj.AgentId, obj.SessionId); | ||
552 | return; | 727 | return; |
553 | } | 728 | } |
554 | 729 | ||
555 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); | 730 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); |
556 | 731 | if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("HomeURI")) | |
557 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | ||
558 | { | 732 | { |
559 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); | 733 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); |
560 | IUserAgentService security = new UserAgentServiceConnector(url); | 734 | IUserAgentService security = new UserAgentServiceConnector(url); |