aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs8
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs5
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs65
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs110
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs28
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs26
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs27
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs2
-rw-r--r--OpenSim/Region/DataSnapshot/LandSnapshot.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs21
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs30
24 files changed, 302 insertions, 159 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 072e4d3..945da7d 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -218,7 +218,13 @@ namespace OpenSim
218 218
219 m_console.Commands.AddCommand("region", false, "debug packet", 219 m_console.Commands.AddCommand("region", false, "debug packet",
220 "debug packet <level>", 220 "debug packet <level>",
221 "Turn on packet debugging", Debug); 221 "Turn on packet debugging",
222 "If level > 255 then all incoming and outgoing packets are logged.\n"
223 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
224 + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
225 + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
226 + "If level <= 0 then no packets are logged.",
227 Debug);
222 228
223 m_console.Commands.AddCommand("region", false, "debug scene", 229 m_console.Commands.AddCommand("region", false, "debug scene",
224 "debug scene <cripting> <collisions> <physics>", 230 "debug scene <cripting> <collisions> <physics>",
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 4ef0b1b..ec3193c 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -36,7 +36,6 @@ using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39
40using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
@@ -403,7 +402,9 @@ namespace OpenSim
403 } 402 }
404 catch (Exception e) 403 catch (Exception e)
405 { 404 {
406 m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace); 405 m_log.ErrorFormat(
406 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
407 e.Message, e.StackTrace);
407 408
408 if (scene.SnmpService != null) 409 if (scene.SnmpService != null)
409 { 410 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index aa7de05..3dea40c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
60 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector 60 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
61 { 61 {
62 /// <value> 62 /// <value>
63 /// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets). 63 /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details.
64 /// </value> 64 /// </value>
65 protected int m_debugPacketLevel = 0; 65 protected int m_debugPacketLevel = 0;
66 66
@@ -2687,6 +2687,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2687 2687
2688 public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y) 2688 public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
2689 { 2689 {
2690 float dwell = 0.0f;
2691 IDwellModule dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
2692 if (dwellModule != null)
2693 dwell = dwellModule.GetDwell(land.GlobalID);
2690 ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); 2694 ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply);
2691 reply.AgentData.AgentID = m_agentId; 2695 reply.AgentData.AgentID = m_agentId;
2692 reply.Data.ParcelID = parcelID; 2696 reply.Data.ParcelID = parcelID;
@@ -2711,7 +2715,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2711 reply.Data.GlobalZ = pos.Z; 2715 reply.Data.GlobalZ = pos.Z;
2712 reply.Data.SimName = Utils.StringToBytes(info.RegionName); 2716 reply.Data.SimName = Utils.StringToBytes(info.RegionName);
2713 reply.Data.SnapshotID = land.SnapshotID; 2717 reply.Data.SnapshotID = land.SnapshotID;
2714 reply.Data.Dwell = land.Dwell; 2718 reply.Data.Dwell = dwell;
2715 reply.Data.SalePrice = land.SalePrice; 2719 reply.Data.SalePrice = land.SalePrice;
2716 reply.Data.AuctionID = (int)land.AuctionID; 2720 reply.Data.AuctionID = (int)land.AuctionID;
2717 2721
@@ -11229,8 +11233,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11229 /// handles splitting manually</param> 11233 /// handles splitting manually</param>
11230 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) 11234 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
11231 { 11235 {
11232 if (m_debugPacketLevel >= 255) 11236 if (m_debugPacketLevel > 0)
11233 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); 11237 {
11238 bool outputPacket = true;
11239
11240 if (m_debugPacketLevel <= 255
11241 && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage))
11242 outputPacket = false;
11243
11244 if (m_debugPacketLevel <= 200
11245 &&
11246 (packet.Type == PacketType.ImagePacket
11247 || packet.Type == PacketType.ImageData
11248 || packet.Type == PacketType.LayerData
11249 || packet.Type == PacketType.CoarseLocationUpdate))
11250 outputPacket = false;
11251
11252 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect))
11253 outputPacket = false;
11254
11255 if (outputPacket)
11256 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
11257 }
11234 11258
11235 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); 11259 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
11236 } 11260 }
@@ -11316,26 +11340,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11316 /// Entryway from the client to the simulator. All UDP packets from the client will end up here 11340 /// Entryway from the client to the simulator. All UDP packets from the client will end up here
11317 /// </summary> 11341 /// </summary>
11318 /// <param name="Pack">OpenMetaverse.packet</param> 11342 /// <param name="Pack">OpenMetaverse.packet</param>
11319 public void ProcessInPacket(Packet Pack) 11343 public void ProcessInPacket(Packet packet)
11320 { 11344 {
11321 if (!m_IsPresenceReady) 11345 if (m_debugPacketLevel > 0)
11322 { 11346 {
11323 if (m_pendingPackets == null) 11347 bool outputPacket = true;
11324 { 11348
11325 m_pendingPackets = new List<Packet>(); 11349 if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
11326 } 11350 outputPacket = false;
11327 m_pendingPackets.Add(Pack); 11351
11352 if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
11353 outputPacket = false;
11354
11355 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11356 outputPacket = false;
11357
11358 if (outputPacket)
11359 m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type);
11328 } 11360 }
11329 else
11330 {
11331 if (m_debugPacketLevel >= 255)
11332 m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
11333 11361
11334 if (!ProcessPacketMethod(Pack)) 11362 if (!ProcessPacketMethod(packet))
11335 m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type); 11363 m_log.Warn("[CLIENT]: unhandled packet " + packet.Type);
11336 11364
11337 PacketPool.Instance.ReturnPacket(Pack); 11365 PacketPool.Instance.ReturnPacket(packet);
11338 }
11339 } 11366 }
11340 11367
11341 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) 11368 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index c791cb4..4609738 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -214,8 +214,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
214 { 214 {
215 m_userTransactions.Manager.MyScene.AssetService.Store(m_asset); 215 m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
216 216
217 IInventoryService invService = m_userTransactions.Manager.MyScene.InventoryService;
218
219 InventoryItemBase item = new InventoryItemBase(); 217 InventoryItemBase item = new InventoryItemBase();
220 item.Owner = ourClient.AgentId; 218 item.Owner = ourClient.AgentId;
221 item.CreatorId = ourClient.AgentId.ToString(); 219 item.CreatorId = ourClient.AgentId.ToString();
@@ -234,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
234 item.Flags = (uint) wearableType; 232 item.Flags = (uint) wearableType;
235 item.CreationDate = Util.UnixTimeSinceEpoch(); 233 item.CreationDate = Util.UnixTimeSinceEpoch();
236 234
237 if (invService.AddItem(item)) 235 if (m_userTransactions.Manager.MyScene.AddInventoryItem(item))
238 ourClient.SendInventoryItemCreateUpdate(item, callbackID); 236 ourClient.SendInventoryItemCreateUpdate(item, callbackID);
239 else 237 else
240 ourClient.SendAlertMessage("Unable to create inventory item"); 238 ourClient.SendAlertMessage("Unable to create inventory item");
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 38152cc..100b55c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -174,16 +174,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
174 UUID itemID = UUID.Zero; 174 UUID itemID = UUID.Zero;
175 if (sp != null) 175 if (sp != null)
176 { 176 {
177 foreach(SceneObjectGroup grp in sp.Attachments) 177 foreach(SceneObjectGroup grp in sp.GetAttachments(AttachmentPt))
178 { 178 {
179 if (grp.GetAttachmentPoint() == (byte)AttachmentPt) 179 itemID = grp.GetFromItemID();
180 { 180 if (itemID != UUID.Zero)
181 itemID = grp.GetFromItemID(); 181 DetachSingleAttachmentToInv(itemID, remoteClient);
182 break; 182 }
183 }
184 }
185 if (itemID != UUID.Zero)
186 DetachSingleAttachmentToInv(itemID, remoteClient);
187 } 183 }
188 184
189 if (group.GetFromItemID() == UUID.Zero) 185 if (group.GetFromItemID() == UUID.Zero)
@@ -197,12 +193,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
197 193
198 SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); 194 SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group);
199 195
200 group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); 196 AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
201
202 // In case it is later dropped again, don't let
203 // it get cleaned up
204 group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
205 group.HasGroupChanged = false;
206 } 197 }
207 else 198 else
208 { 199 {
@@ -280,8 +271,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
280 if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) 271 if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint())
281 tainted = true; 272 tainted = true;
282 273
283 AttachObject(remoteClient, objatt, AttachmentPt, false); 274 // This will throw if the attachment fails
284 //objatt.ScheduleGroupForFullUpdate(); 275 try
276 {
277 AttachObject(remoteClient, objatt, AttachmentPt, false);
278 }
279 catch
280 {
281 // Make sure the object doesn't stick around and bail
282 m_scene.DeleteSceneObject(objatt, false);
283 return null;
284 }
285 285
286 if (tainted) 286 if (tainted)
287 objatt.HasGroupChanged = true; 287 objatt.HasGroupChanged = true;
@@ -551,6 +551,78 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
551 remoteClient.SendInventoryItemCreateUpdate(item, 0); 551 remoteClient.SendInventoryItemCreateUpdate(item, 0);
552 } 552 }
553 } 553 }
554 } 554 }
555
556 /// <summary>
557 /// Attach this scene object to the given avatar.
558 /// </summary>
559 ///
560 /// This isn't publicly available since attachments should always perform the corresponding inventory
561 /// operation (to show the attach in user inventory and update the asset with positional information).
562 ///
563 /// <param name="sp"></param>
564 /// <param name="so"></param>
565 /// <param name="attachmentpoint"></param>
566 /// <param name="AttachOffset"></param>
567 /// <param name="silent"></param>
568 protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent)
569 {
570 // don't attach attachments to child agents
571 if (avatar.IsChildAgent) return;
572
573// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
574
575 so.DetachFromBackup();
576
577 // Remove from database and parcel prim count
578 m_scene.DeleteFromStorage(so.UUID);
579 m_scene.EventManager.TriggerParcelPrimCountTainted();
580
581 so.RootPart.AttachedAvatar = avatar.UUID;
582
583 //Anakin Lohner bug #3839
584 lock (so.Children)
585 {
586 foreach (SceneObjectPart p in so.Children.Values)
587 {
588 p.AttachedAvatar = avatar.UUID;
589 }
590 }
591
592 if (so.RootPart.PhysActor != null)
593 {
594 m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor);
595 so.RootPart.PhysActor = null;
596 }
597
598 so.AbsolutePosition = AttachOffset;
599 so.RootPart.AttachedPos = AttachOffset;
600 so.RootPart.IsAttachment = true;
601
602 so.RootPart.SetParentLocalId(avatar.LocalId);
603 so.SetAttachmentPoint(Convert.ToByte(attachmentpoint));
604
605 avatar.AddAttachment(so);
606
607 if (!silent)
608 {
609 // Killing it here will cause the client to deselect it
610 // It then reappears on the avatar, deselected
611 // through the full update below
612 //
613 if (so.IsSelected)
614 {
615 m_scene.SendKillObject(so.RootPart.LocalId);
616 }
617
618 so.IsSelected = false; // fudge....
619 so.ScheduleGroupForFullUpdate();
620 }
621
622 // In case it is later dropped again, don't let
623 // it get cleaned up
624 so.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
625 so.HasGroupChanged = false;
626 }
555 } 627 }
556} \ No newline at end of file 628}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 22c84e9..52342ec 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -406,8 +406,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
406 // Reset folder ID to the one in which we want to load it 406 // Reset folder ID to the one in which we want to load it
407 item.Folder = loadFolder.ID; 407 item.Folder = loadFolder.ID;
408 408
409 //m_userInfo.AddItem(item); 409 m_scene.AddInventoryItem(item);
410 m_scene.InventoryService.AddItem(item);
411 410
412 return item; 411 return item;
413 } 412 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index 8343091..47e34dc 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
41 /// </summary> 41 /// </summary>
42 public static class InventoryArchiveUtils 42 public static class InventoryArchiveUtils
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings 46 // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings
47 public static readonly char ESCAPE_CHARACTER = '\\'; 47 public static readonly char ESCAPE_CHARACTER = '\\';
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 0218f86..d66a1d0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
163 InventoryFolderBase objsFolder 163 InventoryFolderBase objsFolder
164 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; 164 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
165 item1.Folder = objsFolder.ID; 165 item1.Folder = objsFolder.ID;
166 scene.AddInventoryItem(userId, item1); 166 scene.AddInventoryItem(item1);
167 167
168 MemoryStream archiveWriteStream = new MemoryStream(); 168 MemoryStream archiveWriteStream = new MemoryStream();
169 archiverModule.OnInventoryArchiveSaved += SaveCompleted; 169 archiverModule.OnInventoryArchiveSaved += SaveCompleted;
@@ -282,7 +282,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
282 InventoryFolderBase objsFolder 282 InventoryFolderBase objsFolder
283 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; 283 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
284 item1.Folder = objsFolder.ID; 284 item1.Folder = objsFolder.ID;
285 scene.AddInventoryItem(userId, item1); 285 scene.AddInventoryItem(item1);
286 286
287 MemoryStream archiveWriteStream = new MemoryStream(); 287 MemoryStream archiveWriteStream = new MemoryStream();
288 archiverModule.OnInventoryArchiveSaved += SaveCompleted; 288 archiverModule.OnInventoryArchiveSaved += SaveCompleted;
@@ -485,7 +485,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
485 InventoryFolderBase objsFolder 485 InventoryFolderBase objsFolder
486 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; 486 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
487 item1.Folder = objsFolder.ID; 487 item1.Folder = objsFolder.ID;
488 scene.AddInventoryItem(userId, item1); 488 scene.AddInventoryItem(item1);
489 489
490 MemoryStream archiveWriteStream = new MemoryStream(); 490 MemoryStream archiveWriteStream = new MemoryStream();
491 archiverModule.OnInventoryArchiveSaved += SaveCompleted; 491 archiverModule.OnInventoryArchiveSaved += SaveCompleted;
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
index 6294935..b62df18 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
@@ -54,12 +54,12 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
54 }; 54 };
55 } 55 }
56 56
57 private static byte[] uintToByteArray(uint uIntValue) 57// private static byte[] uintToByteArray(uint uIntValue)
58 { 58// {
59 byte[] result = new byte[4]; 59// byte[] result = new byte[4];
60 Utils.UIntToBytesBig(uIntValue, result, 0); 60// Utils.UIntToBytesBig(uIntValue, result, 0);
61 return result; 61// return result;
62 } 62// }
63 63
64 public static OSD buildEvent(string eventName, OSD eventBody) 64 public static OSD buildEvent(string eventName, OSD eventBody)
65 { 65 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index c673b31..125a397 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
132 } 132 }
133 133
134 // DO NOT OVERRIDE THE BASE METHOD 134 // DO NOT OVERRIDE THE BASE METHOD
135 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 135 public new virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
136 SceneObjectGroup objectGroup, IClientAPI remoteClient) 136 SceneObjectGroup objectGroup, IClientAPI remoteClient)
137 { 137 {
138 UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient); 138 UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 4159610..37f6ea0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
430 item.Name = asset.Name; 430 item.Name = asset.Name;
431 item.AssetType = asset.Type; 431 item.AssetType = asset.Type;
432 432
433 m_Scene.InventoryService.AddItem(item); 433 m_Scene.AddInventoryItem(item);
434 434
435 if (remoteClient != null && item.Owner == remoteClient.AgentId) 435 if (remoteClient != null && item.Owner == remoteClient.AgentId)
436 { 436 {
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 97161fc..5b4fecb 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index 915b59e..cbd9e05 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -221,34 +221,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
221// m_log.DebugFormat( 221// m_log.DebugFormat(
222// "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}", 222// "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}",
223// item.Name, item.Owner, item.Folder); 223// item.Name, item.Owner, item.Folder);
224
225 if (UUID.Zero == item.Folder)
226 {
227 InventoryFolderBase f = m_InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType);
228 if (f != null)
229 {
230// m_log.DebugFormat(
231// "[LOCAL INVENTORY SERVICES CONNECTOR]: Found folder {0} type {1} for item {2}",
232// f.Name, (AssetType)f.Type, item.Name);
233
234 item.Folder = f.ID;
235 }
236 else
237 {
238 f = m_InventoryService.GetRootFolder(item.Owner);
239 if (f != null)
240 {
241 item.Folder = f.ID;
242 }
243 else
244 {
245// m_log.WarnFormat(
246// "[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find root folder for {0} when trying to add item {1} with no parent folder specified",
247// item.Owner, item.Name);
248 return false;
249 }
250 }
251 }
252 224
253 return m_InventoryService.AddItem(item); 225 return m_InventoryService.AddItem(item);
254 } 226 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index 4211fa9..4ab6947 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -227,31 +227,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
227 public bool AddItem(InventoryItemBase item) 227 public bool AddItem(InventoryItemBase item)
228 { 228 {
229 if (item == null) 229 if (item == null)
230 return false; 230 return false;
231
232 if (UUID.Zero == item.Folder)
233 {
234 InventoryFolderBase f = m_RemoteConnector.GetFolderForType(item.Owner, (AssetType)item.AssetType);
235 if (f != null)
236 {
237 item.Folder = f.ID;
238 }
239 else
240 {
241 f = m_RemoteConnector.GetRootFolder(item.Owner);
242 if (f != null)
243 {
244 item.Folder = f.ID;
245 }
246 else
247 {
248 m_log.WarnFormat(
249 "[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find root folder for {0} when trying to add item {1} with no parent folder specified",
250 item.Owner, item.Name);
251 return false;
252 }
253 }
254 }
255 231
256 return m_RemoteConnector.AddItem(item); 232 return m_RemoteConnector.AddItem(item);
257 } 233 }
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 776fe30..f62ec1b 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -171,7 +171,6 @@ namespace OpenSim.Region.CoreModules.World.Land
171 client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner; 171 client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner;
172 client.OnParcelReclaim += ClientOnParcelReclaim; 172 client.OnParcelReclaim += ClientOnParcelReclaim;
173 client.OnParcelInfoRequest += ClientOnParcelInfoRequest; 173 client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
174// client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
175 client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; 174 client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
176 client.OnPreAgentUpdate += ClientOnPreAgentUpdate; 175 client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
177 176
@@ -1116,7 +1115,11 @@ namespace OpenSim.Region.CoreModules.World.Land
1116 m_landList.TryGetValue(localID, out land); 1115 m_landList.TryGetValue(localID, out land);
1117 } 1116 }
1118 1117
1119 if (land != null) land.UpdateLandProperties(args, remote_client); 1118 if (land != null)
1119 {
1120 land.UpdateLandProperties(args, remote_client);
1121 m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(args, localID, remote_client);
1122 }
1120 } 1123 }
1121 1124
1122 public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) 1125 public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
@@ -1434,9 +1437,13 @@ namespace OpenSim.Region.CoreModules.World.Land
1434 m_landList.TryGetValue(parcelID, out land); 1437 m_landList.TryGetValue(parcelID, out land);
1435 } 1438 }
1436 1439
1437 if (land != null) { 1440 if (land != null)
1441 {
1438 land.UpdateLandProperties(land_update, client); 1442 land.UpdateLandProperties(land_update, client);
1439 } else { 1443 m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client);
1444 }
1445 else
1446 {
1440 m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID); 1447 m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID);
1441 } 1448 }
1442 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); 1449 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
@@ -1512,18 +1519,6 @@ namespace OpenSim.Region.CoreModules.World.Land
1512 1519
1513 #endregion 1520 #endregion
1514 1521
1515 private void ClientOnParcelDwellRequest(int localID, IClientAPI remoteClient)
1516 {
1517 ILandObject selectedParcel = null;
1518 lock (m_landList)
1519 {
1520 if (!m_landList.TryGetValue(localID, out selectedParcel))
1521 return;
1522 }
1523
1524 remoteClient.SendParcelDwellReply(localID, selectedParcel.LandData.GlobalID, selectedParcel.LandData.Dwell);
1525 }
1526
1527 private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID) 1522 private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID)
1528 { 1523 {
1529 if (parcelID == UUID.Zero) 1524 if (parcelID == UUID.Zero)
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index 8ce6daf..12750c5 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
219 item.CurrentPermissions |= 16; // Slam! 219 item.CurrentPermissions |= 16; // Slam!
220 item.CreationDate = Util.UnixTimeSinceEpoch(); 220 item.CreationDate = Util.UnixTimeSinceEpoch();
221 221
222 if (m_scene.InventoryService.AddItem(item)) 222 if (m_scene.AddInventoryItem(item))
223 { 223 {
224 remoteClient.SendInventoryItemCreateUpdate(item, 0); 224 remoteClient.SendInventoryItemCreateUpdate(item, 0);
225 } 225 }
diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
index 64d29f2..b8c90cd 100644
--- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
@@ -123,6 +123,8 @@ namespace OpenSim.Region.DataSnapshot.Providers
123 ILandChannel landChannel = m_scene.LandChannel; 123 ILandChannel landChannel = m_scene.LandChannel;
124 List<ILandObject> parcels = landChannel.AllParcels(); 124 List<ILandObject> parcels = landChannel.AllParcels();
125 125
126 IDwellModule dwellModule = m_scene.RequestModuleInterface<IDwellModule>();
127
126 XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "parceldata", ""); 128 XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "parceldata", "");
127 if (parcels != null) 129 if (parcels != null)
128 { 130 {
@@ -208,7 +210,10 @@ namespace OpenSim.Region.DataSnapshot.Providers
208 xmlparcel.AppendChild(infouuid); 210 xmlparcel.AppendChild(infouuid);
209 211
210 XmlNode dwell = nodeFactory.CreateNode(XmlNodeType.Element, "dwell", ""); 212 XmlNode dwell = nodeFactory.CreateNode(XmlNodeType.Element, "dwell", "");
211 dwell.InnerText = parcel.Dwell.ToString(); 213 if (dwellModule != null)
214 dwell.InnerText = dwellModule.GetDwell(parcel.GlobalID).ToString();
215 else
216 dwell.InnerText = "0";
212 xmlparcel.AppendChild(dwell); 217 xmlparcel.AppendChild(dwell);
213 218
214 //TODO: figure how to figure out teleport system landData.landingType 219 //TODO: figure how to figure out teleport system landData.landingType
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 52e6e92..d4e2736 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -113,6 +113,8 @@ namespace OpenSim.Region.Framework.Scenes
113 113
114 public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; 114 public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
115 115
116 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
117
116 /// <summary> 118 /// <summary>
117 /// Fired when an object is touched/grabbed. 119 /// Fired when an object is touched/grabbed.
118 /// </summary> 120 /// </summary>
@@ -2128,5 +2130,27 @@ namespace OpenSim.Region.Framework.Scenes
2128 } 2130 }
2129 } 2131 }
2130 } 2132 }
2133
2134 public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args,
2135 int local_id, IClientAPI remote_client)
2136 {
2137 ParcelPropertiesUpdateRequest handler = OnParcelPropertiesUpdateRequest;
2138 if (handler != null)
2139 {
2140 foreach (ParcelPropertiesUpdateRequest d in handler.GetInvocationList())
2141 {
2142 try
2143 {
2144 d(args, local_id, remote_client);
2145 }
2146 catch (Exception e)
2147 {
2148 m_log.ErrorFormat(
2149 "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}",
2150 e.Message, e.StackTrace);
2151 }
2152 }
2153 }
2154 }
2131 } 2155 }
2132} \ No newline at end of file 2156}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0d9682e..5ee8955 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -70,18 +70,18 @@ namespace OpenSim.Region.Framework.Scenes
70 70
71 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) 71 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
72 { 72 {
73 IMoneyModule money=RequestModuleInterface<IMoneyModule>(); 73 IMoneyModule money = RequestModuleInterface<IMoneyModule>();
74 if (money != null) 74 if (money != null)
75 { 75 {
76 money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); 76 money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload");
77 } 77 }
78 78
79 AddInventoryItem(agentID, item); 79 AddInventoryItem(item);
80 } 80 }
81 81
82 public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item) 82 public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item)
83 { 83 {
84 if (InventoryService.AddItem(item)) 84 if (AddInventoryItem(item))
85 return true; 85 return true;
86 else 86 else
87 { 87 {
@@ -92,19 +92,23 @@ namespace OpenSim.Region.Framework.Scenes
92 } 92 }
93 } 93 }
94 94
95 public void AddInventoryItem(UUID AgentID, InventoryItemBase item) 95 /// <summary>
96 /// Add the given inventory item to a user's inventory.
97 /// </summary>
98 /// <param name="item"></param>
99 public bool AddInventoryItem(InventoryItemBase item)
96 { 100 {
97 InventoryFolderBase folder; 101 InventoryFolderBase folder;
98 102
99 if (item.Folder == UUID.Zero) 103 if (item.Folder == UUID.Zero)
100 { 104 {
101 folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType); 105 folder = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType);
102 if (folder == null) 106 if (folder == null)
103 { 107 {
104 folder = InventoryService.GetRootFolder(AgentID); 108 folder = InventoryService.GetRootFolder(item.Owner);
105 109
106 if (folder == null) 110 if (folder == null)
107 return; 111 return false;
108 } 112 }
109 113
110 item.Folder = folder.ID; 114 item.Folder = folder.ID;
@@ -113,20 +117,37 @@ namespace OpenSim.Region.Framework.Scenes
113 if (InventoryService.AddItem(item)) 117 if (InventoryService.AddItem(item))
114 { 118 {
115 int userlevel = 0; 119 int userlevel = 0;
116 if (Permissions.IsGod(AgentID)) 120 if (Permissions.IsGod(item.Owner))
117 { 121 {
118 userlevel = 1; 122 userlevel = 1;
119 } 123 }
120 EventManager.TriggerOnNewInventoryItemUploadComplete(AgentID, item.AssetID, item.Name, userlevel); 124 EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, item.AssetID, item.Name, userlevel);
125
126 return true;
121 } 127 }
122 else 128 else
123 { 129 {
124 m_log.WarnFormat( 130 m_log.WarnFormat(
125 "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}", 131 "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}",
126 AgentID, item.Name, item.ID); 132 item.Owner, item.Name, item.ID);
127 133
128 return; 134 return false;
129 } 135 }
136 }
137
138 /// <summary>
139 /// Add the given inventory item to a user's inventory.
140 /// </summary>
141 /// <param name="AgentID">
142 /// A <see cref="UUID"/>
143 /// </param>
144 /// <param name="item">
145 /// A <see cref="InventoryItemBase"/>
146 /// </param>
147 [Obsolete("Use AddInventoryItem(InventoryItemBase item) instead. This was deprecated in OpenSim 0.7.1")]
148 public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
149 {
150 AddInventoryItem(item);
130 } 151 }
131 152
132 /// <summary> 153 /// <summary>
@@ -137,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes
137 /// in which the item is to be placed.</param> 158 /// in which the item is to be placed.</param>
138 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) 159 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
139 { 160 {
140 AddInventoryItem(remoteClient.AgentId, item); 161 AddInventoryItem(item);
141 remoteClient.SendInventoryItemCreateUpdate(item, 0); 162 remoteClient.SendInventoryItemCreateUpdate(item, 0);
142 } 163 }
143 164
@@ -529,7 +550,7 @@ namespace OpenSim.Region.Framework.Scenes
529 itemCopy.SalePrice = item.SalePrice; 550 itemCopy.SalePrice = item.SalePrice;
530 itemCopy.SaleType = item.SaleType; 551 itemCopy.SaleType = item.SaleType;
531 552
532 if (InventoryService.AddItem(itemCopy)) 553 if (AddInventoryItem(itemCopy))
533 { 554 {
534 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); 555 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
535 if (invAccess != null) 556 if (invAccess != null)
@@ -775,8 +796,10 @@ namespace OpenSim.Region.Framework.Scenes
775 item.BasePermissions = baseMask; 796 item.BasePermissions = baseMask;
776 item.CreationDate = creationDate; 797 item.CreationDate = creationDate;
777 798
778 if (InventoryService.AddItem(item)) 799 if (AddInventoryItem(item))
800 {
779 remoteClient.SendInventoryItemCreateUpdate(item, callbackID); 801 remoteClient.SendInventoryItemCreateUpdate(item, callbackID);
802 }
780 else 803 else
781 { 804 {
782 m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item"); 805 m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item");
@@ -1142,7 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes
1142 1165
1143 agentItem.Folder = folderId; 1166 agentItem.Folder = folderId;
1144 1167
1145 AddInventoryItem(avatarId, agentItem); 1168 AddInventoryItem(agentItem);
1146 1169
1147 return agentItem; 1170 return agentItem;
1148 } 1171 }
@@ -1266,7 +1289,7 @@ namespace OpenSim.Region.Framework.Scenes
1266 { 1289 {
1267 agentItem.Folder = newFolderID; 1290 agentItem.Folder = newFolderID;
1268 1291
1269 AddInventoryItem(destID, agentItem); 1292 AddInventoryItem(agentItem);
1270 } 1293 }
1271 } 1294 }
1272 1295
@@ -1908,7 +1931,7 @@ namespace OpenSim.Region.Framework.Scenes
1908 // sets itemID so client can show item as 'attached' in inventory 1931 // sets itemID so client can show item as 'attached' in inventory
1909 grp.SetFromItemID(item.ID); 1932 grp.SetFromItemID(item.ID);
1910 1933
1911 if (InventoryService.AddItem(item)) 1934 if (AddInventoryItem(item))
1912 remoteClient.SendInventoryItemCreateUpdate(item, 0); 1935 remoteClient.SendInventoryItemCreateUpdate(item, 0);
1913 else 1936 else
1914 m_dialogModule.SendAlertToUser(remoteClient, "Operation failed"); 1937 m_dialogModule.SendAlertToUser(remoteClient, "Operation failed");
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 400f4c0..94a9dab 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2729,6 +2729,8 @@ namespace OpenSim.Region.Framework.Scenes
2729 try 2729 try
2730 { 2730 {
2731 ScenePresence sp = GetScenePresence(agentID); 2731 ScenePresence sp = GetScenePresence(agentID);
2732 PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
2733
2732 if (sp != null) 2734 if (sp != null)
2733 sp.ControllingClient.Close(); 2735 sp.ControllingClient.Close();
2734 2736
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 8823df1..86842b3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1619,11 +1619,6 @@ namespace OpenSim.Region.Framework.Scenes
1619 1619
1620 if (child != null) 1620 if (child != null)
1621 { 1621 {
1622 // Make sure no child prim is set for sale
1623 // So that, on delink, no prims are unwittingly
1624 // left for sale and sold off
1625 child.RootPart.ObjectSaleType = 0;
1626 child.RootPart.SalePrice = 10;
1627 childGroups.Add(child); 1622 childGroups.Add(child);
1628 } 1623 }
1629 } 1624 }
@@ -1907,9 +1902,6 @@ namespace OpenSim.Region.Framework.Scenes
1907 child.ApplyNextOwnerPermissions(); 1902 child.ApplyNextOwnerPermissions();
1908 } 1903 }
1909 } 1904 }
1910
1911 copy.RootPart.ObjectSaleType = 0;
1912 copy.RootPart.SalePrice = 10;
1913 } 1905 }
1914 1906
1915 Entities.Add(copy); 1907 Entities.Add(copy);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index c5994b2..1959427 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes
278 278
279 if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) 279 if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
280 { 280 {
281 if (stateSource == 1 && // Prim crossing 281 if (stateSource == 2 && // Prim crossing
282 m_part.ParentGroup.Scene.m_trustBinaries) 282 m_part.ParentGroup.Scene.m_trustBinaries)
283 { 283 {
284 m_items.LockItemsForWrite(true); 284 m_items.LockItemsForWrite(true);
@@ -1263,4 +1263,4 @@ namespace OpenSim.Region.Framework.Scenes
1263 Items.LockItemsForRead(false); 1263 Items.LockItemsForRead(false);
1264 } 1264 }
1265 } 1265 }
1266} \ No newline at end of file 1266}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index faf6354..d88f2cc 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3913,6 +3913,27 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju
3913 m_attachments.Add(gobj); 3913 m_attachments.Add(gobj);
3914 } 3914 }
3915 } 3915 }
3916
3917 /// <summary>
3918 /// Get the scene object attached to the given point.
3919 /// </summary>
3920 /// <param name="attachmentPoint"></param>
3921 /// <returns>Returns an empty list if there were no attachments at the point.</returns>
3922 public List<SceneObjectGroup> GetAttachments(uint attachmentPoint)
3923 {
3924 List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
3925
3926 lock (m_attachments)
3927 {
3928 foreach (SceneObjectGroup so in m_attachments)
3929 {
3930 if (attachmentPoint == so.RootPart.AttachmentPoint)
3931 attachments.Add(so);
3932 }
3933 }
3934
3935 return attachments;
3936 }
3916 3937
3917 public bool HasAttachments() 3938 public bool HasAttachments()
3918 { 3939 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 358ce22..dfc9aa3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -134,5 +134,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
134 134
135 #endregion 135 #endregion
136 136
137 [Test]
138 // llRot2Euler test.
139 public void TestllRot2Euler()
140 {
141 // 180, 90 and zero degree rotations.
142 CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 0.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, 0.0f));
143 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 1.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, Math.PI));
144 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 1.0f, 0.0f), new LSL_Types.Vector3(0.0f, 0.0f, Math.PI));
145 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f), new LSL_Types.Vector3(0.0f, 0.0f, 0.0f));
146 CheckllRot2Euler(new LSL_Types.Quaternion(-0.5f, -0.5f, 0.5f, 0.5f), new LSL_Types.Vector3(0, -Math.PI / 2.0f, Math.PI / 2.0f));
147 CheckllRot2Euler(new LSL_Types.Quaternion(-0.707107f, 0.0f, 0.0f, -0.707107f), new LSL_Types.Vector3(Math.PI / 2.0f, 0.0f, 0.0f));
148 // A couple of messy rotations.
149 CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 5.651f, -3.1f, 67.023f), new LSL_Types.Vector3(0.037818f, 0.166447f, -0.095595f));
150 CheckllRot2Euler(new LSL_Types.Quaternion(0.719188f, -0.408934f, -0.363998f, -0.427841f), new LSL_Types.Vector3(-1.954769f, -0.174533f, 1.151917f));
151 }
152
153 private void CheckllRot2Euler(LSL_Types.Quaternion rot, LSL_Types.Vector3 eulerCheck)
154 {
155 // Call LSL function to convert quaternion rotaion to euler radians.
156 LSL_Types.Vector3 eulerCalc = m_lslApi.llRot2Euler(rot);
157 // Check upper and lower bounds of x, y and z.
158 // This type of check is performed as opposed to comparing for equal numbers, in order to allow slight
159 // differences in accuracy.
160 Assert.Greater(eulerCalc.x, eulerCheck.x - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X lower bounds check fail");
161 Assert.Less(eulerCalc.x, eulerCheck.x + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X upper bounds check fail");
162 Assert.Greater(eulerCalc.y, eulerCheck.y - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y lower bounds check fail");
163 Assert.Less(eulerCalc.y, eulerCheck.y + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y upper bounds check fail");
164 Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail");
165 Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail");
166 }
137 } 167 }
138} 168}