From b7ae8701ce6881991fbacf28cdbb0d09f220f6ec Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 14 Apr 2008 18:43:23 +0000
Subject: * Working towards notifying the client if the inventory service has
failed, rather than simply returning 0 items. * This is very early support
which would only be triggered in a rather unlikely case (if the user server
correctly received an inventory skeleton, but later on failed to return the
whole inventory in a timely manner. Also, this only applies to the 1.19.1.4
client onwards * Code cleanup and support for other failure cases (failure of
inventory caching on region crossing, failure to actually add a folder/item,
etc, should follow.
---
OpenSim/Region/Environment/Scenes/InnerScene.cs | 33 +++++++++++++++++++++----
OpenSim/Region/Environment/Scenes/Scene.cs | 2 +-
2 files changed, 29 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index ef98599..0838387 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -618,6 +618,28 @@ namespace OpenSim.Region.Environment.Scenes
return result;
}
+
+ ///
+ /// Get the controlling client for the given avatar, if there is one.
+ ///
+ /// FIXME: The only user of the method right now is Caps.cs, in order to resolve a client API since it can't
+ /// use the ScenePresence. This could be better solved in a number of ways - we could establish an
+ /// OpenSim.Framework.IScenePresence, or move the caps code into a region package (which might be the more
+ /// suitable solution).
+ ///
+ ///
+ /// null if either the avatar wasn't in the scene, or they do not have a controlling client
+ public IClientAPI GetControllingClient(LLUUID agentId)
+ {
+ ScenePresence presence = GetScenePresence(agentId);
+
+ if (presence != null)
+ {
+ return presence.ControllingClient;
+ }
+
+ return null;
+ }
///
/// Request a filtered list of m_scenePresences in this World
@@ -640,16 +662,17 @@ namespace OpenSim.Region.Environment.Scenes
}
///
- /// Request a Avatar by UUID
+ /// Request a scene presence by UUID
///
///
- ///
- public ScenePresence GetScenePresence(LLUUID avatarID)
+ /// null if the agent was not found
+ public ScenePresence GetScenePresence(LLUUID agentID)
{
- if (ScenePresences.ContainsKey(avatarID))
+ if (ScenePresences.ContainsKey(agentID))
{
- return ScenePresences[avatarID];
+ return ScenePresences[agentID];
}
+
return null;
}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 410120f..b93367c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1884,7 +1884,7 @@ namespace OpenSim.Region.Environment.Scenes
cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
-
+ cap.GetClient = m_innerScene.GetControllingClient;
m_capsHandlers[agentId] = cap;
}
--
cgit v1.1