aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2010-09-05 15:06:00 +0100
committerMelanie2010-09-05 15:06:00 +0100
commite4c2b44e5cb756b957a96d13ad9a611dfba12df4 (patch)
treed7978fc31ce346cae467df7a81737cfa323ae6c1 /OpenSim/Region
parentRemove "Dwell" support from core and replace it with calls to methods (diff)
parentRemove "Dwell" support from core and replace it with calls to methods (diff)
downloadopensim-SC_OLD-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.zip
opensim-SC_OLD-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.tar.gz
opensim-SC_OLD-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.tar.bz2
opensim-SC_OLD-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs4
-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/Objects/BuySell/BuySellModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs30
14 files changed, 90 insertions, 90 deletions
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/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/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/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/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}