From c545cc8cd914d6ded605fa2a195461c7aaf3a615 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Sun, 23 Dec 2007 02:14:29 +0000
Subject: Miscellaneous small tweaks and more logging messages to move towards
resolving inventory problems
---
.../Cache/UserProfileCacheService.cs | 7 ++--
OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs | 2 +-
OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs | 2 +-
.../Communications/OGS1/OGS1InventoryService.cs | 40 +++++++++++++++++-----
4 files changed, 39 insertions(+), 12 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 6a7be78..23bddcf 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -27,6 +27,7 @@
*/
using System.Collections.Generic;
using libsecondlife;
+using OpenSim.Framework.Console;
namespace OpenSim.Framework.Communications.Cache
{
@@ -61,12 +62,14 @@ namespace OpenSim.Framework.Communications.Cache
if (userInfo.UserProfile != null)
{
- RequestInventoryForUser(userID, userInfo);
+ // The request itself will occur when the agent finishes logging on to the region
+ // so there's no need to do it here.
+ //RequestInventoryForUser(userID, userInfo);
m_userProfiles.Add(userID, userInfo);
}
else
{
- System.Console.WriteLine("CACHE", "User profile for user not found");
+ MainLog.Instance.Error("USERCACHE", "User profile for user {0} not found", userID);
}
}
}
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
index 3461474..a6b8819 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs
@@ -286,7 +286,7 @@ namespace OpenSim.Framework.Data.MSSQL
///
/// The SQL Result
/// the item read
- public InventoryItemBase readInventoryItem(IDataReader reader)
+ private InventoryItemBase readInventoryItem(IDataReader reader)
{
try
{
diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
index ac0877e..a47a126 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
@@ -302,7 +302,7 @@ namespace OpenSim.Framework.Data.MySQL
///
/// The SQL Result
/// the item read
- public InventoryItemBase readInventoryItem(MySqlDataReader reader)
+ private InventoryItemBase readInventoryItem(MySqlDataReader reader)
{
try
{
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 6c1f77e..0fb083a 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -32,6 +32,7 @@ using OpenSim.Framework;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
+using OpenSim.Framework.Console;
namespace OpenSim.Region.Communications.OGS1
{
@@ -47,10 +48,10 @@ namespace OpenSim.Region.Communications.OGS1
#region IInventoryServices Members
+ // See IInventoryServices
public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
InventoryItemInfo itemCallBack)
- {
-
+ {
if (!m_RequestingInventory.ContainsKey(userID))
{
InventoryRequest request = new InventoryRequest(userID, folderCallBack, itemCallBack);
@@ -59,30 +60,46 @@ namespace OpenSim.Region.Communications.OGS1
}
}
+ ///
+ /// Request the entire user's inventory (folders and items) from the inventory server.
+ ///
+ /// XXX May want to change this so that we don't end up shuffling over data which might prove
+ /// entirely unnecessary.
+ ///
+ ///
private void RequestInventory(LLUUID userID)
{
try
{
- Console.WriteLine("Requesting Inventory from Inventory server ( " + _inventoryServerUrl + "/GetInventory/" +" ) for " + userID.ToString());
- RestObjectPosterResponse requester = new RestObjectPosterResponse();
+ MainLog.Instance.Verbose(
+ "INVENTORY", "Requesting inventory from {0}/GetInventory/ for user {1}",
+ _inventoryServerUrl, userID);
+
+ RestObjectPosterResponse requester
+ = new RestObjectPosterResponse();
requester.ResponseCallback = InventoryResponse;
requester.BeginPostObject(_inventoryServerUrl + "/GetInventory/", userID.UUID);
- Console.WriteLine("Request for Inventory sent");
}
catch (Exception e)
{
- Console.WriteLine(e.Message);
- Console.WriteLine(e.StackTrace);
+ MainLog.Instance.Error("INVENTORY", e.ToString());
}
}
+ ///
+ /// Callback used by the inventory server GetInventory request
+ ///
+ ///
private void InventoryResponse(InventoryCollection response)
{
LLUUID userID = response.UserID;
if (m_RequestingInventory.ContainsKey(userID))
{
-
+ MainLog.Instance.Verbose("INVENTORY",
+ "Received inventory response for user {0} containing {1} folders and {2} items",
+ userID, response.Folders.Count, response.AllItems.Count);
+
InventoryFolderImpl rootFolder = null;
InventoryRequest request = m_RequestingInventory[userID];
foreach (InventoryFolderBase folder in response.Folders)
@@ -113,6 +130,13 @@ namespace OpenSim.Region.Communications.OGS1
}
m_RequestingInventory.Remove(userID);
}
+ else
+ {
+ MainLog.Instance.Warn(
+ "INVENTORY",
+ "Received inventory response for {0} for which we do not have a record of requesting!",
+ userID);
+ }
}
public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
--
cgit v1.1