aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJonathan Freedman2010-11-23 22:27:54 -0800
committerJonathan Freedman2010-11-23 22:27:54 -0800
commitbc51dfc45eb73e34d91fd72d0a537ffc907a9da6 (patch)
tree084062cd82e16edbff08a5e3b705458d915caf86
parentMerge branch 'master-core' into mantis5110 (diff)
parentMerge branch 'master' of /var/git/opensim/ (diff)
downloadopensim-SC-bc51dfc45eb73e34d91fd72d0a537ffc907a9da6.zip
opensim-SC-bc51dfc45eb73e34d91fd72d0a537ffc907a9da6.tar.gz
opensim-SC-bc51dfc45eb73e34d91fd72d0a537ffc907a9da6.tar.bz2
opensim-SC-bc51dfc45eb73e34d91fd72d0a537ffc907a9da6.tar.xz
Merge branch 'master-core' into mantis5110
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs3
-rw-r--r--OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs3
-rw-r--r--OpenSim/Data/Tests/InventoryTests.cs6
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs1
-rw-r--r--OpenSim/Framework/InventoryItemBase.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs105
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs62
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs129
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs42
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs6
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs9
17 files changed, 307 insertions, 99 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 0bfd73a..8d93354 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -697,6 +697,7 @@ namespace OpenSim.Data.SQLite
697 DataRow landRow = land.Rows.Find(globalID.ToString()); 697 DataRow landRow = land.Rows.Find(globalID.ToString());
698 if (landRow != null) 698 if (landRow != null)
699 { 699 {
700 landRow.Delete();
700 land.Rows.Remove(landRow); 701 land.Rows.Remove(landRow);
701 } 702 }
702 List<DataRow> rowsToDelete = new List<DataRow>(); 703 List<DataRow> rowsToDelete = new List<DataRow>();
@@ -707,6 +708,7 @@ namespace OpenSim.Data.SQLite
707 } 708 }
708 for (int iter = 0; iter < rowsToDelete.Count; iter++) 709 for (int iter = 0; iter < rowsToDelete.Count; iter++)
709 { 710 {
711 rowsToDelete[iter].Delete();
710 landaccesslist.Rows.Remove(rowsToDelete[iter]); 712 landaccesslist.Rows.Remove(rowsToDelete[iter]);
711 } 713 }
712 } 714 }
@@ -755,6 +757,7 @@ namespace OpenSim.Data.SQLite
755 } 757 }
756 for (int iter = 0; iter < rowsToDelete.Count; iter++) 758 for (int iter = 0; iter < rowsToDelete.Count; iter++)
757 { 759 {
760 rowsToDelete[iter].Delete();
758 landaccesslist.Rows.Remove(rowsToDelete[iter]); 761 landaccesslist.Rows.Remove(rowsToDelete[iter]);
759 } 762 }
760 rowsToDelete.Clear(); 763 rowsToDelete.Clear();
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
index 1ad1e66..644864a 100644
--- a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs
@@ -657,6 +657,7 @@ namespace OpenSim.Data.SQLiteLegacy
657 DataRow landRow = land.Rows.Find(globalID.ToString()); 657 DataRow landRow = land.Rows.Find(globalID.ToString());
658 if (landRow != null) 658 if (landRow != null)
659 { 659 {
660 landRow.Delete();
660 land.Rows.Remove(landRow); 661 land.Rows.Remove(landRow);
661 } 662 }
662 List<DataRow> rowsToDelete = new List<DataRow>(); 663 List<DataRow> rowsToDelete = new List<DataRow>();
@@ -667,6 +668,7 @@ namespace OpenSim.Data.SQLiteLegacy
667 } 668 }
668 for (int iter = 0; iter < rowsToDelete.Count; iter++) 669 for (int iter = 0; iter < rowsToDelete.Count; iter++)
669 { 670 {
671 rowsToDelete[iter].Delete();
670 landaccesslist.Rows.Remove(rowsToDelete[iter]); 672 landaccesslist.Rows.Remove(rowsToDelete[iter]);
671 } 673 }
672 674
@@ -717,6 +719,7 @@ namespace OpenSim.Data.SQLiteLegacy
717 } 719 }
718 for (int iter = 0; iter < rowsToDelete.Count; iter++) 720 for (int iter = 0; iter < rowsToDelete.Count; iter++)
719 { 721 {
722 rowsToDelete[iter].Delete();
720 landaccesslist.Rows.Remove(rowsToDelete[iter]); 723 landaccesslist.Rows.Remove(rowsToDelete[iter]);
721 } 724 }
722 rowsToDelete.Clear(); 725 rowsToDelete.Clear();
diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs
index 3205bfa..dc03259 100644
--- a/OpenSim/Data/Tests/InventoryTests.cs
+++ b/OpenSim/Data/Tests/InventoryTests.cs
@@ -323,7 +323,8 @@ namespace OpenSim.Data.Tests
323 .IgnoreProperty(x => x.InvType) 323 .IgnoreProperty(x => x.InvType)
324 .IgnoreProperty(x => x.CreatorIdAsUuid) 324 .IgnoreProperty(x => x.CreatorIdAsUuid)
325 .IgnoreProperty(x => x.Description) 325 .IgnoreProperty(x => x.Description)
326 .IgnoreProperty(x => x.CreatorId)); 326 .IgnoreProperty(x => x.CreatorId)
327 .IgnoreProperty(x => x.CreatorData));
327 328
328 inventoryScrambler.Scramble(expected); 329 inventoryScrambler.Scramble(expected);
329 db.updateInventoryItem(expected); 330 db.updateInventoryItem(expected);
@@ -333,7 +334,8 @@ namespace OpenSim.Data.Tests
333 .IgnoreProperty(x => x.InvType) 334 .IgnoreProperty(x => x.InvType)
334 .IgnoreProperty(x => x.CreatorIdAsUuid) 335 .IgnoreProperty(x => x.CreatorIdAsUuid)
335 .IgnoreProperty(x => x.Description) 336 .IgnoreProperty(x => x.Description)
336 .IgnoreProperty(x => x.CreatorId)); 337 .IgnoreProperty(x => x.CreatorId)
338 .IgnoreProperty(x => x.CreatorData));
337 } 339 }
338 340
339 [Test] 341 [Test]
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index 7b0e053..e7f2e13 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -967,6 +967,7 @@ namespace OpenSim.Framework.Capabilities
967 InventoryItemBase item = new InventoryItemBase(); 967 InventoryItemBase item = new InventoryItemBase();
968 item.Owner = m_agentID; 968 item.Owner = m_agentID;
969 item.CreatorId = m_agentID.ToString(); 969 item.CreatorId = m_agentID.ToString();
970 item.CreatorData = String.Empty;
970 item.ID = inventoryItem; 971 item.ID = inventoryItem;
971 item.AssetID = asset.FullID; 972 item.AssetID = asset.FullID;
972 item.Description = assetDescription; 973 item.Description = assetDescription;
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index ce4fc38..a663680 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -117,7 +117,7 @@ namespace OpenSim.Framework
117 } 117 }
118 protected UUID m_creatorIdAsUuid = UUID.Zero; 118 protected UUID m_creatorIdAsUuid = UUID.Zero;
119 119
120 protected string m_creatorData; 120 protected string m_creatorData = string.Empty;
121 public string CreatorData // = <profile url>;<name> 121 public string CreatorData // = <profile url>;<name>
122 { 122 {
123 get { return m_creatorData; } 123 get { return m_creatorData; }
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 1744fb3..1f49a01 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -111,7 +111,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
111 return; 111 return;
112 112
113 if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) 113 if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId))
114 {
115 remoteClient.SendAgentAlertMessage(
116 "You don't have sufficient permissions to attach this object", false);
117
114 return; 118 return;
119 }
115 120
116 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should 121 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
117 // be removed when that functionality is implemented in opensim 122 // be removed when that functionality is implemented in opensim
@@ -141,76 +146,66 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
141 { 146 {
142 Vector3 attachPos = group.AbsolutePosition; 147 Vector3 attachPos = group.AbsolutePosition;
143 148
144 if (m_scene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) 149 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
150 // be removed when that functionality is implemented in opensim
151 AttachmentPt &= 0x7f;
152
153 // If the attachment point isn't the same as the one previously used
154 // set it's offset position = 0 so that it appears on the attachment point
155 // and not in a weird location somewhere unknown.
156 if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint())
145 { 157 {
146 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should 158 attachPos = Vector3.Zero;
147 // be removed when that functionality is implemented in opensim 159 }
148 AttachmentPt &= 0x7f;
149
150 // If the attachment point isn't the same as the one previously used
151 // set it's offset position = 0 so that it appears on the attachment point
152 // and not in a weird location somewhere unknown.
153 if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint())
154 {
155 attachPos = Vector3.Zero;
156 }
157 160
158 // AttachmentPt 0 means the client chose to 'wear' the attachment. 161 // AttachmentPt 0 means the client chose to 'wear' the attachment.
159 if (AttachmentPt == 0) 162 if (AttachmentPt == 0)
160 { 163 {
161 // Check object for stored attachment point 164 // Check object for stored attachment point
162 AttachmentPt = (uint)group.GetAttachmentPoint(); 165 AttachmentPt = (uint)group.GetAttachmentPoint();
163 } 166 }
164 167
165 // if we still didn't find a suitable attachment point....... 168 // if we still didn't find a suitable attachment point.......
166 if (AttachmentPt == 0) 169 if (AttachmentPt == 0)
167 { 170 {
168 // Stick it on left hand with Zero Offset from the attachment point. 171 // Stick it on left hand with Zero Offset from the attachment point.
169 AttachmentPt = (uint)AttachmentPoint.LeftHand; 172 AttachmentPt = (uint)AttachmentPoint.LeftHand;
170 attachPos = Vector3.Zero; 173 attachPos = Vector3.Zero;
171 } 174 }
172 175
173 group.SetAttachmentPoint((byte)AttachmentPt); 176 group.SetAttachmentPoint((byte)AttachmentPt);
174 group.AbsolutePosition = attachPos; 177 group.AbsolutePosition = attachPos;
175 178
176 // Remove any previous attachments 179 // Remove any previous attachments
177 ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); 180 ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
178 UUID itemID = UUID.Zero; 181 UUID itemID = UUID.Zero;
179 if (sp != null) 182 if (sp != null)
183 {
184 foreach (SceneObjectGroup grp in sp.Attachments)
180 { 185 {
181 foreach (SceneObjectGroup grp in sp.Attachments) 186 if (grp.GetAttachmentPoint() == (byte)AttachmentPt)
182 { 187 {
183 if (grp.GetAttachmentPoint() == (byte)AttachmentPt) 188 itemID = grp.GetFromItemID();
184 { 189 break;
185 itemID = grp.GetFromItemID();
186 break;
187 }
188 } 190 }
189 if (itemID != UUID.Zero)
190 DetachSingleAttachmentToInv(itemID, remoteClient);
191 } 191 }
192 if (itemID != UUID.Zero)
193 DetachSingleAttachmentToInv(itemID, remoteClient);
194 }
192 195
193 if (group.GetFromItemID() == UUID.Zero) 196 if (group.GetFromItemID() == UUID.Zero)
194 { 197 {
195 m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemID); 198 m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemID);
196 }
197 else
198 {
199 itemID = group.GetFromItemID();
200 }
201
202 ShowAttachInUserInventory(remoteClient, AttachmentPt, itemID, group);
203
204 AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
205 } 199 }
206 else 200 else
207 { 201 {
208 remoteClient.SendAgentAlertMessage( 202 itemID = group.GetFromItemID();
209 "You don't have sufficient permissions to attach this object", false);
210
211 return false;
212 } 203 }
213 204
205 ShowAttachInUserInventory(remoteClient, AttachmentPt, itemID, group);
206
207 AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
208
214 return true; 209 return true;
215 } 210 }
216 211
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index 358d0a7..2d7244e 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
130 130
131 List<string> mainParams = ops.Parse(cmdparams); 131 List<string> mainParams = ops.Parse(cmdparams);
132 132
133 if (cmdparams.Length > 2) 133 if (mainParams.Count > 2)
134 { 134 {
135 ArchiveRegion(mainParams[2], options); 135 ArchiveRegion(mainParams[2], options);
136 } 136 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a29b7f1..06f8ac1 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1733,7 +1733,12 @@ namespace OpenSim.Region.Framework.Scenes
1733 // Autoreturn has a null client. Nothing else does. So 1733 // Autoreturn has a null client. Nothing else does. So
1734 // allow only returns 1734 // allow only returns
1735 if (action != DeRezAction.Return) 1735 if (action != DeRezAction.Return)
1736 {
1737 m_log.WarnFormat(
1738 "[AGENT INVENTORY]: Ignoring attempt to {0} {1} {2} without a client",
1739 action, grp.Name, grp.UUID);
1736 return; 1740 return;
1741 }
1737 1742
1738 permissionToTakeCopy = false; 1743 permissionToTakeCopy = false;
1739 } 1744 }
@@ -1741,13 +1746,13 @@ namespace OpenSim.Region.Framework.Scenes
1741 { 1746 {
1742 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) 1747 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
1743 permissionToTakeCopy = false; 1748 permissionToTakeCopy = false;
1749
1744 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) 1750 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
1745 permissionToTake = false; 1751 permissionToTake = false;
1746 1752
1747 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) 1753 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
1748 permissionToDelete = false; 1754 permissionToDelete = false;
1749 } 1755 }
1750
1751 } 1756 }
1752 1757
1753 // Handle god perms 1758 // Handle god perms
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index 06890a0..d67638a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -27,13 +27,15 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
30using System.Text; 31using System.Text;
32using log4net;
31using OpenMetaverse; 33using OpenMetaverse;
32using OpenSim.Framework; 34using OpenSim.Framework;
33using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
34 36
35namespace OpenSim.Region.Framework.Scenes 37namespace OpenSim.Region.Framework.Scenes
36{ 38{
37 #region Delegates 39 #region Delegates
38 public delegate uint GenerateClientFlagsHandler(UUID userID, UUID objectID); 40 public delegate uint GenerateClientFlagsHandler(UUID userID, UUID objectID);
39 public delegate void SetBypassPermissionsHandler(bool value); 41 public delegate void SetBypassPermissionsHandler(bool value);
@@ -88,6 +90,8 @@ namespace OpenSim.Region.Framework.Scenes
88 90
89 public class ScenePermissions 91 public class ScenePermissions
90 { 92 {
93 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
94
91 private Scene m_scene; 95 private Scene m_scene;
92 96
93 public ScenePermissions(Scene scene) 97 public ScenePermissions(Scene scene)
@@ -242,6 +246,8 @@ namespace OpenSim.Region.Framework.Scenes
242 #region DELETE OBJECT 246 #region DELETE OBJECT
243 public bool CanDeleteObject(UUID objectID, UUID deleter) 247 public bool CanDeleteObject(UUID objectID, UUID deleter)
244 { 248 {
249 bool result = true;
250
245 DeleteObjectHandler handler = OnDeleteObject; 251 DeleteObjectHandler handler = OnDeleteObject;
246 if (handler != null) 252 if (handler != null)
247 { 253 {
@@ -249,10 +255,18 @@ namespace OpenSim.Region.Framework.Scenes
249 foreach (DeleteObjectHandler h in list) 255 foreach (DeleteObjectHandler h in list)
250 { 256 {
251 if (h(objectID, deleter, m_scene) == false) 257 if (h(objectID, deleter, m_scene) == false)
252 return false; 258 {
259 result = false;
260 break;
261 }
253 } 262 }
254 } 263 }
255 return true; 264
265// m_log.DebugFormat(
266// "[SCENE PERMISSIONS]: CanDeleteObject() fired for object {0}, deleter {1}, result {2}",
267// objectID, deleter, result);
268
269 return result;
256 } 270 }
257 271
258 #endregion 272 #endregion
@@ -260,6 +274,8 @@ namespace OpenSim.Region.Framework.Scenes
260 #region TAKE OBJECT 274 #region TAKE OBJECT
261 public bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID) 275 public bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID)
262 { 276 {
277 bool result = true;
278
263 TakeObjectHandler handler = OnTakeObject; 279 TakeObjectHandler handler = OnTakeObject;
264 if (handler != null) 280 if (handler != null)
265 { 281 {
@@ -267,10 +283,18 @@ namespace OpenSim.Region.Framework.Scenes
267 foreach (TakeObjectHandler h in list) 283 foreach (TakeObjectHandler h in list)
268 { 284 {
269 if (h(objectID, AvatarTakingUUID, m_scene) == false) 285 if (h(objectID, AvatarTakingUUID, m_scene) == false)
270 return false; 286 {
287 result = false;
288 break;
289 }
271 } 290 }
272 } 291 }
273 return true; 292
293// m_log.DebugFormat(
294// "[SCENE PERMISSIONS]: CanTakeObject() fired for object {0}, taker {1}, result {2}",
295// objectID, AvatarTakingUUID, result);
296
297 return result;
274 } 298 }
275 299
276 #endregion 300 #endregion
@@ -278,6 +302,8 @@ namespace OpenSim.Region.Framework.Scenes
278 #region TAKE COPY OBJECT 302 #region TAKE COPY OBJECT
279 public bool CanTakeCopyObject(UUID objectID, UUID userID) 303 public bool CanTakeCopyObject(UUID objectID, UUID userID)
280 { 304 {
305 bool result = true;
306
281 TakeCopyObjectHandler handler = OnTakeCopyObject; 307 TakeCopyObjectHandler handler = OnTakeCopyObject;
282 if (handler != null) 308 if (handler != null)
283 { 309 {
@@ -285,10 +311,18 @@ namespace OpenSim.Region.Framework.Scenes
285 foreach (TakeCopyObjectHandler h in list) 311 foreach (TakeCopyObjectHandler h in list)
286 { 312 {
287 if (h(objectID, userID, m_scene) == false) 313 if (h(objectID, userID, m_scene) == false)
288 return false; 314 {
315 result = false;
316 break;
317 }
289 } 318 }
290 } 319 }
291 return true; 320
321// m_log.DebugFormat(
322// "[SCENE PERMISSIONS]: CanTakeCopyObject() fired for object {0}, user {1}, result {2}",
323// objectID, userID, result);
324
325 return result;
292 } 326 }
293 327
294 #endregion 328 #endregion
@@ -383,6 +417,8 @@ namespace OpenSim.Region.Framework.Scenes
383 #region RETURN OBJECT 417 #region RETURN OBJECT
384 public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects) 418 public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects)
385 { 419 {
420 bool result = true;
421
386 ReturnObjectsHandler handler = OnReturnObjects; 422 ReturnObjectsHandler handler = OnReturnObjects;
387 if (handler != null) 423 if (handler != null)
388 { 424 {
@@ -390,10 +426,18 @@ namespace OpenSim.Region.Framework.Scenes
390 foreach (ReturnObjectsHandler h in list) 426 foreach (ReturnObjectsHandler h in list)
391 { 427 {
392 if (h(land, user, objects, m_scene) == false) 428 if (h(land, user, objects, m_scene) == false)
393 return false; 429 {
430 result = false;
431 break;
432 }
394 } 433 }
395 } 434 }
396 return true; 435
436// m_log.DebugFormat(
437// "[SCENE PERMISSIONS]: CanReturnObjects() fired for user {0} for {1} objects on {2}, result {3}",
438// user, objects.Count, land.LandData.Name, result);
439
440 return result;
397 } 441 }
398 442
399 #endregion 443 #endregion
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c2810b2..4ec530e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2607,6 +2607,7 @@ namespace OpenSim.Region.Framework.Scenes
2607 //if (part.UUID != m_rootPart.UUID) 2607 //if (part.UUID != m_rootPart.UUID)
2608 2608
2609 HasGroupChanged = true; 2609 HasGroupChanged = true;
2610 part.TriggerScriptChangedEvent(Changed.SCALE);
2610 ScheduleGroupForFullUpdate(); 2611 ScheduleGroupForFullUpdate();
2611 2612
2612 //if (part.UUID == m_rootPart.UUID) 2613 //if (part.UUID == m_rootPart.UUID)
@@ -2758,6 +2759,7 @@ namespace OpenSim.Region.Framework.Scenes
2758 part.IgnoreUndoUpdate = false; 2759 part.IgnoreUndoUpdate = false;
2759 part.StoreUndoState(); 2760 part.StoreUndoState();
2760 HasGroupChanged = true; 2761 HasGroupChanged = true;
2762 m_rootPart.TriggerScriptChangedEvent(Changed.SCALE);
2761 ScheduleGroupForTerseUpdate(); 2763 ScheduleGroupForTerseUpdate();
2762 } 2764 }
2763 } 2765 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2155e26..ba592c4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1002,21 +1002,7 @@ namespace OpenSim.Region.Framework.Scenes
1002 public PrimitiveBaseShape Shape 1002 public PrimitiveBaseShape Shape
1003 { 1003 {
1004 get { return m_shape; } 1004 get { return m_shape; }
1005 set 1005 set { m_shape = value; }
1006 {
1007 bool shape_changed = false;
1008 // TODO: this should really be restricted to the right
1009 // set of attributes on shape change. For instance,
1010 // changing the lighting on a shape shouldn't cause
1011 // this.
1012 if (m_shape != null)
1013 shape_changed = true;
1014
1015 m_shape = value;
1016
1017 if (shape_changed)
1018 TriggerScriptChangedEvent(Changed.SHAPE);
1019 }
1020 } 1006 }
1021 1007
1022 public Vector3 Scale 1008 public Vector3 Scale
@@ -4570,6 +4556,7 @@ namespace OpenSim.Region.Framework.Scenes
4570 ParentGroup.RootPart.Rezzed = DateTime.UtcNow; 4556 ParentGroup.RootPart.Rezzed = DateTime.UtcNow;
4571 4557
4572 ParentGroup.HasGroupChanged = true; 4558 ParentGroup.HasGroupChanged = true;
4559 TriggerScriptChangedEvent(Changed.SHAPE);
4573 ScheduleFullUpdate(); 4560 ScheduleFullUpdate();
4574 } 4561 }
4575 4562
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs
new file mode 100644
index 0000000..b3b99f4
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs
@@ -0,0 +1,129 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using Nini.Config;
32using NUnit.Framework;
33using NUnit.Framework.SyntaxHelpers;
34using OpenMetaverse;
35using OpenSim.Framework;
36using OpenSim.Framework.Communications;
37using OpenSim.Region.CoreModules.World.Permissions;
38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Tests.Common;
40using OpenSim.Tests.Common.Mock;
41using OpenSim.Tests.Common.Setup;
42
43namespace OpenSim.Region.Framework.Scenes.Tests
44{
45 /// <summary>
46 /// Tests manipulation of scene objects by users.
47 /// </summary>
48 ///
49 /// This is at a level above the SceneObjectBasicTests, which act on the scene directly.
50 /// FIXME: These tests are very incomplete - they only test for a few conditions.
51 [TestFixture]
52 public class SceneObjectUserTests
53 {
54 /// <summary>
55 /// Test deleting an object from a scene.
56 /// </summary>
57 [Test]
58 public void TestDeRezSceneObject()
59 {
60 TestHelper.InMethod();
61// log4net.Config.XmlConfigurator.Configure();
62
63 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
64
65 TestScene scene = SceneSetupHelpers.SetupScene();
66 IConfigSource configSource = new IniConfigSource();
67 IConfig config = configSource.AddConfig("Startup");
68 config.Set("serverside_object_permissions", true);
69 SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
70 TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);
71
72 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
73 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
74 sogd.Enabled = false;
75
76 SceneObjectPart part
77 = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
78 part.Name = "obj1";
79 scene.AddNewSceneObject(new SceneObjectGroup(part), false);
80 List<uint> localIds = new List<uint>();
81 localIds.Add(part.LocalId);
82
83 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
84 sogd.InventoryDeQueueAndDelete();
85
86 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
87 Assert.That(retrievedPart, Is.Null);
88 }
89
90 /// <summary>
91 /// Test deleting an object from a scene where the deleter is not the owner
92 /// </summary>
93 ///
94 /// This test assumes that the deleter is not a god.
95 [Test]
96 public void TestDeRezSceneObjectNotOwner()
97 {
98 TestHelper.InMethod();
99// log4net.Config.XmlConfigurator.Configure();
100
101 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
102 UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
103
104 TestScene scene = SceneSetupHelpers.SetupScene();
105 IConfigSource configSource = new IniConfigSource();
106 IConfig config = configSource.AddConfig("Startup");
107 config.Set("serverside_object_permissions", true);
108 SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
109 TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);
110
111 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
112 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
113 sogd.Enabled = false;
114
115 SceneObjectPart part
116 = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
117 part.Name = "obj1";
118 scene.AddNewSceneObject(new SceneObjectGroup(part), false);
119 List<uint> localIds = new List<uint>();
120 localIds.Add(part.LocalId);
121
122 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
123 sogd.InventoryDeQueueAndDelete();
124
125 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
126 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
127 }
128 }
129} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index ab5968c..ef52363 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -65,6 +65,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
65 [TestFixtureSetUp] 65 [TestFixtureSetUp]
66 public void Init() 66 public void Init()
67 { 67 {
68 TestHelper.InMethod();
69
68 scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); 70 scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
69 scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); 71 scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
70 scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000); 72 scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 294d4f0..a583cca 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -58,7 +58,7 @@ using OSDMap = OpenMetaverse.StructuredData.OSDMap;
58namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice 58namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
59{ 59{
60 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "FreeSwitchVoiceModule")] 60 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "FreeSwitchVoiceModule")]
61 public class FreeSwitchVoiceModule : INonSharedRegionModule, IVoiceModule 61 public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule
62 { 62 {
63 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 63 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
64 64
@@ -97,8 +97,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
97 private readonly Dictionary<string, string> m_UUIDName = new Dictionary<string, string>(); 97 private readonly Dictionary<string, string> m_UUIDName = new Dictionary<string, string>();
98 private Dictionary<string, string> m_ParcelAddress = new Dictionary<string, string>(); 98 private Dictionary<string, string> m_ParcelAddress = new Dictionary<string, string>();
99 99
100 private Scene m_Scene;
101
102 private IConfig m_Config; 100 private IConfig m_Config;
103 101
104 private IFreeswitchService m_FreeswitchService; 102 private IFreeswitchService m_FreeswitchService;
@@ -165,6 +163,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
165 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), 163 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix),
166 FreeSwitchSLVoiceGetPreloginHTTPHandler); 164 FreeSwitchSLVoiceGetPreloginHTTPHandler);
167 165
166 MainServer.Instance.AddHTTPHandler(String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix), FreeSwitchConfigHTTPHandler);
167
168 // RestStreamHandler h = new 168 // RestStreamHandler h = new
169 // RestStreamHandler("GET", 169 // RestStreamHandler("GET",
170 // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); 170 // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler);
@@ -214,15 +214,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
214 } 214 }
215 } 215 }
216 216
217 public void AddRegion(Scene scene) 217 public void PostInitialise()
218 { 218 {
219 m_Scene = scene; 219 }
220 220
221 public void AddRegion(Scene scene)
222 {
221 // We generate these like this: The region's external host name 223 // We generate these like this: The region's external host name
222 // as defined in Regions.ini is a good address to use. It's a 224 // as defined in Regions.ini is a good address to use. It's a
223 // dotted quad (or should be!) and it can reach this host from 225 // dotted quad (or should be!) and it can reach this host from
224 // a client. The port is grabbed from the region's HTTP server. 226 // a client. The port is grabbed from the region's HTTP server.
225 m_openSimWellKnownHTTPAddress = m_Scene.RegionInfo.ExternalHostName; 227 m_openSimWellKnownHTTPAddress = scene.RegionInfo.ExternalHostName;
226 m_freeSwitchServicePort = MainServer.Instance.Port; 228 m_freeSwitchServicePort = MainServer.Instance.Port;
227 229
228 if (m_Enabled) 230 if (m_Enabled)
@@ -601,7 +603,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
601 response["str_response_string"] = string.Empty; 603 response["str_response_string"] = string.Empty;
602 response["content-type"] = "text/xml"; 604 response["content-type"] = "text/xml";
603 605
604 Hashtable requestBody = parseRequestBody((string)request["body"]); 606 Hashtable requestBody = ParseRequestBody((string)request["body"]);
605 607
606 if (!requestBody.ContainsKey("auth_token")) 608 if (!requestBody.ContainsKey("auth_token"))
607 return response; 609 return response;
@@ -673,7 +675,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
673 string uri = (string)request["uri"]; 675 string uri = (string)request["uri"];
674 string contenttype = (string)request["content-type"]; 676 string contenttype = (string)request["content-type"];
675 677
676 Hashtable requestBody = parseRequestBody((string)request["body"]); 678 Hashtable requestBody = ParseRequestBody((string)request["body"]);
677 679
678 //string pwd = (string) requestBody["pwd"]; 680 //string pwd = (string) requestBody["pwd"];
679 string userid = (string) requestBody["userid"]; 681 string userid = (string) requestBody["userid"];
@@ -717,7 +719,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
717 return response; 719 return response;
718 } 720 }
719 721
720 public Hashtable parseRequestBody(string body) 722 public Hashtable ParseRequestBody(string body)
721 { 723 {
722 Hashtable bodyParams = new Hashtable(); 724 Hashtable bodyParams = new Hashtable();
723 // split string 725 // split string
@@ -790,6 +792,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
790 { 792 {
791 return true; 793 return true;
792 } 794 }
795
796 public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request)
797 {
798 Hashtable response = new Hashtable();
799 response["str_response_string"] = string.Empty;
800 response["content_type"] = "text/plain";
801 response["keepalive"] = false;
802 response["int_response_code"] = 500;
803
804 Hashtable requestBody = ParseRequestBody((string) request["body"]);
805
806 string section = (string) requestBody["section"];
807
808 if (section == "directory")
809 response = m_FreeswitchService.HandleDirectoryRequest(requestBody);
810 else if (section == "dialplan")
811 response = m_FreeswitchService.HandleDialplanRequest(requestBody);
812 else
813 m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section);
814
815 return response;
816 }
793 } 817 }
794 818
795 public class MonoCert : ICertificatePolicy 819 public class MonoCert : ICertificatePolicy
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 6663aa5..660e9a3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -392,13 +392,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
392 { 392 {
393// m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); 393// m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script");
394 PostEvent(new EventParams("changed", 394 PostEvent(new EventParams("changed",
395 new Object[] { (int)Changed.REGION_RESTART }, new DetectParams[0])); 395 new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) },
396 new DetectParams[0]));
396 } 397 }
397 else if (m_stateSource == StateSource.PrimCrossing) 398 else if (m_stateSource == StateSource.PrimCrossing)
398 { 399 {
399 // CHANGED_REGION 400 // CHANGED_REGION
400 PostEvent(new EventParams("changed", 401 PostEvent(new EventParams("changed",
401 new Object[] { (int)Changed.REGION }, new DetectParams[0])); 402 new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) },
403 new DetectParams[0]));
402 } 404 }
403 } 405 }
404 else 406 else
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 23ae5b4..22a718a 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -600,8 +600,10 @@ namespace OpenSim.Server.Handlers.Asset
600 ret["AssetType"] = item.AssetType.ToString(); 600 ret["AssetType"] = item.AssetType.ToString();
601 ret["BasePermissions"] = item.BasePermissions.ToString(); 601 ret["BasePermissions"] = item.BasePermissions.ToString();
602 ret["CreationDate"] = item.CreationDate.ToString(); 602 ret["CreationDate"] = item.CreationDate.ToString();
603 ret["CreatorId"] = item.CreatorId.ToString(); 603 if (item.CreatorId != null)
604 ret["CreatorData"] = item.CreatorData.ToString(); 604 ret["CreatorId"] = item.CreatorId.ToString();
605 else
606 ret["CreatorId"] = String.Empty;
605 ret["CurrentPermissions"] = item.CurrentPermissions.ToString(); 607 ret["CurrentPermissions"] = item.CurrentPermissions.ToString();
606 ret["Description"] = item.Description.ToString(); 608 ret["Description"] = item.Description.ToString();
607 ret["EveryOnePermissions"] = item.EveryOnePermissions.ToString(); 609 ret["EveryOnePermissions"] = item.EveryOnePermissions.ToString();
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
index 88fbda3..b3bfcc2 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
@@ -302,6 +302,8 @@ namespace OpenSim.Services.Connectors
302 302
303 public bool AddItem(InventoryItemBase item) 303 public bool AddItem(InventoryItemBase item)
304 { 304 {
305 if (item.CreatorData == null)
306 item.CreatorData = String.Empty;
305 Dictionary<string,object> ret = MakeRequest("ADDITEM", 307 Dictionary<string,object> ret = MakeRequest("ADDITEM",
306 new Dictionary<string,object> { 308 new Dictionary<string,object> {
307 { "AssetID", item.AssetID.ToString() }, 309 { "AssetID", item.AssetID.ToString() },
@@ -335,6 +337,8 @@ namespace OpenSim.Services.Connectors
335 337
336 public bool UpdateItem(InventoryItemBase item) 338 public bool UpdateItem(InventoryItemBase item)
337 { 339 {
340 if (item.CreatorData == null)
341 item.CreatorData = String.Empty;
338 Dictionary<string,object> ret = MakeRequest("UPDATEITEM", 342 Dictionary<string,object> ret = MakeRequest("UPDATEITEM",
339 new Dictionary<string,object> { 343 new Dictionary<string,object> {
340 { "AssetID", item.AssetID.ToString() }, 344 { "AssetID", item.AssetID.ToString() },
@@ -558,7 +562,10 @@ namespace OpenSim.Services.Connectors
558 item.InvType = int.Parse(data["InvType"].ToString()); 562 item.InvType = int.Parse(data["InvType"].ToString());
559 item.Folder = new UUID(data["Folder"].ToString()); 563 item.Folder = new UUID(data["Folder"].ToString());
560 item.CreatorId = data["CreatorId"].ToString(); 564 item.CreatorId = data["CreatorId"].ToString();
561 item.CreatorData = data["CreatorData"].ToString(); 565 if (data.ContainsKey("CreatorData"))
566 item.CreatorData = data["CreatorData"].ToString();
567 else
568 item.CreatorData = String.Empty;
562 item.Description = data["Description"].ToString(); 569 item.Description = data["Description"].ToString();
563 item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); 570 item.NextPermissions = uint.Parse(data["NextPermissions"].ToString());
564 item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); 571 item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString());