aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-05 19:07:37 +0000
committerMelanie Thielker2017-01-05 19:07:37 +0000
commitb16abc8166c29585cb76cc55c3bdd76e5833cb4f (patch)
tree6a34f465a74b7a3a6dc00a3d7aa8dcc25ac3e3a5 /OpenSim/Region/CoreModules/Avatar
parentMake it possible to disable the bakes module in the way it is described in co... (diff)
downloadopensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.zip
opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.gz
opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.bz2
opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.xz
Massive tab and trailing space cleanup
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs78
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs42
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs16
-rw-r--r--OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs52
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs16
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs160
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs38
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs114
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs84
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs60
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs74
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs44
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs178
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs60
33 files changed, 576 insertions, 576 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index d5c81ce..f4a8a6b 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
61 /// A value of 0 will apply no pause. The pause is specified in milliseconds. 61 /// A value of 0 will apply no pause. The pause is specified in milliseconds.
62 /// </remarks> 62 /// </remarks>
63 public int ThrottlePer100PrimsRezzed { get; set; } 63 public int ThrottlePer100PrimsRezzed { get; set; }
64 64
65 private Scene m_scene; 65 private Scene m_scene;
66 private IInventoryAccessModule m_invAccessModule; 66 private IInventoryAccessModule m_invAccessModule;
67 67
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
69 /// Are attachments enabled? 69 /// Are attachments enabled?
70 /// </summary> 70 /// </summary>
71 public bool Enabled { get; private set; } 71 public bool Enabled { get; private set; }
72 72
73 public string Name { get { return "Attachments Module"; } } 73 public string Name { get { return "Attachments Module"; } }
74 public Type ReplaceableInterface { get { return null; } } 74 public Type ReplaceableInterface { get { return null; } }
75 75
@@ -87,14 +87,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
87 Enabled = true; 87 Enabled = true;
88 } 88 }
89 } 89 }
90 90
91 public void AddRegion(Scene scene) 91 public void AddRegion(Scene scene)
92 { 92 {
93 m_scene = scene; 93 m_scene = scene;
94 if (Enabled) 94 if (Enabled)
95 { 95 {
96 // Only register module with scene if it is enabled. All callers check for a null attachments module. 96 // Only register module with scene if it is enabled. All callers check for a null attachments module.
97 // Ideally, there should be a null attachments module for when this core attachments module has been 97 // Ideally, there should be a null attachments module for when this core attachments module has been
98 // disabled. Registering only when enabled allows for other attachments module implementations. 98 // disabled. Registering only when enabled allows for other attachments module implementations.
99 m_scene.RegisterModuleInterface<IAttachmentsModule>(this); 99 m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
100 m_scene.EventManager.OnNewClient += SubscribeToClientEvents; 100 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
181 private void HandleScriptStateChange(uint localID, bool started) 181 private void HandleScriptStateChange(uint localID, bool started)
182 { 182 {
183 SceneObjectGroup sog = m_scene.GetGroupByPrim(localID); 183 SceneObjectGroup sog = m_scene.GetGroupByPrim(localID);
184 if (sog != null && sog.IsAttachment) 184 if (sog != null && sog.IsAttachment)
185 { 185 {
186 if (!started) 186 if (!started)
187 { 187 {
@@ -198,21 +198,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
198 } 198 }
199 } 199 }
200 } 200 }
201 201
202 public void RemoveRegion(Scene scene) 202 public void RemoveRegion(Scene scene)
203 { 203 {
204 m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); 204 m_scene.UnregisterModuleInterface<IAttachmentsModule>(this);
205 205
206 if (Enabled) 206 if (Enabled)
207 m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; 207 m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
208 } 208 }
209 209
210 public void RegionLoaded(Scene scene) 210 public void RegionLoaded(Scene scene)
211 { 211 {
212 m_invAccessModule = m_scene.RequestModuleInterface<IInventoryAccessModule>(); 212 m_invAccessModule = m_scene.RequestModuleInterface<IInventoryAccessModule>();
213 } 213 }
214 214
215 public void Close() 215 public void Close()
216 { 216 {
217 RemoveRegion(m_scene); 217 RemoveRegion(m_scene);
218 } 218 }
@@ -270,7 +270,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
270 ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); 270 ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();
271 271
272// m_log.DebugFormat( 272// m_log.DebugFormat(
273// "[ATTACHMENTS MODULE]: Copying script state with {0} bytes for object {1} for {2} in {3}", 273// "[ATTACHMENTS MODULE]: Copying script state with {0} bytes for object {1} for {2} in {3}",
274// ad.AttachmentObjectStates[i].Length, so.Name, sp.Name, m_scene.Name); 274// ad.AttachmentObjectStates[i].Length, so.Name, sp.Name, m_scene.Name);
275 275
276 so.SetState(ad.AttachmentObjectStates[i++], m_scene); 276 so.SetState(ad.AttachmentObjectStates[i++], m_scene);
@@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
295 { 295 {
296 if (DebugLevel > 0) 296 if (DebugLevel > 0)
297 m_log.DebugFormat( 297 m_log.DebugFormat(
298 "[ATTACHMENTS MODULE]: Not doing simulator-side attachment rez for {0} in {1} as their viewer has already rezzed attachments", 298 "[ATTACHMENTS MODULE]: Not doing simulator-side attachment rez for {0} in {1} as their viewer has already rezzed attachments",
299 m_scene.Name, sp.Name); 299 m_scene.Name, sp.Name);
300 300
301 return; 301 return;
@@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
357 357
358 // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down 358 // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down
359 // But they're not used anyway, the item is being looked up for now, so let's proceed. 359 // But they're not used anyway, the item is being looked up for now, so let's proceed.
360 //if (UUID.Zero == assetID) 360 //if (UUID.Zero == assetID)
361 //{ 361 //{
362 // m_log.DebugFormat("[ATTACHMENT]: Cannot rez attachment in point {0} with itemID {1}", p, itemID); 362 // m_log.DebugFormat("[ATTACHMENT]: Cannot rez attachment in point {0} with itemID {1}", p, itemID);
363 // continue; 363 // continue;
@@ -434,7 +434,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
434 UpdateDetachedObject(sp, so, String.Empty); 434 UpdateDetachedObject(sp, so, String.Empty);
435 sp.ClearAttachments(); 435 sp.ClearAttachments();
436 } 436 }
437 } 437 }
438 } 438 }
439 439
440 public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) 440 public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent)
@@ -445,7 +445,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
445 if (DebugLevel > 0) 445 if (DebugLevel > 0)
446 m_log.DebugFormat( 446 m_log.DebugFormat(
447 "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}", 447 "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}",
448 m_scene.RegionInfo.RegionName, sp.Name, silent); 448 m_scene.RegionInfo.RegionName, sp.Name, silent);
449 449
450 foreach (SceneObjectGroup sop in sp.GetAttachments()) 450 foreach (SceneObjectGroup sop in sp.GetAttachments())
451 { 451 {
@@ -454,7 +454,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
454 454
455 sp.ClearAttachments(); 455 sp.ClearAttachments();
456 } 456 }
457 457
458 public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, 458 public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent,
459 bool addToInventory, bool append) 459 bool addToInventory, bool append)
460 { 460 {
@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
505 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should 505 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
506 // be removed when that functionality is implemented in opensim 506 // be removed when that functionality is implemented in opensim
507 attachmentPt &= 0x7f; 507 attachmentPt &= 0x7f;
508 508
509 // If the attachment point isn't the same as the one previously used 509 // If the attachment point isn't the same as the one previously used
510 // set it's offset position = 0 so that it appears on the attachment point 510 // set it's offset position = 0 so that it appears on the attachment point
511 // and not in a weird location somewhere unknown. 511 // and not in a weird location somewhere unknown.
@@ -583,7 +583,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
583 583
584 if (addToInventory && sp.PresenceType != PresenceType.Npc) 584 if (addToInventory && sp.PresenceType != PresenceType.Npc)
585 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append); 585 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append);
586 586
587 AttachToAgent(sp, group, attachmentPt, attachPos, silent); 587 AttachToAgent(sp, group, attachmentPt, attachPos, silent);
588 588
589 if (resumeScripts) 589 if (resumeScripts)
@@ -616,11 +616,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
616 } 616 }
617 617
618 public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt) 618 public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt)
619 { 619 {
620 return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, null); 620 return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, null);
621 } 621 }
622 622
623 public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, XmlDocument doc) 623 public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, XmlDocument doc)
624 { 624 {
625 if (!Enabled) 625 if (!Enabled)
626 return null; 626 return null;
@@ -631,8 +631,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
631 (AttachmentPoint)AttachmentPt, itemID, sp.Name, m_scene.Name); 631 (AttachmentPoint)AttachmentPt, itemID, sp.Name, m_scene.Name);
632 632
633 // We check the attachments in the avatar appearance here rather than the objects attached to the 633 // We check the attachments in the avatar appearance here rather than the objects attached to the
634 // ScenePresence itself so that we can ignore calls by viewer 2/3 to attach objects on startup. We are 634 // ScenePresence itself so that we can ignore calls by viewer 2/3 to attach objects on startup. We are
635 // already doing this in ScenePresence.MakeRootAgent(). Simulator-side attaching needs to be done 635 // already doing this in ScenePresence.MakeRootAgent(). Simulator-side attaching needs to be done
636 // because pre-outfit folder viewers (most version 1 viewers) require it. 636 // because pre-outfit folder viewers (most version 1 viewers) require it.
637 bool alreadyOn = false; 637 bool alreadyOn = false;
638 List<AvatarAttachment> existingAttachments = sp.Appearance.GetAttachments(); 638 List<AvatarAttachment> existingAttachments = sp.Appearance.GetAttachments();
@@ -668,7 +668,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
668 668
669 if (DebugLevel > 0) 669 if (DebugLevel > 0)
670 m_log.DebugFormat( 670 m_log.DebugFormat(
671 "[ATTACHMENTS MODULE]: Rezzing {0} attachments from inventory for {1} in {2}", 671 "[ATTACHMENTS MODULE]: Rezzing {0} attachments from inventory for {1} in {2}",
672 rezlist.Count, sp.Name, m_scene.Name); 672 rezlist.Count, sp.Name, m_scene.Name);
673 673
674 foreach (KeyValuePair<UUID, uint> rez in rezlist) 674 foreach (KeyValuePair<UUID, uint> rez in rezlist)
@@ -727,7 +727,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
727 m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); 727 m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID);
728 728
729 so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint; 729 so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint;
730 730
731 sp.RemoveAttachment(so); 731 sp.RemoveAttachment(so);
732 so.FromItemID = UUID.Zero; 732 so.FromItemID = UUID.Zero;
733 733
@@ -744,7 +744,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
744 } 744 }
745 745
746 rootPart.RemFlag(PrimFlags.TemporaryOnRez); 746 rootPart.RemFlag(PrimFlags.TemporaryOnRez);
747 747
748 so.ApplyPhysics(); 748 so.ApplyPhysics();
749 749
750 rootPart.Rezzed = DateTime.Now; 750 rootPart.Rezzed = DateTime.Now;
@@ -804,7 +804,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
804 804
805 if (DebugLevel > 0) 805 if (DebugLevel > 0)
806 m_log.DebugFormat( 806 m_log.DebugFormat(
807 "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}", 807 "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}",
808 so.Name, so.LocalId, so.FromItemID, sp.Name, m_scene.Name); 808 so.Name, so.LocalId, so.FromItemID, sp.Name, m_scene.Name);
809 809
810 // Scripts MUST be snapshotted before the object is 810 // Scripts MUST be snapshotted before the object is
@@ -827,14 +827,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
827 UpdateDetachedObject(sp, so, scriptedState); 827 UpdateDetachedObject(sp, so, scriptedState);
828 } 828 }
829 } 829 }
830 830
831 public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos) 831 public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos)
832 { 832 {
833 if (!Enabled) 833 if (!Enabled)
834 return; 834 return;
835 835
836 sog.UpdateGroupPosition(pos); 836 sog.UpdateGroupPosition(pos);
837 sog.HasGroupChanged = true; 837 sog.HasGroupChanged = true;
838 } 838 }
839 839
840 #endregion 840 #endregion
@@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
843 843
844 // This is public but is not part of the IAttachmentsModule interface. 844 // This is public but is not part of the IAttachmentsModule interface.
845 // RegionCombiner module needs to poke at it to deliver client events. 845 // RegionCombiner module needs to poke at it to deliver client events.
846 // This breaks the encapsulation of the module and should get fixed somehow. 846 // This breaks the encapsulation of the module and should get fixed somehow.
847 public void SubscribeToClientEvents(IClientAPI client) 847 public void SubscribeToClientEvents(IClientAPI client)
848 { 848 {
849 client.OnRezSingleAttachmentFromInv += Client_OnRezSingleAttachmentFromInv; 849 client.OnRezSingleAttachmentFromInv += Client_OnRezSingleAttachmentFromInv;
@@ -856,7 +856,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
856 856
857 // This is public but is not part of the IAttachmentsModule interface. 857 // This is public but is not part of the IAttachmentsModule interface.
858 // RegionCombiner module needs to poke at it to deliver client events. 858 // RegionCombiner module needs to poke at it to deliver client events.
859 // This breaks the encapsulation of the module and should get fixed somehow. 859 // This breaks the encapsulation of the module and should get fixed somehow.
860 public void UnsubscribeFromClientEvents(IClientAPI client) 860 public void UnsubscribeFromClientEvents(IClientAPI client)
861 { 861 {
862 client.OnRezSingleAttachmentFromInv -= Client_OnRezSingleAttachmentFromInv; 862 client.OnRezSingleAttachmentFromInv -= Client_OnRezSingleAttachmentFromInv;
@@ -936,7 +936,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
936 /// Attach this scene object to the given avatar. 936 /// Attach this scene object to the given avatar.
937 /// </summary> 937 /// </summary>
938 /// <remarks> 938 /// <remarks>
939 /// This isn't publicly available since attachments should always perform the corresponding inventory 939 /// This isn't publicly available since attachments should always perform the corresponding inventory
940 /// operation (to show the attach in user inventory and update the asset with positional information). 940 /// operation (to show the attach in user inventory and update the asset with positional information).
941 /// </remarks> 941 /// </remarks>
942 /// <param name="sp"></param> 942 /// <param name="sp"></param>
@@ -997,7 +997,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
997 997
998 // Fudge below is an extremely unhelpful comment. It's probably here so that the scheduled full update 998 // Fudge below is an extremely unhelpful comment. It's probably here so that the scheduled full update
999 // will succeed, as that will not update if an attachment is selected. 999 // will succeed, as that will not update if an attachment is selected.
1000 so.IsSelected = false; // fudge.... 1000 so.IsSelected = false; // fudge....
1001 1001
1002 so.ScheduleGroupForFullUpdate(); 1002 so.ScheduleGroupForFullUpdate();
1003 } 1003 }
@@ -1041,7 +1041,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1041 /// </summary> 1041 /// </summary>
1042 /// <remarks> 1042 /// <remarks>
1043 /// This involves triggering the detach event and getting the script state (which also stops the script) 1043 /// This involves triggering the detach event and getting the script state (which also stops the script)
1044 /// This MUST be done outside sp.AttachmentsSyncLock, since otherwise there is a chance of deadlock if a 1044 /// This MUST be done outside sp.AttachmentsSyncLock, since otherwise there is a chance of deadlock if a
1045 /// running script is performing attachment operations. 1045 /// running script is performing attachment operations.
1046 /// </remarks> 1046 /// </remarks>
1047 /// <returns> 1047 /// <returns>
@@ -1088,7 +1088,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1088 // Remove the object from the scene so no more updates 1088 // Remove the object from the scene so no more updates
1089 // are sent. Doing this before the below changes will ensure 1089 // are sent. Doing this before the below changes will ensure
1090 // updates can't cause "HUD artefacts" 1090 // updates can't cause "HUD artefacts"
1091 1091
1092 m_scene.DeleteSceneObject(so, false, false); 1092 m_scene.DeleteSceneObject(so, false, false);
1093 1093
1094 // Prepare sog for storage 1094 // Prepare sog for storage
@@ -1125,7 +1125,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1125 itemID, rezGroupID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, 1125 itemID, rezGroupID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
1126 false, false, sp.UUID, true); 1126 false, false, sp.UUID, true);
1127 else 1127 else
1128 objatt = m_invAccessModule.RezObject(sp.ControllingClient, 1128 objatt = m_invAccessModule.RezObject(sp.ControllingClient,
1129 null, rezGroupID, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, 1129 null, rezGroupID, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
1130 false, false, sp.UUID, true); 1130 false, false, sp.UUID, true);
1131 1131
@@ -1139,7 +1139,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1139 } 1139 }
1140 else if (itemID == UUID.Zero) 1140 else if (itemID == UUID.Zero)
1141 { 1141 {
1142 // We need to have a FromItemID for multiple attachments on a single attach point to appear. This is 1142 // We need to have a FromItemID for multiple attachments on a single attach point to appear. This is
1143 // true on Singularity 1.8.5 and quite possibly other viewers as well. As NPCs don't have an inventory 1143 // true on Singularity 1.8.5 and quite possibly other viewers as well. As NPCs don't have an inventory
1144 // we will satisfy this requirement by inserting a random UUID. 1144 // we will satisfy this requirement by inserting a random UUID.
1145 objatt.FromItemID = UUID.Random(); 1145 objatt.FromItemID = UUID.Random();
@@ -1185,7 +1185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1185 } 1185 }
1186 1186
1187 if (tainted) 1187 if (tainted)
1188 objatt.HasGroupChanged = true; 1188 objatt.HasGroupChanged = true;
1189 1189
1190 if (ThrottlePer100PrimsRezzed > 0) 1190 if (ThrottlePer100PrimsRezzed > 0)
1191 { 1191 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index 16f1952..941853c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -485,7 +485,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
485 485
486 // Test wearing a second attachment at the same position 486 // Test wearing a second attachment at the same position
487 // Until multiple attachments at one point is implemented, this will remove the first attachment 487 // Until multiple attachments at one point is implemented, this will remove the first attachment
488 // This test relies on both attachments having the same default attachment point (in this case LeftHand 488 // This test relies on both attachments having the same default attachment point (in this case LeftHand
489 // since none other has been set). 489 // since none other has been set).
490 { 490 {
491 scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem2.ID, (uint)AttachmentPoint.Default); 491 scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem2.ID, (uint)AttachmentPoint.Default);
@@ -975,8 +975,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
975 // Both these operations will occur on different threads and will wait for each other. 975 // Both these operations will occur on different threads and will wait for each other.
976 // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 976 // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1
977 // test protocol, where we are trying to avoid unpredictable async operations in regression tests. 977 // test protocol, where we are trying to avoid unpredictable async operations in regression tests.
978 tc.OnTestClientSendRegionTeleport 978 tc.OnTestClientSendRegionTeleport
979 += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) 979 += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL)
980 => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); 980 => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null);
981 981
982 m_numberOfAttachEventsFired = 0; 982 m_numberOfAttachEventsFired = 0;
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 67256ee..0826a08 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
75 m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); 75 m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime)));
76 m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); 76 m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime)));
77 m_reusetextures = appearanceConfig.GetBoolean("ReuseTextures",m_reusetextures); 77 m_reusetextures = appearanceConfig.GetBoolean("ReuseTextures",m_reusetextures);
78 78
79 // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); 79 // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
80 } 80 }
81 81
@@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
166 } 166 }
167 167
168 /// <summary> 168 /// <summary>
169 /// Set appearance data (texture asset IDs and slider settings) 169 /// Set appearance data (texture asset IDs and slider settings)
170 /// </summary> 170 /// </summary>
171 /// <param name="sp"></param> 171 /// <param name="sp"></param>
172 /// <param name="texture"></param> 172 /// <param name="texture"></param>
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
190 { 190 {
191 changed = sp.Appearance.SetVisualParams(visualParams); 191 changed = sp.Appearance.SetVisualParams(visualParams);
192 } 192 }
193 193
194 // Process the baked texture array 194 // Process the baked texture array
195 if (textureEntry != null) 195 if (textureEntry != null)
196 { 196 {
@@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
267 WearableCacheItem[] items = sp.Appearance.WearableCacheItems; 267 WearableCacheItem[] items = sp.Appearance.WearableCacheItems;
268 //foreach (WearableCacheItem item in items) 268 //foreach (WearableCacheItem item in items)
269 //{ 269 //{
270 270
271 //} 271 //}
272 return items; 272 return items;
273 } 273 }
@@ -468,7 +468,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
468 } 468 }
469 469
470 sp.Appearance.WearableCacheItems = wearableCache; 470 sp.Appearance.WearableCacheItems = wearableCache;
471 471
472 if (missing.Count > 0) 472 if (missing.Count > 0)
473 { 473 {
474 foreach (UUID id in missing) 474 foreach (UUID id in missing)
@@ -493,7 +493,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
493 for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) 493 for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++)
494 { 494 {
495 int j = AvatarAppearance.BAKE_INDICES[iter]; 495 int j = AvatarAppearance.BAKE_INDICES[iter];
496 m_log.Debug("[UpdateBCache] {" + iter + "/" + 496 m_log.Debug("[UpdateBCache] {" + iter + "/" +
497 sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" + 497 sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" +
498 sp.Appearance.WearableCacheItems[j].CacheId + ", t-" + 498 sp.Appearance.WearableCacheItems[j].CacheId + ", t-" +
499 sp.Appearance.WearableCacheItems[j].TextureID); 499 sp.Appearance.WearableCacheItems[j].TextureID);
@@ -588,7 +588,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
588 wearableCacheValid = false; 588 wearableCacheValid = false;
589 } 589 }
590 } 590 }
591 591
592 wearableCacheValid = (wearableCacheValid && (hits >= AvatarAppearance.BAKE_INDICES.Length - 1)); 592 wearableCacheValid = (wearableCacheValid && (hits >= AvatarAppearance.BAKE_INDICES.Length - 1));
593 if (wearableCacheValid) 593 if (wearableCacheValid)
594 m_log.Debug("[ValidateBakedCache] have valid local cache"); 594 m_log.Debug("[ValidateBakedCache] have valid local cache");
@@ -601,7 +601,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
601 if (!wearableCacheValid) 601 if (!wearableCacheValid)
602 { 602 {
603 hits = 0; 603 hits = 0;
604 // only use external bake module on login condition check 604 // only use external bake module on login condition check
605// ScenePresence ssp = null; 605// ScenePresence ssp = null;
606// if (sp is ScenePresence) 606// if (sp is ScenePresence)
607 { 607 {
@@ -816,7 +816,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
816 foreach (KeyValuePair<UUID, long> kvp in saves) 816 foreach (KeyValuePair<UUID, long> kvp in saves)
817 { 817 {
818 // We have to load the key and value into local parameters to avoid a race condition if we loop 818 // We have to load the key and value into local parameters to avoid a race condition if we loop
819 // around and load kvp with a different value before FireAndForget has launched its thread. 819 // around and load kvp with a different value before FireAndForget has launched its thread.
820 UUID avatarID = kvp.Key; 820 UUID avatarID = kvp.Key;
821 long sendTime = kvp.Value; 821 long sendTime = kvp.Value;
822 822
@@ -869,13 +869,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
869 869
870 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); 870 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
871 871
872 // Trigger this here because it's the final step in the set/queue/save process for appearance setting. 872 // Trigger this here because it's the final step in the set/queue/save process for appearance setting.
873 // Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes). 873 // Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
874 m_scene.EventManager.TriggerAvatarAppearanceChanged(sp); 874 m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
875 } 875 }
876 876
877 /// <summary> 877 /// <summary>
878 /// For a given set of appearance items, check whether the items are valid and add their asset IDs to 878 /// For a given set of appearance items, check whether the items are valid and add their asset IDs to
879 /// appearance data. 879 /// appearance data.
880 /// </summary> 880 /// </summary>
881 /// <param name='userID'></param> 881 /// <param name='userID'></param>
@@ -893,7 +893,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
893 if (appearance.Wearables[i][j].ItemID == UUID.Zero) 893 if (appearance.Wearables[i][j].ItemID == UUID.Zero)
894 { 894 {
895 m_log.WarnFormat( 895 m_log.WarnFormat(
896 "[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.", 896 "[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.",
897 i, j, userID); 897 i, j, userID);
898 898
899 continue; 899 continue;
@@ -967,7 +967,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
967// case WearableType.Skin: 967// case WearableType.Skin:
968// //case WearableType.Underpants: 968// //case WearableType.Underpants:
969// TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); 969// TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance);
970// 970//
971// m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); 971// m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i);
972// resetwearable = true; 972// resetwearable = true;
973// break; 973// break;
@@ -975,7 +975,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
975// } 975// }
976// continue; 976// continue;
977// } 977// }
978// 978//
979// InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); 979// InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
980// baseItem = invService.GetItem(baseItem); 980// baseItem = invService.GetItem(baseItem);
981// 981//
@@ -1002,7 +1002,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
1002// 1002//
1003// TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); 1003// TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance);
1004// resetwearable = true; 1004// resetwearable = true;
1005// 1005//
1006// } 1006// }
1007// } 1007// }
1008// } 1008// }
@@ -1011,7 +1011,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
1011// if (appearance.Wearables[(int) WearableType.Eyes] == null) 1011// if (appearance.Wearables[(int) WearableType.Eyes] == null)
1012// { 1012// {
1013// m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); 1013// m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes));
1014// 1014//
1015// TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); 1015// TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance);
1016// resetwearable = true; 1016// resetwearable = true;
1017// } 1017// }
@@ -1213,7 +1213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
1213 m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId); 1213 m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId);
1214 }, null, "AvatarFactoryModule.OnClientRequestWearables"); 1214 }, null, "AvatarFactoryModule.OnClientRequestWearables");
1215 } 1215 }
1216 1216
1217 /// <summary> 1217 /// <summary>
1218 /// Set appearance data (texture asset IDs and slider settings) received from a client 1218 /// Set appearance data (texture asset IDs and slider settings) received from a client
1219 /// </summary> 1219 /// </summary>
@@ -1299,12 +1299,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
1299 { 1299 {
1300 UUID texture = UUID.Zero; 1300 UUID texture = UUID.Zero;
1301 int index = request.BakedTextureIndex; 1301 int index = request.BakedTextureIndex;
1302 1302
1303 if (m_reusetextures) 1303 if (m_reusetextures)
1304 { 1304 {
1305 // this is the most insanely dumb way to do this... however it seems to 1305 // this is the most insanely dumb way to do this... however it seems to
1306 // actually work. if the appearance has been reset because wearables have 1306 // actually work. if the appearance has been reset because wearables have
1307 // changed then the texture entries are zero'd out until the bakes are 1307 // changed then the texture entries are zero'd out until the bakes are
1308 // uploaded. on login, if the textures exist in the cache (eg if you logged 1308 // uploaded. on login, if the textures exist in the cache (eg if you logged
1309 // into the simulator recently, then the appearance will pull those and send 1309 // into the simulator recently, then the appearance will pull those and send
1310 // them back in the packet and you won't have to rebake. if the textures aren't 1310 // them back in the packet and you won't have to rebake. if the textures aren't
@@ -1320,7 +1320,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
1320 1320
1321 // m_log.WarnFormat("[AVFACTORY]: reuse texture {0} for index {1}",texture,index); 1321 // m_log.WarnFormat("[AVFACTORY]: reuse texture {0} for index {1}",texture,index);
1322 } 1322 }
1323 1323
1324 CachedTextureResponseArg response = new CachedTextureResponseArg(); 1324 CachedTextureResponseArg response = new CachedTextureResponseArg();
1325 response.BakedTextureIndex = index; 1325 response.BakedTextureIndex = index;
1326 response.BakedTextureID = texture; 1326 response.BakedTextureID = texture;
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
1328 1328
1329 cachedTextureResponse.Add(response); 1329 cachedTextureResponse.Add(response);
1330 } 1330 }
1331 1331
1332 // m_log.WarnFormat("[AVFACTORY]: serial is {0}",serial); 1332 // m_log.WarnFormat("[AVFACTORY]: serial is {0}",serial);
1333 // The serial number appears to be used to match requests and responses 1333 // The serial number appears to be used to match requests and responses
1334 // in the texture transaction. We just send back the serial number 1334 // in the texture transaction. We just send back the serial number
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
index dd93449..33489d1 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
55 // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly 55 // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly
56 // to the AssetService, which will then store temporary and local assets permanently 56 // to the AssetService, which will then store temporary and local assets permanently
57 CoreAssetCache assetCache = new CoreAssetCache(); 57 CoreAssetCache assetCache = new CoreAssetCache();
58 58
59 AvatarFactoryModule afm = new AvatarFactoryModule(); 59 AvatarFactoryModule afm = new AvatarFactoryModule();
60 TestScene scene = new SceneHelpers(assetCache).SetupScene(); 60 TestScene scene = new SceneHelpers(assetCache).SetupScene();
61 SceneHelpers.SetupSceneModules(scene, afm); 61 SceneHelpers.SetupSceneModules(scene, afm);
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
63 63
64 // TODO: Use the actual BunchOfCaps functionality once we slot in the CapabilitiesModules 64 // TODO: Use the actual BunchOfCaps functionality once we slot in the CapabilitiesModules
65 AssetBase bakedTextureAsset; 65 AssetBase bakedTextureAsset;
66 bakedTextureAsset 66 bakedTextureAsset
67 = new AssetBase( 67 = new AssetBase(
68 bakedTextureID, "Test Baked Texture", (sbyte)AssetType.Texture, userId.ToString()); 68 bakedTextureID, "Test Baked Texture", (sbyte)AssetType.Texture, userId.ToString());
69 bakedTextureAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet 69 bakedTextureAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
85 // This is the alpha texture 85 // This is the alpha texture
86 eyesFace.TextureID = bakedTextureID; 86 eyesFace.TextureID = bakedTextureID;
87 afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); 87 afm.SetAppearance(sp, bakedTextureEntry, visualParams, null);
88 88
89 Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); 89 Assert.That(rebakeRequestsReceived, Is.EqualTo(0));
90 90
91 AssetBase eyesBake = scene.AssetService.Get(bakedTextureID.ToString()); 91 AssetBase eyesBake = scene.AssetService.Get(bakedTextureID.ToString());
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
98 /// Test appearance setting where the baked texture UUID are library alpha textures. 98 /// Test appearance setting where the baked texture UUID are library alpha textures.
99 /// </summary> 99 /// </summary>
100 /// <remarks> 100 /// <remarks>
101 /// For a mesh avatar, it appears these 'baked textures' are used. So these should not trigger a request to 101 /// For a mesh avatar, it appears these 'baked textures' are used. So these should not trigger a request to
102 /// rebake. 102 /// rebake.
103 /// </remarks> 103 /// </remarks>
104 [Test] 104 [Test]
@@ -113,14 +113,14 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
113 // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly 113 // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly
114 // to the AssetService, which will then store temporary and local assets permanently 114 // to the AssetService, which will then store temporary and local assets permanently
115 CoreAssetCache assetCache = new CoreAssetCache(); 115 CoreAssetCache assetCache = new CoreAssetCache();
116 116
117 AvatarFactoryModule afm = new AvatarFactoryModule(); 117 AvatarFactoryModule afm = new AvatarFactoryModule();
118 TestScene scene = new SceneHelpers(assetCache).SetupScene(); 118 TestScene scene = new SceneHelpers(assetCache).SetupScene();
119 SceneHelpers.SetupSceneModules(scene, afm); 119 SceneHelpers.SetupSceneModules(scene, afm);
120 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); 120 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
121 121
122 AssetBase libraryAsset; 122 AssetBase libraryAsset;
123 libraryAsset 123 libraryAsset
124 = new AssetBase( 124 = new AssetBase(
125 alphaTextureID, "Default Alpha Layer Texture", (sbyte)AssetType.Texture, userId.ToString()); 125 alphaTextureID, "Default Alpha Layer Texture", (sbyte)AssetType.Texture, userId.ToString());
126 libraryAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet 126 libraryAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
142 // This is the alpha texture 142 // This is the alpha texture
143 eyesFace.TextureID = alphaTextureID; 143 eyesFace.TextureID = alphaTextureID;
144 afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); 144 afm.SetAppearance(sp, bakedTextureEntry, visualParams, null);
145 145
146 Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); 146 Assert.That(rebakeRequestsReceived, Is.EqualTo(0));
147 } 147 }
148 148
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
158 // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly 158 // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly
159 // to the AssetService, which will then store temporary and local assets permanently 159 // to the AssetService, which will then store temporary and local assets permanently
160 CoreAssetCache assetCache = new CoreAssetCache(); 160 CoreAssetCache assetCache = new CoreAssetCache();
161 161
162 AvatarFactoryModule afm = new AvatarFactoryModule(); 162 AvatarFactoryModule afm = new AvatarFactoryModule();
163 TestScene scene = new SceneHelpers(assetCache).SetupScene(); 163 TestScene scene = new SceneHelpers(assetCache).SetupScene();
164 SceneHelpers.SetupSceneModules(scene, afm); 164 SceneHelpers.SetupSceneModules(scene, afm);
diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
index 6d97251..27e84b0 100644
--- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
53 private UTF8Encoding enc = new UTF8Encoding(); 53 private UTF8Encoding enc = new UTF8Encoding();
54 private string m_URL = String.Empty; 54 private string m_URL = String.Empty;
55 private static XmlSerializer m_serializer = new XmlSerializer(typeof(AssetBase)); 55 private static XmlSerializer m_serializer = new XmlSerializer(typeof(AssetBase));
56 private static bool m_enabled = false; 56 private static bool m_enabled = false;
57 57
58 private static IServiceAuth m_Auth; 58 private static IServiceAuth m_Auth;
59 59
@@ -64,18 +64,18 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
64 return; 64 return;
65 65
66 m_URL = config.GetString("URL", String.Empty); 66 m_URL = config.GetString("URL", String.Empty);
67 if (m_URL == String.Empty) 67 if (m_URL == String.Empty)
68 return; 68 return;
69 69
70 m_enabled = true; 70 m_enabled = true;
71 71
72 m_Auth = ServiceAuth.Create(configSource, "XBakes"); 72 m_Auth = ServiceAuth.Create(configSource, "XBakes");
73 } 73 }
74 74
75 public void AddRegion(Scene scene) 75 public void AddRegion(Scene scene)
76 { 76 {
77 if (!m_enabled) 77 if (!m_enabled)
78 return; 78 return;
79 79
80 // m_log.InfoFormat("[XBakes]: Enabled for region {0}", scene.RegionInfo.RegionName); 80 // m_log.InfoFormat("[XBakes]: Enabled for region {0}", scene.RegionInfo.RegionName);
81 m_Scene = scene; 81 m_Scene = scene;
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
177 177
178 int numberWears = 0; 178 int numberWears = 0;
179 MemoryStream reqStream; 179 MemoryStream reqStream;
180 180
181 using (MemoryStream bakeStream = new MemoryStream()) 181 using (MemoryStream bakeStream = new MemoryStream())
182 using (XmlTextWriter bakeWriter = new XmlTextWriter(bakeStream, null)) 182 using (XmlTextWriter bakeWriter = new XmlTextWriter(bakeStream, null))
183 { 183 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 5164289..53800bb 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
69 m_enabled = false; 69 m_enabled = false;
70 return; 70 return;
71 } 71 }
72 72
73 m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance); 73 m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance);
74 m_saydistance = m_config.GetInt("say_distance", m_saydistance); 74 m_saydistance = m_config.GetInt("say_distance", m_saydistance);
75 m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance); 75 m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance);
@@ -123,7 +123,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
123 } 123 }
124 } 124 }
125 } 125 }
126 126
127 public virtual void Close() 127 public virtual void Close()
128 { 128 {
129 } 129 }
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
132 { 132 {
133 } 133 }
134 134
135 public virtual Type ReplaceableInterface 135 public virtual Type ReplaceableInterface
136 { 136 {
137 get { return null; } 137 get { return null; }
138 } 138 }
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
222 return; 222 return;
223 } 223 }
224 224
225 switch (sourceType) 225 switch (sourceType)
226 { 226 {
227 case ChatSourceType.Agent: 227 case ChatSourceType.Agent:
228 ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId); 228 ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId);
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
240 } 240 }
241 destination = UUID.Zero; // Avatars cant "SayTo" 241 destination = UUID.Zero; // Avatars cant "SayTo"
242 ownerID = c.Sender.AgentId; 242 ownerID = c.Sender.AgentId;
243 243
244 hidePos = fromPos; 244 hidePos = fromPos;
245 break; 245 break;
246 246
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
264 message = message.Substring(0, 1000); 264 message = message.Substring(0, 1000);
265 265
266// m_log.DebugFormat( 266// m_log.DebugFormat(
267// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", 267// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}",
268// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); 268// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType);
269 269
270 HashSet<UUID> receiverIDs = new HashSet<UUID>(); 270 HashSet<UUID> receiverIDs = new HashSet<UUID>();
@@ -317,13 +317,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
317 } 317 }
318 } 318 }
319 }); 319 });
320 320
321 scene.EventManager.TriggerOnChatToClients( 321 scene.EventManager.TriggerOnChatToClients(
322 fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); 322 fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
323 } 323 }
324 324
325 static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30); 325 static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30);
326 326
327 public virtual void OnChatBroadcast(Object sender, OSChatMessage c) 327 public virtual void OnChatBroadcast(Object sender, OSChatMessage c)
328 { 328 {
329 if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; 329 if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return;
@@ -341,7 +341,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
341 // broadcast chat works by redistributing every incoming chat 341 // broadcast chat works by redistributing every incoming chat
342 // message to each avatar in the scene. 342 // message to each avatar in the scene.
343 string fromName = c.From; 343 string fromName = c.From;
344 344
345 UUID fromID = UUID.Zero; 345 UUID fromID = UUID.Zero;
346 UUID ownerID = UUID.Zero; 346 UUID ownerID = UUID.Zero;
347 ChatSourceType sourceType = ChatSourceType.Object; 347 ChatSourceType sourceType = ChatSourceType.Object;
@@ -353,15 +353,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
353 ownerID = c.Sender.AgentId; 353 ownerID = c.Sender.AgentId;
354 sourceType = ChatSourceType.Agent; 354 sourceType = ChatSourceType.Agent;
355 } 355 }
356 else if (c.SenderUUID != UUID.Zero) 356 else if (c.SenderUUID != UUID.Zero)
357 { 357 {
358 fromID = c.SenderUUID; 358 fromID = c.SenderUUID;
359 ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; 359 ownerID = ((SceneObjectPart)c.SenderObject).OwnerID;
360 } 360 }
361 361
362 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); 362 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
363 HashSet<UUID> receiverIDs = new HashSet<UUID>(); 363 HashSet<UUID> receiverIDs = new HashSet<UUID>();
364 364
365 if (c.Scene != null) 365 if (c.Scene != null)
366 { 366 {
367 ((Scene)c.Scene).ForEachRootClient 367 ((Scene)c.Scene).ForEachRootClient
@@ -374,7 +374,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
374 (null != c.SenderObject) && 374 (null != c.SenderObject) &&
375 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) 375 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
376 return; 376 return;
377 377
378 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, 378 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID,
379 (byte)sourceType, (byte)ChatAudibleLevel.Fully); 379 (byte)sourceType, (byte)ChatAudibleLevel.Fully);
380 receiverIDs.Add(client.AgentId); 380 receiverIDs.Add(client.AgentId);
@@ -400,7 +400,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
400 /// <param name="type"></param> 400 /// <param name="type"></param>
401 /// <param name="message"></param> 401 /// <param name="message"></param>
402 /// <param name="src"></param> 402 /// <param name="src"></param>
403 /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a 403 /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a
404 /// precondition</returns> 404 /// precondition</returns>
405 protected virtual bool TrySendChatMessage( 405 protected virtual bool TrySendChatMessage(
406 ScenePresence presence, Vector3 fromPos, Vector3 regionPos, 406 ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
430 presence.ControllingClient.SendChatMessage( 430 presence.ControllingClient.SendChatMessage(
431 message, (byte) type, fromPos, fromName, 431 message, (byte) type, fromPos, fromName,
432 fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); 432 fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully);
433 433
434 return true; 434 return true;
435 } 435 }
436 436
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
index a720ad9..5457dc3 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
47{ 47{
48 [TestFixture] 48 [TestFixture]
49 public class ChatModuleTests : OpenSimTestCase 49 public class ChatModuleTests : OpenSimTestCase
50 { 50 {
51 [TestFixtureSetUp] 51 [TestFixtureSetUp]
52 public void FixtureInit() 52 public void FixtureInit()
53 { 53 {
@@ -66,14 +66,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
66 } 66 }
67 67
68 private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB) 68 private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB)
69 { 69 {
70 // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the 70 // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the
71 // CapabilitiesModule complain when it can't set up HTTP endpoints. 71 // CapabilitiesModule complain when it can't set up HTTP endpoints.
72 BaseHttpServer httpServer = new BaseHttpServer(99999); 72 BaseHttpServer httpServer = new BaseHttpServer(99999);
73 MainServer.AddHttpServer(httpServer); 73 MainServer.AddHttpServer(httpServer);
74 MainServer.Instance = httpServer; 74 MainServer.Instance = httpServer;
75 75
76 // We need entity transfer modules so that when sp2 logs into the east region, the region calls 76 // We need entity transfer modules so that when sp2 logs into the east region, the region calls
77 // EntityTransferModuleto set up a child agent on the west region. 77 // EntityTransferModuleto set up a child agent on the west region.
78 // XXX: However, this is not an entity transfer so is misleading. 78 // XXX: However, this is not an entity transfer so is misleading.
79 EntityTransferModule etmA = new EntityTransferModule(); 79 EntityTransferModule etmA = new EntityTransferModule();
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
87 modulesConfig.Set("SimulationServices", lscm.Name); 87 modulesConfig.Set("SimulationServices", lscm.Name);
88 88
89 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); 89 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
90 SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); 90 SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule());
91 SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule()); 91 SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule());
92 } 92 }
93 93
@@ -111,8 +111,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
111 Vector3 sp2Position = new Vector3(250, 128, 20); 111 Vector3 sp2Position = new Vector3(250, 128, 20);
112 112
113 SceneHelpers sh = new SceneHelpers(); 113 SceneHelpers sh = new SceneHelpers();
114 TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); 114 TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000);
115 TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); 115 TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000);
116 116
117 SetupNeighbourRegions(sceneWest, sceneEast); 117 SetupNeighbourRegions(sceneWest, sceneEast);
118 118
@@ -124,12 +124,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
124 // physics is irrelevant to this test. 124 // physics is irrelevant to this test.
125 sp1.Flying = true; 125 sp1.Flying = true;
126 126
127 // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to 127 // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to
128 // make the connection. For this test, will simplify this chain by making the connection directly. 128 // make the connection. For this test, will simplify this chain by making the connection directly.
129 ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid); 129 ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid);
130 TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; 130 TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient;
131 131
132 sp1.AbsolutePosition = sp1Position; 132 sp1.AbsolutePosition = sp1Position;
133 133
134 ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid); 134 ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid);
135 TestClient sp2Client = (TestClient)sp2.ControllingClient; 135 TestClient sp2Client = (TestClient)sp2.ControllingClient;
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
138 ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid); 138 ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid);
139 TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; 139 TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient;
140 140
141 sp2.AbsolutePosition = sp2Position; 141 sp2.AbsolutePosition = sp2Position;
142 142
143 // We must update the scenes in order to make the root new root agents trigger position updates in their 143 // We must update the scenes in order to make the root new root agents trigger position updates in their
144 // children. 144 // children.
@@ -147,19 +147,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
147 147
148 // Check child positions are correct. 148 // Check child positions are correct.
149 Assert.AreEqual( 149 Assert.AreEqual(
150 new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), 150 new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z),
151 sp1ChildClient.SceneAgent.AbsolutePosition); 151 sp1ChildClient.SceneAgent.AbsolutePosition);
152 152
153 Assert.AreEqual( 153 Assert.AreEqual(
154 new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), 154 new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z),
155 sp2ChildClient.SceneAgent.AbsolutePosition); 155 sp2ChildClient.SceneAgent.AbsolutePosition);
156 156
157 string receivedSp1ChatMessage = ""; 157 string receivedSp1ChatMessage = "";
158 string receivedSp2ChatMessage = ""; 158 string receivedSp2ChatMessage = "";
159 159
160 sp1ChildClient.OnReceivedChatMessage 160 sp1ChildClient.OnReceivedChatMessage
161 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; 161 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message;
162 sp2ChildClient.OnReceivedChatMessage 162 sp2ChildClient.OnReceivedChatMessage
163 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; 163 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message;
164 164
165 TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); 165 TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage);
@@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
175 175
176 // Check child position is correct. 176 // Check child position is correct.
177 Assert.AreEqual( 177 Assert.AreEqual(
178 new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), 178 new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z),
179 sp1ChildClient.SceneAgent.AbsolutePosition); 179 sp1ChildClient.SceneAgent.AbsolutePosition);
180 180
181 TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); 181 TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage);
@@ -202,8 +202,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
202 Vector3 sp2Position = new Vector3(128, 6, 20); 202 Vector3 sp2Position = new Vector3(128, 6, 20);
203 203
204 SceneHelpers sh = new SceneHelpers(); 204 SceneHelpers sh = new SceneHelpers();
205 TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); 205 TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000);
206 TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); 206 TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001);
207 207
208 SetupNeighbourRegions(sceneNorth, sceneSouth); 208 SetupNeighbourRegions(sceneNorth, sceneSouth);
209 209
@@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
215 // physics is irrelevant to this test. 215 // physics is irrelevant to this test.
216 sp1.Flying = true; 216 sp1.Flying = true;
217 217
218 // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to 218 // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to
219 // make the connection. For this test, will simplify this chain by making the connection directly. 219 // make the connection. For this test, will simplify this chain by making the connection directly.
220 ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid); 220 ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid);
221 TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; 221 TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient;
222 222
223 sp1.AbsolutePosition = sp1Position; 223 sp1.AbsolutePosition = sp1Position;
224 224
225 ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid); 225 ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid);
226 TestClient sp2Client = (TestClient)sp2.ControllingClient; 226 TestClient sp2Client = (TestClient)sp2.ControllingClient;
@@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
229 ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid); 229 ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid);
230 TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; 230 TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient;
231 231
232 sp2.AbsolutePosition = sp2Position; 232 sp2.AbsolutePosition = sp2Position;
233 233
234 // We must update the scenes in order to make the root new root agents trigger position updates in their 234 // We must update the scenes in order to make the root new root agents trigger position updates in their
235 // children. 235 // children.
@@ -238,19 +238,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
238 238
239 // Check child positions are correct. 239 // Check child positions are correct.
240 Assert.AreEqual( 240 Assert.AreEqual(
241 new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), 241 new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z),
242 sp1ChildClient.SceneAgent.AbsolutePosition); 242 sp1ChildClient.SceneAgent.AbsolutePosition);
243 243
244 Assert.AreEqual( 244 Assert.AreEqual(
245 new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), 245 new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z),
246 sp2ChildClient.SceneAgent.AbsolutePosition); 246 sp2ChildClient.SceneAgent.AbsolutePosition);
247 247
248 string receivedSp1ChatMessage = ""; 248 string receivedSp1ChatMessage = "";
249 string receivedSp2ChatMessage = ""; 249 string receivedSp2ChatMessage = "";
250 250
251 sp1ChildClient.OnReceivedChatMessage 251 sp1ChildClient.OnReceivedChatMessage
252 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; 252 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message;
253 sp2ChildClient.OnReceivedChatMessage 253 sp2ChildClient.OnReceivedChatMessage
254 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; 254 += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message;
255 255
256 TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); 256 TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage);
@@ -266,13 +266,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
266 266
267 // Check child position is correct. 267 // Check child position is correct.
268 Assert.AreEqual( 268 Assert.AreEqual(
269 new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), 269 new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z),
270 sp1ChildClient.SceneAgent.AbsolutePosition); 270 sp1ChildClient.SceneAgent.AbsolutePosition);
271 271
272 TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); 272 TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage);
273 TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage); 273 TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage);
274 } 274 }
275 275
276 private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage) 276 private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage)
277 { 277 {
278 receivedMessage = ""; 278 receivedMessage = "";
diff --git a/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs b/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs
index 764adf9..cf65c47 100644
--- a/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs
@@ -62,19 +62,19 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands
62 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); 62 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
63 63
64 public string Name { get { return "User Commands Module"; } } 64 public string Name { get { return "User Commands Module"; } }
65 65
66 public Type ReplaceableInterface { get { return null; } } 66 public Type ReplaceableInterface { get { return null; } }
67 67
68 public void Initialise(IConfigSource source) 68 public void Initialise(IConfigSource source)
69 { 69 {
70// m_log.DebugFormat("[USER COMMANDS MODULE]: INITIALIZED MODULE"); 70// m_log.DebugFormat("[USER COMMANDS MODULE]: INITIALIZED MODULE");
71 } 71 }
72 72
73 public void PostInitialise() 73 public void PostInitialise()
74 { 74 {
75// m_log.DebugFormat("[USER COMMANDS MODULE]: POST INITIALIZED MODULE"); 75// m_log.DebugFormat("[USER COMMANDS MODULE]: POST INITIALIZED MODULE");
76 } 76 }
77 77
78 public void Close() 78 public void Close()
79 { 79 {
80// m_log.DebugFormat("[USER COMMANDS MODULE]: CLOSED MODULE"); 80// m_log.DebugFormat("[USER COMMANDS MODULE]: CLOSED MODULE");
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index aaa331b..7980de3 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
167 m_Enabled = true; 167 m_Enabled = true;
168 m_log.DebugFormat("[FRIENDS MODULE]: {0} enabled.", Name); 168 m_log.DebugFormat("[FRIENDS MODULE]: {0} enabled.", Name);
169 } 169 }
170 } 170 }
171 } 171 }
172 172
173 protected virtual void InitModule(IConfigSource config) 173 protected virtual void InitModule(IConfigSource config)
@@ -570,7 +570,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
570 protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) 570 protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im)
571 { 571 {
572 if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) 572 if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered)
573 { 573 {
574 // we got a friendship offer 574 // we got a friendship offer
575 UUID principalID = new UUID(im.fromAgentID); 575 UUID principalID = new UUID(im.fromAgentID);
576 UUID friendID = new UUID(im.toAgentID); 576 UUID friendID = new UUID(im.toAgentID);
@@ -605,7 +605,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
605 im.imSessionID = im.fromAgentID; 605 im.imSessionID = im.fromAgentID;
606 im.fromAgentName = GetFriendshipRequesterName(agentID); 606 im.fromAgentName = GetFriendshipRequesterName(agentID);
607 607
608 // Try the local sim 608 // Try the local sim
609 if (LocalFriendshipOffered(friendID, im)) 609 if (LocalFriendshipOffered(friendID, im))
610 return true; 610 return true;
611 611
@@ -648,7 +648,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
648 ccm.CreateCallingCard(client.AgentId, friendID, UUID.Zero); 648 ccm.CreateCallingCard(client.AgentId, friendID, UUID.Zero);
649 } 649 }
650 650
651 // Update the local cache. 651 // Update the local cache.
652 RecacheFriends(client); 652 RecacheFriends(client);
653 653
654 // 654 //
@@ -704,7 +704,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
704 } 704 }
705 } 705 }
706 } 706 }
707 707
708 public void RemoveFriendship(IClientAPI client, UUID exfriendID) 708 public void RemoveFriendship(IClientAPI client, UUID exfriendID)
709 { 709 {
710 if (!DeleteFriendship(client.AgentId, exfriendID)) 710 if (!DeleteFriendship(client.AgentId, exfriendID))
@@ -732,7 +732,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
732 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); 732 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
733 m_FriendsSimConnector.FriendshipTerminated(region, client.AgentId, exfriendID); 733 m_FriendsSimConnector.FriendshipTerminated(region, client.AgentId, exfriendID);
734 } 734 }
735 } 735 }
736 } 736 }
737 737
738 public void FindFriend(IClientAPI remoteClient,UUID HunterID ,UUID PreyID) 738 public void FindFriend(IClientAPI remoteClient,UUID HunterID ,UUID PreyID)
@@ -740,7 +740,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
740 UUID requester = remoteClient.AgentId; 740 UUID requester = remoteClient.AgentId;
741 if(requester != HunterID) // only allow client agent to be the hunter (?) 741 if(requester != HunterID) // only allow client agent to be the hunter (?)
742 return; 742 return;
743 743
744 FriendInfo[] friends = GetFriendsFromCache(requester); 744 FriendInfo[] friends = GetFriendsFromCache(requester);
745 if (friends.Length == 0) 745 if (friends.Length == 0)
746 return; 746 return;
@@ -773,7 +773,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
773 } 773 }
774 774
775 PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { PreyID.ToString() }); 775 PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { PreyID.ToString() });
776 776
777 if (friendSessions == null || friendSessions.Length == 0) 777 if (friendSessions == null || friendSessions.Length == 0)
778 return; 778 return;
779 779
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
index c421740..81aa882 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
127 UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(UUID.Zero, fromID); 127 UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(UUID.Zero, fromID);
128 string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName; 128 string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName;
129 129
130 GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, 130 GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID,
131 (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); 131 (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero);
132 132
133 // !! HACK 133 // !! HACK
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index 9954749..ac05a6e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -539,8 +539,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
539 // m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}", 539 // m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}",
540 // agentUUI, friendUUI, agentFriendService, friendFriendService); 540 // agentUUI, friendUUI, agentFriendService, friendFriendService);
541 541
542 } 542 }
543 543
544 // Delete any previous friendship relations 544 // Delete any previous friendship relations
545 DeletePreviousRelations(agentID, friendID); 545 DeletePreviousRelations(agentID, friendID);
546 546
@@ -641,11 +641,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
641 FriendsService.Delete(a1, f.Friend); 641 FriendsService.Delete(a1, f.Friend);
642 // and also the converse 642 // and also the converse
643 FriendsService.Delete(f.Friend, a1.ToString()); 643 FriendsService.Delete(f.Friend, a1.ToString());
644 } 644 }
645 } 645 }
646 } 646 }
647 } 647 }
648 648
649 finfos = GetFriendsFromCache(a1); 649 finfos = GetFriendsFromCache(a1);
650 if (finfos != null) 650 if (finfos != null)
651 { 651 {
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
658 FriendsService.Delete(a2, f.Friend); 658 FriendsService.Delete(a2, f.Friend);
659 // and also the converse 659 // and also the converse
660 FriendsService.Delete(f.Friend, a2.ToString()); 660 FriendsService.Delete(f.Friend, a2.ToString());
661 } 661 }
662 } 662 }
663 } 663 }
664 } 664 }
@@ -783,7 +783,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
783 m_log.DebugFormat("[HGFRIENDS MODULE]: Forwading friendship from {0} to {1} @ {2}", agentID, friendID, friendsURL); 783 m_log.DebugFormat("[HGFRIENDS MODULE]: Forwading friendship from {0} to {1} @ {2}", agentID, friendID, friendsURL);
784 GridRegion region = new GridRegion(); 784 GridRegion region = new GridRegion();
785 region.ServerURI = friendsURL; 785 region.ServerURI = friendsURL;
786 786
787 string name = im.fromAgentName; 787 string name = im.fromAgentName;
788 if (m_uMan.IsLocalGridUser(agentID)) 788 if (m_uMan.IsLocalGridUser(agentID))
789 { 789 {
@@ -815,7 +815,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
815 } 815 }
816 816
817 m_HGFriendsConnector.FriendshipOffered(region, agentID, friendID, im.message, name); 817 m_HGFriendsConnector.FriendshipOffered(region, agentID, friendID, im.message, name);
818 818
819 return true; 819 return true;
820 } 820 }
821 } 821 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs
index 1fa4dd6..3fae271 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
32 { 32 {
33 if (kvp.Key != "local") 33 if (kvp.Key != "local")
34 { 34 {
35 // For the others, call the user agent service 35 // For the others, call the user agent service
36 List<string> ids = new List<string>(); 36 List<string> ids = new List<string>();
37 foreach (FriendInfo f in kvp.Value) 37 foreach (FriendInfo f in kvp.Value)
38 ids.Add(f.Friend); 38 ids.Add(f.Friend);
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
index e6fd54e..3d9bd35 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
67 // so that different services and simulator can share the data in standalone mode. This is pretty horrible 67 // so that different services and simulator can share the data in standalone mode. This is pretty horrible
68 // effectively the statics are global variables. 68 // effectively the statics are global variables.
69 NullFriendsData.Clear(); 69 NullFriendsData.Clear();
70 70
71 IConfigSource config = new IniConfigSource(); 71 IConfigSource config = new IniConfigSource();
72 config.AddConfig("Modules"); 72 config.AddConfig("Modules");
73 // Not strictly necessary since FriendsModule assumes it is the default (!) 73 // Not strictly necessary since FriendsModule assumes it is the default (!)
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
index 4efcd3b..03e2c5a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
@@ -42,11 +42,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
42{ 42{
43 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")] 43 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")]
44 public class GesturesModule : INonSharedRegionModule 44 public class GesturesModule : INonSharedRegionModule
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 protected Scene m_scene; 48 protected Scene m_scene;
49 49
50 public void Initialise(IConfigSource source) 50 public void Initialise(IConfigSource source)
51 { 51 {
52 } 52 }
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
67 m_scene.EventManager.OnNewClient -= OnNewClient; 67 m_scene.EventManager.OnNewClient -= OnNewClient;
68 m_scene = null; 68 m_scene = null;
69 } 69 }
70 70
71 public void Close() {} 71 public void Close() {}
72 public string Name { get { return "Gestures Module"; } } 72 public string Name { get { return "Gestures Module"; } }
73 73
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
81 client.OnActivateGesture += ActivateGesture; 81 client.OnActivateGesture += ActivateGesture;
82 client.OnDeactivateGesture += DeactivateGesture; 82 client.OnDeactivateGesture += DeactivateGesture;
83 } 83 }
84 84
85 public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) 85 public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId)
86 { 86 {
87 IInventoryService invService = m_scene.InventoryService; 87 IInventoryService invService = m_scene.InventoryService;
@@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
92 item.Flags |= 1; 92 item.Flags |= 1;
93 invService.UpdateItem(item); 93 invService.UpdateItem(item);
94 } 94 }
95 else 95 else
96 m_log.WarnFormat( 96 m_log.WarnFormat(
97 "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name); 97 "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name);
98 } 98 }
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
107 item.Flags &= ~(uint)1; 107 item.Flags &= ~(uint)1;
108 invService.UpdateItem(item); 108 invService.UpdateItem(item);
109 } 109 }
110 else 110 else
111 m_log.ErrorFormat( 111 m_log.ErrorFormat(
112 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); 112 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
113 } 113 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index db02379..8d3c10d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -112,19 +112,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
112 client.OnGodKickUser += KickUser; 112 client.OnGodKickUser += KickUser;
113 client.OnRequestGodlikePowers += RequestGodlikePowers; 113 client.OnRequestGodlikePowers += RequestGodlikePowers;
114 } 114 }
115 115
116 public void UnsubscribeFromClientEvents(IClientAPI client) 116 public void UnsubscribeFromClientEvents(IClientAPI client)
117 { 117 {
118 client.OnGodKickUser -= KickUser; 118 client.OnGodKickUser -= KickUser;
119 client.OnRequestGodlikePowers -= RequestGodlikePowers; 119 client.OnRequestGodlikePowers -= RequestGodlikePowers;
120 } 120 }
121 121
122 private void OnRegisterCaps(UUID agentID, Caps caps) 122 private void OnRegisterCaps(UUID agentID, Caps caps)
123 { 123 {
124 string uri = "/CAPS/" + UUID.Random(); 124 string uri = "/CAPS/" + UUID.Random();
125 125
126 caps.RegisterHandler( 126 caps.RegisterHandler(
127 "UntrustedSimulatorMessage", 127 "UntrustedSimulatorMessage",
128 new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null)); 128 new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null));
129 } 129 }
130 130
@@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
176 if (godLike && sp.GodLevel < 200 && DialogModule != null) 176 if (godLike && sp.GodLevel < 200 && DialogModule != null)
177 DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); 177 DialogModule.SendAlertToUser(agentID, "Request for god powers denied");
178 } 178 }
179 179
180 /// <summary> 180 /// <summary>
181 /// Kicks or freezes User specified from the simulator. This logs them off of the grid 181 /// Kicks or freezes User specified from the simulator. This logs them off of the grid
182 /// </summary> 182 /// </summary>
@@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
261 if(sp.IsDeleted || sp.IsChildAgent) 261 if(sp.IsDeleted || sp.IsChildAgent)
262 return; 262 return;
263 sp.ControllingClient.Kick(reason); 263 sp.ControllingClient.Kick(reason);
264 sp.Scene.CloseAgent(sp.UUID, true); 264 sp.Scene.CloseAgent(sp.UUID, true);
265 } 265 }
266 266
267 private void OnIncomingInstantMessage(GridInstantMessage msg) 267 private void OnIncomingInstantMessage(GridInstantMessage msg)
diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
index 543410e..7f91a61 100644
--- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
@@ -145,7 +145,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
145 return; 145 return;
146 146
147// m_log.Debug("[GROUPS]: Shutting down group module."); 147// m_log.Debug("[GROUPS]: Shutting down group module.");
148 148
149 lock (m_ClientMap) 149 lock (m_ClientMap)
150 { 150 {
151 m_ClientMap.Clear(); 151 m_ClientMap.Clear();
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
index 63b3dba..16e2ec3 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
@@ -144,11 +144,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
144 foreach (Scene scene in m_Scenes) 144 foreach (Scene scene in m_Scenes)
145 { 145 {
146// m_log.DebugFormat( 146// m_log.DebugFormat(
147// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", 147// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}",
148// toAgentID.ToString(), scene.RegionInfo.RegionName); 148// toAgentID.ToString(), scene.RegionInfo.RegionName);
149 ScenePresence sp = scene.GetScenePresence(toAgentID); 149 ScenePresence sp = scene.GetScenePresence(toAgentID);
150 if (sp != null && !sp.IsChildAgent && !sp.IsDeleted) 150 if (sp != null && !sp.IsChildAgent && !sp.IsDeleted)
151 { 151 {
152 // Local message 152 // Local message
153// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); 153// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
154 sp.ControllingClient.SendInstantMessage(im); 154 sp.ControllingClient.SendInstantMessage(im);
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
index 7d54a00..71c0a8a 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
49 /// Is this module enabled? 49 /// Is this module enabled?
50 /// </value> 50 /// </value>
51 protected bool m_enabled = false; 51 protected bool m_enabled = false;
52 52
53 protected readonly List<Scene> m_scenes = new List<Scene>(); 53 protected readonly List<Scene> m_scenes = new List<Scene>();
54 54
55 #region Region Module interface 55 #region Region Module interface
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
65 "InstantMessageModule") 65 "InstantMessageModule")
66 return; 66 return;
67 } 67 }
68 68
69 m_enabled = true; 69 m_enabled = true;
70 } 70 }
71 71
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 6b120fb..efb9421 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -207,10 +207,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
207 protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request, IPEndPoint remoteClient) 207 protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request, IPEndPoint remoteClient)
208 { 208 {
209 bool successful = false; 209 bool successful = false;
210 210
211 // TODO: For now, as IMs seem to be a bit unreliable on OSGrid, catch all exception that 211 // TODO: For now, as IMs seem to be a bit unreliable on OSGrid, catch all exception that
212 // happen here and aren't caught and log them. 212 // happen here and aren't caught and log them.
213 try 213 try
214 { 214 {
215 // various rational defaults 215 // various rational defaults
216 UUID fromAgentID = UUID.Zero; 216 UUID fromAgentID = UUID.Zero;
@@ -475,7 +475,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
475 /// </summary> 475 /// </summary>
476 476
477 /// <param name="prevRegionHandle"> 477 /// <param name="prevRegionHandle">
478 /// Pass in 0 the first time this method is called. It will be called recursively with the last 478 /// Pass in 0 the first time this method is called. It will be called recursively with the last
479 /// regionhandle tried 479 /// regionhandle tried
480 /// </param> 480 /// </param>
481 private void SendGridInstantMessageViaXMLRPCAsyncMain(GridInstantMessage im, MessageResultNotification result) 481 private void SendGridInstantMessageViaXMLRPCAsyncMain(GridInstantMessage im, MessageResultNotification result)
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs
index 315d372..2d57193 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs
@@ -118,11 +118,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
118 { 118 {
119 get { return null; } 119 get { return null; }
120 } 120 }
121 121
122 public void Close() 122 public void Close()
123 { 123 {
124 } 124 }
125 125
126 private void OnNewClient(IClientAPI client) 126 private void OnNewClient(IClientAPI client)
127 { 127 {
128 client.OnMuteListRequest += OnMuteListRequest; 128 client.OnMuteListRequest += OnMuteListRequest;
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
index 369d480..d1f6054 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
146 { 146 {
147 get { return null; } 147 get { return null; }
148 } 148 }
149 149
150 public void Close() 150 public void Close()
151 { 151 {
152 } 152 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 4a06fd1..3838316 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
56 /// bumps here should be compatible. 56 /// bumps here should be compatible.
57 /// </summary> 57 /// </summary>
58 public static int MAX_MAJOR_VERSION = 1; 58 public static int MAX_MAJOR_VERSION = 1;
59 59
60 protected TarArchiveReader archive; 60 protected TarArchiveReader archive;
61 61
62 private UserAccount m_userInfo; 62 private UserAccount m_userInfo;
@@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
66 /// ID of this request 66 /// ID of this request
67 /// </value> 67 /// </value>
68 protected UUID m_id; 68 protected UUID m_id;
69 69
70 /// <summary> 70 /// <summary>
71 /// Do we want to merge this load with existing inventory? 71 /// Do we want to merge this load with existing inventory?
72 /// </summary> 72 /// </summary>
@@ -82,41 +82,41 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
82 /// The stream from which the inventory archive will be loaded. 82 /// The stream from which the inventory archive will be loaded.
83 /// </value> 83 /// </value>
84 private Stream m_loadStream; 84 private Stream m_loadStream;
85 85
86 /// <summary> 86 /// <summary>
87 /// Has the control file been loaded for this archive? 87 /// Has the control file been loaded for this archive?
88 /// </summary> 88 /// </summary>
89 public bool ControlFileLoaded { get; private set; } 89 public bool ControlFileLoaded { get; private set; }
90 90
91 /// <summary> 91 /// <summary>
92 /// Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't 92 /// Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't
93 /// enforce. 93 /// enforce.
94 /// </summary> 94 /// </summary>
95 public bool EnforceControlFileCheck { get; private set; } 95 public bool EnforceControlFileCheck { get; private set; }
96 96
97 protected bool m_assetsLoaded; 97 protected bool m_assetsLoaded;
98 protected bool m_inventoryNodesLoaded; 98 protected bool m_inventoryNodesLoaded;
99 99
100 protected int m_successfulAssetRestores; 100 protected int m_successfulAssetRestores;
101 protected int m_failedAssetRestores; 101 protected int m_failedAssetRestores;
102 protected int m_successfulItemRestores; 102 protected int m_successfulItemRestores;
103 103
104 /// <summary> 104 /// <summary>
105 /// Root destination folder for the IAR load. 105 /// Root destination folder for the IAR load.
106 /// </summary> 106 /// </summary>
107 protected InventoryFolderBase m_rootDestinationFolder; 107 protected InventoryFolderBase m_rootDestinationFolder;
108 108
109 /// <summary> 109 /// <summary>
110 /// Inventory nodes loaded from the iar. 110 /// Inventory nodes loaded from the iar.
111 /// </summary> 111 /// </summary>
112 protected HashSet<InventoryNodeBase> m_loadedNodes = new HashSet<InventoryNodeBase>(); 112 protected HashSet<InventoryNodeBase> m_loadedNodes = new HashSet<InventoryNodeBase>();
113 113
114 /// <summary> 114 /// <summary>
115 /// In order to load identically named folders, we need to keep track of the folders that we have already 115 /// In order to load identically named folders, we need to keep track of the folders that we have already
116 /// resolved. 116 /// resolved.
117 /// </summary> 117 /// </summary>
118 Dictionary <string, InventoryFolderBase> m_resolvedFolders = new Dictionary<string, InventoryFolderBase>(); 118 Dictionary <string, InventoryFolderBase> m_resolvedFolders = new Dictionary<string, InventoryFolderBase>();
119 119
120 /// <summary> 120 /// <summary>
121 /// Record the creator id that should be associated with an asset. This is used to adjust asset creator ids 121 /// Record the creator id that should be associated with an asset. This is used to adjust asset creator ids
122 /// after OSP resolution (since OSP creators are only stored in the item 122 /// after OSP resolution (since OSP creators are only stored in the item
@@ -163,9 +163,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
163 m_invPath = invPath; 163 m_invPath = invPath;
164 m_loadStream = loadStream; 164 m_loadStream = loadStream;
165 m_module = module; 165 m_module = module;
166 166
167 // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things 167 // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things
168 // (I thought they weren't). We will need to bump the version number and perform this check on all 168 // (I thought they weren't). We will need to bump the version number and perform this check on all
169 // subsequent IAR versions only 169 // subsequent IAR versions only
170 ControlFileLoaded = true; 170 ControlFileLoaded = true;
171 } 171 }
@@ -188,19 +188,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
188 Exception reportedException = null; 188 Exception reportedException = null;
189 189
190 string filePath = "ERROR"; 190 string filePath = "ERROR";
191 191
192 List<InventoryFolderBase> folderCandidates 192 List<InventoryFolderBase> folderCandidates
193 = InventoryArchiveUtils.FindFoldersByPath( 193 = InventoryArchiveUtils.FindFoldersByPath(
194 m_InventoryService, m_userInfo.PrincipalID, m_invPath); 194 m_InventoryService, m_userInfo.PrincipalID, m_invPath);
195 195
196 if (folderCandidates.Count == 0) 196 if (folderCandidates.Count == 0)
197 { 197 {
198 // Possibly provide an option later on to automatically create this folder if it does not exist 198 // Possibly provide an option later on to automatically create this folder if it does not exist
199 m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); 199 m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath);
200 200
201 return m_loadedNodes; 201 return m_loadedNodes;
202 } 202 }
203 203
204 m_rootDestinationFolder = folderCandidates[0]; 204 m_rootDestinationFolder = folderCandidates[0];
205 archive = new TarArchiveReader(m_loadStream); 205 archive = new TarArchiveReader(m_loadStream);
206 byte[] data; 206 byte[] data;
@@ -211,7 +211,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
211 if (filePath == ArchiveConstants.CONTROL_FILE_PATH) 211 if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
212 { 212 {
213 LoadControlFile(filePath, data); 213 LoadControlFile(filePath, data);
214 } 214 }
215 else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) 215 else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
216 { 216 {
217 LoadAssetFile(filePath, data); 217 LoadAssetFile(filePath, data);
@@ -221,17 +221,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
221 LoadInventoryFile(filePath, entryType, data); 221 LoadInventoryFile(filePath, entryType, data);
222 } 222 }
223 } 223 }
224 224
225 archive.Close(); 225 archive.Close();
226 226
227 m_log.DebugFormat( 227 m_log.DebugFormat(
228 "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", 228 "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures",
229 m_successfulAssetRestores, m_failedAssetRestores); 229 m_successfulAssetRestores, m_failedAssetRestores);
230 230
231 //Alicia: When this is called by LibraryModule or Tests, m_module will be null as event is not required 231 //Alicia: When this is called by LibraryModule or Tests, m_module will be null as event is not required
232 if(m_module != null) 232 if(m_module != null)
233 m_module.TriggerInventoryArchiveLoaded(m_id, true, m_userInfo, m_invPath, m_loadStream, reportedException, m_successfulItemRestores); 233 m_module.TriggerInventoryArchiveLoaded(m_id, true, m_userInfo, m_invPath, m_loadStream, reportedException, m_successfulItemRestores);
234 234
235 return m_loadedNodes; 235 return m_loadedNodes;
236 } 236 }
237 catch(Exception Ex) 237 catch(Exception Ex)
@@ -268,8 +268,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
268 /// </param> 268 /// </param>
269 /// <returns>The last user inventory folder created or found for the archive path</returns> 269 /// <returns>The last user inventory folder created or found for the archive path</returns>
270 public InventoryFolderBase ReplicateArchivePathToUserInventory( 270 public InventoryFolderBase ReplicateArchivePathToUserInventory(
271 string iarPath, 271 string iarPath,
272 InventoryFolderBase rootDestFolder, 272 InventoryFolderBase rootDestFolder,
273 Dictionary <string, InventoryFolderBase> resolvedFolders, 273 Dictionary <string, InventoryFolderBase> resolvedFolders,
274 HashSet<InventoryNodeBase> loadedNodes) 274 HashSet<InventoryNodeBase> loadedNodes)
275 { 275 {
@@ -277,27 +277,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
277 277
278// m_log.DebugFormat( 278// m_log.DebugFormat(
279// "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); 279// "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID);
280 280
281 InventoryFolderBase destFolder 281 InventoryFolderBase destFolder
282 = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); 282 = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders);
283 283
284// m_log.DebugFormat( 284// m_log.DebugFormat(
285// "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", 285// "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]",
286// iarPath, iarPathExisting); 286// iarPath, iarPathExisting);
287 287
288 string iarPathToCreate = iarPath.Substring(iarPathExisting.Length); 288 string iarPathToCreate = iarPath.Substring(iarPathExisting.Length);
289 CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes); 289 CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes);
290 290
291 return destFolder; 291 return destFolder;
292 } 292 }
293 293
294 /// <summary> 294 /// <summary>
295 /// Resolve a destination folder 295 /// Resolve a destination folder
296 /// </summary> 296 /// </summary>
297 /// 297 ///
298 /// We require here a root destination folder (usually the root of the user's inventory) and the archive 298 /// We require here a root destination folder (usually the root of the user's inventory) and the archive
299 /// path. We also pass in a list of previously resolved folders in case we've found this one previously. 299 /// path. We also pass in a list of previously resolved folders in case we've found this one previously.
300 /// 300 ///
301 /// <param name="archivePath"> 301 /// <param name="archivePath">
302 /// The item archive path to resolve. The portion of the path passed back is that 302 /// The item archive path to resolve. The portion of the path passed back is that
303 /// which corresponds to the resolved desintation folder. 303 /// which corresponds to the resolved desintation folder.
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
321 while (archivePath.Length > 0) 321 while (archivePath.Length > 0)
322 { 322 {
323// m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); 323// m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath);
324 324
325 if (resolvedFolders.ContainsKey(archivePath)) 325 if (resolvedFolders.ContainsKey(archivePath))
326 { 326 {
327// m_log.DebugFormat( 327// m_log.DebugFormat(
@@ -332,13 +332,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
332 { 332 {
333 if (m_merge) 333 if (m_merge)
334 { 334 {
335 // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the 335 // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the
336 // iar name and try to find that instead. 336 // iar name and try to find that instead.
337 string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); 337 string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath);
338 List<InventoryFolderBase> folderCandidates 338 List<InventoryFolderBase> folderCandidates
339 = InventoryArchiveUtils.FindFoldersByPath( 339 = InventoryArchiveUtils.FindFoldersByPath(
340 m_InventoryService, m_userInfo.PrincipalID, plainPath); 340 m_InventoryService, m_userInfo.PrincipalID, plainPath);
341 341
342 if (folderCandidates.Count != 0) 342 if (folderCandidates.Count != 0)
343 { 343 {
344 InventoryFolderBase destFolder = folderCandidates[0]; 344 InventoryFolderBase destFolder = folderCandidates[0];
@@ -346,7 +346,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
346 return destFolder; 346 return destFolder;
347 } 347 }
348 } 348 }
349 349
350 // Don't include the last slash so find the penultimate one 350 // Don't include the last slash so find the penultimate one
351 int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); 351 int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2);
352 352
@@ -365,10 +365,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
365 } 365 }
366 } 366 }
367 } 367 }
368 368
369 return rootDestFolder; 369 return rootDestFolder;
370 } 370 }
371 371
372 /// <summary> 372 /// <summary>
373 /// Create a set of folders for the given path. 373 /// Create a set of folders for the given path.
374 /// </summary> 374 /// </summary>
@@ -388,10 +388,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
388 /// Track the inventory nodes created. 388 /// Track the inventory nodes created.
389 /// </param> 389 /// </param>
390 protected void CreateFoldersForPath( 390 protected void CreateFoldersForPath(
391 InventoryFolderBase destFolder, 391 InventoryFolderBase destFolder,
392 string iarPathExisting, 392 string iarPathExisting,
393 string iarPathToReplicate, 393 string iarPathToReplicate,
394 Dictionary <string, InventoryFolderBase> resolvedFolders, 394 Dictionary <string, InventoryFolderBase> resolvedFolders,
395 HashSet<InventoryNodeBase> loadedNodes) 395 HashSet<InventoryNodeBase> loadedNodes)
396 { 396 {
397 string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); 397 string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
@@ -402,7 +402,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
402 402
403 if (!rawDirsToCreate[i].Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) 403 if (!rawDirsToCreate[i].Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR))
404 continue; 404 continue;
405 405
406 int identicalNameIdentifierIndex 406 int identicalNameIdentifierIndex
407 = rawDirsToCreate[i].LastIndexOf( 407 = rawDirsToCreate[i].LastIndexOf(
408 ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); 408 ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR);
@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
412 newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); 412 newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName);
413 UUID newFolderId = UUID.Random(); 413 UUID newFolderId = UUID.Random();
414 414
415 destFolder 415 destFolder
416 = new InventoryFolderBase( 416 = new InventoryFolderBase(
417 newFolderId, newFolderName, m_userInfo.PrincipalID, 417 newFolderId, newFolderName, m_userInfo.PrincipalID,
418 (short)FolderType.None, destFolder.ID, 1); 418 (short)FolderType.None, destFolder.ID, 1);
@@ -427,7 +427,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
427 loadedNodes.Add(destFolder); 427 loadedNodes.Add(destFolder);
428 } 428 }
429 } 429 }
430 430
431 /// <summary> 431 /// <summary>
432 /// Load an item from the archive 432 /// Load an item from the archive
433 /// </summary> 433 /// </summary>
@@ -438,7 +438,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
438 protected InventoryItemBase LoadItem(byte[] data, InventoryFolderBase loadFolder) 438 protected InventoryItemBase LoadItem(byte[] data, InventoryFolderBase loadFolder)
439 { 439 {
440 InventoryItemBase item = UserInventoryItemSerializer.Deserialize(data); 440 InventoryItemBase item = UserInventoryItemSerializer.Deserialize(data);
441 441
442 // Don't use the item ID that's in the file 442 // Don't use the item ID that's in the file
443 item.ID = UUID.Random(); 443 item.ID = UUID.Random();
444 444
@@ -446,7 +446,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
446 if (UUID.Zero != ospResolvedId) // The user exists in this grid 446 if (UUID.Zero != ospResolvedId) // The user exists in this grid
447 { 447 {
448// m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId); 448// m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId);
449 449
450// item.CreatorIdAsUuid = ospResolvedId; 450// item.CreatorIdAsUuid = ospResolvedId;
451 451
452 // Don't preserve the OSPA in the creator id (which actually gets persisted to the 452 // Don't preserve the OSPA in the creator id (which actually gets persisted to the
@@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
474 474
475 if (!m_InventoryService.AddItem(item)) 475 if (!m_InventoryService.AddItem(item))
476 m_log.WarnFormat("[INVENTORY ARCHIVER]: Unable to save item {0} in folder {1}", item.Name, item.Folder); 476 m_log.WarnFormat("[INVENTORY ARCHIVER]: Unable to save item {0} in folder {1}", item.Name, item.Folder);
477 477
478 return item; 478 return item;
479 } 479 }
480 480
@@ -519,7 +519,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
519 data = SceneObjectSerializer.ModifySerializedObject(assetId, data, 519 data = SceneObjectSerializer.ModifySerializedObject(assetId, data,
520 sog => { 520 sog => {
521 bool modified = false; 521 bool modified = false;
522 522
523 foreach (SceneObjectPart sop in sog.Parts) 523 foreach (SceneObjectPart sop in sog.Parts)
524 { 524 {
525 if (string.IsNullOrEmpty(sop.CreatorData)) 525 if (string.IsNullOrEmpty(sop.CreatorData))
@@ -528,10 +528,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
528 modified = true; 528 modified = true;
529 } 529 }
530 } 530 }
531 531
532 return modified; 532 return modified;
533 }); 533 });
534 534
535 if (data == null) 535 if (data == null)
536 return false; 536 return false;
537 } 537 }
@@ -568,7 +568,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
568 int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value); 568 int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value);
569 int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value); 569 int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value);
570 string version = string.Format("{0}.{1}", majorVersion, minorVersion); 570 string version = string.Format("{0}.{1}", majorVersion, minorVersion);
571 571
572 if (majorVersion > MAX_MAJOR_VERSION) 572 if (majorVersion > MAX_MAJOR_VERSION)
573 { 573 {
574 throw new Exception( 574 throw new Exception(
@@ -576,38 +576,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
576 "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below", 576 "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below",
577 majorVersion, MAX_MAJOR_VERSION)); 577 majorVersion, MAX_MAJOR_VERSION));
578 } 578 }
579 579
580 ControlFileLoaded = true; 580 ControlFileLoaded = true;
581 m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); 581 m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
582 } 582 }
583 583
584 /// <summary> 584 /// <summary>
585 /// Load inventory file 585 /// Load inventory file
586 /// </summary> 586 /// </summary>
587 /// <param name="path"></param> 587 /// <param name="path"></param>
588 /// <param name="entryType"></param> 588 /// <param name="entryType"></param>
589 /// <param name="data"></param> 589 /// <param name="data"></param>
590 protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data) 590 protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data)
591 { 591 {
592 if (!ControlFileLoaded) 592 if (!ControlFileLoaded)
593 throw new Exception( 593 throw new Exception(
594 string.Format( 594 string.Format(
595 "The IAR you are trying to load does not list {0} before {1}. Aborting load", 595 "The IAR you are trying to load does not list {0} before {1}. Aborting load",
596 ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.INVENTORY_PATH)); 596 ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.INVENTORY_PATH));
597 597
598 if (m_assetsLoaded) 598 if (m_assetsLoaded)
599 throw new Exception( 599 throw new Exception(
600 string.Format( 600 string.Format(
601 "The IAR you are trying to load does not list all {0} before {1}. Aborting load", 601 "The IAR you are trying to load does not list all {0} before {1}. Aborting load",
602 ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); 602 ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH));
603 603
604 path = path.Substring(ArchiveConstants.INVENTORY_PATH.Length); 604 path = path.Substring(ArchiveConstants.INVENTORY_PATH.Length);
605 605
606 // Trim off the file portion if we aren't already dealing with a directory path 606 // Trim off the file portion if we aren't already dealing with a directory path
607 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType) 607 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType)
608 path = path.Remove(path.LastIndexOf("/") + 1); 608 path = path.Remove(path.LastIndexOf("/") + 1);
609 609
610 InventoryFolderBase foundFolder 610 InventoryFolderBase foundFolder
611 = ReplicateArchivePathToUserInventory( 611 = ReplicateArchivePathToUserInventory(
612 path, m_rootDestinationFolder, m_resolvedFolders, m_loadedNodes); 612 path, m_rootDestinationFolder, m_resolvedFolders, m_loadedNodes);
613 613
@@ -618,17 +618,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
618 if (item != null) 618 if (item != null)
619 { 619 {
620 m_successfulItemRestores++; 620 m_successfulItemRestores++;
621 621
622 // If we aren't loading the folder containing the item then well need to update the 622 // If we aren't loading the folder containing the item then well need to update the
623 // viewer separately for that item. 623 // viewer separately for that item.
624 if (!m_loadedNodes.Contains(foundFolder)) 624 if (!m_loadedNodes.Contains(foundFolder))
625 m_loadedNodes.Add(item); 625 m_loadedNodes.Add(item);
626 } 626 }
627 } 627 }
628 628
629 m_inventoryNodesLoaded = true; 629 m_inventoryNodesLoaded = true;
630 } 630 }
631 631
632 /// <summary> 632 /// <summary>
633 /// Load asset file 633 /// Load asset file
634 /// </summary> 634 /// </summary>
@@ -639,15 +639,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
639 if (!ControlFileLoaded) 639 if (!ControlFileLoaded)
640 throw new Exception( 640 throw new Exception(
641 string.Format( 641 string.Format(
642 "The IAR you are trying to load does not list {0} before {1}. Aborting load", 642 "The IAR you are trying to load does not list {0} before {1}. Aborting load",
643 ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.ASSETS_PATH)); 643 ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.ASSETS_PATH));
644 644
645 if (!m_inventoryNodesLoaded) 645 if (!m_inventoryNodesLoaded)
646 throw new Exception( 646 throw new Exception(
647 string.Format( 647 string.Format(
648 "The IAR you are trying to load does not list all {0} before {1}. Aborting load", 648 "The IAR you are trying to load does not list all {0} before {1}. Aborting load",
649 ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); 649 ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH));
650 650
651 if (LoadAsset(path, data)) 651 if (LoadAsset(path, data))
652 m_successfulAssetRestores++; 652 m_successfulAssetRestores++;
653 else 653 else
@@ -655,10 +655,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
655 655
656 if ((m_successfulAssetRestores) % 50 == 0) 656 if ((m_successfulAssetRestores) % 50 == 0)
657 m_log.DebugFormat( 657 m_log.DebugFormat(
658 "[INVENTORY ARCHIVER]: Loaded {0} assets...", 658 "[INVENTORY ARCHIVER]: Loaded {0} assets...",
659 m_successfulAssetRestores); 659 m_successfulAssetRestores);
660 660
661 m_assetsLoaded = true; 661 m_assetsLoaded = true;
662 } 662 }
663 } 663 }
664} 664}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index dbaf2aa..b66aad5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
69 /// The path to the required folder. 69 /// The path to the required folder.
70 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. 70 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
71 /// </param> 71 /// </param>
72 /// <returns>The folder found. Please note that if there are multiple folders with the same name then an 72 /// <returns>The folder found. Please note that if there are multiple folders with the same name then an
73 /// unspecified one will be returned. If no such folder eixsts then null is returned</returns> 73 /// unspecified one will be returned. If no such folder eixsts then null is returned</returns>
74 public static InventoryFolderBase FindFolderByPath( 74 public static InventoryFolderBase FindFolderByPath(
75 IInventoryService inventoryService, UUID userId, string path) 75 IInventoryService inventoryService, UUID userId, string path)
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
102 /// The path to the required folder. 102 /// The path to the required folder.
103 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. 103 /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned.
104 /// </param> 104 /// </param>
105 /// <returns>The folder found. Please note that if there are multiple folders with the same name then an 105 /// <returns>The folder found. Please note that if there are multiple folders with the same name then an
106 /// unspecified one will be returned. If no such folder eixsts then null is returned</returns> 106 /// unspecified one will be returned. If no such folder eixsts then null is returned</returns>
107 public static InventoryFolderBase FindFolderByPath( 107 public static InventoryFolderBase FindFolderByPath(
108 IInventoryService inventoryService, InventoryFolderBase startFolder, string path) 108 IInventoryService inventoryService, InventoryFolderBase startFolder, string path)
@@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
149 149
150 return FindFoldersByPath(inventoryService, rootFolder, path); 150 return FindFoldersByPath(inventoryService, rootFolder, path);
151 } 151 }
152 152
153 /// <summary> 153 /// <summary>
154 /// Find a set of folders given a PATH_DELIMITER delimited path starting from this folder 154 /// Find a set of folders given a PATH_DELIMITER delimited path starting from this folder
155 /// </summary> 155 /// </summary>
@@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
175 IInventoryService inventoryService, InventoryFolderBase startFolder, string path) 175 IInventoryService inventoryService, InventoryFolderBase startFolder, string path)
176 { 176 {
177 List<InventoryFolderBase> foundFolders = new List<InventoryFolderBase>(); 177 List<InventoryFolderBase> foundFolders = new List<InventoryFolderBase>();
178 178
179 if (path == string.Empty) 179 if (path == string.Empty)
180 { 180 {
181 foundFolders.Add(startFolder); 181 foundFolders.Add(startFolder);
@@ -189,17 +189,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
189 foundFolders.Add(startFolder); 189 foundFolders.Add(startFolder);
190 return foundFolders; 190 return foundFolders;
191 } 191 }
192 192
193 // If the path isn't just / then trim any starting extraneous slashes 193 // If the path isn't just / then trim any starting extraneous slashes
194 path = path.TrimStart(new char[] { PATH_DELIMITER }); 194 path = path.TrimStart(new char[] { PATH_DELIMITER });
195 195
196// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Adjusted path in FindFolderByPath() is [{0}]", path); 196// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Adjusted path in FindFolderByPath() is [{0}]", path);
197 197
198 string[] components = SplitEscapedPath(path); 198 string[] components = SplitEscapedPath(path);
199 components[0] = UnescapePath(components[0]); 199 components[0] = UnescapePath(components[0]);
200 200
201 //string[] components = path.Split(new string[] { PATH_DELIMITER.ToString() }, 2, StringSplitOptions.None); 201 //string[] components = path.Split(new string[] { PATH_DELIMITER.ToString() }, 2, StringSplitOptions.None);
202 202
203 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); 203 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID);
204 204
205// m_log.DebugFormat( 205// m_log.DebugFormat(
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
230 /// 230 ///
231 /// FIXME: Delimitors which occur in names themselves are not currently escapable. 231 /// FIXME: Delimitors which occur in names themselves are not currently escapable.
232 /// </remarks> 232 /// </remarks>
233 /// 233 ///
234 /// <param name="inventoryService"> 234 /// <param name="inventoryService">
235 /// Inventory service to query 235 /// Inventory service to query
236 /// </param> 236 /// </param>
@@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
301 /// 301 ///
302 /// FIXME: Delimitors which occur in names themselves are not currently escapable. 302 /// FIXME: Delimitors which occur in names themselves are not currently escapable.
303 /// </remarks> 303 /// </remarks>
304 /// 304 ///
305 /// <param name="inventoryService">Inventory service to query</param> 305 /// <param name="inventoryService">Inventory service to query</param>
306 /// <param name="startFolder">The folder from which the path starts</param> 306 /// <param name="startFolder">The folder from which the path starts</param>
307 /// <param name="path">The path to the required item.</param> 307 /// <param name="path">The path to the required item.</param>
@@ -313,10 +313,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
313 313
314 // If the path isn't just / then trim any starting extraneous slashes 314 // If the path isn't just / then trim any starting extraneous slashes
315 path = path.TrimStart(new char[] { PATH_DELIMITER }); 315 path = path.TrimStart(new char[] { PATH_DELIMITER });
316 316
317 string[] components = SplitEscapedPath(path); 317 string[] components = SplitEscapedPath(path);
318 components[0] = UnescapePath(components[0]); 318 components[0] = UnescapePath(components[0]);
319 319
320 //string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); 320 //string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None);
321 321
322 if (components.Length == 1) 322 if (components.Length == 1)
@@ -324,15 +324,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
324// m_log.DebugFormat( 324// m_log.DebugFormat(
325// "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}", 325// "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}",
326// components[0], startFolder.Name, startFolder.ID); 326// components[0], startFolder.Name, startFolder.ID);
327 327
328 List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); 328 List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID);
329 329
330// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count); 330// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count);
331 331
332 foreach (InventoryItemBase item in items) 332 foreach (InventoryItemBase item in items)
333 { 333 {
334// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID); 334// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID);
335 335
336 if (item.Name == components[0]) 336 if (item.Name == components[0])
337 foundItems.Add(item); 337 foundItems.Add(item);
338 } 338 }
@@ -342,7 +342,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
342// m_log.DebugFormat("FOUND COMPONENTS [{0}] and [{1}]", components[0], components[1]); 342// m_log.DebugFormat("FOUND COMPONENTS [{0}] and [{1}]", components[0], components[1]);
343 343
344 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); 344 InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID);
345 345
346 foreach (InventoryFolderBase folder in contents.Folders) 346 foreach (InventoryFolderBase folder in contents.Folders)
347 { 347 {
348 if (folder.Name == components[0]) 348 if (folder.Name == components[0])
@@ -365,9 +365,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
365 public static string[] SplitEscapedPath(string path) 365 public static string[] SplitEscapedPath(string path)
366 { 366 {
367// m_log.DebugFormat("SPLITTING PATH {0}", path); 367// m_log.DebugFormat("SPLITTING PATH {0}", path);
368 368
369 bool singleEscapeChar = false; 369 bool singleEscapeChar = false;
370 370
371 for (int i = 0; i < path.Length; i++) 371 for (int i = 0; i < path.Length; i++)
372 { 372 {
373 if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar) 373 if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar)
@@ -395,7 +395,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
395 public static string UnescapePath(string path) 395 public static string UnescapePath(string path)
396 { 396 {
397// m_log.DebugFormat("ESCAPING PATH {0}", path); 397// m_log.DebugFormat("ESCAPING PATH {0}", path);
398 398
399 StringBuilder sb = new StringBuilder(); 399 StringBuilder sb = new StringBuilder();
400 400
401 bool singleEscapeChar = false; 401 bool singleEscapeChar = false;
@@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
418 } 418 }
419 419
420// m_log.DebugFormat("ESCAPED PATH TO {0}", sb); 420// m_log.DebugFormat("ESCAPED PATH TO {0}", sb);
421 421
422 return sb.ToString(); 422 return sb.ToString();
423 } 423 }
424 424
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 8847414..be59eb5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -172,7 +172,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
172 172
173 public string Name { get { return "Inventory Archiver Module"; } } 173 public string Name { get { return "Inventory Archiver Module"; } }
174 174
175 #endregion 175 #endregion
176 176
177 /// <summary> 177 /// <summary>
178 /// Trigger the inventory archive saved event. 178 /// Trigger the inventory archive saved event.
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs
index c2e645f..f559c2e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs
@@ -56,23 +56,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
56 { 56 {
57 TestHelpers.InMethod(); 57 TestHelpers.InMethod();
58// log4net.Config.XmlConfigurator.Configure(); 58// log4net.Config.XmlConfigurator.Configure();
59 59
60 SerialiserModule serialiserModule = new SerialiserModule(); 60 SerialiserModule serialiserModule = new SerialiserModule();
61 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 61 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
62 62
63 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 63 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
64 Scene scene = new SceneHelpers().SetupScene(); 64 Scene scene = new SceneHelpers().SetupScene();
65 65
66 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 66 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
67 67
68 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); 68 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood");
69 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 69 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
70 70
71 archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); 71 archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
72 InventoryItemBase foundItem1 72 InventoryItemBase foundItem1
73 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); 73 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name);
74 74
75 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); 75 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
76 76
77 // Now try loading to a root child folder 77 // Now try loading to a root child folder
78 UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false); 78 UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false);
@@ -90,9 +90,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
90 90
91 InventoryItemBase foundItem3 91 InventoryItemBase foundItem3
92 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name); 92 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name);
93 Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); 93 Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3");
94 } 94 }
95 95
96 /// <summary> 96 /// <summary>
97 /// Test that things work when the load path specified starts with a slash 97 /// Test that things work when the load path specified starts with a slash
98 /// </summary> 98 /// </summary>
@@ -101,22 +101,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
101 { 101 {
102 TestHelpers.InMethod(); 102 TestHelpers.InMethod();
103// log4net.Config.XmlConfigurator.Configure(); 103// log4net.Config.XmlConfigurator.Configure();
104 104
105 SerialiserModule serialiserModule = new SerialiserModule(); 105 SerialiserModule serialiserModule = new SerialiserModule();
106 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 106 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
107 Scene scene = new SceneHelpers().SetupScene(); 107 Scene scene = new SceneHelpers().SetupScene();
108 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 108 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
109 109
110 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); 110 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
111 archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); 111 archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream);
112 112
113 InventoryItemBase foundItem1 113 InventoryItemBase foundItem1
114 = InventoryArchiveUtils.FindItemByPath( 114 = InventoryArchiveUtils.FindItemByPath(
115 scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name); 115 scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name);
116 116
117 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); 117 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()");
118 } 118 }
119 119
120 [Test] 120 [Test]
121 public void TestLoadIarPathWithEscapedChars() 121 public void TestLoadIarPathWithEscapedChars()
122 { 122 {
@@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
137 string userLastName = "Stirrup"; 137 string userLastName = "Stirrup";
138 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); 138 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
139 UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); 139 UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood");
140 140
141 // Create asset 141 // Create asset
142 SceneObjectGroup object1; 142 SceneObjectGroup object1;
143 SceneObjectPart part1; 143 SceneObjectPart part1;
@@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
168 item1.Name = itemName; 168 item1.Name = itemName;
169 item1.AssetID = asset1.FullID; 169 item1.AssetID = asset1.FullID;
170 item1.ID = item1Id; 170 item1.ID = item1Id;
171 InventoryFolderBase objsFolder 171 InventoryFolderBase objsFolder
172 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, "Objects")[0]; 172 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, "Objects")[0];
173 item1.Folder = objsFolder.ID; 173 item1.Folder = objsFolder.ID;
174 scene.AddInventoryItem(item1); 174 scene.AddInventoryItem(item1);
@@ -189,16 +189,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
189 InventoryItemBase foundItem1 189 InventoryItemBase foundItem1
190 = InventoryArchiveUtils.FindItemByPath( 190 = InventoryArchiveUtils.FindItemByPath(
191 scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); 191 scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName);
192 192
193 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); 193 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
194// Assert.That( 194// Assert.That(
195// foundItem1.CreatorId, Is.EqualTo(userUuid), 195// foundItem1.CreatorId, Is.EqualTo(userUuid),
196// "Loaded item non-uuid creator doesn't match that of the loading user"); 196// "Loaded item non-uuid creator doesn't match that of the loading user");
197 Assert.That( 197 Assert.That(
198 foundItem1.Name, Is.EqualTo(itemName), 198 foundItem1.Name, Is.EqualTo(itemName),
199 "Loaded item name doesn't match saved name"); 199 "Loaded item name doesn't match saved name");
200 } 200 }
201 201
202 /// <summary> 202 /// <summary>
203 /// Test replication of an archive path to the user's inventory. 203 /// Test replication of an archive path to the user's inventory.
204 /// </summary> 204 /// </summary>
@@ -207,21 +207,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
207 { 207 {
208 TestHelpers.InMethod(); 208 TestHelpers.InMethod();
209// log4net.Config.XmlConfigurator.Configure(); 209// log4net.Config.XmlConfigurator.Configure();
210 210
211 Scene scene = new SceneHelpers().SetupScene(); 211 Scene scene = new SceneHelpers().SetupScene();
212 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 212 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
213 213
214 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); 214 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
215 HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>(); 215 HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>();
216 216
217 string folder1Name = "1"; 217 string folder1Name = "1";
218 string folder2aName = "2a"; 218 string folder2aName = "2a";
219 string folder2bName = "2b"; 219 string folder2bName = "2b";
220 220
221 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random()); 221 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random());
222 string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); 222 string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random());
223 string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); 223 string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random());
224 224
225 string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); 225 string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName });
226 string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); 226 string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName });
227 227
@@ -229,42 +229,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
229 // Test replication of path1 229 // Test replication of path1
230 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) 230 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false)
231 .ReplicateArchivePathToUserInventory( 231 .ReplicateArchivePathToUserInventory(
232 iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), 232 iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
233 foldersCreated, nodesLoaded); 233 foldersCreated, nodesLoaded);
234 234
235 List<InventoryFolderBase> folder1Candidates 235 List<InventoryFolderBase> folder1Candidates
236 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); 236 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name);
237 Assert.That(folder1Candidates.Count, Is.EqualTo(1)); 237 Assert.That(folder1Candidates.Count, Is.EqualTo(1));
238 238
239 InventoryFolderBase folder1 = folder1Candidates[0]; 239 InventoryFolderBase folder1 = folder1Candidates[0];
240 List<InventoryFolderBase> folder2aCandidates 240 List<InventoryFolderBase> folder2aCandidates
241 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); 241 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName);
242 Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); 242 Assert.That(folder2aCandidates.Count, Is.EqualTo(1));
243 } 243 }
244 244
245 { 245 {
246 // Test replication of path2 246 // Test replication of path2
247 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) 247 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false)
248 .ReplicateArchivePathToUserInventory( 248 .ReplicateArchivePathToUserInventory(
249 iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), 249 iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
250 foldersCreated, nodesLoaded); 250 foldersCreated, nodesLoaded);
251 251
252 List<InventoryFolderBase> folder1Candidates 252 List<InventoryFolderBase> folder1Candidates
253 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); 253 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name);
254 Assert.That(folder1Candidates.Count, Is.EqualTo(1)); 254 Assert.That(folder1Candidates.Count, Is.EqualTo(1));
255 255
256 InventoryFolderBase folder1 = folder1Candidates[0]; 256 InventoryFolderBase folder1 = folder1Candidates[0];
257 257
258 List<InventoryFolderBase> folder2aCandidates 258 List<InventoryFolderBase> folder2aCandidates
259 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); 259 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName);
260 Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); 260 Assert.That(folder2aCandidates.Count, Is.EqualTo(1));
261 261
262 List<InventoryFolderBase> folder2bCandidates 262 List<InventoryFolderBase> folder2bCandidates
263 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2bName); 263 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2bName);
264 Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); 264 Assert.That(folder2bCandidates.Count, Is.EqualTo(1));
265 } 265 }
266 } 266 }
267 267
268 /// <summary> 268 /// <summary>
269 /// Test replication of a partly existing archive path to the user's inventory. This should create 269 /// Test replication of a partly existing archive path to the user's inventory. This should create
270 /// a duplicate path without the merge option. 270 /// a duplicate path without the merge option.
@@ -274,31 +274,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
274 { 274 {
275 TestHelpers.InMethod(); 275 TestHelpers.InMethod();
276 //log4net.Config.XmlConfigurator.Configure(); 276 //log4net.Config.XmlConfigurator.Configure();
277 277
278 Scene scene = new SceneHelpers().SetupScene(); 278 Scene scene = new SceneHelpers().SetupScene();
279 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 279 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
280 280
281 string folder1ExistingName = "a"; 281 string folder1ExistingName = "a";
282 string folder2Name = "b"; 282 string folder2Name = "b";
283 283
284 InventoryFolderBase folder1 284 InventoryFolderBase folder1
285 = UserInventoryHelpers.CreateInventoryFolder( 285 = UserInventoryHelpers.CreateInventoryFolder(
286 scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); 286 scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false);
287 287
288 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); 288 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random());
289 string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); 289 string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random());
290 290
291 string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); 291 string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName });
292 292
293 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) 293 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false)
294 .ReplicateArchivePathToUserInventory( 294 .ReplicateArchivePathToUserInventory(
295 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), 295 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
296 new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); 296 new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>());
297 297
298 List<InventoryFolderBase> folder1PostCandidates 298 List<InventoryFolderBase> folder1PostCandidates
299 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); 299 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
300 Assert.That(folder1PostCandidates.Count, Is.EqualTo(2)); 300 Assert.That(folder1PostCandidates.Count, Is.EqualTo(2));
301 301
302 // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder. 302 // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder.
303 InventoryFolderBase folder1Post = null; 303 InventoryFolderBase folder1Post = null;
304 foreach (InventoryFolderBase folder in folder1PostCandidates) 304 foreach (InventoryFolderBase folder in folder1PostCandidates)
@@ -311,11 +311,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
311 } 311 }
312// Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); 312// Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID));
313 313
314 List<InventoryFolderBase> folder2PostCandidates 314 List<InventoryFolderBase> folder2PostCandidates
315 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1Post, "b"); 315 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1Post, "b");
316 Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); 316 Assert.That(folder2PostCandidates.Count, Is.EqualTo(1));
317 } 317 }
318 318
319 /// <summary> 319 /// <summary>
320 /// Test replication of a partly existing archive path to the user's inventory. This should create 320 /// Test replication of a partly existing archive path to the user's inventory. This should create
321 /// a merged path. 321 /// a merged path.
@@ -325,33 +325,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
325 { 325 {
326 TestHelpers.InMethod(); 326 TestHelpers.InMethod();
327// log4net.Config.XmlConfigurator.Configure(); 327// log4net.Config.XmlConfigurator.Configure();
328 328
329 Scene scene = new SceneHelpers().SetupScene(); 329 Scene scene = new SceneHelpers().SetupScene();
330 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 330 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
331 331
332 string folder1ExistingName = "a"; 332 string folder1ExistingName = "a";
333 string folder2Name = "b"; 333 string folder2Name = "b";
334 334
335 InventoryFolderBase folder1 335 InventoryFolderBase folder1
336 = UserInventoryHelpers.CreateInventoryFolder( 336 = UserInventoryHelpers.CreateInventoryFolder(
337 scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); 337 scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false);
338 338
339 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); 339 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random());
340 string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); 340 string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random());
341 341
342 string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); 342 string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName });
343 343
344 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true) 344 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true)
345 .ReplicateArchivePathToUserInventory( 345 .ReplicateArchivePathToUserInventory(
346 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), 346 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
347 new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); 347 new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>());
348 348
349 List<InventoryFolderBase> folder1PostCandidates 349 List<InventoryFolderBase> folder1PostCandidates
350 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); 350 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
351 Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); 351 Assert.That(folder1PostCandidates.Count, Is.EqualTo(1));
352 Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); 352 Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID));
353 353
354 List<InventoryFolderBase> folder2PostCandidates 354 List<InventoryFolderBase> folder2PostCandidates
355 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1PostCandidates[0], "b"); 355 = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1PostCandidates[0], "b");
356 Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); 356 Assert.That(folder2PostCandidates.Count, Is.EqualTo(1));
357 } 357 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs
index 57b4f80..d0bdc91 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
47{ 47{
48 [TestFixture] 48 [TestFixture]
49 public class InventoryArchiveLoadTests : InventoryArchiveTestCase 49 public class InventoryArchiveLoadTests : InventoryArchiveTestCase
50 { 50 {
51 protected TestScene m_scene; 51 protected TestScene m_scene;
52 protected InventoryArchiverModule m_archiverModule; 52 protected InventoryArchiverModule m_archiverModule;
53 53
@@ -55,12 +55,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
55 public override void SetUp() 55 public override void SetUp()
56 { 56 {
57 base.SetUp(); 57 base.SetUp();
58 58
59 SerialiserModule serialiserModule = new SerialiserModule(); 59 SerialiserModule serialiserModule = new SerialiserModule();
60 m_archiverModule = new InventoryArchiverModule(); 60 m_archiverModule = new InventoryArchiverModule();
61 61
62 m_scene = new SceneHelpers().SetupScene(); 62 m_scene = new SceneHelpers().SetupScene();
63 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); 63 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
64 } 64 }
65 65
66 [Test] 66 [Test]
@@ -68,35 +68,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
68 { 68 {
69 TestHelpers.InMethod(); 69 TestHelpers.InMethod();
70// TestHelpers.EnableLogging(); 70// TestHelpers.EnableLogging();
71 71
72 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); 72 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password");
73 m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream); 73 m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream);
74 74
75 InventoryItemBase coaItem 75 InventoryItemBase coaItem
76 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName); 76 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName);
77 77
78 Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1"); 78 Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1");
79 79
80 string assetXml = AssetHelpers.ReadAssetAsString(m_scene.AssetService, coaItem.AssetID); 80 string assetXml = AssetHelpers.ReadAssetAsString(m_scene.AssetService, coaItem.AssetID);
81 81
82 CoalescedSceneObjects coa; 82 CoalescedSceneObjects coa;
83 bool readResult = CoalescedSceneObjectsSerializer.TryFromXml(assetXml, out coa); 83 bool readResult = CoalescedSceneObjectsSerializer.TryFromXml(assetXml, out coa);
84 84
85 Assert.That(readResult, Is.True); 85 Assert.That(readResult, Is.True);
86 Assert.That(coa.Count, Is.EqualTo(2)); 86 Assert.That(coa.Count, Is.EqualTo(2));
87 87
88 List<SceneObjectGroup> coaObjects = coa.Objects; 88 List<SceneObjectGroup> coaObjects = coa.Objects;
89 Assert.That(coaObjects[0].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000120"))); 89 Assert.That(coaObjects[0].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000120")));
90 Assert.That(coaObjects[0].AbsolutePosition, Is.EqualTo(new Vector3(15, 30, 45))); 90 Assert.That(coaObjects[0].AbsolutePosition, Is.EqualTo(new Vector3(15, 30, 45)));
91 91
92 Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140"))); 92 Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140")));
93 Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75))); 93 Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75)));
94 } 94 }
95 95
96 /// <summary> 96 /// <summary>
97 /// Test case where a creator account exists for the creator UUID embedded in item metadata and serialized 97 /// Test case where a creator account exists for the creator UUID embedded in item metadata and serialized
98 /// objects. 98 /// objects.
99 /// </summary> 99 /// </summary>
100 [Test] 100 [Test]
101 public void TestLoadIarCreatorAccountPresent() 101 public void TestLoadIarCreatorAccountPresent()
102 { 102 {
@@ -105,26 +105,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
105 105
106 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); 106 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
107 107
108 m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream); 108 m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream);
109 InventoryItemBase foundItem1 109 InventoryItemBase foundItem1
110 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_item1Name); 110 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_item1Name);
111 111
112 Assert.That( 112 Assert.That(
113 foundItem1.CreatorId, Is.EqualTo(m_uaLL1.PrincipalID.ToString()), 113 foundItem1.CreatorId, Is.EqualTo(m_uaLL1.PrincipalID.ToString()),
114 "Loaded item non-uuid creator doesn't match original"); 114 "Loaded item non-uuid creator doesn't match original");
115 Assert.That( 115 Assert.That(
116 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL1.PrincipalID), 116 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL1.PrincipalID),
117 "Loaded item uuid creator doesn't match original"); 117 "Loaded item uuid creator doesn't match original");
118 Assert.That(foundItem1.Owner, Is.EqualTo(m_uaLL1.PrincipalID), 118 Assert.That(foundItem1.Owner, Is.EqualTo(m_uaLL1.PrincipalID),
119 "Loaded item owner doesn't match inventory reciever"); 119 "Loaded item owner doesn't match inventory reciever");
120 120
121 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); 121 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString());
122 string xmlData = Utils.BytesToString(asset1.Data); 122 string xmlData = Utils.BytesToString(asset1.Data);
123 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 123 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
124 124
125 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID)); 125 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID));
126 } 126 }
127 127
128// /// <summary> 128// /// <summary>
129// /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where 129// /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
130// /// an account exists with the same name as the creator, though not the same id. 130// /// an account exists with the same name as the creator, though not the same id.
@@ -137,24 +137,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
137// 137//
138// UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); 138// UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
139// UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); 139// UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire");
140// 140//
141// m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); 141// m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
142// InventoryItemBase foundItem1 142// InventoryItemBase foundItem1
143// = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); 143// = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name);
144// 144//
145// Assert.That( 145// Assert.That(
146// foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()), 146// foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()),
147// "Loaded item non-uuid creator doesn't match original"); 147// "Loaded item non-uuid creator doesn't match original");
148// Assert.That( 148// Assert.That(
149// foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID), 149// foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID),
150// "Loaded item uuid creator doesn't match original"); 150// "Loaded item uuid creator doesn't match original");
151// Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID), 151// Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID),
152// "Loaded item owner doesn't match inventory reciever"); 152// "Loaded item owner doesn't match inventory reciever");
153// 153//
154// AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); 154// AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString());
155// string xmlData = Utils.BytesToString(asset1.Data); 155// string xmlData = Utils.BytesToString(asset1.Data);
156// SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 156// SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
157// 157//
158// Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID)); 158// Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID));
159// } 159// }
160 160
@@ -167,26 +167,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
167 { 167 {
168 TestHelpers.InMethod(); 168 TestHelpers.InMethod();
169// log4net.Config.XmlConfigurator.Configure(); 169// log4net.Config.XmlConfigurator.Configure();
170 170
171 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); 171 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password");
172 m_archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream); 172 m_archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream);
173 173
174 InventoryItemBase foundItem1 174 InventoryItemBase foundItem1
175 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); 175 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name);
176 176
177 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); 177 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
178 Assert.That( 178 Assert.That(
179 foundItem1.CreatorId, Is.EqualTo(m_uaMT.PrincipalID.ToString()), 179 foundItem1.CreatorId, Is.EqualTo(m_uaMT.PrincipalID.ToString()),
180 "Loaded item non-uuid creator doesn't match that of the loading user"); 180 "Loaded item non-uuid creator doesn't match that of the loading user");
181 Assert.That( 181 Assert.That(
182 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaMT.PrincipalID), 182 foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaMT.PrincipalID),
183 "Loaded item uuid creator doesn't match that of the loading user"); 183 "Loaded item uuid creator doesn't match that of the loading user");
184 184
185 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); 185 AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString());
186 string xmlData = Utils.BytesToString(asset1.Data); 186 string xmlData = Utils.BytesToString(asset1.Data);
187 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 187 SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
188 188
189 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaMT.PrincipalID)); 189 Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaMT.PrincipalID));
190 } 190 }
191 } 191 }
192} \ No newline at end of file 192} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs
index 7265405..bd112b4 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs
@@ -50,19 +50,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
50 { 50 {
51 protected TestScene m_scene; 51 protected TestScene m_scene;
52 protected InventoryArchiverModule m_archiverModule; 52 protected InventoryArchiverModule m_archiverModule;
53 53
54 [SetUp] 54 [SetUp]
55 public override void SetUp() 55 public override void SetUp()
56 { 56 {
57 base.SetUp(); 57 base.SetUp();
58 58
59 SerialiserModule serialiserModule = new SerialiserModule(); 59 SerialiserModule serialiserModule = new SerialiserModule();
60 m_archiverModule = new InventoryArchiverModule(); 60 m_archiverModule = new InventoryArchiverModule();
61 61
62 m_scene = new SceneHelpers().SetupScene(); 62 m_scene = new SceneHelpers().SetupScene();
63 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); 63 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
64 } 64 }
65 65
66 /// <summary> 66 /// <summary>
67 /// Test that the IAR has the required files in the right order. 67 /// Test that the IAR has the required files in the right order.
68 /// </summary> 68 /// </summary>
@@ -73,20 +73,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
73 public void TestOrder() 73 public void TestOrder()
74 { 74 {
75 TestHelpers.InMethod(); 75 TestHelpers.InMethod();
76// log4net.Config.XmlConfigurator.Configure(); 76// log4net.Config.XmlConfigurator.Configure();
77 77
78 MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes); 78 MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes);
79 TarArchiveReader tar = new TarArchiveReader(archiveReadStream); 79 TarArchiveReader tar = new TarArchiveReader(archiveReadStream);
80 string filePath; 80 string filePath;
81 TarArchiveReader.TarEntryType tarEntryType; 81 TarArchiveReader.TarEntryType tarEntryType;
82 82
83 byte[] data = tar.ReadEntry(out filePath, out tarEntryType); 83 byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
84 Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); 84 Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
85 85
86 InventoryArchiveReadRequest iarr 86 InventoryArchiveReadRequest iarr
87 = new InventoryArchiveReadRequest(UUID.Random(), null, null, null, null, null, null, (Stream)null, false); 87 = new InventoryArchiveReadRequest(UUID.Random(), null, null, null, null, null, null, (Stream)null, false);
88 iarr.LoadControlFile(filePath, data); 88 iarr.LoadControlFile(filePath, data);
89 89
90 Assert.That(iarr.ControlFileLoaded, Is.True); 90 Assert.That(iarr.ControlFileLoaded, Is.True);
91 } 91 }
92 92
@@ -119,22 +119,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
119// InventoryArchiveUtils. 119// InventoryArchiveUtils.
120 bool gotObjectsFolder = false; 120 bool gotObjectsFolder = false;
121 121
122 string objectsFolderName 122 string objectsFolderName
123 = string.Format( 123 = string.Format(
124 "{0}{1}", 124 "{0}{1}",
125 ArchiveConstants.INVENTORY_PATH, 125 ArchiveConstants.INVENTORY_PATH,
126 InventoryArchiveWriteRequest.CreateArchiveFolderName( 126 InventoryArchiveWriteRequest.CreateArchiveFolderName(
127 UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, userId, "Objects"))); 127 UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, userId, "Objects")));
128 128
129 string filePath; 129 string filePath;
130 TarArchiveReader.TarEntryType tarEntryType; 130 TarArchiveReader.TarEntryType tarEntryType;
131 131
132 while (tar.ReadEntry(out filePath, out tarEntryType) != null) 132 while (tar.ReadEntry(out filePath, out tarEntryType) != null)
133 { 133 {
134// Console.WriteLine("Got {0}", filePath); 134// Console.WriteLine("Got {0}", filePath);
135 135
136 // Lazily, we only bother to look for the system objects folder created when we call CreateUserWithInventory() 136 // Lazily, we only bother to look for the system objects folder created when we call CreateUserWithInventory()
137 // XXX: But really we need to stop all that stuff being created in tests or check for such folders 137 // XXX: But really we need to stop all that stuff being created in tests or check for such folders
138 // more thoroughly 138 // more thoroughly
139 if (filePath == objectsFolderName) 139 if (filePath == objectsFolderName)
140 gotObjectsFolder = true; 140 gotObjectsFolder = true;
@@ -157,19 +157,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
157 UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); 157 UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword);
158 158
159 // Create base folder 159 // Create base folder
160 InventoryFolderBase f1 160 InventoryFolderBase f1
161 = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1", true); 161 = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1", true);
162 162
163 // Create item1 163 // Create item1
164 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Dog Object", 0x5); 164 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Dog Object", 0x5);
165 InventoryItemBase i1 = UserInventoryHelpers.AddInventoryItem(m_scene, so1, 0x50, 0x60, "f1"); 165 InventoryItemBase i1 = UserInventoryHelpers.AddInventoryItem(m_scene, so1, 0x50, 0x60, "f1");
166 166
167 // Create embedded folder 167 // Create embedded folder
168 InventoryFolderBase f1_1 168 InventoryFolderBase f1_1
169 = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1/f1.1", true); 169 = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1/f1.1", true);
170 170
171 // Create embedded item 171 // Create embedded item
172 SceneObjectGroup so1_1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Cat Object", 0x6); 172 SceneObjectGroup so1_1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Cat Object", 0x6);
173 InventoryItemBase i2 = UserInventoryHelpers.AddInventoryItem(m_scene, so1_1, 0x500, 0x600, "f1/f1.1"); 173 InventoryItemBase i2 = UserInventoryHelpers.AddInventoryItem(m_scene, so1_1, 0x500, 0x600, "f1/f1.1");
174 174
175 MemoryStream archiveWriteStream = new MemoryStream(); 175 MemoryStream archiveWriteStream = new MemoryStream();
@@ -188,18 +188,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
188// InventoryArchiveUtils. 188// InventoryArchiveUtils.
189 bool gotf1 = false, gotf1_1 = false, gotso1 = false, gotso2 = false; 189 bool gotf1 = false, gotf1_1 = false, gotso1 = false, gotso2 = false;
190 190
191 string f1FileName 191 string f1FileName
192 = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1)); 192 = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1));
193 string f1_1FileName 193 string f1_1FileName
194 = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1_1)); 194 = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1_1));
195 string so1FileName 195 string so1FileName
196 = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i1)); 196 = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i1));
197 string so2FileName 197 string so2FileName
198 = string.Format("{0}{1}", f1_1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i2)); 198 = string.Format("{0}{1}", f1_1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i2));
199 199
200 string filePath; 200 string filePath;
201 TarArchiveReader.TarEntryType tarEntryType; 201 TarArchiveReader.TarEntryType tarEntryType;
202 202
203 while (tar.ReadEntry(out filePath, out tarEntryType) != null) 203 while (tar.ReadEntry(out filePath, out tarEntryType) != null)
204 { 204 {
205// Console.WriteLine("Got {0}", filePath); 205// Console.WriteLine("Got {0}", filePath);
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
222 222
223 // TODO: Test presence of more files and contents of files. 223 // TODO: Test presence of more files and contents of files.
224 } 224 }
225 225
226 /// <summary> 226 /// <summary>
227 /// Test saving a single inventory item to an IAR 227 /// Test saving a single inventory item to an IAR
228 /// (subject to change since there is no fixed format yet). 228 /// (subject to change since there is no fixed format yet).
@@ -239,10 +239,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
239 string userPassword = "troll"; 239 string userPassword = "troll";
240 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); 240 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
241 UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); 241 UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword);
242 242
243 // Create asset 243 // Create asset
244 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); 244 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
245 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); 245 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
246 246
247 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); 247 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
248 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); 248 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
@@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
255 item1.Name = item1Name; 255 item1.Name = item1Name;
256 item1.AssetID = asset1.FullID; 256 item1.AssetID = asset1.FullID;
257 item1.ID = item1Id; 257 item1.ID = item1Id;
258 InventoryFolderBase objsFolder 258 InventoryFolderBase objsFolder
259 = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, userId, "Objects")[0]; 259 = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, userId, "Objects")[0];
260 item1.Folder = objsFolder.ID; 260 item1.Folder = objsFolder.ID;
261 m_scene.AddInventoryItem(item1); 261 m_scene.AddInventoryItem(item1);
@@ -285,7 +285,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
285 TarArchiveReader.TarEntryType tarEntryType; 285 TarArchiveReader.TarEntryType tarEntryType;
286 286
287// Console.WriteLine("Reading archive"); 287// Console.WriteLine("Reading archive");
288 288
289 while (tar.ReadEntry(out filePath, out tarEntryType) != null) 289 while (tar.ReadEntry(out filePath, out tarEntryType) != null)
290 { 290 {
291 Console.WriteLine("Got {0}", filePath); 291 Console.WriteLine("Got {0}", filePath);
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
294// { 294// {
295// gotControlFile = true; 295// gotControlFile = true;
296// } 296// }
297 297
298 if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml")) 298 if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml"))
299 { 299 {
300// string fileName = filePath.Remove(0, "Objects/".Length); 300// string fileName = filePath.Remove(0, "Objects/".Length);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index 519c697..0b65829 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -49,35 +49,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
49 public class InventoryArchiveTestCase : OpenSimTestCase 49 public class InventoryArchiveTestCase : OpenSimTestCase
50 { 50 {
51 protected ManualResetEvent mre = new ManualResetEvent(false); 51 protected ManualResetEvent mre = new ManualResetEvent(false);
52 52
53 /// <summary> 53 /// <summary>
54 /// A raw array of bytes that we'll use to create an IAR memory stream suitable for isolated use in each test. 54 /// A raw array of bytes that we'll use to create an IAR memory stream suitable for isolated use in each test.
55 /// </summary> 55 /// </summary>
56 protected byte[] m_iarStreamBytes; 56 protected byte[] m_iarStreamBytes;
57 57
58 /// <summary> 58 /// <summary>
59 /// Stream of data representing a common IAR for load tests. 59 /// Stream of data representing a common IAR for load tests.
60 /// </summary> 60 /// </summary>
61 protected MemoryStream m_iarStream; 61 protected MemoryStream m_iarStream;
62 62
63 protected UserAccount m_uaMT 63 protected UserAccount m_uaMT
64 = new UserAccount { 64 = new UserAccount {
65 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), 65 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"),
66 FirstName = "Mr", 66 FirstName = "Mr",
67 LastName = "Tiddles" }; 67 LastName = "Tiddles" };
68 68
69 protected UserAccount m_uaLL1 69 protected UserAccount m_uaLL1
70 = new UserAccount { 70 = new UserAccount {
71 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), 71 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"),
72 FirstName = "Lord", 72 FirstName = "Lord",
73 LastName = "Lucan" }; 73 LastName = "Lucan" };
74 74
75 protected UserAccount m_uaLL2 75 protected UserAccount m_uaLL2
76 = new UserAccount { 76 = new UserAccount {
77 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"), 77 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"),
78 FirstName = "Lord", 78 FirstName = "Lord",
79 LastName = "Lucan" }; 79 LastName = "Lucan" };
80 80
81 protected string m_item1Name = "Ray Gun Item"; 81 protected string m_item1Name = "Ray Gun Item";
82 protected string m_coaItemName = "Coalesced Item"; 82 protected string m_coaItemName = "Coalesced Item";
83 83
@@ -105,72 +105,72 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
105 base.SetUp(); 105 base.SetUp();
106 m_iarStream = new MemoryStream(m_iarStreamBytes); 106 m_iarStream = new MemoryStream(m_iarStreamBytes);
107 } 107 }
108 108
109 protected void ConstructDefaultIarBytesForTestLoad() 109 protected void ConstructDefaultIarBytesForTestLoad()
110 { 110 {
111// log4net.Config.XmlConfigurator.Configure(); 111// log4net.Config.XmlConfigurator.Configure();
112 112
113 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 113 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
114 Scene scene = new SceneHelpers().SetupScene(); 114 Scene scene = new SceneHelpers().SetupScene();
115 SceneHelpers.SetupSceneModules(scene, archiverModule); 115 SceneHelpers.SetupSceneModules(scene, archiverModule);
116 116
117 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 117 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
118 118
119 MemoryStream archiveWriteStream = new MemoryStream(); 119 MemoryStream archiveWriteStream = new MemoryStream();
120 120
121 // Create scene object asset 121 // Create scene object asset
122 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); 122 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
123 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); 123 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50);
124 124
125 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); 125 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
126 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); 126 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
127 scene.AssetService.Store(asset1); 127 scene.AssetService.Store(asset1);
128 128
129 // Create scene object item 129 // Create scene object item
130 InventoryItemBase item1 = new InventoryItemBase(); 130 InventoryItemBase item1 = new InventoryItemBase();
131 item1.Name = m_item1Name; 131 item1.Name = m_item1Name;
132 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); 132 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020");
133 item1.AssetID = asset1.FullID; 133 item1.AssetID = asset1.FullID;
134 item1.GroupID = UUID.Random(); 134 item1.GroupID = UUID.Random();
135 item1.CreatorId = m_uaLL1.PrincipalID.ToString(); 135 item1.CreatorId = m_uaLL1.PrincipalID.ToString();
136 item1.Owner = m_uaLL1.PrincipalID; 136 item1.Owner = m_uaLL1.PrincipalID;
137 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; 137 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
138 scene.AddInventoryItem(item1); 138 scene.AddInventoryItem(item1);
139 139
140 // Create coalesced objects asset 140 // Create coalesced objects asset
141 SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120); 141 SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120);
142 cobj1.AbsolutePosition = new Vector3(15, 30, 45); 142 cobj1.AbsolutePosition = new Vector3(15, 30, 45);
143 143
144 SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140); 144 SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140);
145 cobj2.AbsolutePosition = new Vector3(25, 50, 75); 145 cobj2.AbsolutePosition = new Vector3(25, 50, 75);
146 146
147 CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2); 147 CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2);
148 148
149 AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa); 149 AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa);
150 scene.AssetService.Store(coaAsset); 150 scene.AssetService.Store(coaAsset);
151 151
152 // Create coalesced objects inventory item 152 // Create coalesced objects inventory item
153 InventoryItemBase coaItem = new InventoryItemBase(); 153 InventoryItemBase coaItem = new InventoryItemBase();
154 coaItem.Name = m_coaItemName; 154 coaItem.Name = m_coaItemName;
155 coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180"); 155 coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180");
156 coaItem.AssetID = coaAsset.FullID; 156 coaItem.AssetID = coaAsset.FullID;
157 coaItem.GroupID = UUID.Random(); 157 coaItem.GroupID = UUID.Random();
158 coaItem.CreatorId = m_uaLL1.PrincipalID.ToString(); 158 coaItem.CreatorId = m_uaLL1.PrincipalID.ToString();
159 coaItem.Owner = m_uaLL1.PrincipalID; 159 coaItem.Owner = m_uaLL1.PrincipalID;
160 coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; 160 coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
161 scene.AddInventoryItem(coaItem); 161 scene.AddInventoryItem(coaItem);
162 162
163 archiverModule.ArchiveInventory( 163 archiverModule.ArchiveInventory(
164 UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream); 164 UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream);
165 165
166 m_iarStreamBytes = archiveWriteStream.ToArray(); 166 m_iarStreamBytes = archiveWriteStream.ToArray();
167 } 167 }
168 168
169 protected void SaveCompleted( 169 protected void SaveCompleted(
170 UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, 170 UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream,
171 Exception reportedException, int SaveCount, int FilterCount) 171 Exception reportedException, int SaveCount, int FilterCount)
172 { 172 {
173 mre.Set(); 173 mre.Set();
174 } 174 }
175 } 175 }
176} \ No newline at end of file 176} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 46da5a9..5d7f25c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -149,10 +149,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
149 private void OnInstantMessage(IClientAPI client, GridInstantMessage im) 149 private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
150 { 150 {
151// m_log.DebugFormat( 151// m_log.DebugFormat(
152// "[INVENTORY TRANSFER]: {0} IM type received from client {1}. From={2} ({3}), To={4}", 152// "[INVENTORY TRANSFER]: {0} IM type received from client {1}. From={2} ({3}), To={4}",
153// (InstantMessageDialog)im.dialog, client.Name, 153// (InstantMessageDialog)im.dialog, client.Name,
154// im.fromAgentID, im.fromAgentName, im.toAgentID); 154// im.fromAgentID, im.fromAgentName, im.toAgentID);
155 155
156 Scene scene = FindClientScene(client.AgentId); 156 Scene scene = FindClientScene(client.AgentId);
157 157
158 if (scene == null) // Something seriously wrong here. 158 if (scene == null) // Something seriously wrong here.
@@ -164,31 +164,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
164 164
165 if (im.binaryBucket.Length < 17) // Invalid 165 if (im.binaryBucket.Length < 17) // Invalid
166 return; 166 return;
167 167
168 UUID recipientID = new UUID(im.toAgentID); 168 UUID recipientID = new UUID(im.toAgentID);
169 ScenePresence user = scene.GetScenePresence(recipientID); 169 ScenePresence user = scene.GetScenePresence(recipientID);
170 UUID copyID; 170 UUID copyID;
171 171
172 // First byte is the asset type 172 // First byte is the asset type
173 AssetType assetType = (AssetType)im.binaryBucket[0]; 173 AssetType assetType = (AssetType)im.binaryBucket[0];
174 174
175 if (AssetType.Folder == assetType) 175 if (AssetType.Folder == assetType)
176 { 176 {
177 UUID folderID = new UUID(im.binaryBucket, 1); 177 UUID folderID = new UUID(im.binaryBucket, 1);
178 178
179 m_log.DebugFormat( 179 m_log.DebugFormat(
180 "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", 180 "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory",
181 folderID, new UUID(im.toAgentID)); 181 folderID, new UUID(im.toAgentID));
182 182
183 InventoryFolderBase folderCopy 183 InventoryFolderBase folderCopy
184 = scene.GiveInventoryFolder(client, recipientID, client.AgentId, folderID, UUID.Zero); 184 = scene.GiveInventoryFolder(client, recipientID, client.AgentId, folderID, UUID.Zero);
185 185
186 if (folderCopy == null) 186 if (folderCopy == null)
187 { 187 {
188 client.SendAgentAlertMessage("Can't find folder to give. Nothing given.", false); 188 client.SendAgentAlertMessage("Can't find folder to give. Nothing given.", false);
189 return; 189 return;
190 } 190 }
191 191
192 // The outgoing binary bucket should contain only the byte which signals an asset folder is 192 // The outgoing binary bucket should contain only the byte which signals an asset folder is
193 // being copied and the following bytes for the copied folder's UUID 193 // being copied and the following bytes for the copied folder's UUID
194 copyID = folderCopy.ID; 194 copyID = folderCopy.ID;
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
196 im.binaryBucket = new byte[1 + copyIDBytes.Length]; 196 im.binaryBucket = new byte[1 + copyIDBytes.Length];
197 im.binaryBucket[0] = (byte)AssetType.Folder; 197 im.binaryBucket[0] = (byte)AssetType.Folder;
198 Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); 198 Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length);
199 199
200 if (user != null) 200 if (user != null)
201 user.ControllingClient.SendBulkUpdateInventory(folderCopy); 201 user.ControllingClient.SendBulkUpdateInventory(folderCopy);
202 202
@@ -225,10 +225,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
225 client.SendAgentAlertMessage(message, false); 225 client.SendAgentAlertMessage(message, false);
226 return; 226 return;
227 } 227 }
228 228
229 copyID = itemCopy.ID; 229 copyID = itemCopy.ID;
230 Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); 230 Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16);
231 231
232 if (user != null) 232 if (user != null)
233 user.ControllingClient.SendBulkUpdateInventory(itemCopy); 233 user.ControllingClient.SendBulkUpdateInventory(itemCopy);
234 234
@@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
253 else 253 else
254 { 254 {
255 if (m_TransferModule != null) 255 if (m_TransferModule != null)
256 m_TransferModule.SendInstantMessage(im, delegate(bool success) 256 m_TransferModule.SendInstantMessage(im, delegate(bool success)
257 { 257 {
258 if (!success) 258 if (!success)
259 client.SendAlertMessage("User not online. Inventory has been saved"); 259 client.SendAlertMessage("User not online. Inventory has been saved");
@@ -308,8 +308,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
308 } 308 }
309 309
310 // XXX: This code was placed here to try and accomodate RLV which moves given folders named #RLV/~<name> 310 // XXX: This code was placed here to try and accomodate RLV which moves given folders named #RLV/~<name>
311 // to the requested folder, which in this case is #RLV. However, it is the viewer that appears to be 311 // to the requested folder, which in this case is #RLV. However, it is the viewer that appears to be
312 // response from renaming the #RLV/~example folder to ~example. For some reason this is not yet 312 // response from renaming the #RLV/~example folder to ~example. For some reason this is not yet
313 // happening, possibly because we are not sending the correct inventory update messages with the correct 313 // happening, possibly because we are not sending the correct inventory update messages with the correct
314 // transaction IDs 314 // transaction IDs
315 else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) 315 else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
@@ -380,7 +380,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
380 InventoryItemBase item = invService.GetItem(client.AgentId, inventoryID); 380 InventoryItemBase item = invService.GetItem(client.AgentId, inventoryID);
381 InventoryFolderBase folder = null; 381 InventoryFolderBase folder = null;
382 UUID? previousParentFolderID = null; 382 UUID? previousParentFolderID = null;
383 383
384 if (item != null && trashFolder != null) 384 if (item != null && trashFolder != null)
385 { 385 {
386 previousParentFolderID = item.Folder; 386 previousParentFolderID = item.Folder;
@@ -404,18 +404,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
404 client.SendBulkUpdateInventory(folder); 404 client.SendBulkUpdateInventory(folder);
405 } 405 }
406 } 406 }
407 407
408 if ((null == item && null == folder) | null == trashFolder) 408 if ((null == item && null == folder) | null == trashFolder)
409 { 409 {
410 string reason = String.Empty; 410 string reason = String.Empty;
411 411
412 if (trashFolder == null) 412 if (trashFolder == null)
413 reason += " Trash folder not found."; 413 reason += " Trash folder not found.";
414 if (item == null) 414 if (item == null)
415 reason += " Item not found."; 415 reason += " Item not found.";
416 if (folder == null) 416 if (folder == null)
417 reason += " Folder not found."; 417 reason += " Folder not found.";
418 418
419 client.SendAgentAlertMessage("Unable to delete "+ 419 client.SendAgentAlertMessage("Unable to delete "+
420 "received inventory" + reason, false); 420 "received inventory" + reason, false);
421 } 421 }
@@ -471,12 +471,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
471 { 471 {
472 if (im.binaryBucket.Length < 17) // Invalid 472 if (im.binaryBucket.Length < 17) // Invalid
473 return; 473 return;
474 474
475 UUID recipientID = new UUID(im.toAgentID); 475 UUID recipientID = new UUID(im.toAgentID);
476 476
477 // First byte is the asset type 477 // First byte is the asset type
478 AssetType assetType = (AssetType)im.binaryBucket[0]; 478 AssetType assetType = (AssetType)im.binaryBucket[0];
479 479
480 if (AssetType.Folder == assetType) 480 if (AssetType.Folder == assetType)
481 { 481 {
482 UUID folderID = new UUID(im.binaryBucket, 1); 482 UUID folderID = new UUID(im.binaryBucket, 1);
@@ -505,12 +505,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
505 { 505 {
506 if (im.binaryBucket.Length < 1) // Invalid 506 if (im.binaryBucket.Length < 1) // Invalid
507 return; 507 return;
508 508
509 UUID recipientID = new UUID(im.toAgentID); 509 UUID recipientID = new UUID(im.toAgentID);
510 510
511 // Bucket is the asset type 511 // Bucket is the asset type
512 AssetType assetType = (AssetType)im.binaryBucket[0]; 512 AssetType assetType = (AssetType)im.binaryBucket[0];
513 513
514 if (AssetType.Folder == assetType) 514 if (AssetType.Folder == assetType)
515 { 515 {
516 UUID folderID = new UUID(im.imSessionID); 516 UUID folderID = new UUID(im.imSessionID);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs
index 7ddc396..82ed091 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs
@@ -44,9 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
44{ 44{
45 [TestFixture] 45 [TestFixture]
46 public class InventoryTransferModuleTests : OpenSimTestCase 46 public class InventoryTransferModuleTests : OpenSimTestCase
47 { 47 {
48 protected TestScene m_scene; 48 protected TestScene m_scene;
49 49
50 [SetUp] 50 [SetUp]
51 public override void SetUp() 51 public override void SetUp()
52 { 52 {
@@ -56,9 +56,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
56 config.AddConfig("Messaging"); 56 config.AddConfig("Messaging");
57 config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); 57 config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");
58 58
59 m_scene = new SceneHelpers().SetupScene(); 59 m_scene = new SceneHelpers().SetupScene();
60 SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule()); 60 SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule());
61 } 61 }
62 62
63 [Test] 63 [Test]
64 public void TestAcceptGivenItem() 64 public void TestAcceptGivenItem()
@@ -69,9 +69,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
69 UUID itemId = TestHelpers.ParseTail(0x100); 69 UUID itemId = TestHelpers.ParseTail(0x100);
70 UUID assetId = TestHelpers.ParseTail(0x200); 70 UUID assetId = TestHelpers.ParseTail(0x200);
71 71
72 UserAccount ua1 72 UserAccount ua1
73 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); 73 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw");
74 UserAccount ua2 74 UserAccount ua2
75 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); 75 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw");
76 76
77 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); 77 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1);
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
81 TestClient receiverClient = (TestClient)receiverSp.ControllingClient; 81 TestClient receiverClient = (TestClient)receiverSp.ControllingClient;
82 82
83 // Create the object to test give 83 // Create the object to test give
84 InventoryItemBase originalItem 84 InventoryItemBase originalItem
85 = UserInventoryHelpers.CreateInventoryItem( 85 = UserInventoryHelpers.CreateInventoryItem(
86 m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); 86 m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object);
87 87
@@ -89,35 +89,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
89 byte[] itemIdBytes = itemId.GetBytes(); 89 byte[] itemIdBytes = itemId.GetBytes();
90 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); 90 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length);
91 91
92 GridInstantMessage giveIm 92 GridInstantMessage giveIm
93 = new GridInstantMessage( 93 = new GridInstantMessage(
94 m_scene, 94 m_scene,
95 giverSp.UUID, 95 giverSp.UUID,
96 giverSp.Name, 96 giverSp.Name,
97 receiverSp.UUID, 97 receiverSp.UUID,
98 (byte)InstantMessageDialog.InventoryOffered, 98 (byte)InstantMessageDialog.InventoryOffered,
99 false, 99 false,
100 "inventory offered msg", 100 "inventory offered msg",
101 initialSessionId, 101 initialSessionId,
102 false, 102 false,
103 Vector3.Zero, 103 Vector3.Zero,
104 giveImBinaryBucket, 104 giveImBinaryBucket,
105 true); 105 true);
106 106
107 giverClient.HandleImprovedInstantMessage(giveIm); 107 giverClient.HandleImprovedInstantMessage(giveIm);
108 108
109 // These details might not all be correct. 109 // These details might not all be correct.
110 GridInstantMessage acceptIm 110 GridInstantMessage acceptIm
111 = new GridInstantMessage( 111 = new GridInstantMessage(
112 m_scene, 112 m_scene,
113 receiverSp.UUID, 113 receiverSp.UUID,
114 receiverSp.Name, 114 receiverSp.Name,
115 giverSp.UUID, 115 giverSp.UUID,
116 (byte)InstantMessageDialog.InventoryAccepted, 116 (byte)InstantMessageDialog.InventoryAccepted,
117 false, 117 false,
118 "inventory accepted msg", 118 "inventory accepted msg",
119 initialSessionId, 119 initialSessionId,
120 false, 120 false,
121 Vector3.Zero, 121 Vector3.Zero,
122 null, 122 null,
123 true); 123 true);
@@ -133,7 +133,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
133 Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); 133 Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID));
134 134
135 // Test for item successfully making it into the receiver's inventory 135 // Test for item successfully making it into the receiver's inventory
136 InventoryItemBase receivedItem 136 InventoryItemBase receivedItem
137 = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj"); 137 = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj");
138 138
139 Assert.That(receivedItem, Is.Not.Null); 139 Assert.That(receivedItem, Is.Not.Null);
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
148 Assert.That(originalItemAfterDelete, Is.Not.Null); 148 Assert.That(originalItemAfterDelete, Is.Not.Null);
149 149
150 // TODO: Test scenario where giver deletes their item first. 150 // TODO: Test scenario where giver deletes their item first.
151 } 151 }
152 152
153 /// <summary> 153 /// <summary>
154 /// Test user rejection of a given item. 154 /// Test user rejection of a given item.
@@ -165,9 +165,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
165 UUID itemId = TestHelpers.ParseTail(0x100); 165 UUID itemId = TestHelpers.ParseTail(0x100);
166 UUID assetId = TestHelpers.ParseTail(0x200); 166 UUID assetId = TestHelpers.ParseTail(0x200);
167 167
168 UserAccount ua1 168 UserAccount ua1
169 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); 169 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw");
170 UserAccount ua2 170 UserAccount ua2
171 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); 171 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw");
172 172
173 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); 173 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1);
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
177 TestClient receiverClient = (TestClient)receiverSp.ControllingClient; 177 TestClient receiverClient = (TestClient)receiverSp.ControllingClient;
178 178
179 // Create the object to test give 179 // Create the object to test give
180 InventoryItemBase originalItem 180 InventoryItemBase originalItem
181 = UserInventoryHelpers.CreateInventoryItem( 181 = UserInventoryHelpers.CreateInventoryItem(
182 m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); 182 m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object);
183 183
@@ -188,36 +188,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
188 byte[] itemIdBytes = itemId.GetBytes(); 188 byte[] itemIdBytes = itemId.GetBytes();
189 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); 189 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length);
190 190
191 GridInstantMessage giveIm 191 GridInstantMessage giveIm
192 = new GridInstantMessage( 192 = new GridInstantMessage(
193 m_scene, 193 m_scene,
194 giverSp.UUID, 194 giverSp.UUID,
195 giverSp.Name, 195 giverSp.Name,
196 receiverSp.UUID, 196 receiverSp.UUID,
197 (byte)InstantMessageDialog.InventoryOffered, 197 (byte)InstantMessageDialog.InventoryOffered,
198 false, 198 false,
199 "inventory offered msg", 199 "inventory offered msg",
200 initialSessionId, 200 initialSessionId,
201 false, 201 false,
202 Vector3.Zero, 202 Vector3.Zero,
203 giveImBinaryBucket, 203 giveImBinaryBucket,
204 true); 204 true);
205 205
206 giverClient.HandleImprovedInstantMessage(giveIm); 206 giverClient.HandleImprovedInstantMessage(giveIm);
207 207
208 // These details might not all be correct. 208 // These details might not all be correct.
209 // Session ID is now the created item ID (!) 209 // Session ID is now the created item ID (!)
210 GridInstantMessage rejectIm 210 GridInstantMessage rejectIm
211 = new GridInstantMessage( 211 = new GridInstantMessage(
212 m_scene, 212 m_scene,
213 receiverSp.UUID, 213 receiverSp.UUID,
214 receiverSp.Name, 214 receiverSp.Name,
215 giverSp.UUID, 215 giverSp.UUID,
216 (byte)InstantMessageDialog.InventoryDeclined, 216 (byte)InstantMessageDialog.InventoryDeclined,
217 false, 217 false,
218 "inventory declined msg", 218 "inventory declined msg",
219 new UUID(receivedIm.imSessionID), 219 new UUID(receivedIm.imSessionID),
220 false, 220 false,
221 Vector3.Zero, 221 Vector3.Zero,
222 null, 222 null,
223 true); 223 true);
@@ -233,7 +233,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
233 Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); 233 Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID));
234 234
235 // Test for item successfully making it into the receiver's inventory 235 // Test for item successfully making it into the receiver's inventory
236 InventoryItemBase receivedItem 236 InventoryItemBase receivedItem
237 = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); 237 = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj");
238 238
239 InventoryFolderBase trashFolder 239 InventoryFolderBase trashFolder
@@ -250,7 +250,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
250 = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); 250 = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj");
251 251
252 Assert.That(originalItemAfterDelete, Is.Not.Null); 252 Assert.That(originalItemAfterDelete, Is.Not.Null);
253 } 253 }
254 254
255 [Test] 255 [Test]
256 public void TestAcceptGivenFolder() 256 public void TestAcceptGivenFolder()
@@ -261,9 +261,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
261 UUID initialSessionId = TestHelpers.ParseTail(0x10); 261 UUID initialSessionId = TestHelpers.ParseTail(0x10);
262 UUID folderId = TestHelpers.ParseTail(0x100); 262 UUID folderId = TestHelpers.ParseTail(0x100);
263 263
264 UserAccount ua1 264 UserAccount ua1
265 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); 265 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw");
266 UserAccount ua2 266 UserAccount ua2
267 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); 267 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw");
268 268
269 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); 269 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1);
@@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
272 ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); 272 ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2);
273 TestClient receiverClient = (TestClient)receiverSp.ControllingClient; 273 TestClient receiverClient = (TestClient)receiverSp.ControllingClient;
274 274
275 InventoryFolderBase originalFolder 275 InventoryFolderBase originalFolder
276 = UserInventoryHelpers.CreateInventoryFolder( 276 = UserInventoryHelpers.CreateInventoryFolder(
277 m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); 277 m_scene.InventoryService, giverSp.UUID, folderId, "f1", true);
278 278
@@ -281,35 +281,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
281 byte[] itemIdBytes = folderId.GetBytes(); 281 byte[] itemIdBytes = folderId.GetBytes();
282 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); 282 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length);
283 283
284 GridInstantMessage giveIm 284 GridInstantMessage giveIm
285 = new GridInstantMessage( 285 = new GridInstantMessage(
286 m_scene, 286 m_scene,
287 giverSp.UUID, 287 giverSp.UUID,
288 giverSp.Name, 288 giverSp.Name,
289 receiverSp.UUID, 289 receiverSp.UUID,
290 (byte)InstantMessageDialog.InventoryOffered, 290 (byte)InstantMessageDialog.InventoryOffered,
291 false, 291 false,
292 "inventory offered msg", 292 "inventory offered msg",
293 initialSessionId, 293 initialSessionId,
294 false, 294 false,
295 Vector3.Zero, 295 Vector3.Zero,
296 giveImBinaryBucket, 296 giveImBinaryBucket,
297 true); 297 true);
298 298
299 giverClient.HandleImprovedInstantMessage(giveIm); 299 giverClient.HandleImprovedInstantMessage(giveIm);
300 300
301 // These details might not all be correct. 301 // These details might not all be correct.
302 GridInstantMessage acceptIm 302 GridInstantMessage acceptIm
303 = new GridInstantMessage( 303 = new GridInstantMessage(
304 m_scene, 304 m_scene,
305 receiverSp.UUID, 305 receiverSp.UUID,
306 receiverSp.Name, 306 receiverSp.Name,
307 giverSp.UUID, 307 giverSp.UUID,
308 (byte)InstantMessageDialog.InventoryAccepted, 308 (byte)InstantMessageDialog.InventoryAccepted,
309 false, 309 false,
310 "inventory accepted msg", 310 "inventory accepted msg",
311 initialSessionId, 311 initialSessionId,
312 false, 312 false,
313 Vector3.Zero, 313 Vector3.Zero,
314 null, 314 null,
315 true); 315 true);
@@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
325 Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); 325 Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID));
326 326
327 // Test for item successfully making it into the receiver's inventory 327 // Test for item successfully making it into the receiver's inventory
328 InventoryFolderBase receivedFolder 328 InventoryFolderBase receivedFolder
329 = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1"); 329 = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1");
330 330
331 Assert.That(receivedFolder, Is.Not.Null); 331 Assert.That(receivedFolder, Is.Not.Null);
@@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
340 Assert.That(originalFolderAfterDelete, Is.Not.Null); 340 Assert.That(originalFolderAfterDelete, Is.Not.Null);
341 341
342 // TODO: Test scenario where giver deletes their item first. 342 // TODO: Test scenario where giver deletes their item first.
343 } 343 }
344 344
345 /// <summary> 345 /// <summary>
346 /// Test user rejection of a given item. 346 /// Test user rejection of a given item.
@@ -357,9 +357,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
357 UUID initialSessionId = TestHelpers.ParseTail(0x10); 357 UUID initialSessionId = TestHelpers.ParseTail(0x10);
358 UUID folderId = TestHelpers.ParseTail(0x100); 358 UUID folderId = TestHelpers.ParseTail(0x100);
359 359
360 UserAccount ua1 360 UserAccount ua1
361 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); 361 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw");
362 UserAccount ua2 362 UserAccount ua2
363 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); 363 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw");
364 364
365 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); 365 ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1);
@@ -369,7 +369,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
369 TestClient receiverClient = (TestClient)receiverSp.ControllingClient; 369 TestClient receiverClient = (TestClient)receiverSp.ControllingClient;
370 370
371 // Create the folder to test give 371 // Create the folder to test give
372 InventoryFolderBase originalFolder 372 InventoryFolderBase originalFolder
373 = UserInventoryHelpers.CreateInventoryFolder( 373 = UserInventoryHelpers.CreateInventoryFolder(
374 m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); 374 m_scene.InventoryService, giverSp.UUID, folderId, "f1", true);
375 375
@@ -381,36 +381,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
381 byte[] itemIdBytes = folderId.GetBytes(); 381 byte[] itemIdBytes = folderId.GetBytes();
382 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); 382 Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length);
383 383
384 GridInstantMessage giveIm 384 GridInstantMessage giveIm
385 = new GridInstantMessage( 385 = new GridInstantMessage(
386 m_scene, 386 m_scene,
387 giverSp.UUID, 387 giverSp.UUID,
388 giverSp.Name, 388 giverSp.Name,
389 receiverSp.UUID, 389 receiverSp.UUID,
390 (byte)InstantMessageDialog.InventoryOffered, 390 (byte)InstantMessageDialog.InventoryOffered,
391 false, 391 false,
392 "inventory offered msg", 392 "inventory offered msg",
393 initialSessionId, 393 initialSessionId,
394 false, 394 false,
395 Vector3.Zero, 395 Vector3.Zero,
396 giveImBinaryBucket, 396 giveImBinaryBucket,
397 true); 397 true);
398 398
399 giverClient.HandleImprovedInstantMessage(giveIm); 399 giverClient.HandleImprovedInstantMessage(giveIm);
400 400
401 // These details might not all be correct. 401 // These details might not all be correct.
402 // Session ID is now the created item ID (!) 402 // Session ID is now the created item ID (!)
403 GridInstantMessage rejectIm 403 GridInstantMessage rejectIm
404 = new GridInstantMessage( 404 = new GridInstantMessage(
405 m_scene, 405 m_scene,
406 receiverSp.UUID, 406 receiverSp.UUID,
407 receiverSp.Name, 407 receiverSp.Name,
408 giverSp.UUID, 408 giverSp.UUID,
409 (byte)InstantMessageDialog.InventoryDeclined, 409 (byte)InstantMessageDialog.InventoryDeclined,
410 false, 410 false,
411 "inventory declined msg", 411 "inventory declined msg",
412 new UUID(receivedIm.imSessionID), 412 new UUID(receivedIm.imSessionID),
413 false, 413 false,
414 Vector3.Zero, 414 Vector3.Zero,
415 null, 415 null,
416 true); 416 true);
@@ -426,7 +426,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
426 Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); 426 Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID));
427 427
428 // Test for folder successfully making it into the receiver's inventory 428 // Test for folder successfully making it into the receiver's inventory
429 InventoryFolderBase receivedFolder 429 InventoryFolderBase receivedFolder
430 = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); 430 = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1");
431 431
432 InventoryFolderBase trashFolder 432 InventoryFolderBase trashFolder
@@ -443,6 +443,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests
443 = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); 443 = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1");
444 444
445 Assert.That(originalFolderAfterDelete, Is.Not.Null); 445 Assert.That(originalFolderAfterDelete, Is.Not.Null);
446 } 446 }
447 } 447 }
448} \ No newline at end of file 448} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index 24286a4..10781e9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
65 { 65 {
66 m_Enabled = true; 66 m_Enabled = true;
67 67
68 m_ThisGridURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", 68 m_ThisGridURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI",
69 new string[] { "Startup", "Hypergrid", "Messaging" }, String.Empty); 69 new string[] { "Startup", "Hypergrid", "Messaging" }, String.Empty);
70 // Legacy. Remove soon! 70 // Legacy. Remove soon!
71 m_ThisGridURL = config.Configs["Messaging"].GetString("Gatekeeper", m_ThisGridURL); 71 m_ThisGridURL = config.Configs["Messaging"].GetString("Gatekeeper", m_ThisGridURL);
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
154 154
155 void OnIncomingInstantMessage(GridInstantMessage im) 155 void OnIncomingInstantMessage(GridInstantMessage im)
156 { 156 {
157 if (im.dialog == (byte)InstantMessageDialog.RequestTeleport 157 if (im.dialog == (byte)InstantMessageDialog.RequestTeleport
158 || im.dialog == (byte)InstantMessageDialog.GodLikeRequestTeleport) 158 || im.dialog == (byte)InstantMessageDialog.GodLikeRequestTeleport)
159 { 159 {
160 UUID sessionID = new UUID(im.imSessionID); 160 UUID sessionID = new UUID(im.imSessionID);
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
195 195
196 m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); 196 m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message);
197 m_PendingLures.Add(sessionID, m, 7200); // 2 hours 197 m_PendingLures.Add(sessionID, m, 7200); // 2 hours
198 198
199 if (m_TransferModule != null) 199 if (m_TransferModule != null)
200 { 200 {
201 m_TransferModule.SendInstantMessage(m, 201 m_TransferModule.SendInstantMessage(m,
diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
index 0b1dbc7..1e1caca 100644
--- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
68 { 68 {
69 if (!m_Enabled) 69 if (!m_Enabled)
70 return; 70 return;
71 71
72 lock (m_Scenes) 72 lock (m_Scenes)
73 { 73 {
74 if (!m_Scenes.Contains(scene)) 74 if (!m_Scenes.Contains(scene))
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index df5265c..138c0f7 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
85 /// <value> 85 /// <value>
86 /// The configuration 86 /// The configuration
87 /// </value> 87 /// </value>
88 public IConfigSource Config 88 public IConfigSource Config
89 { 89 {
90 get; 90 get;
91 set; 91 set;
@@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
97 /// <value> 97 /// <value>
98 /// The profile server URI. 98 /// The profile server URI.
99 /// </value> 99 /// </value>
100 public string ProfileServerUri 100 public string ProfileServerUri
101 { 101 {
102 get; 102 get;
103 set; 103 set;
@@ -120,13 +120,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
120 /// <value> 120 /// <value>
121 /// <c>true</c> if enabled; otherwise, <c>false</c>. 121 /// <c>true</c> if enabled; otherwise, <c>false</c>.
122 /// </value> 122 /// </value>
123 public bool Enabled 123 public bool Enabled
124 { 124 {
125 get; 125 get;
126 set; 126 set;
127 } 127 }
128 128
129 public string MyGatekeeper 129 public string MyGatekeeper
130 { 130 {
131 get; private set; 131 get; private set;
132 } 132 }
@@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
135 /// <summary> 135 /// <summary>
136 /// This is called to initialize the region module. For shared modules, this is called exactly once, after 136 /// This is called to initialize the region module. For shared modules, this is called exactly once, after
137 /// creating the single (shared) instance. For non-shared modules, this is called once on each instance, after 137 /// creating the single (shared) instance. For non-shared modules, this is called once on each instance, after
138 /// the instace for the region has been created. 138 /// the instace for the region has been created.
139 /// </summary> 139 /// </summary>
140 /// <param name='source'> 140 /// <param name='source'>
141 /// Source. 141 /// Source.
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
162 Enabled = false; 162 Enabled = false;
163 return; 163 return;
164 } 164 }
165 165
166 m_allowUserProfileWebURLs = profileConfig.GetBoolean("AllowUserProfileWebURLs", m_allowUserProfileWebURLs); 166 m_allowUserProfileWebURLs = profileConfig.GetBoolean("AllowUserProfileWebURLs", m_allowUserProfileWebURLs);
167 167
168 m_log.Debug("[PROFILES]: Full Profiles Enabled"); 168 m_log.Debug("[PROFILES]: Full Profiles Enabled");
@@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
212 /// This will be called once for every scene loaded. In a shared module this will be multiple times in one 212 /// This will be called once for every scene loaded. In a shared module this will be multiple times in one
213 /// instance, while a nonshared module instance will only be called once. This method is called after AddRegion 213 /// instance, while a nonshared module instance will only be called once. This method is called after AddRegion
214 /// has been called in all modules for that scene, providing an opportunity to request another module's 214 /// has been called in all modules for that scene, providing an opportunity to request another module's
215 /// interface, or hook an event from another module. 215 /// interface, or hook an event from another module.
216 /// </summary> 216 /// </summary>
217 /// <param name='scene'> 217 /// <param name='scene'>
218 /// Scene. 218 /// Scene.
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
230 /// module has registered the interface by then, this module will be activated, else it will remain inactive, 230 /// module has registered the interface by then, this module will be activated, else it will remain inactive,
231 /// letting the other module take over. This should return non-null ONLY in modules that are intended to be 231 /// letting the other module take over. This should return non-null ONLY in modules that are intended to be
232 /// easily replaceable, e.g. stub implementations that the developer expects to be replaced by third party 232 /// easily replaceable, e.g. stub implementations that the developer expects to be replaced by third party
233 /// provided modules. 233 /// provided modules.
234 /// </summary> 234 /// </summary>
235 /// <value> 235 /// <value>
236 /// The replaceable interface. 236 /// The replaceable interface.
@@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
248 } 248 }
249 249
250 /// <value> 250 /// <value>
251 /// The name of the module 251 /// The name of the module
252 /// </value> 252 /// </value>
253 /// <summary> 253 /// <summary>
254 /// Gets the module name. 254 /// Gets the module name.
@@ -451,7 +451,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
451 } 451 }
452 452
453 public void ClassifiedInfoRequest(UUID queryClassifiedID, IClientAPI remoteClient) 453 public void ClassifiedInfoRequest(UUID queryClassifiedID, IClientAPI remoteClient)
454 { 454 {
455 UUID target = remoteClient.AgentId; 455 UUID target = remoteClient.AgentId;
456 UserClassifiedAdd ad = new UserClassifiedAdd(); 456 UserClassifiedAdd ad = new UserClassifiedAdd();
457 ad.ClassifiedId = queryClassifiedID; 457 ad.ClassifiedId = queryClassifiedID;
@@ -459,7 +459,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
459 lock (m_classifiedCache) 459 lock (m_classifiedCache)
460 { 460 {
461 if (m_classifiedCache.ContainsKey(queryClassifiedID)) 461 if (m_classifiedCache.ContainsKey(queryClassifiedID))
462 { 462 {
463 target = m_classifiedCache[queryClassifiedID]; 463 target = m_classifiedCache[queryClassifiedID];
464 464
465 m_classifiedInterest[queryClassifiedID] --; 465 m_classifiedInterest[queryClassifiedID] --;
@@ -870,7 +870,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
870 870
871 string theirGatekeeperURI; 871 string theirGatekeeperURI;
872 GetUserGatekeeperURI(targetID, out theirGatekeeperURI); 872 GetUserGatekeeperURI(targetID, out theirGatekeeperURI);
873 873
874 object Pick = (object)pick; 874 object Pick = (object)pick;
875 if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) { 875 if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) {
876 remoteClient.SendAgentAlertMessage ( 876 remoteClient.SendAgentAlertMessage (
@@ -880,11 +880,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
880 pick = (UserProfilePick)Pick; 880 pick = (UserProfilePick)Pick;
881 if(foreign) 881 if(foreign)
882 cacheForeignImage(targetID, pick.SnapshotId); 882 cacheForeignImage(targetID, pick.SnapshotId);
883 883
884 Vector3 globalPos = new Vector3(Vector3.Zero); 884 Vector3 globalPos = new Vector3(Vector3.Zero);
885 Vector3.TryParse(pick.GlobalPos, out globalPos); 885 Vector3.TryParse(pick.GlobalPos, out globalPos);
886 886
887 if (!string.IsNullOrWhiteSpace(MyGatekeeper) && pick.Gatekeeper != MyGatekeeper) 887 if (!string.IsNullOrWhiteSpace(MyGatekeeper) && pick.Gatekeeper != MyGatekeeper)
888 { 888 {
889 // Setup the illusion 889 // Setup the illusion
890 string region = string.Format("{0} {1}",pick.Gatekeeper,pick.SimName); 890 string region = string.Format("{0} {1}",pick.Gatekeeper,pick.SimName);
@@ -896,7 +896,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
896 } 896 }
897 else 897 else
898 { 898 {
899 // we have a proxy on map 899 // we have a proxy on map
900 ulong oriHandle; 900 ulong oriHandle;
901 uint oriX; 901 uint oriX;
902 uint oriY; 902 uint oriY;
@@ -909,7 +909,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
909 } 909 }
910 else 910 else
911 { 911 {
912 // this is a fail on large regions 912 // this is a fail on large regions
913 uint gtmp = (uint)globalPos.X >> 8; 913 uint gtmp = (uint)globalPos.X >> 8;
914 globalPos.X -= (gtmp << 8); 914 globalPos.X -= (gtmp << 8);
915 915
@@ -975,7 +975,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
975 /// Enabled. 975 /// Enabled.
976 /// </param> 976 /// </param>
977 public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled) 977 public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled)
978 { 978 {
979 m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); 979 m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString());
980 980
981 UserProfilePick pick = new UserProfilePick(); 981 UserProfilePick pick = new UserProfilePick();
@@ -1012,7 +1012,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1012 else 1012 else
1013 { 1013 {
1014 m_log.WarnFormat( 1014 m_log.WarnFormat(
1015 "[PROFILES]: PickInfoUpdate found no parcel info at {0},{1} in {2}", 1015 "[PROFILES]: PickInfoUpdate found no parcel info at {0},{1} in {2}",
1016 avaPos.X, avaPos.Y, p.Scene.Name); 1016 avaPos.X, avaPos.Y, p.Scene.Name);
1017 } 1017 }
1018 1018
@@ -1146,7 +1146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1146 remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); 1146 remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes);
1147 return; 1147 return;
1148 } 1148 }
1149 note = (UserProfileNotes) Note; 1149 note = (UserProfileNotes) Note;
1150 remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); 1150 remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes);
1151 } 1151 }
1152 1152
@@ -1225,10 +1225,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1225 { 1225 {
1226 m_log.InfoFormat("[PROFILES]: UserPreferences update error"); 1226 m_log.InfoFormat("[PROFILES]: UserPreferences update error");
1227 remoteClient.SendAgentAlertMessage("Error updating preferences", false); 1227 remoteClient.SendAgentAlertMessage("Error updating preferences", false);
1228 return; 1228 return;
1229 } 1229 }
1230 } 1230 }
1231 1231
1232 /// <summary> 1232 /// <summary>
1233 /// Users the preferences request. 1233 /// Users the preferences request.
1234 /// </summary> 1234 /// </summary>
@@ -1256,7 +1256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1256 pref = (UserPreferences) Pref; 1256 pref = (UserPreferences) Pref;
1257 1257
1258 remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail); 1258 remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail);
1259 1259
1260 } 1260 }
1261 #endregion User Preferences 1261 #endregion User Preferences
1262 1262
@@ -1437,7 +1437,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1437 { 1437 {
1438 props.AboutText ="Profile not available at this time. User may still be unknown to this grid"; 1438 props.AboutText ="Profile not available at this time. User may still be unknown to this grid";
1439 } 1439 }
1440 1440
1441 if(!m_allowUserProfileWebURLs) 1441 if(!m_allowUserProfileWebURLs)
1442 props.WebUrl =""; 1442 props.WebUrl ="";
1443 1443
@@ -1568,7 +1568,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1568 { 1568 {
1569 m_log.Debug( 1569 m_log.Debug(
1570 string.Format( 1570 string.Format(
1571 "[PROFILES]: Request using the OpenProfile API for user {0} to {1} failed", 1571 "[PROFILES]: Request using the OpenProfile API for user {0} to {1} failed",
1572 properties.UserId, serverURI), 1572 properties.UserId, serverURI),
1573 e); 1573 e);
1574 1574
@@ -1586,7 +1586,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1586 return false; 1586 return false;
1587 } 1587 }
1588 } 1588 }
1589 1589
1590 properties = (UserProfileProperties)Prop; 1590 properties = (UserProfileProperties)Prop;
1591 if(foreign) 1591 if(foreign)
1592 { 1592 {
@@ -1704,7 +1704,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1704 { 1704 {
1705 bool local; 1705 bool local;
1706 local = UserManagementModule.IsLocalGridUser(userID); 1706 local = UserManagementModule.IsLocalGridUser(userID);
1707 1707
1708 if (!local) 1708 if (!local)
1709 { 1709 {
1710 serverURI = UserManagementModule.GetUserServerURL(userID, "GatekeeperURI"); 1710 serverURI = UserManagementModule.GetUserServerURL(userID, "GatekeeperURI");
@@ -1761,13 +1761,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1761 1761
1762 string imageIDstr = imageID.ToString(); 1762 string imageIDstr = imageID.ToString();
1763 1763
1764 1764
1765 if(m_assetCache != null && m_assetCache.Check(imageIDstr)) 1765 if(m_assetCache != null && m_assetCache.Check(imageIDstr))
1766 return; 1766 return;
1767 1767
1768 if(Scene.AssetService.Get(imageIDstr) != null) 1768 if(Scene.AssetService.Get(imageIDstr) != null)
1769 return; 1769 return;
1770 1770
1771 Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, imageIDstr)); 1771 Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, imageIDstr));
1772 } 1772 }
1773 1773
@@ -1876,7 +1876,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1876 1876
1877 if (mret.ContainsKey("error")) 1877 if (mret.ContainsKey("error"))
1878 return false; 1878 return false;
1879 1879
1880 // get params... 1880 // get params...
1881 OSD.DeserializeMembers(ref parameters, (OSDMap) mret["result"]); 1881 OSD.DeserializeMembers(ref parameters, (OSDMap) mret["result"]);
1882 return true; 1882 return true;