aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs4
-rw-r--r--OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs4
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs4
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Framework/Servers/VersionInfo.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs55
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs34
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs50
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs50
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs28
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/ITerrain.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs9
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs84
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs4
-rw-r--r--OpenSim/Tests/Common/Setup/AssetHelpers.cs46
-rw-r--r--OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs18
27 files changed, 322 insertions, 133 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index 30c8e4c..5798a64 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -1723,5 +1723,9 @@ namespace OpenSim.Client.MXP.ClientStack
1723 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) 1723 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1724 { 1724 {
1725 } 1725 }
1726
1727 public void StopFlying(ISceneEntity presence)
1728 {
1729 }
1726 } 1730 }
1727} 1731}
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
index bc48123..906947e 100644
--- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
+++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
@@ -1208,6 +1208,10 @@ namespace OpenSim.Client.Sirikata.ClientStack
1208 { 1208 {
1209 } 1209 }
1210 1210
1211 public void StopFlying(ISceneEntity presence)
1212 {
1213 }
1214
1211 #endregion 1215 #endregion
1212 } 1216 }
1213} 1217}
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index e6d1c48..13a27f5 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -1223,5 +1223,9 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
1223 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) 1223 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1224 { 1224 {
1225 } 1225 }
1226
1227 public void StopFlying(ISceneEntity presence)
1228 {
1229 }
1226 } 1230 }
1227} 1231}
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 71174d2..d85b101 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1310,5 +1310,7 @@ namespace OpenSim.Framework
1310 1310
1311 void SendChangeUserRights(UUID agentID, UUID friendID, int rights); 1311 void SendChangeUserRights(UUID agentID, UUID friendID, int rights);
1312 void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId); 1312 void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId);
1313
1314 void StopFlying(ISceneEntity presence);
1313 } 1315 }
1314} 1316}
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs
index 518f2ea..f3ac191 100644
--- a/OpenSim/Framework/Servers/VersionInfo.cs
+++ b/OpenSim/Framework/Servers/VersionInfo.cs
@@ -29,7 +29,7 @@ namespace OpenSim
29{ 29{
30 public class VersionInfo 30 public class VersionInfo
31 { 31 {
32 private const string VERSION_NUMBER = "0.7CM"; 32 private const string VERSION_NUMBER = "0.7.1CM";
33 private const Flavour VERSION_FLAVOUR = Flavour.Dev; 33 private const Flavour VERSION_FLAVOUR = Flavour.Dev;
34 34
35 public enum Flavour 35 public enum Flavour
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index b2df0bd..f071841 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -11873,5 +11873,60 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11873 dialog.Buttons = buttons; 11873 dialog.Buttons = buttons;
11874 OutPacket(dialog, ThrottleOutPacketType.Task); 11874 OutPacket(dialog, ThrottleOutPacketType.Task);
11875 } 11875 }
11876
11877 public void StopFlying(ISceneEntity p)
11878 {
11879 if (p is ScenePresence)
11880 {
11881 ScenePresence presence = p as ScenePresence;
11882 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities
11883 // There's no explicit message to send the client to tell it to stop flying.. it relies on the
11884 // velocity, collision plane and avatar height
11885
11886 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
11887 // when the avatar stands up
11888
11889 Vector3 pos = presence.AbsolutePosition;
11890
11891 if (presence.Appearance.AvatarHeight != 127.0f)
11892 pos += new Vector3(0f, 0f, (presence.Appearance.AvatarHeight/6f));
11893 else
11894 pos += new Vector3(0f, 0f, (1.56f/6f));
11895
11896 presence.AbsolutePosition = pos;
11897
11898 // attach a suitable collision plane regardless of the actual situation to force the LLClient to land.
11899 // Collision plane below the avatar's position a 6th of the avatar's height is suitable.
11900 // Mind you, that this method doesn't get called if the avatar's velocity magnitude is greater then a
11901 // certain amount.. because the LLClient wouldn't land in that situation anyway.
11902
11903 // why are we still testing for this really old height value default???
11904 if (presence.Appearance.AvatarHeight != 127.0f)
11905 presence.CollisionPlane = new Vector4(0, 0, 0, pos.Z - presence.Appearance.AvatarHeight/6f);
11906 else
11907 presence.CollisionPlane = new Vector4(0, 0, 0, pos.Z - (1.56f/6f));
11908
11909
11910 ImprovedTerseObjectUpdatePacket.ObjectDataBlock block =
11911 CreateImprovedTerseBlock(p, false);
11912
11913 const float TIME_DILATION = 1.0f;
11914 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
11915
11916
11917 ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
11918 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
11919 packet.RegionData.TimeDilation = timeDilation;
11920 packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
11921
11922 packet.ObjectData[0] = block;
11923
11924 OutPacket(packet, ThrottleOutPacketType.Task, true);
11925 }
11926
11927 //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
11928 // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
11929
11930 }
11876 } 11931 }
11877} 11932}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 60d1720..b4f1ed6 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -219,40 +219,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
219 CreateFoldersForPath(destFolder, archivePathSectionToCreate, resolvedFolders, loadedNodes); 219 CreateFoldersForPath(destFolder, archivePathSectionToCreate, resolvedFolders, loadedNodes);
220 220
221 return destFolder; 221 return destFolder;
222
223 /*
224 string[] rawFolders = filePath.Split(new char[] { '/' });
225
226 // Find the folders that do exist along the path given
227 int i = 0;
228 bool noFolder = false;
229 InventoryFolderImpl foundFolder = rootDestinationFolder;
230 while (!noFolder && i < rawFolders.Length)
231 {
232 InventoryFolderImpl folder = foundFolder.FindFolderByPath(rawFolders[i]);
233 if (null != folder)
234 {
235 m_log.DebugFormat("[INVENTORY ARCHIVER]: Found folder {0}", folder.Name);
236 foundFolder = folder;
237 i++;
238 }
239 else
240 {
241 noFolder = true;
242 }
243 }
244
245 // Create any folders that did not previously exist
246 while (i < rawFolders.Length)
247 {
248 m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0}", rawFolders[i]);
249
250 UUID newFolderId = UUID.Random();
251 m_userInfo.CreateFolder(
252 rawFolders[i++], newFolderId, (ushort)AssetType.Folder, foundFolder.ID);
253 foundFolder = foundFolder.GetChildFolder(newFolderId);
254 }
255 */
256 } 222 }
257 223
258 /// <summary> 224 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 59cd386..00bd27a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
279 public void TestIarV0_1WithEscapedChars() 279 public void TestIarV0_1WithEscapedChars()
280 { 280 {
281 TestHelper.InMethod(); 281 TestHelper.InMethod();
282 log4net.Config.XmlConfigurator.Configure(); 282// log4net.Config.XmlConfigurator.Configure();
283 283
284 string itemName = "You & you are a mean/man/"; 284 string itemName = "You & you are a mean/man/";
285 string humanEscapedItemName = @"You & you are a mean\/man\/"; 285 string humanEscapedItemName = @"You & you are a mean\/man\/";
@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
505 /// Test replication of an archive path to the user's inventory. 505 /// Test replication of an archive path to the user's inventory.
506 /// </summary> 506 /// </summary>
507 [Test] 507 [Test]
508 public void TestReplicateArchivePathToUserInventory() 508 public void TestNewIarPath()
509 { 509 {
510 TestHelper.InMethod(); 510 TestHelper.InMethod();
511 //log4net.Config.XmlConfigurator.Configure(); 511 //log4net.Config.XmlConfigurator.Configure();
@@ -540,5 +540,51 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
540 InventoryFolderBase folder2 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, "b"); 540 InventoryFolderBase folder2 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, "b");
541 Assert.That(folder2, Is.Not.Null, "Could not find folder b"); 541 Assert.That(folder2, Is.Not.Null, "Could not find folder b");
542 } 542 }
543
544 /// <summary>
545 /// Test replication of a partly existing archive path to the user's inventory.
546 /// </summary>
547 [Test]
548 public void TestPartExistingIarPath()
549 {
550 TestHelper.InMethod();
551 //log4net.Config.XmlConfigurator.Configure();
552
553 Scene scene = SceneSetupHelpers.SetupScene("inventory");
554 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
555
556 string folder1ExistingName = "a";
557 string folder2Name = "b";
558 string itemName = "c.lsl";
559
560 InventoryFolderBase folder1
561 = UserInventoryTestUtils.CreateInventoryFolder(
562 scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
563
564 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random());
565 string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random());
566 string itemArchiveName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random());
567
568 string itemArchivePath
569 = string.Format(
570 "{0}{1}{2}{3}",
571 ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemArchiveName);
572
573 new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null)
574 .ReplicateArchivePathToUserInventory(
575 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
576 new Dictionary<string, InventoryFolderBase>(), new List<InventoryNodeBase>());
577
578 InventoryFolderBase folder1Post
579 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
580 Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID));
581 /*
582 InventoryFolderBase folder2
583 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b");
584 Assert.That(folder2, Is.Not.Null);
585 InventoryItemBase item = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, folder2, itemName);
586 Assert.That(item, Is.Not.Null);
587 */
588 }
543 } 589 }
544} \ No newline at end of file 590} \ 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 c333812..2f1e9dd 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -154,17 +154,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
154 private void OnInstantMessage(IClientAPI client, GridInstantMessage im) 154 private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
155 { 155 {
156 m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog); 156 m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog);
157
157 Scene scene = FindClientScene(client.AgentId); 158 Scene scene = FindClientScene(client.AgentId);
158 159
159 if (scene == null) // Something seriously wrong here. 160 if (scene == null) // Something seriously wrong here.
160 return; 161 return;
161 162
162 163
163
164 if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) 164 if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
165 { 165 {
166 //m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0])); 166 //m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0]));
167 167
168 if (im.binaryBucket.Length < 17) // Invalid
169 return;
170
168 UUID receipientID = new UUID(im.toAgentID); 171 UUID receipientID = new UUID(im.toAgentID);
169 ScenePresence user = scene.GetScenePresence(receipientID); 172 ScenePresence user = scene.GetScenePresence(receipientID);
170 UUID copyID; 173 UUID copyID;
@@ -420,8 +423,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
420 { 423 {
421 // Check if this is ours to handle 424 // Check if this is ours to handle
422 // 425 //
423 m_log.Info("OnGridInstantMessage");
424
425 Scene scene = FindClientScene(new UUID(msg.toAgentID)); 426 Scene scene = FindClientScene(new UUID(msg.toAgentID));
426 427
427 if (scene == null) 428 if (scene == null)
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 266621f..5e2c04c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -180,6 +180,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
180 180
181 sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); 181 sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
182 sp.Teleport(position); 182 sp.Teleport(position);
183
184 foreach (SceneObjectGroup grp in sp.Attachments)
185 sp.Scene.EventManager.TriggerOnScriptChangedEvent(grp.LocalId, (uint)Changed.TELEPORT);
183 } 186 }
184 else // Another region possibly in another simulator 187 else // Another region possibly in another simulator
185 { 188 {
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
index b71b5f6..b96d95a 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
@@ -70,10 +70,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
70 70
71 #region IMapImageGenerator Members 71 #region IMapImageGenerator Members
72 72
73 public byte[] WriteJpeg2000Image(string gradientmap) 73 public Bitmap CreateMapTile(string gradientmap)
74 { 74 {
75 byte[] imageData = null;
76
77 bool drawPrimVolume = true; 75 bool drawPrimVolume = true;
78 bool textureTerrain = false; 76 bool textureTerrain = false;
79 77
@@ -98,32 +96,36 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
98 } 96 }
99 terrainRenderer.Initialise(m_scene, m_config); 97 terrainRenderer.Initialise(m_scene, m_config);
100 98
101 using (Bitmap mapbmp = new Bitmap((int)Constants.RegionSize, (int)Constants.RegionSize)) 99 Bitmap mapbmp = new Bitmap((int)Constants.RegionSize, (int)Constants.RegionSize, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
102 { 100 //long t = System.Environment.TickCount;
103 //long t = System.Environment.TickCount; 101 //for (int i = 0; i < 10; ++i) {
104 //for (int i = 0; i < 10; ++i) { 102 terrainRenderer.TerrainToBitmap(mapbmp);
105 terrainRenderer.TerrainToBitmap(mapbmp); 103 //}
106 //} 104 //t = System.Environment.TickCount - t;
107 //t = System.Environment.TickCount - t; 105 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
108 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
109 106
110 107
111 if (drawPrimVolume) 108 if (drawPrimVolume)
112 { 109 {
113 DrawObjectVolume(m_scene, mapbmp); 110 DrawObjectVolume(m_scene, mapbmp);
114 } 111 }
115 112
116 try 113 return mapbmp;
117 { 114 }
118 imageData = OpenJPEG.EncodeFromImage(mapbmp, true); 115
119 } 116 public byte[] WriteJpeg2000Image(string gradientmap)
120 catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke 117 {
121 { 118 try
122 m_log.Error("Failed generating terrain map: " + e); 119 {
123 } 120 using (Bitmap mapbmp = CreateMapTile(gradientmap))
121 return OpenJPEG.EncodeFromImage(mapbmp, true);
122 }
123 catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke
124 {
125 m_log.Error("Failed generating terrain map: " + e);
124 } 126 }
125 127
126 return imageData; 128 return null;
127 } 129 }
128 130
129 #endregion 131 #endregion
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
index a297cf3..fef2ef3 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
@@ -37,6 +37,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
37{ 37{
38 public class ShadedMapTileRenderer : IMapTileTerrainRenderer 38 public class ShadedMapTileRenderer : IMapTileTerrainRenderer
39 { 39 {
40 private static readonly Color WATER_COLOR = Color.FromArgb(29, 71, 95);
41
40 private static readonly ILog m_log = 42 private static readonly ILog m_log =
41 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 44
@@ -221,8 +223,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
221 223
222 try 224 try
223 { 225 {
224 Color water = Color.FromArgb((int)heightvalue, (int)heightvalue, 255); 226 mapbmp.SetPixel(x, yr, WATER_COLOR);
225 mapbmp.SetPixel(x, yr, water);
226 } 227 }
227 catch (ArgumentException) 228 catch (ArgumentException)
228 { 229 {
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs
index 4ecad74..8b34f6e 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs
@@ -136,6 +136,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
136 private static readonly UUID defaultTerrainTexture4 = new UUID("53a2f406-4895-1d13-d541-d2e3b86bc19c"); 136 private static readonly UUID defaultTerrainTexture4 = new UUID("53a2f406-4895-1d13-d541-d2e3b86bc19c");
137 private static readonly Color defaultColor4 = Color.FromArgb(200, 200, 200); 137 private static readonly Color defaultColor4 = Color.FromArgb(200, 200, 200);
138 138
139 private static readonly Color WATER_COLOR = Color.FromArgb(29, 71, 95);
140
139 #endregion 141 #endregion
140 142
141 143
@@ -406,8 +408,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
406 408
407 heightvalue = 100f - (heightvalue * 100f) / 19f; // 0 - 19 => 100 - 0 409 heightvalue = 100f - (heightvalue * 100f) / 19f; // 0 - 19 => 100 - 0
408 410
409 Color water = Color.FromArgb((int)heightvalue, (int)heightvalue, 255); 411 mapbmp.SetPixel(x, yr, WATER_COLOR);
410 mapbmp.SetPixel(x, yr, water);
411 } 412 }
412 } 413 }
413 } 414 }
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index c6fb18d..0e849e5 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1002,41 +1002,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1002 1002
1003 public void RegenerateMaptile(byte[] data) 1003 public void RegenerateMaptile(byte[] data)
1004 { 1004 {
1005 // Overwrites the local Asset cache with new maptile data
1006 // Assets are single write, this causes the asset server to ignore this update,
1007 // but the local asset cache does not
1008
1009 // this is on purpose! The net result of this is the region always has the most up to date
1010 // map tile while protecting the (grid) asset database from bloat caused by a new asset each
1011 // time a mapimage is generated!
1012
1013 UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; 1005 UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
1014 1006
1015 int lastMapRefresh = 0;
1016 int twoDays = 172800;
1017// int RefreshSeconds = twoDays;
1018
1019 try
1020 {
1021 lastMapRefresh = Convert.ToInt32(m_scene.RegionInfo.lastMapRefresh);
1022 }
1023 catch (ArgumentException)
1024 {
1025 }
1026 catch (FormatException)
1027 {
1028 }
1029 catch (OverflowException)
1030 {
1031 }
1032
1033 m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE"); 1007 m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE");
1034 1008
1035 m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random(); 1009 m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random();
1036 1010
1037 AssetBase asset = new AssetBase( 1011 AssetBase asset = new AssetBase(
1038 m_scene.RegionInfo.RegionSettings.TerrainImageID, 1012 m_scene.RegionInfo.RegionSettings.TerrainImageID,
1039 "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(), 1013 "terrainImage_" + m_scene.RegionInfo.RegionID.ToString(),
1040 (sbyte)AssetType.Texture, 1014 (sbyte)AssetType.Texture,
1041 m_scene.RegionInfo.RegionID.ToString()); 1015 m_scene.RegionInfo.RegionID.ToString());
1042 asset.Data = data; 1016 asset.Data = data;
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index a84a3c8..8ec5bb5 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -1164,5 +1164,9 @@ namespace OpenSim.Region.Examples.SimpleModule
1164 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) 1164 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1165 { 1165 {
1166 } 1166 }
1167
1168 public void StopFlying(ISceneEntity presence)
1169 {
1170 }
1167 } 1171 }
1168} 1172}
diff --git a/OpenSim/Region/Framework/Interfaces/ITerrain.cs b/OpenSim/Region/Framework/Interfaces/ITerrain.cs
index f5662cb..b42e872 100644
--- a/OpenSim/Region/Framework/Interfaces/ITerrain.cs
+++ b/OpenSim/Region/Framework/Interfaces/ITerrain.cs
@@ -73,6 +73,7 @@ namespace OpenSim.Region.Framework.Interfaces
73 73
74 public interface IMapImageGenerator 74 public interface IMapImageGenerator
75 { 75 {
76 System.Drawing.Bitmap CreateMapTile(string gradientmap);
76 byte[] WriteJpeg2000Image(string gradientmap); 77 byte[] WriteJpeg2000Image(string gradientmap);
77 } 78 }
78} 79}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index c4cff12..c3cdca8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -681,7 +681,7 @@ namespace OpenSim.Region.Framework.Scenes
681 foreach (TaskInventoryItem item in items) 681 foreach (TaskInventoryItem item in items)
682 { 682 {
683 m_items.Add(item.ItemID, item); 683 m_items.Add(item.ItemID, item);
684 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 684// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
685 } 685 }
686 m_items.LockItemsForWrite(false); 686 m_items.LockItemsForWrite(false);
687 687
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8cd3ac6..b6f67f7 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1098,27 +1098,7 @@ namespace OpenSim.Region.Framework.Scenes
1098 1098
1099 public void StopFlying() 1099 public void StopFlying()
1100 { 1100 {
1101 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities 1101 ControllingClient.StopFlying(this);
1102 // There's no explicit message to send the client to tell it to stop flying.. it relies on the
1103 // velocity, collision plane and avatar height
1104
1105 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
1106 // when the avatar stands up
1107
1108 if (m_avHeight != 127.0f)
1109 {
1110 AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (m_avHeight / 6f));
1111 }
1112 else
1113 {
1114 AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f));
1115 }
1116
1117 m_updateCount = UPDATE_COUNT; //KF: Trigger Anim updates to catch falling anim.
1118
1119 ControllingClient.SendPrimUpdate(this, PrimUpdateFlags.Position);
1120 //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
1121 // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
1122 } 1102 }
1123 1103
1124 public void AddNeighbourRegion(ulong regionHandle, string cap) 1104 public void AddNeighbourRegion(ulong regionHandle, string cap)
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index f7544ac..5bdaa17 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -221,7 +221,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
221 sr = new StringReader(parts[i].OuterXml); 221 sr = new StringReader(parts[i].OuterXml);
222 reader = new XmlTextReader(sr); 222 reader = new XmlTextReader(sr);
223 SceneObjectPart part = SceneObjectPart.FromXml(reader); 223 SceneObjectPart part = SceneObjectPart.FromXml(reader);
224
225 int originalLinkNum = part.LinkNum;
226
224 sceneObject.AddPart(part); 227 sceneObject.AddPart(part);
228
229 // SceneObjectGroup.AddPart() tries to be smart and automatically set the LinkNum.
230 // We override that here
231 if (originalLinkNum != 0)
232 part.LinkNum = originalLinkNum;
233
225 part.StoreUndoState(); 234 part.StoreUndoState();
226 reader.Close(); 235 reader.Close();
227 sr.Close(); 236 sr.Close();
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 2ed8fbf..d72ee6f 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1689,5 +1689,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1689 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) 1689 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1690 { 1690 {
1691 } 1691 }
1692
1693 public void StopFlying(ISceneEntity presence)
1694 {
1695 }
1692 } 1696 }
1693} 1697}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index e43ef78..c3edba2 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -1171,5 +1171,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
1171 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) 1171 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1172 { 1172 {
1173 } 1173 }
1174
1175 public void StopFlying(ISceneEntity presence)
1176 {
1177 }
1174 } 1178 }
1175} 1179}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0a4544c..9f3e354 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2862,6 +2862,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2862 // objects rezzed with this method are die_at_edge by default. 2862 // objects rezzed with this method are die_at_edge by default.
2863 new_group.RootPart.SetDieAtEdge(true); 2863 new_group.RootPart.SetDieAtEdge(true);
2864 2864
2865 new_group.ResumeScripts();
2866
2865 m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( 2867 m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
2866 "object_rez", new Object[] { 2868 "object_rez", new Object[] {
2867 new LSL_String( 2869 new LSL_String(
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp
index 23138ef..f02d2d9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OpenSim.Region.ScriptEngine.Shared.Api.Runtime.mdp
@@ -18,10 +18,10 @@
18 </DeploymentInformation> 18 </DeploymentInformation>
19 <Contents> 19 <Contents>
20 <File name="./CM_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 20 <File name="./CM_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
21 <File name="./CM_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
22 <File name="./Executor.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 21 <File name="./Executor.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
23 <File name="./LSL_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 22 <File name="./LSL_Constants.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
24 <File name="./LSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 23 <File name="./LSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
24 <File name="./LS_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
25 <File name="./MOD_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 25 <File name="./MOD_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
26 <File name="./OSSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 26 <File name="./OSSL_Stub.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
27 <File name="./ScriptBase.cs" subtype="Code" buildaction="Compile" dependson="" data="" /> 27 <File name="./ScriptBase.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 57924b7..6a61da6 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -28,17 +28,18 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Collections.Specialized; 30using System.Collections.Specialized;
31using System.Drawing;
32using System.Drawing.Imaging;
33using System.IO;
31using System.Net; 34using System.Net;
32using System.Reflection; 35using System.Reflection;
33using log4net; 36using log4net;
34using Mono.Addins; 37using Mono.Addins;
35using Nini.Config; 38using Nini.Config;
36using OpenSim.Framework; 39using OpenSim.Framework;
37using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 41using OpenSim.Region.Framework.Scenes;
40using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
41using OpenSim.Server.Base;
42using OpenMetaverse; 43using OpenMetaverse;
43using OpenMetaverse.StructuredData; 44using OpenMetaverse.StructuredData;
44 45
@@ -62,7 +63,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
62 #region ISharedRegionModule 63 #region ISharedRegionModule
63 64
64 public Type ReplaceableInterface { get { return null; } } 65 public Type ReplaceableInterface { get { return null; } }
65 public void RegionLoaded(Scene scene) { } 66 public void RegionLoaded(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { UploadMapTile(scene); } }
66 public void PostInitialise() { } 67 public void PostInitialise() { }
67 public void Close() { } 68 public void Close() { }
68 69
@@ -358,6 +359,83 @@ namespace OpenSim.Services.Connectors.SimianGrid
358 359
359 #endregion IGridService 360 #endregion IGridService
360 361
362 private void UploadMapTile(IScene scene)
363 {
364 string errorMessage = null;
365
366 // Create a PNG map tile and upload it to the AddMapTile API
367 byte[] pngData = Utils.EmptyBytes;
368 IMapImageGenerator tileGenerator = scene.RequestModuleInterface<IMapImageGenerator>();
369 if (tileGenerator == null)
370 {
371 m_log.Warn("[SIMIAN GRID CONNECTOR]: Cannot upload PNG map tile without an IMapImageGenerator");
372 return;
373 }
374
375 using (Image mapTile = tileGenerator.CreateMapTile("defaultstripe.png"))
376 {
377 using (MemoryStream stream = new MemoryStream())
378 {
379 mapTile.Save(stream, ImageFormat.Png);
380 pngData = stream.ToArray();
381 }
382 }
383
384 List<MultipartForm.Element> postParameters = new List<MultipartForm.Element>()
385 {
386 new MultipartForm.Parameter("X", scene.RegionInfo.RegionLocX.ToString()),
387 new MultipartForm.Parameter("Y", scene.RegionInfo.RegionLocY.ToString()),
388 new MultipartForm.File("Tile", "tile.png", "image/png", pngData)
389 };
390
391 // Make the remote storage request
392 try
393 {
394 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_serverUrl);
395
396 HttpWebResponse response = MultipartForm.Post(request, postParameters);
397 using (Stream responseStream = response.GetResponseStream())
398 {
399 string responseStr = null;
400
401 try
402 {
403 responseStr = responseStream.GetStreamString();
404 OSD responseOSD = OSDParser.Deserialize(responseStr);
405 if (responseOSD.Type == OSDType.Map)
406 {
407 OSDMap responseMap = (OSDMap)responseOSD;
408 if (responseMap["Success"].AsBoolean())
409 m_log.Info("[SIMIAN GRID CONNECTOR]: Uploaded " + pngData.Length + " byte PNG map tile to AddMapTile");
410 else
411 errorMessage = "Upload failed: " + responseMap["Message"].AsString();
412 }
413 else
414 {
415 errorMessage = "Response format was invalid:\n" + responseStr;
416 }
417 }
418 catch (Exception ex)
419 {
420 if (!String.IsNullOrEmpty(responseStr))
421 errorMessage = "Failed to parse the response:\n" + responseStr;
422 else
423 errorMessage = "Failed to retrieve the response: " + ex.Message;
424 }
425 }
426 }
427 catch (WebException ex)
428 {
429 errorMessage = ex.Message;
430 }
431
432 if (!String.IsNullOrEmpty(errorMessage))
433 {
434 m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}",
435 pngData.Length, scene.RegionInfo.RegionName, errorMessage);
436 }
437 }
438
361 private GridRegion GetNearestRegion(Vector3d position, bool onlyEnabled) 439 private GridRegion GetNearestRegion(Vector3d position, bool onlyEnabled)
362 { 440 {
363 NameValueCollection requestArgs = new NameValueCollection 441 NameValueCollection requestArgs = new NameValueCollection
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index ebbf4ff..f8304c0 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -1224,5 +1224,9 @@ namespace OpenSim.Tests.Common.Mock
1224 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) 1224 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1225 { 1225 {
1226 } 1226 }
1227
1228 public void StopFlying(ISceneEntity presence)
1229 {
1230 }
1227 } 1231 }
1228} 1232}
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
index 6dc993f..f9a80b0 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
@@ -36,25 +36,29 @@ namespace OpenSim.Tests.Common
36 public class AssetHelpers 36 public class AssetHelpers
37 { 37 {
38 /// <summary> 38 /// <summary>
39 /// Create an asset from the given data 39 /// Create a notecard asset with a random uuid and dummy text.
40 /// </summary> 40 /// </summary>
41 public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, byte[] data, UUID creatorID) 41 /// <param name="creatorId">/param>
42 /// <returns></returns>
43 public static AssetBase CreateAsset(UUID creatorId)
42 { 44 {
43 AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)assetType, creatorID.ToString()); 45 return CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
44 asset.Data = data;
45 return asset;
46 } 46 }
47 47
48 /// <summary> 48 /// <summary>
49 /// Create an asset from the given data 49 /// Create and store a notecard asset with a random uuid and dummy text.
50 /// </summary> 50 /// </summary>
51 public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, string data, UUID creatorID) 51 /// <param name="creatorId">/param>
52 /// <returns></returns>
53 public static AssetBase CreateAsset(Scene scene, UUID creatorId)
52 { 54 {
53 return CreateAsset(assetUuid, assetType, Encoding.ASCII.GetBytes(data), creatorID); 55 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
54 } 56 scene.AssetService.Store(asset);
55 57 return asset;
58 }
59
56 /// <summary> 60 /// <summary>
57 /// Create an asset from the given scene object 61 /// Create an asset from the given scene object.
58 /// </summary> 62 /// </summary>
59 /// <param name="assetUuid"></param> 63 /// <param name="assetUuid"></param>
60 /// <param name="sog"></param> 64 /// <param name="sog"></param>
@@ -67,5 +71,23 @@ namespace OpenSim.Tests.Common
67 Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(sog)), 71 Encoding.ASCII.GetBytes(SceneObjectSerializer.ToXml2Format(sog)),
68 sog.OwnerID); 72 sog.OwnerID);
69 } 73 }
74
75 /// <summary>
76 /// Create an asset from the given data.
77 /// </summary>
78 public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, string data, UUID creatorID)
79 {
80 return CreateAsset(assetUuid, assetType, Encoding.ASCII.GetBytes(data), creatorID);
81 }
82
83 /// <summary>
84 /// Create an asset from the given data.
85 /// </summary>
86 public static AssetBase CreateAsset(UUID assetUuid, AssetType assetType, byte[] data, UUID creatorID)
87 {
88 AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)assetType, creatorID.ToString());
89 asset.Data = data;
90 return asset;
91 }
70 } 92 }
71} 93}
diff --git a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
index 7e0c567..c57363a 100644
--- a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
+++ b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes;
31using OpenSim.Services.Interfaces; 32using OpenSim.Services.Interfaces;
32 33
33namespace OpenSim.Tests.Common 34namespace OpenSim.Tests.Common
@@ -39,6 +40,23 @@ namespace OpenSim.Tests.Common
39 { 40 {
40 public static readonly string PATH_DELIMITER = "/"; 41 public static readonly string PATH_DELIMITER = "/";
41 42
43 public static InventoryItemBase CreateInventoryItem(
44 Scene scene, string itemName, UUID itemId, string folderPath, UUID userId)
45 {
46 InventoryItemBase item = new InventoryItemBase();
47 item.Name = itemName;
48 item.AssetID = AssetHelpers.CreateAsset(scene, userId).FullID;
49 item.ID = itemId;
50
51 // Really quite bad since the objs folder could be moved in the future and confuse the tests
52 InventoryFolderBase objsFolder = scene.InventoryService.GetFolderForType(userId, AssetType.Object);
53
54 item.Folder = objsFolder.ID;
55 scene.AddInventoryItem(userId, item);
56
57 return item;
58 }
59
42 /// <summary> 60 /// <summary>
43 /// Create inventory folders starting from the user's root folder. 61 /// Create inventory folders starting from the user's root folder.
44 /// </summary> 62 /// </summary>