diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9c80d3e..78fbd3b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -521,6 +521,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
521 | 521 | ||
522 | public IAttachmentsModule AttachmentsModule { get; set; } | 522 | public IAttachmentsModule AttachmentsModule { get; set; } |
523 | public IEntityTransferModule EntityTransferModule { get; private set; } | 523 | public IEntityTransferModule EntityTransferModule { get; private set; } |
524 | public IAgentAssetTransactions AgentTransactionsModule { get; private set; } | ||
524 | 525 | ||
525 | public IAvatarFactoryModule AvatarFactory | 526 | public IAvatarFactoryModule AvatarFactory |
526 | { | 527 | { |
@@ -1289,6 +1290,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1289 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); | 1290 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); |
1290 | EntityTransferModule = RequestModuleInterface<IEntityTransferModule>(); | 1291 | EntityTransferModule = RequestModuleInterface<IEntityTransferModule>(); |
1291 | m_groupsModule = RequestModuleInterface<IGroupsModule>(); | 1292 | m_groupsModule = RequestModuleInterface<IGroupsModule>(); |
1293 | AgentTransactionsModule = RequestModuleInterface<IAgentAssetTransactions>(); | ||
1292 | } | 1294 | } |
1293 | 1295 | ||
1294 | #endregion | 1296 | #endregion |
@@ -3428,32 +3430,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
3428 | { | 3430 | { |
3429 | m_eventManager.TriggerOnRemovePresence(agentID); | 3431 | m_eventManager.TriggerOnRemovePresence(agentID); |
3430 | 3432 | ||
3431 | if (AttachmentsModule != null && !isChildAgent && avatar.PresenceType != PresenceType.Npc) | 3433 | if (!isChildAgent) |
3432 | { | 3434 | { |
3433 | IUserManagement uMan = RequestModuleInterface<IUserManagement>(); | 3435 | if (AttachmentsModule != null && avatar.PresenceType != PresenceType.Npc) |
3434 | // Don't save attachments for HG visitors, it | ||
3435 | // messes up their inventory. When a HG visitor logs | ||
3436 | // out on a foreign grid, their attachments will be | ||
3437 | // reloaded in the state they were in when they left | ||
3438 | // the home grid. This is best anyway as the visited | ||
3439 | // grid may use an incompatible script engine. | ||
3440 | if (uMan == null || uMan.IsLocalGridUser(avatar.UUID)) | ||
3441 | AttachmentsModule.SaveChangedAttachments(avatar, false); | ||
3442 | } | ||
3443 | |||
3444 | ForEachClient( | ||
3445 | delegate(IClientAPI client) | ||
3446 | { | 3436 | { |
3447 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway | 3437 | IUserManagement uMan = RequestModuleInterface<IUserManagement>(); |
3448 | try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); } | 3438 | // Don't save attachments for HG visitors, it |
3449 | catch (NullReferenceException) { } | 3439 | // messes up their inventory. When a HG visitor logs |
3450 | }); | 3440 | // out on a foreign grid, their attachments will be |
3451 | 3441 | // reloaded in the state they were in when they left | |
3452 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); | 3442 | // the home grid. This is best anyway as the visited |
3453 | if (agentTransactions != null) | 3443 | // grid may use an incompatible script engine. |
3454 | { | 3444 | if (uMan == null || uMan.IsLocalGridUser(avatar.UUID)) |
3455 | agentTransactions.RemoveAgentAssetTransactions(agentID); | 3445 | AttachmentsModule.SaveChangedAttachments(avatar, false); |
3446 | } | ||
3447 | |||
3448 | ForEachClient( | ||
3449 | delegate(IClientAPI client) | ||
3450 | { | ||
3451 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway | ||
3452 | try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); } | ||
3453 | catch (NullReferenceException) { } | ||
3454 | }); | ||
3456 | } | 3455 | } |
3456 | |||
3457 | // It's possible for child agents to have transactions if changes are being made cross-border. | ||
3458 | if (AgentTransactionsModule != null) | ||
3459 | AgentTransactionsModule.RemoveAgentAssetTransactions(agentID); | ||
3457 | } | 3460 | } |
3458 | finally | 3461 | finally |
3459 | { | 3462 | { |