diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-18 11:09:43 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-18 11:09:43 -0400 |
commit | 311b51a1843f43daa7796a46961b65fe702e1b85 (patch) | |
tree | 756554b330c8bdd970f319c3af0327efb9017673 /OpenSim/Services/Connectors | |
parent | * Some Physics Scene Changes to prepare for larger regions (diff) | |
parent | Fixes mantis #4020 (http://opensimulator.org/mantis/view.php?id=4020) (diff) | |
download | opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.zip opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.tar.gz opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.tar.bz2 opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.tar.xz |
*remove conflicts
Diffstat (limited to 'OpenSim/Services/Connectors')
4 files changed, 123 insertions, 19 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs index f6d1500..94b4ad9 100644 --- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs | |||
@@ -149,7 +149,7 @@ namespace OpenSim.Services.Connectors.Inventory | |||
149 | /// <returns></returns> | 149 | /// <returns></returns> |
150 | public InventoryCollection GetFolderContent(string id, UUID folderID, UUID sessionID) | 150 | public InventoryCollection GetFolderContent(string id, UUID folderID, UUID sessionID) |
151 | { | 151 | { |
152 | m_log.Debug("[HGInventory]: GetSystemFolders " + id); | 152 | m_log.Debug("[HGInventory]: GetFolderContent " + id); |
153 | string url = string.Empty; | 153 | string url = string.Empty; |
154 | string userID = string.Empty; | 154 | string userID = string.Empty; |
155 | 155 | ||
@@ -279,5 +279,17 @@ namespace OpenSim.Services.Connectors.Inventory | |||
279 | return null; | 279 | return null; |
280 | } | 280 | } |
281 | 281 | ||
282 | public int GetAssetPermissions(string id, UUID assetID, UUID sessionID) | ||
283 | { | ||
284 | string url = string.Empty; | ||
285 | string userID = string.Empty; | ||
286 | |||
287 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
288 | { | ||
289 | ISessionAuthInventoryService connector = GetConnector(url); | ||
290 | return connector.GetAssetPermissions(userID, assetID, sessionID); | ||
291 | } | ||
292 | return 0; | ||
293 | } | ||
282 | } | 294 | } |
283 | } | 295 | } |
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs index 973cb0a..f50bcf5 100644 --- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs +++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs | |||
@@ -120,5 +120,7 @@ namespace OpenSim.Services.Connectors | |||
120 | 120 | ||
121 | InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID session_id); | 121 | InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID session_id); |
122 | 122 | ||
123 | int GetAssetPermissions(string userID, UUID assetID, UUID session_id); | ||
124 | |||
123 | } | 125 | } |
124 | } | 126 | } |
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index e41b427..5d94eac 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -163,21 +163,48 @@ namespace OpenSim.Services.Connectors | |||
163 | /// <returns></returns> | 163 | /// <returns></returns> |
164 | public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(string userID, UUID sessionID) | 164 | public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(string userID, UUID sessionID) |
165 | { | 165 | { |
166 | // !!! Not just yet. | 166 | List<InventoryFolderBase> folders = null; |
167 | //try | 167 | Dictionary<AssetType, InventoryFolderBase> dFolders = new Dictionary<AssetType, InventoryFolderBase>(); |
168 | //{ | 168 | try |
169 | // List<InventoryFolderBase> folders = SynchronousRestSessionObjectPoster<Guid, List<InventoryFolderBase>>.BeginPostObject( | 169 | { |
170 | // "POST", m_ServerURI + "/SystemFolders/", new Guid(userID), sessionID.ToString(), userID.ToString()); | 170 | folders = SynchronousRestSessionObjectPoster<Guid, List<InventoryFolderBase>>.BeginPostObject( |
171 | // Dictionary<AssetType, InventoryFolderBase> dFolders = new Dictionary<AssetType, InventoryFolderBase>(); | 171 | "POST", m_ServerURI + "/SystemFolders/", new Guid(userID), sessionID.ToString(), userID.ToString()); |
172 | // foreach (InventoryFolderBase f in folders) | 172 | |
173 | // dFolders[(AssetType)f.Type] = f; | 173 | foreach (InventoryFolderBase f in folders) |
174 | // return dFolders; | 174 | dFolders[(AssetType)f.Type] = f; |
175 | //} | 175 | |
176 | //catch (Exception e) | 176 | return dFolders; |
177 | //{ | 177 | } |
178 | // m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetSystemFolders operation failed, {0} {1}", | 178 | catch (Exception e) |
179 | // e.Source, e.Message); | 179 | { |
180 | //} | 180 | // Maybe we're talking to an old inventory server. Try this other thing. |
181 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetSystemFolders operation failed, {0} {1}. Trying RootFolders.", | ||
182 | e.Source, e.Message); | ||
183 | |||
184 | try | ||
185 | { | ||
186 | folders = SynchronousRestSessionObjectPoster<Guid, List<InventoryFolderBase>>.BeginPostObject( | ||
187 | "POST", m_ServerURI + "/RootFolders/", new Guid(userID), sessionID.ToString(), userID.ToString()); | ||
188 | } | ||
189 | catch (Exception ex) | ||
190 | { | ||
191 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: RootFolders operation also failed, {0} {1}. Give up.", | ||
192 | e.Source, ex.Message); | ||
193 | } | ||
194 | |||
195 | if ((folders != null) && (folders.Count > 0)) | ||
196 | { | ||
197 | dFolders[AssetType.Folder] = folders[0]; // Root folder is the first one | ||
198 | folders.RemoveAt(0); | ||
199 | foreach (InventoryFolderBase f in folders) | ||
200 | { | ||
201 | if ((f.Type != (short)AssetType.Folder) && (f.Type != (short)AssetType.Unknown)) | ||
202 | dFolders[(AssetType)f.Type] = f; | ||
203 | } | ||
204 | |||
205 | return dFolders; | ||
206 | } | ||
207 | } | ||
181 | 208 | ||
182 | return new Dictionary<AssetType, InventoryFolderBase>(); | 209 | return new Dictionary<AssetType, InventoryFolderBase>(); |
183 | } | 210 | } |
@@ -192,13 +219,52 @@ namespace OpenSim.Services.Connectors | |||
192 | { | 219 | { |
193 | try | 220 | try |
194 | { | 221 | { |
222 | // normal case | ||
195 | return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject( | 223 | return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject( |
196 | "POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString()); | 224 | "POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString()); |
197 | } | 225 | } |
198 | catch (Exception e) | 226 | catch (Exception e) |
199 | { | 227 | { |
200 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderForType operation failed, {0} {1}", | 228 | // Maybe we're talking to an old inventory server. Try this other thing. |
229 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderForType operation failed, {0} {1}. Trying RootFolders and GetItems.", | ||
201 | e.Source, e.Message); | 230 | e.Source, e.Message); |
231 | |||
232 | List<InventoryFolderBase> folders = null; | ||
233 | try | ||
234 | { | ||
235 | folders = SynchronousRestSessionObjectPoster<Guid, List<InventoryFolderBase>>.BeginPostObject( | ||
236 | "POST", m_ServerURI + "/RootFolders/", new Guid(userID), sessionID.ToString(), userID.ToString()); | ||
237 | } | ||
238 | catch (Exception ex) | ||
239 | { | ||
240 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: RootFolders operation also failed, {0} {1}. Give up.", | ||
241 | e.Source, ex.Message); | ||
242 | } | ||
243 | |||
244 | if ((folders != null) && (folders.Count > 0)) | ||
245 | { | ||
246 | folders = folders.FindAll(delegate (InventoryFolderBase f) { return f.ParentID == folderID ; }); | ||
247 | |||
248 | try | ||
249 | { | ||
250 | List<InventoryItemBase> items = SynchronousRestSessionObjectPoster<Guid, List<InventoryItemBase>>.BeginPostObject( | ||
251 | "POST", m_ServerURI + "/GetItems/", folderID.Guid, sessionID.ToString(), userID.ToString()); | ||
252 | |||
253 | if (items != null) | ||
254 | { | ||
255 | InventoryCollection result = new InventoryCollection(); | ||
256 | result.Folders = folders; | ||
257 | result.Items = items; | ||
258 | result.UserID = new UUID(userID); | ||
259 | return result; | ||
260 | } | ||
261 | } | ||
262 | catch (Exception ex) | ||
263 | { | ||
264 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: QueryFolder and GetItems operation failed, {0} {1}. Give up.", | ||
265 | e.Source, ex.Message); | ||
266 | } | ||
267 | } | ||
202 | } | 268 | } |
203 | 269 | ||
204 | return null; | 270 | return null; |
@@ -348,6 +414,25 @@ namespace OpenSim.Services.Connectors | |||
348 | return null; | 414 | return null; |
349 | } | 415 | } |
350 | 416 | ||
417 | public int GetAssetPermissions(string userID, UUID assetID, UUID sessionID) | ||
418 | { | ||
419 | try | ||
420 | { | ||
421 | InventoryItemBase item = new InventoryItemBase(); | ||
422 | item.Owner = new UUID(userID); | ||
423 | item.AssetID = assetID; | ||
424 | return SynchronousRestSessionObjectPoster<InventoryItemBase, int>.BeginPostObject( | ||
425 | "POST", m_ServerURI + "/AssetPermissions/", item, sessionID.ToString(), userID); | ||
426 | } | ||
427 | catch (Exception e) | ||
428 | { | ||
429 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: AssetPermissions operation failed, {0} {1}", | ||
430 | e.Source, e.Message); | ||
431 | } | ||
432 | |||
433 | return 0; | ||
434 | } | ||
435 | |||
351 | #endregion | 436 | #endregion |
352 | 437 | ||
353 | /// <summary> | 438 | /// <summary> |
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs index 22289aa..5cbd307 100644 --- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs | |||
@@ -156,12 +156,12 @@ namespace OpenSim.Services.Connectors | |||
156 | return false; | 156 | return false; |
157 | } | 157 | } |
158 | 158 | ||
159 | public InventoryItemBase QueryItem(InventoryItemBase item) | 159 | public InventoryItemBase GetItem(InventoryItemBase item) |
160 | { | 160 | { |
161 | return null; | 161 | return null; |
162 | } | 162 | } |
163 | 163 | ||
164 | public InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 164 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) |
165 | { | 165 | { |
166 | return null; | 166 | return null; |
167 | } | 167 | } |
@@ -176,5 +176,10 @@ namespace OpenSim.Services.Connectors | |||
176 | return null; | 176 | return null; |
177 | } | 177 | } |
178 | 178 | ||
179 | public int GetAssetPermissions(UUID userID, UUID assetID) | ||
180 | { | ||
181 | return 0; | ||
182 | } | ||
183 | |||
179 | } | 184 | } |
180 | } | 185 | } |