aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs20
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs200
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs125
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs12
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs10
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs22
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs36
7 files changed, 352 insertions, 73 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 1e09610..97a1be6 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
101 /// <param name="silent"></param> 101 /// <param name="silent"></param>
102 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) 102 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
103 { 103 {
104 m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); 104// m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
105 105
106 try 106 try
107 { 107 {
@@ -226,9 +226,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
226 public UUID RezSingleAttachmentFromInventory( 226 public UUID RezSingleAttachmentFromInventory(
227 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) 227 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
228 { 228 {
229 m_log.DebugFormat( 229// m_log.DebugFormat(
230 "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}", 230// "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}",
231 (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name); 231// (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name);
232 232
233 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should 233 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
234 // be removed when that functionality is implemented in opensim 234 // be removed when that functionality is implemented in opensim
@@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
261 false, false, remoteClient.AgentId, true); 261 false, false, remoteClient.AgentId, true);
262 262
263// m_log.DebugFormat( 263// m_log.DebugFormat(
264// "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", 264// "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}",
265// objatt.Name, remoteClient.Name, AttachmentPt); 265// objatt.Name, remoteClient.Name, AttachmentPt);
266 266
267 if (objatt != null) 267 if (objatt != null)
@@ -466,7 +466,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
466 { 466 {
467 m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); 467 m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
468 group.DetachToInventoryPrep(); 468 group.DetachToInventoryPrep();
469 m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); 469// m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
470 470
471 // If an item contains scripts, it's always changed. 471 // If an item contains scripts, it's always changed.
472 // This ensures script state is saved on detach 472 // This ensures script state is saved on detach
@@ -501,10 +501,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
501 /// <summary> 501 /// <summary>
502 /// Update the attachment asset for the new sog details if they have changed. 502 /// Update the attachment asset for the new sog details if they have changed.
503 /// </summary> 503 /// </summary>
504 /// 504 /// <remarks>
505 /// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects, 505 /// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects,
506 /// these details are not stored on the region. 506 /// these details are not stored on the region.
507 /// 507 /// </remarks>
508 /// <param name="remoteClient"></param> 508 /// <param name="remoteClient"></param>
509 /// <param name="grp"></param> 509 /// <param name="grp"></param>
510 /// <param name="itemID"></param> 510 /// <param name="itemID"></param>
@@ -566,8 +566,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
566 /// <param name="silent"></param> 566 /// <param name="silent"></param>
567 protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent) 567 protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
568 { 568 {
569 m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", Name, avatar.Name, 569// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}",
570 attachmentpoint, attachOffset, so.RootPart.AttachedPos); 570// so.Name, avatar.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos);
571 571
572 so.DetachFromBackup(); 572 so.DetachFromBackup();
573 573
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
new file mode 100644
index 0000000..5bac4c6
--- /dev/null
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -0,0 +1,200 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using System.Text;
32using System.Threading;
33using System.Timers;
34using Timer=System.Timers.Timer;
35using Nini.Config;
36using NUnit.Framework;
37using OpenMetaverse;
38using OpenSim.Framework;
39using OpenSim.Framework.Communications;
40using OpenSim.Region.CoreModules.Avatar.Attachments;
41using OpenSim.Region.CoreModules.Framework.InventoryAccess;
42using OpenSim.Region.CoreModules.World.Serialiser;
43using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
44using OpenSim.Region.Framework.Scenes;
45using OpenSim.Region.Framework.Interfaces;
46using OpenSim.Tests.Common;
47using OpenSim.Tests.Common.Mock;
48
49namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
50{
51 /// <summary>
52 /// Attachment tests
53 /// </summary>
54 [TestFixture]
55 public class AttachmentsModuleTests
56 {
57 public Scene scene;
58 public UUID agent1;
59 public static Random random;
60 public AgentCircuitData acd1;
61 public SceneObjectGroup sog1, sog2;
62
63 [SetUp]
64 public void Init()
65 {
66 // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
67 Util.FireAndForgetMethod = FireAndForgetMethod.None;
68
69 IConfigSource config = new IniConfigSource();
70 config.AddConfig("Modules");
71 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
72
73 scene = SceneHelpers.SetupScene();
74 SceneHelpers.SetupSceneModules(scene, config, new AttachmentsModule(), new BasicInventoryAccessModule());
75
76 agent1 = UUID.Random();
77 random = new Random();
78 sog1 = NewSOG(UUID.Random(), scene, agent1);
79 sog2 = NewSOG(UUID.Random(), scene, agent1);
80 }
81
82 [TearDown]
83 public void TearDown()
84 {
85 // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
86 // threads. Possibly, later tests should be rewritten not to worry about such things.
87 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
88 }
89
90 [Test]
91 public void TestAddAttachments()
92 {
93 TestHelpers.InMethod();
94
95 ScenePresence presence = SceneHelpers.AddScenePresence(scene, agent1);
96 presence.AddAttachment(sog1);
97 presence.AddAttachment(sog2);
98
99 Assert.That(presence.HasAttachments(), Is.True);
100 Assert.That(presence.ValidateAttachments(), Is.True);
101 }
102
103 [Test]
104 public void TestRemoveAttachments()
105 {
106 TestHelpers.InMethod();
107
108 ScenePresence presence = SceneHelpers.AddScenePresence(scene, agent1);
109 presence.AddAttachment(sog1);
110 presence.AddAttachment(sog2);
111 presence.RemoveAttachment(sog1);
112 presence.RemoveAttachment(sog2);
113 Assert.That(presence.HasAttachments(), Is.False);
114 }
115
116 [Test]
117 public void TestRezAttachmentsOnAvatarEntrance()
118 {
119 TestHelpers.InMethod();
120// log4net.Config.XmlConfigurator.Configure();
121
122 UUID userId = TestHelpers.ParseTail(0x1);
123 UUID attItemId = TestHelpers.ParseTail(0x2);
124 UUID attAssetId = TestHelpers.ParseTail(0x3);
125 string attName = "att";
126
127 UserAccountHelpers.CreateUserWithInventory(scene, userId);
128 InventoryItemBase attItem
129 = UserInventoryHelpers.CreateInventoryItem(
130 scene, attName, attItemId, attAssetId, userId, InventoryType.Object);
131
132 AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId);
133 acd.Appearance = new AvatarAppearance();
134 acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID);
135 ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd);
136
137 Assert.That(presence.HasAttachments(), Is.True);
138 List<SceneObjectGroup> attachments = presence.Attachments;
139
140 Assert.That(attachments.Count, Is.EqualTo(1));
141 Assert.That(attachments[0].Name, Is.EqualTo(attName));
142 }
143
144 // I'm commenting this test because scene setup NEEDS InventoryService to
145 // be non-null
146 //[Test]
147// public void T032_CrossAttachments()
148// {
149// TestHelpers.InMethod();
150//
151// ScenePresence presence = scene.GetScenePresence(agent1);
152// ScenePresence presence2 = scene2.GetScenePresence(agent1);
153// presence2.AddAttachment(sog1);
154// presence2.AddAttachment(sog2);
155//
156// ISharedRegionModule serialiser = new SerialiserModule();
157// SceneHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser);
158// SceneHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser);
159//
160// Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross");
161//
162// //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful");
163// Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted");
164// Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects");
165// }
166
167 private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent)
168 {
169 SceneObjectPart sop = new SceneObjectPart();
170 sop.Name = RandomName();
171 sop.Description = RandomName();
172 sop.Text = RandomName();
173 sop.SitName = RandomName();
174 sop.TouchName = RandomName();
175 sop.UUID = uuid;
176 sop.Shape = PrimitiveBaseShape.Default;
177 sop.Shape.State = 1;
178 sop.OwnerID = agent;
179
180 SceneObjectGroup sog = new SceneObjectGroup(sop);
181 sog.SetScene(scene);
182
183 return sog;
184 }
185
186 private static string RandomName()
187 {
188 StringBuilder name = new StringBuilder();
189 int size = random.Next(5,12);
190 char ch;
191 for (int i = 0; i < size; i++)
192 {
193 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
194 name.Append(ch);
195 }
196
197 return name.ToString();
198 }
199 }
200} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index e3e3452..4627701 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
104 public void NewClient(IClientAPI client) 104 public void NewClient(IClientAPI client)
105 { 105 {
106 client.OnRequestWearables += SendWearables; 106 client.OnRequestWearables += SendWearables;
107 client.OnSetAppearance += SetAppearance; 107 client.OnSetAppearance += SetAppearanceFromClient;
108 client.OnAvatarNowWearing += AvatarIsWearing; 108 client.OnAvatarNowWearing += AvatarIsWearing;
109 } 109 }
110 110
@@ -189,7 +189,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
189 /// <param name="client"></param> 189 /// <param name="client"></param>
190 /// <param name="texture"></param> 190 /// <param name="texture"></param>
191 /// <param name="visualParam"></param> 191 /// <param name="visualParam"></param>
192 public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) 192 public void SetAppearanceFromClient(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams)
193 { 193 {
194 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 194 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
195 if (sp == null) 195 if (sp == null)
@@ -257,6 +257,85 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
257 return true; 257 return true;
258 } 258 }
259 259
260 public bool SaveBakedTextures(UUID agentId)
261 {
262 ScenePresence sp = m_scene.GetScenePresence(agentId);
263
264 if (sp == null || sp.IsChildAgent)
265 return false;
266
267 AvatarAppearance appearance = sp.Appearance;
268 Primitive.TextureEntryFace[] faceTextures = appearance.Texture.FaceTextures;
269
270 m_log.DebugFormat(
271 "[AV FACTORY]: Permanently saving baked textures for {0} in {1}",
272 sp.Name, m_scene.RegionInfo.RegionName);
273
274 foreach (int i in Enum.GetValues(typeof(BakeType)))
275 {
276 BakeType bakeType = (BakeType)i;
277
278 if (bakeType == BakeType.Unknown)
279 continue;
280
281// m_log.DebugFormat(
282// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}",
283// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
284
285 int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType);
286 Primitive.TextureEntryFace bakedTextureFace = faceTextures[ftIndex];
287
288 if (bakedTextureFace == null)
289 {
290 m_log.WarnFormat(
291 "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
292 bakeType, sp.Name, m_scene.RegionInfo.RegionName);
293
294 continue;
295 }
296
297 AssetBase asset = m_scene.AssetService.Get(bakedTextureFace.TextureID.ToString());
298
299 if (asset != null)
300 {
301 asset.Temporary = false;
302 m_scene.AssetService.Store(asset);
303 }
304 else
305 {
306 m_log.WarnFormat(
307 "[AV FACTORY]: Baked texture id {0} not found for bake {1} for avatar {2} in {3} when trying to save permanently",
308 bakedTextureFace.TextureID, bakeType, sp.Name, m_scene.RegionInfo.RegionName);
309 }
310 }
311
312// for (int i = 0; i < faceTextures.Length; i++)
313// {
314//// m_log.DebugFormat(
315//// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}",
316//// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
317//
318// if (faceTextures[i] == null)
319// continue;
320//
321// AssetBase asset = m_scene.AssetService.Get(faceTextures[i].TextureID.ToString());
322//
323// if (asset != null)
324// {
325// asset.Temporary = false;
326// m_scene.AssetService.Store(asset);
327// }
328// else
329// {
330// m_log.WarnFormat(
331// "[AV FACTORY]: Baked texture {0} for {1} in {2} not found when trying to save permanently",
332// faceTextures[i].TextureID, sp.Name, m_scene.RegionInfo.RegionName);
333// }
334// }
335
336 return true;
337 }
338
260 #region UpdateAppearanceTimer 339 #region UpdateAppearanceTimer
261 340
262 /// <summary> 341 /// <summary>
@@ -289,25 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
289 } 368 }
290 } 369 }
291 370
292 private void HandleAppearanceSend(UUID agentid) 371 private void SaveAppearance(UUID agentid)
293 {
294 ScenePresence sp = m_scene.GetScenePresence(agentid);
295 if (sp == null)
296 {
297 m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid);
298 return;
299 }
300
301 // m_log.WarnFormat("[AVFACTORY]: Handle appearance send for {0}", agentid);
302
303 // Send the appearance to everyone in the scene
304 sp.SendAppearanceToAllOtherAgents();
305
306 // Send animations back to the avatar as well
307 sp.Animator.SendAnimPack();
308 }
309
310 private void HandleAppearanceSave(UUID agentid)
311 { 372 {
312 // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved 373 // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved
313 // in a culture where decimal points are commas and then reloaded in a culture which just treats them as 374 // in a culture where decimal points are commas and then reloaded in a culture which just treats them as
@@ -337,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
337 { 398 {
338 if (kvp.Value < now) 399 if (kvp.Value < now)
339 { 400 {
340 Util.FireAndForget(delegate(object o) { HandleAppearanceSend(kvp.Key); }); 401 Util.FireAndForget(delegate(object o) { SendAppearance(kvp.Key); });
341 m_sendqueue.Remove(kvp.Key); 402 m_sendqueue.Remove(kvp.Key);
342 } 403 }
343 } 404 }
@@ -350,7 +411,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
350 { 411 {
351 if (kvp.Value < now) 412 if (kvp.Value < now)
352 { 413 {
353 Util.FireAndForget(delegate(object o) { HandleAppearanceSave(kvp.Key); }); 414 Util.FireAndForget(delegate(object o) { SaveAppearance(kvp.Key); });
354 m_savequeue.Remove(kvp.Key); 415 m_savequeue.Remove(kvp.Key);
355 } 416 }
356 } 417 }
@@ -427,6 +488,24 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
427 } 488 }
428 } 489 }
429 490
491 public bool SendAppearance(UUID agentId)
492 {
493 ScenePresence sp = m_scene.GetScenePresence(agentId);
494 if (sp == null)
495 {
496 m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId);
497 return false;
498 }
499
500 // Send the appearance to everyone in the scene
501 sp.SendAppearanceToAllOtherAgents();
502
503 // Send animations back to the avatar as well
504 sp.Animator.SendAnimPack();
505
506 return true;
507 }
508
430 private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) 509 private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance)
431 { 510 {
432 IInventoryService invService = m_scene.InventoryService; 511 IInventoryService invService = m_scene.InventoryService;
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
index 07de908..b831b31 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
@@ -44,21 +44,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
44 [Test] 44 [Test]
45 public void TestSetAppearance() 45 public void TestSetAppearance()
46 { 46 {
47 TestHelper.InMethod(); 47 TestHelpers.InMethod();
48// log4net.Config.XmlConfigurator.Configure(); 48// log4net.Config.XmlConfigurator.Configure();
49 49
50 UUID userId = TestHelper.ParseTail(0x1); 50 UUID userId = TestHelpers.ParseTail(0x1);
51 51
52 AvatarFactoryModule afm = new AvatarFactoryModule(); 52 AvatarFactoryModule afm = new AvatarFactoryModule();
53 TestScene scene = SceneSetupHelpers.SetupScene(); 53 TestScene scene = SceneHelpers.SetupScene();
54 SceneSetupHelpers.SetupSceneModules(scene, afm); 54 SceneHelpers.SetupSceneModules(scene, afm);
55 TestClient tc = SceneSetupHelpers.AddClient(scene, userId); 55 IClientAPI tc = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
56 56
57 byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT]; 57 byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT];
58 for (byte i = 0; i < visualParams.Length; i++) 58 for (byte i = 0; i < visualParams.Length; i++)
59 visualParams[i] = i; 59 visualParams[i] = i;
60 60
61 afm.SetAppearance(tc, new Primitive.TextureEntry(TestHelper.ParseTail(0x10)), visualParams); 61 afm.SetAppearanceFromClient(tc, new Primitive.TextureEntry(TestHelpers.ParseTail(0x10)), visualParams);
62 62
63 ScenePresence sp = scene.GetScenePresence(userId); 63 ScenePresence sp = scene.GetScenePresence(userId);
64 64
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index aadeedb..19ef571 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -100,8 +100,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
100// log4net.Config.XmlConfigurator.Configure(); 100// log4net.Config.XmlConfigurator.Configure();
101 101
102 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 102 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
103 Scene scene = SceneSetupHelpers.SetupScene(); 103 Scene scene = SceneHelpers.SetupScene();
104 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 104 SceneHelpers.SetupSceneModules(scene, archiverModule);
105 105
106 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 106 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
107 107
@@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
109 109
110 // Create scene object asset 110 // Create scene object asset
111 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); 111 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
112 SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); 112 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50);
113 113
114 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); 114 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
115 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); 115 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
@@ -127,10 +127,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
127 scene.AddInventoryItem(item1); 127 scene.AddInventoryItem(item1);
128 128
129 // Create coalesced objects asset 129 // Create coalesced objects asset
130 SceneObjectGroup cobj1 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120); 130 SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120);
131 cobj1.AbsolutePosition = new Vector3(15, 30, 45); 131 cobj1.AbsolutePosition = new Vector3(15, 30, 45);
132 132
133 SceneObjectGroup cobj2 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140); 133 SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140);
134 cobj2.AbsolutePosition = new Vector3(25, 50, 75); 134 cobj2.AbsolutePosition = new Vector3(25, 50, 75);
135 135
136 CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2); 136 CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index ae3ab21..e409c8e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -61,14 +61,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
61 SerialiserModule serialiserModule = new SerialiserModule(); 61 SerialiserModule serialiserModule = new SerialiserModule();
62 m_archiverModule = new InventoryArchiverModule(); 62 m_archiverModule = new InventoryArchiverModule();
63 63
64 m_scene = SceneSetupHelpers.SetupScene(); 64 m_scene = SceneHelpers.SetupScene();
65 SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); 65 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
66 } 66 }
67 67
68 [Test] 68 [Test]
69 public void TestLoadCoalesecedItem() 69 public void TestLoadCoalesecedItem()
70 { 70 {
71 TestHelper.InMethod(); 71 TestHelpers.InMethod();
72// log4net.Config.XmlConfigurator.Configure(); 72// log4net.Config.XmlConfigurator.Configure();
73 73
74 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); 74 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password");
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
104 [Test] 104 [Test]
105 public void TestOrder() 105 public void TestOrder()
106 { 106 {
107 TestHelper.InMethod(); 107 TestHelpers.InMethod();
108// log4net.Config.XmlConfigurator.Configure(); 108// log4net.Config.XmlConfigurator.Configure();
109 109
110 MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes); 110 MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes);
@@ -129,7 +129,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
129 [Test] 129 [Test]
130 public void TestSaveItemToIar() 130 public void TestSaveItemToIar()
131 { 131 {
132 TestHelper.InMethod(); 132 TestHelpers.InMethod();
133// log4net.Config.XmlConfigurator.Configure(); 133// log4net.Config.XmlConfigurator.Configure();
134 134
135 // Create user 135 // Create user
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
141 141
142 // Create asset 142 // Create asset
143 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); 143 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
144 SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); 144 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
145 145
146 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); 146 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
147 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); 147 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
224 [Test] 224 [Test]
225 public void TestSaveItemToIarNoAssets() 225 public void TestSaveItemToIarNoAssets()
226 { 226 {
227 TestHelper.InMethod(); 227 TestHelpers.InMethod();
228// log4net.Config.XmlConfigurator.Configure(); 228// log4net.Config.XmlConfigurator.Configure();
229 229
230 // Create user 230 // Create user
@@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
236 236
237 // Create asset 237 // Create asset
238 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); 238 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
239 SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); 239 SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
240 240
241 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); 241 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
242 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); 242 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
@@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
325 [Test] 325 [Test]
326 public void TestLoadIarCreatorAccountPresent() 326 public void TestLoadIarCreatorAccountPresent()
327 { 327 {
328 TestHelper.InMethod(); 328 TestHelpers.InMethod();
329// log4net.Config.XmlConfigurator.Configure(); 329// log4net.Config.XmlConfigurator.Configure();
330 330
331 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); 331 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
@@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
357 [Test] 357 [Test]
358 public void TestLoadIarV0_1SameNameCreator() 358 public void TestLoadIarV0_1SameNameCreator()
359 { 359 {
360 TestHelper.InMethod(); 360 TestHelpers.InMethod();
361// log4net.Config.XmlConfigurator.Configure(); 361// log4net.Config.XmlConfigurator.Configure();
362 362
363 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); 363 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
@@ -390,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
390 [Test] 390 [Test]
391 public void TestLoadIarV0_1AbsentCreator() 391 public void TestLoadIarV0_1AbsentCreator()
392 { 392 {
393 TestHelper.InMethod(); 393 TestHelpers.InMethod();
394// log4net.Config.XmlConfigurator.Configure(); 394// log4net.Config.XmlConfigurator.Configure();
395 395
396 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); 396 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password");
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index 127d5f8..417c20c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -57,13 +57,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
57 [Test] 57 [Test]
58 public void TestSavePathToIarV0_1() 58 public void TestSavePathToIarV0_1()
59 { 59 {
60 TestHelper.InMethod(); 60 TestHelpers.InMethod();
61// log4net.Config.XmlConfigurator.Configure(); 61// log4net.Config.XmlConfigurator.Configure();
62 62
63 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 63 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
64 64
65 Scene scene = SceneSetupHelpers.SetupScene(); 65 Scene scene = SceneHelpers.SetupScene();
66 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 66 SceneHelpers.SetupSceneModules(scene, archiverModule);
67 67
68 // Create user 68 // Create user
69 string userFirstName = "Jock"; 69 string userFirstName = "Jock";
@@ -172,16 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
172 [Test] 172 [Test]
173 public void TestLoadIarToInventoryPaths() 173 public void TestLoadIarToInventoryPaths()
174 { 174 {
175 TestHelper.InMethod(); 175 TestHelpers.InMethod();
176// log4net.Config.XmlConfigurator.Configure(); 176// log4net.Config.XmlConfigurator.Configure();
177 177
178 SerialiserModule serialiserModule = new SerialiserModule(); 178 SerialiserModule serialiserModule = new SerialiserModule();
179 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 179 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
180 180
181 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 181 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
182 Scene scene = SceneSetupHelpers.SetupScene(); 182 Scene scene = SceneHelpers.SetupScene();
183 183
184 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 184 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
185 185
186 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); 186 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood");
187 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 187 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
@@ -217,13 +217,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
217 [Test] 217 [Test]
218 public void TestLoadIarPathStartsWithSlash() 218 public void TestLoadIarPathStartsWithSlash()
219 { 219 {
220 TestHelper.InMethod(); 220 TestHelpers.InMethod();
221// log4net.Config.XmlConfigurator.Configure(); 221// log4net.Config.XmlConfigurator.Configure();
222 222
223 SerialiserModule serialiserModule = new SerialiserModule(); 223 SerialiserModule serialiserModule = new SerialiserModule();
224 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 224 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
225 Scene scene = SceneSetupHelpers.SetupScene(); 225 Scene scene = SceneHelpers.SetupScene();
226 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 226 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
227 227
228 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); 228 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
229 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); 229 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream);
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
238 [Test] 238 [Test]
239 public void TestLoadIarPathWithEscapedChars() 239 public void TestLoadIarPathWithEscapedChars()
240 { 240 {
241 TestHelper.InMethod(); 241 TestHelpers.InMethod();
242// log4net.Config.XmlConfigurator.Configure(); 242// log4net.Config.XmlConfigurator.Configure();
243 243
244 string itemName = "You & you are a mean/man/"; 244 string itemName = "You & you are a mean/man/";
@@ -247,8 +247,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
247 247
248 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 248 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
249 249
250 Scene scene = SceneSetupHelpers.SetupScene(); 250 Scene scene = SceneHelpers.SetupScene();
251 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 251 SceneHelpers.SetupSceneModules(scene, archiverModule);
252 252
253 // Create user 253 // Create user
254 string userFirstName = "Jock"; 254 string userFirstName = "Jock";
@@ -323,10 +323,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
323 [Test] 323 [Test]
324 public void TestNewIarPath() 324 public void TestNewIarPath()
325 { 325 {
326 TestHelper.InMethod(); 326 TestHelpers.InMethod();
327// log4net.Config.XmlConfigurator.Configure(); 327// log4net.Config.XmlConfigurator.Configure();
328 328
329 Scene scene = SceneSetupHelpers.SetupScene(); 329 Scene scene = SceneHelpers.SetupScene();
330 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 330 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
331 331
332 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); 332 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
@@ -390,10 +390,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
390 [Test] 390 [Test]
391 public void TestPartExistingIarPath() 391 public void TestPartExistingIarPath()
392 { 392 {
393 TestHelper.InMethod(); 393 TestHelpers.InMethod();
394 //log4net.Config.XmlConfigurator.Configure(); 394 //log4net.Config.XmlConfigurator.Configure();
395 395
396 Scene scene = SceneSetupHelpers.SetupScene(); 396 Scene scene = SceneHelpers.SetupScene();
397 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 397 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
398 398
399 string folder1ExistingName = "a"; 399 string folder1ExistingName = "a";
@@ -441,10 +441,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
441 [Test] 441 [Test]
442 public void TestMergeIarPath() 442 public void TestMergeIarPath()
443 { 443 {
444 TestHelper.InMethod(); 444 TestHelpers.InMethod();
445// log4net.Config.XmlConfigurator.Configure(); 445// log4net.Config.XmlConfigurator.Configure();
446 446
447 Scene scene = SceneSetupHelpers.SetupScene(); 447 Scene scene = SceneHelpers.SetupScene();
448 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 448 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
449 449
450 string folder1ExistingName = "a"; 450 string folder1ExistingName = "a";