diff options
author | Justin Clarke Casey | 2008-04-11 20:37:26 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-11 20:37:26 +0000 |
commit | b3f783ae056fd2e8921336a1d459d91c7df97ce3 (patch) | |
tree | 0cb69554ade962cdb1db4e853e1da564c1e2f4a9 /OpenSim/Grid | |
parent | * Minor refactoring in OGS1InventoryService (diff) | |
download | opensim-SC_OLD-b3f783ae056fd2e8921336a1d459d91c7df97ce3.zip opensim-SC_OLD-b3f783ae056fd2e8921336a1d459d91c7df97ce3.tar.gz opensim-SC_OLD-b3f783ae056fd2e8921336a1d459d91c7df97ce3.tar.bz2 opensim-SC_OLD-b3f783ae056fd2e8921336a1d459d91c7df97ce3.tar.xz |
* Reduce publicly exposed fields on InventoryCollection, which was causing duplicate sets of inventory data to be sent over the grid
* Won't actually fix anything, since we were handling the problem anyway
* Also add more doc, fix up debugging messages, etc
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r-- | OpenSim/Grid/InventoryServer/GridInventoryService.cs | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index 72d43d4..8a45bad 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs | |||
@@ -37,9 +37,13 @@ using OpenSim.Framework.Console; | |||
37 | 37 | ||
38 | namespace OpenSim.Grid.InventoryServer | 38 | namespace OpenSim.Grid.InventoryServer |
39 | { | 39 | { |
40 | /// <summary> | ||
41 | /// Used on a grid server to satisfy external inventory requests | ||
42 | /// </summary> | ||
40 | public class GridInventoryService : InventoryServiceBase | 43 | public class GridInventoryService : InventoryServiceBase |
41 | { | 44 | { |
42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly log4net.ILog m_log |
46 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | 47 | ||
44 | public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) | 48 | public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) |
45 | { | 49 | { |
@@ -110,7 +114,7 @@ namespace OpenSim.Grid.InventoryServer | |||
110 | 114 | ||
111 | LLUUID userID = new LLUUID(rawUserID); | 115 | LLUUID userID = new LLUUID(rawUserID); |
112 | 116 | ||
113 | m_log.InfoFormat("[AGENT INVENTORY]: Processing request for inventory of {0}", userID); | 117 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID); |
114 | 118 | ||
115 | InventoryCollection invCollection = new InventoryCollection(); | 119 | InventoryCollection invCollection = new InventoryCollection(); |
116 | 120 | ||
@@ -118,7 +122,7 @@ namespace OpenSim.Grid.InventoryServer | |||
118 | 122 | ||
119 | if (null == allFolders) | 123 | if (null == allFolders) |
120 | { | 124 | { |
121 | m_log.WarnFormat("[AGENT INVENTORY]: No inventory found for user {0}", rawUserID); | 125 | m_log.WarnFormat("[GRID AGENT INVENTORY]: No inventory found for user {0}", rawUserID); |
122 | 126 | ||
123 | return invCollection; | 127 | return invCollection; |
124 | } | 128 | } |
@@ -135,23 +139,23 @@ namespace OpenSim.Grid.InventoryServer | |||
135 | } | 139 | } |
136 | } | 140 | } |
137 | 141 | ||
138 | invCollection.AllItems = allItems; | ||
139 | invCollection.Folders = allFolders; | ||
140 | invCollection.UserID = userID; | 142 | invCollection.UserID = userID; |
143 | invCollection.Folders = allFolders; | ||
144 | invCollection.Items = allItems; | ||
141 | 145 | ||
142 | // foreach (InventoryFolderBase folder in folders) | 146 | // foreach (InventoryFolderBase folder in invCollection.Folders) |
143 | // { | 147 | // { |
144 | // m_log.DebugFormat( | 148 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID); |
145 | // "[AGENT INVENTORY]: Sending back folder {0}, {1}", | ||
146 | // folder.name, folder.folderID); | ||
147 | // } | 149 | // } |
148 | // | 150 | // |
149 | // foreach (InventoryItemBase item in allItems) | 151 | // foreach (InventoryItemBase item in invCollection.Items) |
150 | // { | 152 | // { |
151 | // m_log.DebugFormat( | 153 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); |
152 | // "[AGENT INVENTORY]: Sending back item {0}, {1}, folder {2}", | ||
153 | // item.inventoryName, item.inventoryID, item.parentFolderID); | ||
154 | // } | 154 | // } |
155 | |||
156 | m_log.InfoFormat( | ||
157 | "[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items", | ||
158 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); | ||
155 | 159 | ||
156 | return invCollection; | 160 | return invCollection; |
157 | } | 161 | } |
@@ -176,8 +180,7 @@ namespace OpenSim.Grid.InventoryServer | |||
176 | { | 180 | { |
177 | LLUUID userID = new LLUUID(rawUserID); | 181 | LLUUID userID = new LLUUID(rawUserID); |
178 | 182 | ||
179 | m_log.Info( | 183 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Creating new set of inventory folders for user {0}", userID); |
180 | "[AGENT INVENTORY]: Creating new set of inventory folders for " + userID.ToString()); | ||
181 | 184 | ||
182 | CreateNewUserInventory(userID); | 185 | CreateNewUserInventory(userID); |
183 | return true; | 186 | return true; |
@@ -202,10 +205,7 @@ namespace OpenSim.Grid.InventoryServer | |||
202 | public bool AddInventoryFolder(InventoryFolderBase folder) | 205 | public bool AddInventoryFolder(InventoryFolderBase folder) |
203 | { | 206 | { |
204 | // Right now, this actions act more like an update/insert combination than a simple create. | 207 | // Right now, this actions act more like an update/insert combination than a simple create. |
205 | m_log.Info( | 208 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Creating folder {0} {1} in folder {2}", folder.Name, folder.ID, folder.ParentID); |
206 | "[AGENT INVENTORY]: " + | ||
207 | "Updating in " + folder.ParentID.ToString() | ||
208 | + ", folder " + folder.Name); | ||
209 | 209 | ||
210 | AddNewInventoryFolder(folder.Owner, folder); | 210 | AddNewInventoryFolder(folder.Owner, folder); |
211 | return true; | 211 | return true; |
@@ -213,10 +213,7 @@ namespace OpenSim.Grid.InventoryServer | |||
213 | 213 | ||
214 | public bool MoveInventoryFolder(InventoryFolderBase folder) | 214 | public bool MoveInventoryFolder(InventoryFolderBase folder) |
215 | { | 215 | { |
216 | m_log.Info( | 216 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); |
217 | "[AGENT INVENTORY]: " + | ||
218 | "Moving folder " + folder.ID | ||
219 | + " to " + folder.ParentID.ToString()); | ||
220 | 217 | ||
221 | MoveExistingInventoryFolder(folder); | 218 | MoveExistingInventoryFolder(folder); |
222 | return true; | 219 | return true; |
@@ -225,10 +222,7 @@ namespace OpenSim.Grid.InventoryServer | |||
225 | public bool AddInventoryItem(InventoryItemBase item) | 222 | public bool AddInventoryItem(InventoryItemBase item) |
226 | { | 223 | { |
227 | // Right now, this actions act more like an update/insert combination than a simple create. | 224 | // Right now, this actions act more like an update/insert combination than a simple create. |
228 | m_log.Info( | 225 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); |
229 | "[AGENT INVENTORY]: " + | ||
230 | "Updating in " + item.Folder.ToString() | ||
231 | + ", item " + item.Name); | ||
232 | 226 | ||
233 | AddNewInventoryItem(item.Owner, item); | 227 | AddNewInventoryItem(item.Owner, item); |
234 | return true; | 228 | return true; |
@@ -236,15 +230,16 @@ namespace OpenSim.Grid.InventoryServer | |||
236 | 230 | ||
237 | public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) | 231 | public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) |
238 | { | 232 | { |
239 | // extra spaces to align with other inventory messages | 233 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); |
240 | m_log.Info( | ||
241 | "[AGENT INVENTORY]: " + | ||
242 | "Deleting in " + item.Folder.ToString() | ||
243 | + ", item " + item.Name); | ||
244 | 234 | ||
245 | DeleteItem(item); | 235 | DeleteItem(item); |
246 | } | 236 | } |
247 | 237 | ||
238 | /// <summary> | ||
239 | /// FIXME: Get DeleteInventoryItem to return a bool | ||
240 | /// </summary> | ||
241 | /// <param name="item"></param> | ||
242 | /// <returns></returns> | ||
248 | public bool DeleteInvItem(InventoryItemBase item) | 243 | public bool DeleteInvItem(InventoryItemBase item) |
249 | { | 244 | { |
250 | DeleteInventoryItem(item.Owner, item); | 245 | DeleteInventoryItem(item.Owner, item); |