diff options
author | Justin Clarke Casey | 2008-03-30 00:45:04 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-03-30 00:45:04 +0000 |
commit | 2fddd775f48d9261772f804f0396bb24768afae7 (patch) | |
tree | 6bddde4283c587e4a1a1ec9b9ec249d3fc02c4f0 | |
parent | * Refactor: Remove unused inventory methods, some of which weren't properly i... (diff) | |
download | opensim-SC-2fddd775f48d9261772f804f0396bb24768afae7.zip opensim-SC-2fddd775f48d9261772f804f0396bb24768afae7.tar.gz opensim-SC-2fddd775f48d9261772f804f0396bb24768afae7.tar.bz2 opensim-SC-2fddd775f48d9261772f804f0396bb24768afae7.tar.xz |
* Stop the grid inventory service sending all folder and item details twice
* This change will have no functional impact - we were already filtering out the dupes on the other end.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/InventoryServiceBase.cs | 33 | ||||
-rw-r--r-- | OpenSim/Grid/InventoryServer/GridInventoryService.cs | 32 |
2 files changed, 10 insertions, 55 deletions
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 719e0d6..a0228e8 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -75,42 +75,11 @@ namespace OpenSim.Framework.Communications | |||
75 | #endregion | 75 | #endregion |
76 | 76 | ||
77 | #region IInventoryServices methods | 77 | #region IInventoryServices methods |
78 | |||
79 | /// <summary> | ||
80 | /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree) | ||
81 | /// for the given user. | ||
82 | /// </summary> | ||
83 | /// <param name="userID"></param> | ||
84 | /// <returns></returns> | ||
85 | public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) | ||
86 | { | ||
87 | List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); | ||
88 | InventoryFolderBase rootFolder = null; | ||
89 | |||
90 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | ||
91 | { | ||
92 | rootFolder = plugin.Value.getUserRootFolder(userID); | ||
93 | if (rootFolder != null) | ||
94 | { | ||
95 | m_log.Info( | ||
96 | "[INVENTORY]: Found root folder for user with ID " + userID + ". Retrieving inventory contents."); | ||
97 | |||
98 | inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); | ||
99 | inventoryList.Insert(0, rootFolder); | ||
100 | return inventoryList; | ||
101 | } | ||
102 | } | ||
103 | |||
104 | m_log.Warn( | ||
105 | "[INVENTORY]: Could not find a root folder belonging to user with ID " + userID); | ||
106 | |||
107 | return inventoryList; | ||
108 | } | ||
109 | 78 | ||
110 | // See IInventoryServices | 79 | // See IInventoryServices |
111 | public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) | 80 | public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) |
112 | { | 81 | { |
113 | m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); | 82 | //m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); |
114 | 83 | ||
115 | List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); | 84 | List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); |
116 | 85 | ||
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index a003cd3..681e8bb 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs | |||
@@ -46,22 +46,8 @@ namespace OpenSim.Grid.InventoryServer | |||
46 | private bool TryGetUsersInventory(LLUUID userID, out List<InventoryFolderBase> folderList, | 46 | private bool TryGetUsersInventory(LLUUID userID, out List<InventoryFolderBase> folderList, |
47 | out List<InventoryItemBase> itemsList) | 47 | out List<InventoryItemBase> itemsList) |
48 | { | 48 | { |
49 | List<InventoryFolderBase> rootFolders = RequestFirstLevelFolders(userID); | 49 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); |
50 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); | 50 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); |
51 | List<InventoryFolderBase> allFolders = new List<InventoryFolderBase>(); | ||
52 | |||
53 | if (rootFolders != null) | ||
54 | { | ||
55 | allFolders.InsertRange(0, rootFolders); | ||
56 | foreach (InventoryFolderBase subfolder in rootFolders) | ||
57 | { | ||
58 | List<InventoryFolderBase> subFolders = GetAllFolders(subfolder.folderID); | ||
59 | if (subFolders != null) | ||
60 | { | ||
61 | allFolders.InsertRange(0, subFolders); | ||
62 | } | ||
63 | } | ||
64 | } | ||
65 | 51 | ||
66 | foreach (InventoryFolderBase folder in allFolders) | 52 | foreach (InventoryFolderBase folder in allFolders) |
67 | { | 53 | { |
@@ -108,7 +94,7 @@ namespace OpenSim.Grid.InventoryServer | |||
108 | { | 94 | { |
109 | LLUUID userID = new LLUUID(rawUserID); | 95 | LLUUID userID = new LLUUID(rawUserID); |
110 | 96 | ||
111 | m_log.Info("[GRID INVENTORY]: Request for inventory of " + userID.ToString()); | 97 | m_log.Info("[AGENT INVENTORY]: Processing request for inventory of " + userID.ToString()); |
112 | 98 | ||
113 | InventoryCollection invCollection = new InventoryCollection(); | 99 | InventoryCollection invCollection = new InventoryCollection(); |
114 | List<InventoryFolderBase> folders; | 100 | List<InventoryFolderBase> folders; |
@@ -123,14 +109,14 @@ namespace OpenSim.Grid.InventoryServer | |||
123 | // foreach (InventoryFolderBase folder in folders) | 109 | // foreach (InventoryFolderBase folder in folders) |
124 | // { | 110 | // { |
125 | // m_log.DebugFormat( | 111 | // m_log.DebugFormat( |
126 | // "[GRID INVENTORY]: Sending back folder {0}, {1}", | 112 | // "[AGENT INVENTORY]: Sending back folder {0}, {1}", |
127 | // folder.name, folder.folderID); | 113 | // folder.name, folder.folderID); |
128 | // } | 114 | // } |
129 | // | 115 | // |
130 | // foreach (InventoryItemBase item in allItems) | 116 | // foreach (InventoryItemBase item in allItems) |
131 | // { | 117 | // { |
132 | // m_log.DebugFormat( | 118 | // m_log.DebugFormat( |
133 | // "[GRID INVENTORY]: Sending back item {0}, {1}, folder {2}", | 119 | // "[AGENT INVENTORY]: Sending back item {0}, {1}, folder {2}", |
134 | // item.inventoryName, item.inventoryID, item.parentFolderID); | 120 | // item.inventoryName, item.inventoryID, item.parentFolderID); |
135 | // } | 121 | // } |
136 | 122 | ||
@@ -153,7 +139,7 @@ namespace OpenSim.Grid.InventoryServer | |||
153 | LLUUID userID = new LLUUID(rawUserID); | 139 | LLUUID userID = new LLUUID(rawUserID); |
154 | 140 | ||
155 | m_log.Info( | 141 | m_log.Info( |
156 | "[INVENTORY]: Creating new set of inventory folders for " + userID.ToString()); | 142 | "[AGENT INVENTORY]: Creating new set of inventory folders for " + userID.ToString()); |
157 | 143 | ||
158 | CreateNewUserInventory(userID); | 144 | CreateNewUserInventory(userID); |
159 | return true; | 145 | return true; |
@@ -179,7 +165,7 @@ namespace OpenSim.Grid.InventoryServer | |||
179 | { | 165 | { |
180 | // Right now, this actions act more like an update/insert combination than a simple create. | 166 | // Right now, this actions act more like an update/insert combination than a simple create. |
181 | m_log.Info( | 167 | m_log.Info( |
182 | "[INVENTORY]: " + | 168 | "[AGENT INVENTORY]: " + |
183 | "Updating in " + folder.parentID.ToString() | 169 | "Updating in " + folder.parentID.ToString() |
184 | + ", folder " + folder.name); | 170 | + ", folder " + folder.name); |
185 | 171 | ||
@@ -190,7 +176,7 @@ namespace OpenSim.Grid.InventoryServer | |||
190 | public bool MoveInventoryFolder(InventoryFolderBase folder) | 176 | public bool MoveInventoryFolder(InventoryFolderBase folder) |
191 | { | 177 | { |
192 | m_log.Info( | 178 | m_log.Info( |
193 | "[INVENTORY]: " + | 179 | "[AGENT INVENTORY]: " + |
194 | "Moving folder " + folder.folderID | 180 | "Moving folder " + folder.folderID |
195 | + " to " + folder.parentID.ToString()); | 181 | + " to " + folder.parentID.ToString()); |
196 | 182 | ||
@@ -202,7 +188,7 @@ namespace OpenSim.Grid.InventoryServer | |||
202 | { | 188 | { |
203 | // Right now, this actions act more like an update/insert combination than a simple create. | 189 | // Right now, this actions act more like an update/insert combination than a simple create. |
204 | m_log.Info( | 190 | m_log.Info( |
205 | "[INVENTORY]: " + | 191 | "[AGENT INVENTORY]: " + |
206 | "Updating in " + item.parentFolderID.ToString() | 192 | "Updating in " + item.parentFolderID.ToString() |
207 | + ", item " + item.inventoryName); | 193 | + ", item " + item.inventoryName); |
208 | 194 | ||
@@ -214,7 +200,7 @@ namespace OpenSim.Grid.InventoryServer | |||
214 | { | 200 | { |
215 | // extra spaces to align with other inventory messages | 201 | // extra spaces to align with other inventory messages |
216 | m_log.Info( | 202 | m_log.Info( |
217 | "[INVENTORY]: " + | 203 | "[AGENT INVENTORY]: " + |
218 | "Deleting in " + item.parentFolderID.ToString() | 204 | "Deleting in " + item.parentFolderID.ToString() |
219 | + ", item " + item.inventoryName); | 205 | + ", item " + item.inventoryName); |
220 | 206 | ||