aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2007-12-23 02:14:29 +0000
committerJustin Clarke Casey2007-12-23 02:14:29 +0000
commitc545cc8cd914d6ded605fa2a195461c7aaf3a615 (patch)
treea779ea09574ba196c54a2c7c62d36fa3171299ef
parentSimplify GridServer mainmap log messages. (diff)
downloadopensim-SC-c545cc8cd914d6ded605fa2a195461c7aaf3a615.zip
opensim-SC-c545cc8cd914d6ded605fa2a195461c7aaf3a615.tar.gz
opensim-SC-c545cc8cd914d6ded605fa2a195461c7aaf3a615.tar.bz2
opensim-SC-c545cc8cd914d6ded605fa2a195461c7aaf3a615.tar.xz
Miscellaneous small tweaks and more logging messages to move towards resolving inventory problems
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs7
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs2
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs2
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs40
4 files changed, 39 insertions, 12 deletions
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 @@
27*/ 27*/
28using System.Collections.Generic; 28using System.Collections.Generic;
29using libsecondlife; 29using libsecondlife;
30using OpenSim.Framework.Console;
30 31
31namespace OpenSim.Framework.Communications.Cache 32namespace OpenSim.Framework.Communications.Cache
32{ 33{
@@ -61,12 +62,14 @@ namespace OpenSim.Framework.Communications.Cache
61 62
62 if (userInfo.UserProfile != null) 63 if (userInfo.UserProfile != null)
63 { 64 {
64 RequestInventoryForUser(userID, userInfo); 65 // The request itself will occur when the agent finishes logging on to the region
66 // so there's no need to do it here.
67 //RequestInventoryForUser(userID, userInfo);
65 m_userProfiles.Add(userID, userInfo); 68 m_userProfiles.Add(userID, userInfo);
66 } 69 }
67 else 70 else
68 { 71 {
69 System.Console.WriteLine("CACHE", "User profile for user not found"); 72 MainLog.Instance.Error("USERCACHE", "User profile for user {0} not found", userID);
70 } 73 }
71 } 74 }
72 } 75 }
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
286 /// </summary> 286 /// </summary>
287 /// <param name="reader">The SQL Result</param> 287 /// <param name="reader">The SQL Result</param>
288 /// <returns>the item read</returns> 288 /// <returns>the item read</returns>
289 public InventoryItemBase readInventoryItem(IDataReader reader) 289 private InventoryItemBase readInventoryItem(IDataReader reader)
290 { 290 {
291 try 291 try
292 { 292 {
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
302 /// </summary> 302 /// </summary>
303 /// <param name="reader">The SQL Result</param> 303 /// <param name="reader">The SQL Result</param>
304 /// <returns>the item read</returns> 304 /// <returns>the item read</returns>
305 public InventoryItemBase readInventoryItem(MySqlDataReader reader) 305 private InventoryItemBase readInventoryItem(MySqlDataReader reader)
306 { 306 {
307 try 307 try
308 { 308 {
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;
32using OpenSim.Framework.Servers; 32using OpenSim.Framework.Servers;
33using OpenSim.Framework.Communications; 33using OpenSim.Framework.Communications;
34using OpenSim.Framework.Communications.Cache; 34using OpenSim.Framework.Communications.Cache;
35using OpenSim.Framework.Console;
35 36
36namespace OpenSim.Region.Communications.OGS1 37namespace OpenSim.Region.Communications.OGS1
37{ 38{
@@ -47,10 +48,10 @@ namespace OpenSim.Region.Communications.OGS1
47 48
48 #region IInventoryServices Members 49 #region IInventoryServices Members
49 50
51 // See IInventoryServices
50 public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, 52 public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
51 InventoryItemInfo itemCallBack) 53 InventoryItemInfo itemCallBack)
52 { 54 {
53
54 if (!m_RequestingInventory.ContainsKey(userID)) 55 if (!m_RequestingInventory.ContainsKey(userID))
55 { 56 {
56 InventoryRequest request = new InventoryRequest(userID, folderCallBack, itemCallBack); 57 InventoryRequest request = new InventoryRequest(userID, folderCallBack, itemCallBack);
@@ -59,30 +60,46 @@ namespace OpenSim.Region.Communications.OGS1
59 } 60 }
60 } 61 }
61 62
63 /// <summary>
64 /// Request the entire user's inventory (folders and items) from the inventory server.
65 ///
66 /// XXX May want to change this so that we don't end up shuffling over data which might prove
67 /// entirely unnecessary.
68 /// </summary>
69 /// <param name="userID"></param>
62 private void RequestInventory(LLUUID userID) 70 private void RequestInventory(LLUUID userID)
63 { 71 {
64 try 72 try
65 { 73 {
66 Console.WriteLine("Requesting Inventory from Inventory server ( " + _inventoryServerUrl + "/GetInventory/" +" ) for " + userID.ToString()); 74 MainLog.Instance.Verbose(
67 RestObjectPosterResponse<InventoryCollection> requester = new RestObjectPosterResponse<InventoryCollection>(); 75 "INVENTORY", "Requesting inventory from {0}/GetInventory/ for user {1}",
76 _inventoryServerUrl, userID);
77
78 RestObjectPosterResponse<InventoryCollection> requester
79 = new RestObjectPosterResponse<InventoryCollection>();
68 requester.ResponseCallback = InventoryResponse; 80 requester.ResponseCallback = InventoryResponse;
69 81
70 requester.BeginPostObject<Guid>(_inventoryServerUrl + "/GetInventory/", userID.UUID); 82 requester.BeginPostObject<Guid>(_inventoryServerUrl + "/GetInventory/", userID.UUID);
71 Console.WriteLine("Request for Inventory sent");
72 } 83 }
73 catch (Exception e) 84 catch (Exception e)
74 { 85 {
75 Console.WriteLine(e.Message); 86 MainLog.Instance.Error("INVENTORY", e.ToString());
76 Console.WriteLine(e.StackTrace);
77 } 87 }
78 } 88 }
79 89
90 /// <summary>
91 /// Callback used by the inventory server GetInventory request
92 /// </summary>
93 /// <param name="userID"></param>
80 private void InventoryResponse(InventoryCollection response) 94 private void InventoryResponse(InventoryCollection response)
81 { 95 {
82 LLUUID userID = response.UserID; 96 LLUUID userID = response.UserID;
83 if (m_RequestingInventory.ContainsKey(userID)) 97 if (m_RequestingInventory.ContainsKey(userID))
84 { 98 {
85 99 MainLog.Instance.Verbose("INVENTORY",
100 "Received inventory response for user {0} containing {1} folders and {2} items",
101 userID, response.Folders.Count, response.AllItems.Count);
102
86 InventoryFolderImpl rootFolder = null; 103 InventoryFolderImpl rootFolder = null;
87 InventoryRequest request = m_RequestingInventory[userID]; 104 InventoryRequest request = m_RequestingInventory[userID];
88 foreach (InventoryFolderBase folder in response.Folders) 105 foreach (InventoryFolderBase folder in response.Folders)
@@ -113,6 +130,13 @@ namespace OpenSim.Region.Communications.OGS1
113 } 130 }
114 m_RequestingInventory.Remove(userID); 131 m_RequestingInventory.Remove(userID);
115 } 132 }
133 else
134 {
135 MainLog.Instance.Warn(
136 "INVENTORY",
137 "Received inventory response for {0} for which we do not have a record of requesting!",
138 userID);
139 }
116 } 140 }
117 141
118 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) 142 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)