diff options
Diffstat (limited to 'OpenSim/Framework')
7 files changed, 100 insertions, 15 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index 6472f31..c0168e2 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs | |||
@@ -215,6 +215,7 @@ namespace OpenSim.Framework | |||
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | |||
218 | /// <summary> | 219 | /// <summary> |
219 | /// Serializable Agent Circuit Data | 220 | /// Serializable Agent Circuit Data |
220 | /// </summary> | 221 | /// </summary> |
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index aacd127..825ab81 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -226,6 +226,46 @@ namespace OpenSim.Framework | |||
226 | } | 226 | } |
227 | } | 227 | } |
228 | 228 | ||
229 | public class AttachmentData | ||
230 | { | ||
231 | public int AttachPoint; | ||
232 | public UUID ItemID; | ||
233 | public UUID AssetID; | ||
234 | |||
235 | public AttachmentData(int point, UUID item, UUID asset) | ||
236 | { | ||
237 | AttachPoint = point; | ||
238 | ItemID = item; | ||
239 | AssetID = asset; | ||
240 | } | ||
241 | |||
242 | public AttachmentData(OSDMap args) | ||
243 | { | ||
244 | UnpackUpdateMessage(args); | ||
245 | } | ||
246 | |||
247 | public OSDMap PackUpdateMessage() | ||
248 | { | ||
249 | OSDMap attachdata = new OSDMap(); | ||
250 | attachdata["point"] = OSD.FromInteger(AttachPoint); | ||
251 | attachdata["item"] = OSD.FromUUID(ItemID); | ||
252 | attachdata["asset"] = OSD.FromUUID(AssetID); | ||
253 | |||
254 | return attachdata; | ||
255 | } | ||
256 | |||
257 | |||
258 | public void UnpackUpdateMessage(OSDMap args) | ||
259 | { | ||
260 | if (args["point"] != null) | ||
261 | AttachPoint = args["point"].AsInteger(); | ||
262 | if (args["item"] != null) | ||
263 | ItemID = args["item"].AsUUID(); | ||
264 | if (args["asset"] != null) | ||
265 | AssetID = args["asset"].AsUUID(); | ||
266 | } | ||
267 | } | ||
268 | |||
229 | public class AgentData : IAgentData | 269 | public class AgentData : IAgentData |
230 | { | 270 | { |
231 | private UUID m_id; | 271 | private UUID m_id; |
@@ -272,6 +312,7 @@ namespace OpenSim.Framework | |||
272 | public byte[] AgentTextures; | 312 | public byte[] AgentTextures; |
273 | public byte[] VisualParams; | 313 | public byte[] VisualParams; |
274 | public UUID[] Wearables; | 314 | public UUID[] Wearables; |
315 | public AttachmentData[] Attachments; | ||
275 | 316 | ||
276 | public string CallbackURI; | 317 | public string CallbackURI; |
277 | 318 | ||
@@ -352,6 +393,13 @@ namespace OpenSim.Framework | |||
352 | args["wearables"] = wears; | 393 | args["wearables"] = wears; |
353 | } | 394 | } |
354 | 395 | ||
396 | if ((Attachments != null) && (Attachments.Length > 0)) | ||
397 | { | ||
398 | OSDArray attachs = new OSDArray(Attachments.Length); | ||
399 | foreach (AttachmentData att in Attachments) | ||
400 | attachs.Add(att.PackUpdateMessage()); | ||
401 | args["attachments"] = attachs; | ||
402 | } | ||
355 | 403 | ||
356 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) | 404 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) |
357 | args["callback_uri"] = OSD.FromString(CallbackURI); | 405 | args["callback_uri"] = OSD.FromString(CallbackURI); |
@@ -492,7 +540,21 @@ namespace OpenSim.Framework | |||
492 | foreach (OSD o in wears) | 540 | foreach (OSD o in wears) |
493 | Wearables[i++] = o.AsUUID(); | 541 | Wearables[i++] = o.AsUUID(); |
494 | } | 542 | } |
495 | 543 | ||
544 | if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) | ||
545 | { | ||
546 | OSDArray attachs = (OSDArray)(args["attachments"]); | ||
547 | Attachments = new AttachmentData[attachs.Count]; | ||
548 | int i = 0; | ||
549 | foreach (OSD o in attachs) | ||
550 | { | ||
551 | if (o.Type == OSDType.Map) | ||
552 | { | ||
553 | Attachments[i++] = new AttachmentData((OSDMap)o); | ||
554 | } | ||
555 | } | ||
556 | } | ||
557 | |||
496 | if (args["callback_uri"] != null) | 558 | if (args["callback_uri"] != null) |
497 | CallbackURI = args["callback_uri"].AsString(); | 559 | CallbackURI = args["callback_uri"].AsString(); |
498 | } | 560 | } |
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 8ee1b1a..ca641d0 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -747,7 +747,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
747 | 747 | ||
748 | InventoryItemBase itemInfo = null; | 748 | InventoryItemBase itemInfo = null; |
749 | 749 | ||
750 | itemInfo = m_InventoryService.QueryItem(item); | 750 | itemInfo = m_InventoryService.GetItem(item); |
751 | 751 | ||
752 | if (itemInfo != null) | 752 | if (itemInfo != null) |
753 | { | 753 | { |
@@ -784,7 +784,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
784 | 784 | ||
785 | InventoryFolderBase folderInfo = null; | 785 | InventoryFolderBase folderInfo = null; |
786 | 786 | ||
787 | folderInfo = m_InventoryService.QueryFolder(folder); | 787 | folderInfo = m_InventoryService.GetFolder(folder); |
788 | 788 | ||
789 | if (folderInfo != null) | 789 | if (folderInfo != null) |
790 | { | 790 | { |
diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs index 9709975..8a8108b 100644 --- a/OpenSim/Framework/Communications/Services/LoginService.cs +++ b/OpenSim/Framework/Communications/Services/LoginService.cs | |||
@@ -205,7 +205,8 @@ namespace OpenSim.Framework.Communications.Services | |||
205 | // Otherwise... | 205 | // Otherwise... |
206 | // Create a new agent session | 206 | // Create a new agent session |
207 | 207 | ||
208 | m_userManager.ResetAttachments(userProfile.ID); | 208 | // XXYY we don't need this |
209 | //m_userManager.ResetAttachments(userProfile.ID); | ||
209 | 210 | ||
210 | CreateAgent(userProfile, request); | 211 | CreateAgent(userProfile, request); |
211 | 212 | ||
@@ -462,7 +463,8 @@ namespace OpenSim.Framework.Communications.Services | |||
462 | // Otherwise... | 463 | // Otherwise... |
463 | // Create a new agent session | 464 | // Create a new agent session |
464 | 465 | ||
465 | m_userManager.ResetAttachments(userProfile.ID); | 466 | // XXYY We don't need this |
467 | //m_userManager.ResetAttachments(userProfile.ID); | ||
466 | 468 | ||
467 | CreateAgent(userProfile, request); | 469 | CreateAgent(userProfile, request); |
468 | 470 | ||
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs index fe88cf5..670c9ff 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs | |||
@@ -186,14 +186,14 @@ namespace OpenSim.Framework.Communications.Tests | |||
186 | 186 | ||
187 | Assert.That( | 187 | Assert.That( |
188 | userInfo.CreateFolder("testFolder1", folderId, (ushort)AssetType.Animation, missingFolderId), Is.False); | 188 | userInfo.CreateFolder("testFolder1", folderId, (ushort)AssetType.Animation, missingFolderId), Is.False); |
189 | Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Null); | 189 | Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null); |
190 | Assert.That(userInfo.RootFolder.ContainsChildFolder(missingFolderId), Is.False); | 190 | Assert.That(userInfo.RootFolder.ContainsChildFolder(missingFolderId), Is.False); |
191 | Assert.That(userInfo.RootFolder.FindFolder(folderId), Is.Null); | 191 | Assert.That(userInfo.RootFolder.FindFolder(folderId), Is.Null); |
192 | 192 | ||
193 | // 2: Try a folder create that should work | 193 | // 2: Try a folder create that should work |
194 | Assert.That( | 194 | Assert.That( |
195 | userInfo.CreateFolder("testFolder2", folderId, (ushort)AssetType.Animation, userInfo.RootFolder.ID), Is.True); | 195 | userInfo.CreateFolder("testFolder2", folderId, (ushort)AssetType.Animation, userInfo.RootFolder.ID), Is.True); |
196 | Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Not.Null); | 196 | Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Not.Null); |
197 | Assert.That(userInfo.RootFolder.ContainsChildFolder(folderId), Is.True); | 197 | Assert.That(userInfo.RootFolder.ContainsChildFolder(folderId), Is.True); |
198 | } | 198 | } |
199 | 199 | ||
@@ -228,7 +228,7 @@ namespace OpenSim.Framework.Communications.Tests | |||
228 | Assert.That(newFolderName1, Is.EqualTo(folder1.Name)); | 228 | Assert.That(newFolderName1, Is.EqualTo(folder1.Name)); |
229 | Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type)); | 229 | Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type)); |
230 | 230 | ||
231 | InventoryFolderBase dataFolder1 = myScene.InventoryService.QueryFolder(myFolder); | 231 | InventoryFolderBase dataFolder1 = myScene.InventoryService.GetFolder(myFolder); |
232 | Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name)); | 232 | Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name)); |
233 | Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type)); | 233 | Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type)); |
234 | } | 234 | } |
@@ -254,7 +254,7 @@ namespace OpenSim.Framework.Communications.Tests | |||
254 | Assert.That(folder2.ContainsChildFolder(folder1Id), Is.True); | 254 | Assert.That(folder2.ContainsChildFolder(folder1Id), Is.True); |
255 | Assert.That(rootFolder.ContainsChildFolder(folder1Id), Is.False); | 255 | Assert.That(rootFolder.ContainsChildFolder(folder1Id), Is.False); |
256 | 256 | ||
257 | InventoryFolderBase dataFolder1 = myScene.InventoryService.QueryFolder(myFolder2); | 257 | InventoryFolderBase dataFolder1 = myScene.InventoryService.GetFolder(myFolder2); |
258 | Assert.That(newFolderName2, Is.EqualTo(dataFolder1.Name)); | 258 | Assert.That(newFolderName2, Is.EqualTo(dataFolder1.Name)); |
259 | Assert.That(folderType2, Is.EqualTo((ushort)dataFolder1.Type)); | 259 | Assert.That(folderType2, Is.EqualTo((ushort)dataFolder1.Type)); |
260 | Assert.That(folder2Id, Is.EqualTo(dataFolder1.ParentID)); | 260 | Assert.That(folder2Id, Is.EqualTo(dataFolder1.ParentID)); |
@@ -296,7 +296,7 @@ namespace OpenSim.Framework.Communications.Tests | |||
296 | InventoryFolderBase myFolder = new InventoryFolderBase(); | 296 | InventoryFolderBase myFolder = new InventoryFolderBase(); |
297 | myFolder.ID = folderToMoveId; | 297 | myFolder.ID = folderToMoveId; |
298 | Assert.That(folder2.ContainsChildFolder(folderToMoveId), Is.True); | 298 | Assert.That(folder2.ContainsChildFolder(folderToMoveId), Is.True); |
299 | Assert.That(myScene.InventoryService.QueryFolder(myFolder).ParentID, Is.EqualTo(folder2Id)); | 299 | Assert.That(myScene.InventoryService.GetFolder(myFolder).ParentID, Is.EqualTo(folder2Id)); |
300 | 300 | ||
301 | Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False); | 301 | Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False); |
302 | } | 302 | } |
@@ -322,13 +322,13 @@ namespace OpenSim.Framework.Communications.Tests | |||
322 | myFolder.ID = folder1Id; | 322 | myFolder.ID = folder1Id; |
323 | 323 | ||
324 | userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID); | 324 | userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID); |
325 | Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Not.Null); | 325 | Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Not.Null); |
326 | 326 | ||
327 | // Test purge | 327 | // Test purge |
328 | userInfo.PurgeFolder(rootFolder.ID); | 328 | userInfo.PurgeFolder(rootFolder.ID); |
329 | 329 | ||
330 | Assert.That(rootFolder.RequestListOfFolders(), Is.Empty); | 330 | Assert.That(rootFolder.RequestListOfFolders(), Is.Empty); |
331 | Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Null); | 331 | Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null); |
332 | } | 332 | } |
333 | } | 333 | } |
334 | } \ No newline at end of file | 334 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index b1b7809..22dcef9 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs | |||
@@ -552,12 +552,12 @@ namespace OpenSim.Framework.Communications.Tests | |||
552 | return false; | 552 | return false; |
553 | } | 553 | } |
554 | 554 | ||
555 | public InventoryItemBase QueryItem(InventoryItemBase item) | 555 | public InventoryItemBase GetItem(InventoryItemBase item) |
556 | { | 556 | { |
557 | return null; | 557 | return null; |
558 | } | 558 | } |
559 | 559 | ||
560 | public InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 560 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) |
561 | { | 561 | { |
562 | return null; | 562 | return null; |
563 | } | 563 | } |
@@ -575,5 +575,10 @@ namespace OpenSim.Framework.Communications.Tests | |||
575 | root.ParentID = UUID.Zero; | 575 | root.ParentID = UUID.Zero; |
576 | return root; | 576 | return root; |
577 | } | 577 | } |
578 | |||
579 | public int GetAssetPermissions(UUID userID, UUID assetID) | ||
580 | { | ||
581 | return 1; | ||
582 | } | ||
578 | } | 583 | } |
579 | } | 584 | } |
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 4307fe2..7150c82 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs | |||
@@ -354,7 +354,22 @@ namespace OpenSim.Framework | |||
354 | } | 354 | } |
355 | } | 355 | } |
356 | protected int m_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | 356 | protected int m_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
357 | 357 | ||
358 | public InventoryItemBase() | ||
359 | { | ||
360 | } | ||
361 | |||
362 | public InventoryItemBase(UUID id) | ||
363 | { | ||
364 | ID = id; | ||
365 | } | ||
366 | |||
367 | public InventoryItemBase(UUID id, UUID owner) | ||
368 | { | ||
369 | ID = id; | ||
370 | Owner = owner; | ||
371 | } | ||
372 | |||
358 | public object Clone() | 373 | public object Clone() |
359 | { | 374 | { |
360 | return MemberwiseClone(); | 375 | return MemberwiseClone(); |