From 0688861aa72dc162a3da7b60804ac17ff5908067 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Nov 2011 22:15:29 +0000
Subject: Use the more extensive
Utils.AssetTypeToString()/InventoryTypeToString() conversion rather than the
arrays in TaskInventoryItem
---
.../WebFetchInvDescHandler.cs | 5 +-
OpenSim/Framework/TaskInventoryItem.cs | 57 ----------------------
.../Framework/Scenes/SceneObjectPartInventory.cs | 4 +-
3 files changed, 5 insertions(+), 61 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
index 17dbcd5..52b5f2c 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
@@ -235,10 +235,11 @@ namespace OpenSim.Capabilities.Handlers
llsdFolder.folder_id = invFolder.ID;
llsdFolder.parent_id = invFolder.ParentID;
llsdFolder.name = invFolder.Name;
- if (invFolder.Type < 0 || invFolder.Type >= TaskInventoryItem.Types.Length)
+
+ if (!Enum.IsDefined(typeof(AssetType), invFolder.Type))
llsdFolder.type = "-1";
else
- llsdFolder.type = TaskInventoryItem.Types[invFolder.Type];
+ llsdFolder.type = Utils.AssetTypeToString((AssetType)invFolder.Type);
llsdFolder.preferred_type = "-1";
return llsdFolder;
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs
index 30d775c..ba2a306 100644
--- a/OpenSim/Framework/TaskInventoryItem.cs
+++ b/OpenSim/Framework/TaskInventoryItem.cs
@@ -40,63 +40,6 @@ namespace OpenSim.Framework
///
private const uint FULL_MASK_PERMISSIONS_GENERAL = 2147483647;
- ///
- /// Inventory types
- ///
- public static string[] InvTypes = new string[]
- {
- "texture",
- "sound",
- "calling_card",
- "landmark",
- String.Empty,
- String.Empty,
- "object",
- "notecard",
- String.Empty,
- String.Empty,
- "lsl_text",
- String.Empty,
- String.Empty,
- "bodypart",
- String.Empty,
- "snapshot",
- String.Empty,
- String.Empty,
- "wearable",
- "animation",
- "gesture"
- };
-
- ///
- /// Asset types
- ///
- public static string[] Types = new string[]
- {
- "texture",
- "sound",
- "callcard",
- "landmark",
- "clothing", // Deprecated
- "clothing",
- "object",
- "notecard",
- "category",
- "root",
- "lsltext",
- "lslbyte",
- "txtr_tga",
- "bodypart",
- "trash",
- "snapshot",
- "lstndfnd",
- "snd_wav",
- "img_tga",
- "jpeg",
- "animatn",
- "gesture"
- };
-
private UUID _assetID = UUID.Zero;
private uint _baseMask = FULL_MASK_PERMISSIONS_GENERAL;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index d80944b..daddb90 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -832,8 +832,8 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddSectionEnd();
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
- invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
- invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
+ invString.AddNameValueLine("type", Utils.AssetTypeToString((AssetType)item.Type));
+ invString.AddNameValueLine("inv_type", Utils.InventoryTypeToString((InventoryType)item.InvType));
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
invString.AddSaleStart();
--
cgit v1.1
From b785f204ce33fc78ec4b0f9a30c20bc56ebea0d9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Nov 2011 22:19:57 +0000
Subject: remove some mono compiler warnings
---
OpenSim/Framework/Console/CommandConsole.cs | 2 +-
OpenSim/Framework/WebUtil.cs | 2 +-
OpenSim/Region/Physics/Manager/PhysicsScene.cs | 2 +-
OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 6 +++---
OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 8 ++++----
bin/OpenSimDefaults.ini | 6 +++---
6 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index f10b857..a0d3541 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -565,7 +565,7 @@ namespace OpenSim.Framework.Console
///
public class CommandConsole : ConsoleBase, ICommandConsole
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public ICommands Commands { get; private set; }
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index c6be79e..b761dfe 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -294,7 +294,7 @@ namespace OpenSim.Framework
return result;
}
}
- catch (Exception e)
+ catch
{
// don't need to treat this as an error... we're just guessing anyway
// m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message);
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 7ab295a..2a6163c 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Physics.Manager
public abstract class PhysicsScene
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
///
/// Name of this scene. Useful in debug messages to distinguish one OdeScene instance from another.
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 489a23a..73c1c02 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private float CAPSULE_RADIUS = 0.37f;
private float CAPSULE_LENGTH = 2.140599f;
private float m_tensor = 3800000f;
- private float heightFudgeFactor = 0.52f;
+// private float heightFudgeFactor = 0.52f;
private float walkDivisor = 1.3f;
private float runDivisor = 0.8f;
private bool flying = false;
@@ -149,7 +149,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public OdeCharacter(
String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p,
- float capsule_radius, float tensor, float density, float height_fudge_factor,
+ float capsule_radius, float tensor, float density,
float walk_divisor, float rundivisor)
{
m_uuid = UUID.Random();
@@ -187,7 +187,7 @@ namespace OpenSim.Region.Physics.OdePlugin
CAPSULE_RADIUS = capsule_radius;
m_tensor = tensor;
m_density = density;
- heightFudgeFactor = height_fudge_factor;
+// heightFudgeFactor = height_fudge_factor;
walkDivisor = walk_divisor;
runDivisor = rundivisor;
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 0456f56..5b28e7c 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private bool avCapsuleTilted = true; // true = old compatibility mode with leaning capsule; false = new corrected mode
public bool IsAvCapsuleTilted { get { return avCapsuleTilted; } set { avCapsuleTilted = value; } }
private float avDensity = 80f;
- private float avHeightFudgeFactor = 0.52f;
+// private float avHeightFudgeFactor = 0.52f;
private float avMovementDivisorWalk = 1.3f;
private float avMovementDivisorRun = 0.8f;
private float minimumGroundFlightOffset = 3f;
@@ -316,7 +316,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private int m_physicsiterations = 10;
private const float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag
private readonly PhysicsActor PANull = new NullPhysicsActor();
- private float step_time = 0.0f;
+// private float step_time = 0.0f;
//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it
//Ckrinke private int ms = 0;
public IntPtr world;
@@ -479,7 +479,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10);
avDensity = physicsconfig.GetFloat("av_density", 80f);
- avHeightFudgeFactor = physicsconfig.GetFloat("av_height_fudge_factor", 0.52f);
+// avHeightFudgeFactor = physicsconfig.GetFloat("av_height_fudge_factor", 0.52f);
avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f);
avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f);
avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f);
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Physics.OdePlugin
OdeCharacter newAv
= new OdeCharacter(
avName, this, pos, size, avPIDD, avPIDP,
- avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor,
+ avCapRadius, avStandupTensor, avDensity,
avMovementDivisorWalk, avMovementDivisorRun);
newAv.Flying = isFlying;
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 5fe1352..ebd734d 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -507,8 +507,7 @@
; silly vanity "Facelights" dead. Sorry, head mounted miner's lamps
; will also be affected.
;
- ;DisableFacelights = "false"
-
+ ;DisableFacelights = "false(1815)
[ClientStack.LindenCaps]
;; Long list of capabilities taken from
@@ -722,7 +721,8 @@
av_density = 80
; use this value to cut 52% of the height the sim gives us
- av_height_fudge_factor = 0.52
+ ; Currently unused
+ ; av_height_fudge_factor = 0.52
; Movement. Smaller is faster.
--
cgit v1.1
From 676d32974adc913b2902db6cfa456c77bd52cd85 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Nov 2011 22:46:42 +0000
Subject: Implement the FetchInventoryDescendents2 capability using the same
code as WebFetchInventoryDescendents.
Enabling this by setting Cap_FetchInventoryDescendents2 = "localhost" in the [ClientStack.LindenCaps] section of OpenSim.ini downloads inventory via http rather than udp in later viewers.
---
.../WebFetchInvDescHandler.cs | 2 +-
.../Linden/Caps/WebFetchInvDescModule.cs | 55 +++++++++++++++-------
bin/OpenSimDefaults.ini | 11 +++--
3 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
index 52b5f2c..04fa55c 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
@@ -117,7 +117,6 @@ namespace OpenSim.Capabilities.Handlers
response += inventoryitemstr;
}
-
if (response.Length == 0)
{
// Ter-guess: If requests fail a lot, the client seems to stop requesting descendants.
@@ -135,6 +134,7 @@ namespace OpenSim.Capabilities.Handlers
//m_log.Debug("[CAPS] "+response);
}
+
return response;
}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 1c1d83c..2a41b87 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -42,18 +42,24 @@ using OpenSim.Capabilities.Handlers;
namespace OpenSim.Region.ClientStack.Linden
{
-
+ ///
+ /// This module implements both WebFetchInventoryDescendents and FetchInventoryDescendents2 capabilities.
+ ///
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class WebFetchInvDescModule : INonSharedRegionModule
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
private Scene m_scene;
private IInventoryService m_InventoryService;
private ILibraryService m_LibraryService;
- private bool m_Enabled = false;
- private string m_URL;
+
+ private bool m_Enabled;
+
+ private string m_fetchInventoryDescendents2Url;
+ private string m_webFetchInventoryDescendentsUrl;
#region ISharedRegionModule Members
@@ -63,9 +69,10 @@ namespace OpenSim.Region.ClientStack.Linden
if (config == null)
return;
- m_URL = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty);
- // Cap doesn't exist
- if (m_URL != string.Empty)
+ m_fetchInventoryDescendents2Url = config.GetString("Cap_FetchInventoryDescendents2", string.Empty);
+ m_webFetchInventoryDescendentsUrl = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty);
+
+ if (m_fetchInventoryDescendents2Url != string.Empty || m_webFetchInventoryDescendentsUrl != string.Empty)
m_Enabled = true;
}
@@ -111,26 +118,40 @@ namespace OpenSim.Region.ClientStack.Linden
#endregion
- public void RegisterCaps(UUID agentID, Caps caps)
+ private void RegisterCaps(UUID agentID, Caps caps)
{
UUID capID = UUID.Random();
- //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
- if (m_URL == "localhost")
+ if (m_webFetchInventoryDescendentsUrl != "")
+ RegisterFetchCap(agentID, caps, "WebFetchInventoryDescendents", m_webFetchInventoryDescendentsUrl);
+ else if (m_fetchInventoryDescendents2Url != "")
+ RegisterFetchCap(agentID, caps, "FetchInventoryDescendents2", m_fetchInventoryDescendents2Url);
+ }
+
+ private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url)
+ {
+ string capUrl;
+
+ if (url == "localhost")
{
- m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
+ capUrl = "/CAPS/" + UUID.Random();
+
WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
- IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/" + UUID.Random(), webFetchHandler.FetchInventoryDescendentsRequest);
- caps.RegisterHandler("WebFetchInventoryDescendents", reqHandler);
-// caps.RegisterHandler("FetchInventoryDescendents2", reqHandler);
+ IRequestHandler reqHandler
+ = new RestStreamHandler("POST", capUrl, webFetchHandler.FetchInventoryDescendentsRequest);
+
+ caps.RegisterHandler(capName, reqHandler);
}
else
{
- m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
- caps.RegisterHandler("WebFetchInventoryDescendents", m_URL);
-// caps.RegisterHandler("FetchInventoryDescendents2", m_URL);
+ capUrl = url;
+
+ caps.RegisterHandler(capName, capUrl);
}
- }
+// m_log.DebugFormat(
+// "[WEB FETCH INV DESC MODULE]: Registered capability {0} at {1} in region {2} for {3}",
+// capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
+ }
}
}
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index ebd734d..972efe4 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -573,11 +573,14 @@
Cap_UploadObjectAsset = "localhost"
Cap_ViewerStartAuction = ""
Cap_ViewerStats = ""
- ; This last one is supported by OpenSim, but may
- ; lead to poor sim performance if served by the simulators,
- ; so it is disabled by default.
- Cap_WebFetchInventoryDescendents = ""
+ ; The fetch inventory descendents caps are supported by OpenSim, but may
+ ; lead to poor sim performance if served by the simulators,
+ ; so they are disabled by default.
+ ; FetchInventoryDescendents2 is the one used in the latest Linden Lab viewers (from some point in the v2 series and above)
+ Cap_WebFetchInventoryDescendents = ""
+ Cap_FetchInventoryDescendents2 = ""
+
[Chat]
; Controls whether the chat module is enabled. Default is true.
--
cgit v1.1
From 5b4fe23f7f1877a150ed50dd63beaac762fe8674 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Nov 2011 23:43:57 +0000
Subject: Resolve error where an unknown asset type would cause the fetch
inventory descendents cap to fail.
Introduced just a few commits ago in 0688861
---
.../WebFetchInvDescHandler.cs | 83 +++++++++++-----------
.../Linden/Caps/WebFetchInvDescModule.cs | 5 +-
2 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
index 04fa55c..08570bc 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
@@ -42,7 +42,6 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Capabilities.Handlers
{
-
public class WebFetchInvDescHandler
{
private static readonly ILog m_log =
@@ -60,39 +59,40 @@ namespace OpenSim.Capabilities.Handlers
public string FetchInventoryDescendentsRequest(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
-// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Received request");
-
- // nasty temporary hack here, the linden client falsely
- // identifies the uuid 00000000-0000-0000-0000-000000000000
- // as a string which breaks us
- //
- // correctly mark it as a uuid
- //
- request = request.Replace("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000");
-
- // another hack 1 results in a
- // System.ArgumentException: Object type System.Int32 cannot
- // be converted to target type: System.Boolean
- //
- request = request.Replace("fetch_folders0", "fetch_folders0");
- request = request.Replace("fetch_folders1", "fetch_folders1");
-
- Hashtable hash = new Hashtable();
- try
- {
- hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
- }
- catch (LLSD.LLSDParseException pe)
- {
- m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message);
- m_log.Error("Request: " + request.ToString());
- }
-
- ArrayList foldersrequested = (ArrayList)hash["folders"];
-
- string response = "";
lock (m_fetchLock)
{
+// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Received request {0}", request);
+
+ // nasty temporary hack here, the linden client falsely
+ // identifies the uuid 00000000-0000-0000-0000-000000000000
+ // as a string which breaks us
+ //
+ // correctly mark it as a uuid
+ //
+ request = request.Replace("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000");
+
+ // another hack 1 results in a
+ // System.ArgumentException: Object type System.Int32 cannot
+ // be converted to target type: System.Boolean
+ //
+ request = request.Replace("fetch_folders0", "fetch_folders0");
+ request = request.Replace("fetch_folders1", "fetch_folders1");
+
+ Hashtable hash = new Hashtable();
+ try
+ {
+ hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
+ }
+ catch (LLSD.LLSDParseException e)
+ {
+ m_log.ErrorFormat("[WEB FETCH INV DESC HANDLER]: Fetch error: {0}{1}" + e.Message, e.StackTrace);
+ m_log.Error("Request: " + request);
+ }
+
+ ArrayList foldersrequested = (ArrayList)hash["folders"];
+
+ string response = "";
+
for (int i = 0; i < foldersrequested.Count; i++)
{
string inventoryitemstr = "";
@@ -106,7 +106,7 @@ namespace OpenSim.Capabilities.Handlers
}
catch (Exception e)
{
- m_log.Debug("[CAPS]: caught exception doing OSD deserialize" + e);
+ m_log.Debug("[WEB FETCH INV DESC HANDLER]: caught exception doing OSD deserialize" + e);
}
LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest);
@@ -130,12 +130,12 @@ namespace OpenSim.Capabilities.Handlers
response = "";
}
- //m_log.DebugFormat("[CAPS]: Replying to CAPS fetch inventory request with following xml");
- //m_log.Debug("[CAPS] "+response);
+// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request");
+ //m_log.Debug("[WEB FETCH INV DESC HANDLER] "+response);
+
+ return response;
}
-
- return response;
}
///
@@ -184,8 +184,9 @@ namespace OpenSim.Capabilities.Handlers
return reply;
}
- public InventoryCollection Fetch(UUID agentID, UUID folderID, UUID ownerID,
- bool fetchFolders, bool fetchItems, int sortOrder, out int version)
+ public InventoryCollection Fetch(
+ UUID agentID, UUID folderID, UUID ownerID,
+ bool fetchFolders, bool fetchItems, int sortOrder, out int version)
{
m_log.DebugFormat(
"[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
@@ -194,6 +195,7 @@ namespace OpenSim.Capabilities.Handlers
version = 0;
InventoryFolderImpl fold;
if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null && agentID == m_LibraryService.LibraryRootFolder.Owner)
+ {
if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
{
InventoryCollection ret = new InventoryCollection();
@@ -202,6 +204,7 @@ namespace OpenSim.Capabilities.Handlers
return ret;
}
+ }
InventoryCollection contents = new InventoryCollection();
@@ -236,7 +239,7 @@ namespace OpenSim.Capabilities.Handlers
llsdFolder.parent_id = invFolder.ParentID;
llsdFolder.name = invFolder.Name;
- if (!Enum.IsDefined(typeof(AssetType), invFolder.Type))
+ if (invFolder.Type == (short)AssetType.Unknown || !Enum.IsDefined(typeof(AssetType), (sbyte)invFolder.Type))
llsdFolder.type = "-1";
else
llsdFolder.type = Utils.AssetTypeToString((AssetType)invFolder.Type);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 2a41b87..a49d619 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -48,8 +48,7 @@ namespace OpenSim.Region.ClientStack.Linden
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class WebFetchInvDescModule : INonSharedRegionModule
{
- private static readonly ILog m_log =
- LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
@@ -120,8 +119,6 @@ namespace OpenSim.Region.ClientStack.Linden
private void RegisterCaps(UUID agentID, Caps caps)
{
- UUID capID = UUID.Random();
-
if (m_webFetchInventoryDescendentsUrl != "")
RegisterFetchCap(agentID, caps, "WebFetchInventoryDescendents", m_webFetchInventoryDescendentsUrl);
else if (m_fetchInventoryDescendents2Url != "")
--
cgit v1.1
From 95a686dbf5fce50b332c16231e5ebfdd07add0e4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Nov 2011 23:45:29 +0000
Subject: Fix config so that you can have both WebFetchInventoryDescendents and
FetchInvnetoryDescendents2 caps active at once
---
OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index a49d619..72177a8 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -121,7 +121,8 @@ namespace OpenSim.Region.ClientStack.Linden
{
if (m_webFetchInventoryDescendentsUrl != "")
RegisterFetchCap(agentID, caps, "WebFetchInventoryDescendents", m_webFetchInventoryDescendentsUrl);
- else if (m_fetchInventoryDescendents2Url != "")
+
+ if (m_fetchInventoryDescendents2Url != "")
RegisterFetchCap(agentID, caps, "FetchInventoryDescendents2", m_fetchInventoryDescendents2Url);
}
--
cgit v1.1
From c5b636469ddaec551101049a0eaf5f1c08fdef1e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Nov 2011 00:13:04 +0000
Subject: Stop locking the requests coming in to WebFetchInvDecHandler.
There's no technical reason for this as the methods are thread safe. However, it might have served to slow down requests.
---
.../WebFetchInvDescHandler.cs | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
index 08570bc..de7abe2 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Capabilities.Handlers
private IInventoryService m_InventoryService;
private ILibraryService m_LibraryService;
- private object m_fetchLock = new Object();
+// private object m_fetchLock = new Object();
public WebFetchInvDescHandler(IInventoryService invService, ILibraryService libService)
{
@@ -59,8 +59,8 @@ namespace OpenSim.Capabilities.Handlers
public string FetchInventoryDescendentsRequest(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
- lock (m_fetchLock)
- {
+// lock (m_fetchLock)
+// {
// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Received request {0}", request);
// nasty temporary hack here, the linden client falsely
@@ -135,7 +135,7 @@ namespace OpenSim.Capabilities.Handlers
return response;
- }
+// }
}
///
@@ -188,9 +188,9 @@ namespace OpenSim.Capabilities.Handlers
UUID agentID, UUID folderID, UUID ownerID,
bool fetchFolders, bool fetchItems, int sortOrder, out int version)
{
- m_log.DebugFormat(
- "[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
- fetchFolders, fetchItems, folderID, agentID);
+// m_log.DebugFormat(
+// "[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
+// fetchFolders, fetchItems, folderID, agentID);
version = 0;
InventoryFolderImpl fold;
@@ -220,7 +220,7 @@ namespace OpenSim.Capabilities.Handlers
}
else
{
- // Lost itemsm don't really need a version
+ // Lost items don't really need a version
version = 1;
}
--
cgit v1.1
From 11c19b0d2ea97e82f3da3bb8fde665a25b044943 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Nov 2011 00:29:01 +0000
Subject: Use the same web fetch handler for every request from every avatar,
since it contains no instance code
---
.../ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 72177a8..10f43d1 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -60,6 +60,8 @@ namespace OpenSim.Region.ClientStack.Linden
private string m_fetchInventoryDescendents2Url;
private string m_webFetchInventoryDescendentsUrl;
+ private WebFetchInvDescHandler m_webFetchHandler;
+
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
@@ -72,7 +74,9 @@ namespace OpenSim.Region.ClientStack.Linden
m_webFetchInventoryDescendentsUrl = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty);
if (m_fetchInventoryDescendents2Url != string.Empty || m_webFetchInventoryDescendentsUrl != string.Empty)
+ {
m_Enabled = true;
+ }
}
public void AddRegion(Scene s)
@@ -97,8 +101,13 @@ namespace OpenSim.Region.ClientStack.Linden
if (!m_Enabled)
return;
- m_InventoryService = m_scene.InventoryService; ;
+ m_InventoryService = m_scene.InventoryService;
m_LibraryService = m_scene.LibraryService;
+
+ // We'll reuse the same handler for all requests.
+ if (m_fetchInventoryDescendents2Url == "localhost" || m_webFetchInventoryDescendentsUrl == "localhost")
+ m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
+
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
@@ -134,9 +143,8 @@ namespace OpenSim.Region.ClientStack.Linden
{
capUrl = "/CAPS/" + UUID.Random();
- WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
IRequestHandler reqHandler
- = new RestStreamHandler("POST", capUrl, webFetchHandler.FetchInventoryDescendentsRequest);
+ = new RestStreamHandler("POST", capUrl, m_webFetchHandler.FetchInventoryDescendentsRequest);
caps.RegisterHandler(capName, reqHandler);
}
--
cgit v1.1
From bafea2282a95017099578a0a31a908e746161414 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Nov 2011 01:39:23 +0000
Subject: Rip out unused Scene.HandleFetchInventoryDescendentsCAPS().
This has been handled by WebFetchInvDescHandler.Fetch() for some time.
---
.../WebFetchInvDescHandler.cs | 13 +++++
.../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 1 -
.../Framework/Scenes/Scene.PacketHandlers.cs | 58 ----------------------
3 files changed, 13 insertions(+), 59 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
index de7abe2..2dade5b 100644
--- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs
@@ -184,6 +184,17 @@ namespace OpenSim.Capabilities.Handlers
return reply;
}
+ ///
+ /// Handle the caps inventory descendents fetch.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// An empty InventoryCollection if the inventory look up failed
public InventoryCollection Fetch(
UUID agentID, UUID folderID, UUID ownerID,
bool fetchFolders, bool fetchItems, int sortOrder, out int version)
@@ -192,6 +203,8 @@ namespace OpenSim.Capabilities.Handlers
// "[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
// fetchFolders, fetchItems, folderID, agentID);
+ // FIXME MAYBE: We're not handling sortOrder!
+
version = 0;
InventoryFolderImpl fold;
if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null && agentID == m_LibraryService.LibraryRootFolder.Owner)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index b93a41b..8f0ae76 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -134,7 +134,6 @@ namespace OpenSim.Region.ClientStack.Linden
AddNewInventoryItem = m_Scene.AddUploadedInventoryItem;
ItemUpdatedCall = m_Scene.CapsUpdateInventoryItemAsset;
TaskScriptUpdatedCall = m_Scene.CapsUpdateTaskInventoryScriptAsset;
- CAPSFetchInventoryDescendents = m_Scene.HandleFetchInventoryDescendentsCAPS;
GetClient = m_Scene.SceneGraph.GetControllingClient;
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 270e582..2ac6387 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -511,64 +511,6 @@ namespace OpenSim.Region.Framework.Scenes
SendInventoryDelegate d = (SendInventoryDelegate)iar.AsyncState;
d.EndInvoke(iar);
}
-
- ///
- /// Handle the caps inventory descendents fetch.
- ///
- /// Since the folder structure is sent to the client on login, I believe we only need to handle items.
- /// Diva comment 8/13/2009: what if someone gave us a folder in the meantime??
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- /// null if the inventory look up failed
- public InventoryCollection HandleFetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID,
- bool fetchFolders, bool fetchItems, int sortOrder, out int version)
- {
- m_log.DebugFormat(
- "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
- fetchFolders, fetchItems, folderID, agentID);
-
- // FIXME MAYBE: We're not handling sortOrder!
-
- // TODO: This code for looking in the folder for the library should be folded back into the
- // CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc.
- // can be handled transparently).
- InventoryFolderImpl fold;
- if (LibraryService != null && LibraryService.LibraryRootFolder != null)
- if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
- {
- version = 0;
- InventoryCollection ret = new InventoryCollection();
- ret.Folders = new List();
- ret.Items = fold.RequestListOfItems();
-
- return ret;
- }
-
- InventoryCollection contents = new InventoryCollection();
-
- if (folderID != UUID.Zero)
- {
- contents = InventoryService.GetFolderContent(agentID, folderID);
- InventoryFolderBase containingFolder = new InventoryFolderBase();
- containingFolder.ID = folderID;
- containingFolder.Owner = agentID;
- containingFolder = InventoryService.GetFolder(containingFolder);
- version = containingFolder.Version;
- }
- else
- {
- // Lost itemsm don't really need a version
- version = 1;
- }
-
- return contents;
-
- }
///
/// Handle an inventory folder creation request from the client.
--
cgit v1.1
From 46e1bcb6b68e1b032fa658582cab68682f98d230 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Nov 2011 01:40:46 +0000
Subject: minor: remove mono compiler warning
---
OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index f9af9c1..f9d6eee 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
{
public class ScriptInstance : MarshalByRefObject, IScriptInstance
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IScriptEngine m_Engine;
private IScriptWorkItem m_CurrentResult = null;
--
cgit v1.1
From 86cc00aaa8dba93ea614460ceab7d6ba5e1adec5 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Nov 2011 01:52:12 +0000
Subject: minor: formatting changes in Scene.PacketHandlers.cs
---
OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 2ac6387..6ba74c7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -330,7 +330,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
- }
+ }
public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List surfaceArgs)
{
@@ -484,6 +484,7 @@ namespace OpenSim.Region.Framework.Scenes
// can be handled transparently).
InventoryFolderImpl fold = null;
if (LibraryService != null && LibraryService.LibraryRootFolder != null)
+ {
if ((fold = LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
{
remoteClient.SendInventoryFolderDetails(
@@ -491,6 +492,7 @@ namespace OpenSim.Region.Framework.Scenes
fold.RequestListOfFolders(), fold.Version, fetchFolders, fetchItems);
return;
}
+ }
// We're going to send the reply async, because there may be
// an enormous quantity of packets -- basically the entire inventory!
@@ -585,14 +587,13 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ delegate void PurgeFolderDelegate(UUID userID, UUID folder);
+
///
/// This should delete all the items and folders in the given directory.
///
///
///
-
- delegate void PurgeFolderDelegate(UUID userID, UUID folder);
-
public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID)
{
PurgeFolderDelegate d = PurgeFolderAsync;
@@ -606,7 +607,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
-
private void PurgeFolderAsync(UUID userID, UUID folderID)
{
InventoryFolderBase folder = new InventoryFolderBase(folderID, userID);
--
cgit v1.1
From 4efd9a3b7bedbacf166ab8a923dd0219e0d548af Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 Nov 2011 01:55:36 +0000
Subject: When removing an LSL sensor for a script (e.g. through
llResetScript() or state change), don't also remove sensors for other scripts
in the same prim.
Hopefully fixes http://opensimulator.org/mantis/view.php?id=4448 and http://opensimulator.org/mantis/view.php?id=4452
---
.../ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 5527d14..3eeb23d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -140,7 +140,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
List NewSensors = new List();
foreach (SenseRepeatClass ts in SenseRepeaters)
{
- if (ts.localID != m_localID && ts.itemID != m_itemID)
+ if (ts.localID != m_localID || ts.itemID != m_itemID)
{
NewSensors.Add(ts);
}
--
cgit v1.1