aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Data/IXInventoryData.cs29
-rw-r--r--OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs35
-rw-r--r--OpenSim/Data/MSSQL/MSSQLXInventoryData.cs10
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs27
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs30
-rw-r--r--OpenSim/Data/MySQL/MySQLXInventoryData.cs10
-rw-r--r--OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs28
-rw-r--r--OpenSim/Data/SQLite/SQLiteXInventoryData.cs10
-rw-r--r--OpenSim/Framework/Tests/AnimationTests.cs1
-rw-r--r--OpenSim/Framework/WebUtil.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs13
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs25
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs3
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs1
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs45
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs67
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs37
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs85
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs1
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs1
-rw-r--r--OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs17
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs150
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs13
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs34
-rw-r--r--OpenSim/Tests/Common/Helpers/AssetHelpers.cs (renamed from OpenSim/Tests/Common/Setup/AssetHelpers.cs)20
-rw-r--r--OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs (renamed from OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs)4
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneSetupHelpers.cs (renamed from OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs)2
-rw-r--r--OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs89
-rw-r--r--OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs (renamed from OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs)4
-rw-r--r--OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs (renamed from OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs)4
57 files changed, 674 insertions, 213 deletions
diff --git a/OpenSim/Data/IXInventoryData.cs b/OpenSim/Data/IXInventoryData.cs
index d85a7ef..85a5c08 100644
--- a/OpenSim/Data/IXInventoryData.cs
+++ b/OpenSim/Data/IXInventoryData.cs
@@ -74,9 +74,38 @@ namespace OpenSim.Data
74 bool StoreFolder(XInventoryFolder folder); 74 bool StoreFolder(XInventoryFolder folder);
75 bool StoreItem(XInventoryItem item); 75 bool StoreItem(XInventoryItem item);
76 76
77 /// <summary>
78 /// Delete folders where field == val
79 /// </summary>
80 /// <param name="field"></param>
81 /// <param name="val"></param>
82 /// <returns>true if the delete was successful, false if it was not</returns>
77 bool DeleteFolders(string field, string val); 83 bool DeleteFolders(string field, string val);
84
85 /// <summary>
86 /// Delete folders where field1 == val1, field2 == val2...
87 /// </summary>
88 /// <param name="fields"></param>
89 /// <param name="vals"></param>
90 /// <returns>true if the delete was successful, false if it was not</returns>
91 bool DeleteFolders(string[] fields, string[] vals);
92
93 /// <summary>
94 /// Delete items where field == val
95 /// </summary>
96 /// <param name="field"></param>
97 /// <param name="val"></param>
98 /// <returns>true if the delete was successful, false if it was not</returns>
78 bool DeleteItems(string field, string val); 99 bool DeleteItems(string field, string val);
79 100
101 /// <summary>
102 /// Delete items where field1 == val1, field2 == val2...
103 /// </summary>
104 /// <param name="fields"></param>
105 /// <param name="vals"></param>
106 /// <returns>true if the delete was successful, false if it was not</returns>
107 bool DeleteItems(string[] fields, string[] vals);
108
80 bool MoveItem(string id, string newParent); 109 bool MoveItem(string id, string newParent);
81 XInventoryItem[] GetActiveGestures(UUID principalID); 110 XInventoryItem[] GetActiveGestures(UUID principalID);
82 int GetAssetPermissions(UUID principalID, UUID assetID); 111 int GetAssetPermissions(UUID principalID, UUID assetID);
diff --git a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs
index 19e8fa6..6e695ce 100644
--- a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs
+++ b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs
@@ -335,24 +335,35 @@ namespace OpenSim.Data.MSSQL
335 } 335 }
336 } 336 }
337 337
338 public virtual bool Delete(string field, string val) 338 public virtual bool Delete(string field, string key)
339 { 339 {
340 return Delete(new string[] { field }, new string[] { key });
341 }
342
343 public virtual bool Delete(string[] fields, string[] keys)
344 {
345 if (fields.Length != keys.Length)
346 return false;
347
348 List<string> terms = new List<string>();
349
340 using (SqlConnection conn = new SqlConnection(m_ConnectionString)) 350 using (SqlConnection conn = new SqlConnection(m_ConnectionString))
341 using (SqlCommand cmd = new SqlCommand()) 351 using (SqlCommand cmd = new SqlCommand())
342 { 352 {
343 string deleteCommand = String.Format("DELETE FROM {0} WHERE [{1}] = @{1}", m_Realm, field); 353 for (int i = 0; i < fields.Length; i++)
344 cmd.CommandText = deleteCommand;
345
346 cmd.Parameters.Add(m_database.CreateParameter(field, val));
347 cmd.Connection = conn;
348 conn.Open();
349
350 if (cmd.ExecuteNonQuery() > 0)
351 { 354 {
352 //m_log.Warn("[MSSQLGenericTable]: " + deleteCommand); 355 cmd.Parameters.Add(m_database.CreateParameter(fields[i], keys[i]));
353 return true; 356 terms.Add("[" + fields[i] + "] = @" + fields[i]);
354 } 357 }
355 return false; 358
359 string where = String.Join(" AND ", terms.ToArray());
360
361 string query = String.Format("DELETE * FROM {0} WHERE {1}", m_Realm, where);
362
363 cmd.Connection = conn;
364 cmd.CommandText = query;
365 conn.Open();
366 return cmd.ExecuteNonQuery() > 0;
356 } 367 }
357 } 368 }
358 } 369 }
diff --git a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
index 739eb55..dc35a2e 100644
--- a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
@@ -79,11 +79,21 @@ namespace OpenSim.Data.MSSQL
79 return m_Folders.Delete(field, val); 79 return m_Folders.Delete(field, val);
80 } 80 }
81 81
82 public bool DeleteFolders(string[] fields, string[] vals)
83 {
84 return m_Folders.Delete(fields, vals);
85 }
86
82 public bool DeleteItems(string field, string val) 87 public bool DeleteItems(string field, string val)
83 { 88 {
84 return m_Items.Delete(field, val); 89 return m_Items.Delete(field, val);
85 } 90 }
86 91
92 public bool DeleteItems(string[] fields, string[] vals)
93 {
94 return m_Items.Delete(fields, vals);
95 }
96
87 public bool MoveItem(string id, string newParent) 97 public bool MoveItem(string id, string newParent)
88 { 98 {
89 return m_Items.MoveItem(id, newParent); 99 return m_Items.MoveItem(id, newParent);
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index cfffbd8..754cf72 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -264,18 +264,33 @@ namespace OpenSim.Data.MySQL
264 } 264 }
265 } 265 }
266 266
267 public virtual bool Delete(string field, string val) 267 public virtual bool Delete(string field, string key)
268 { 268 {
269 return Delete(new string[] { field }, new string[] { key });
270 }
271
272 public virtual bool Delete(string[] fields, string[] keys)
273 {
274 if (fields.Length != keys.Length)
275 return false;
276
277 List<string> terms = new List<string>();
278
269 using (MySqlCommand cmd = new MySqlCommand()) 279 using (MySqlCommand cmd = new MySqlCommand())
270 { 280 {
281 for (int i = 0 ; i < fields.Length ; i++)
282 {
283 cmd.Parameters.AddWithValue(fields[i], keys[i]);
284 terms.Add("`" + fields[i] + "` = ?" + fields[i]);
285 }
271 286
272 cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field); 287 string where = String.Join(" and ", terms.ToArray());
273 cmd.Parameters.AddWithValue(field, val);
274 288
275 if (ExecuteNonQuery(cmd) > 0) 289 string query = String.Format("delete from {0} where {1}", m_Realm, where);
276 return true;
277 290
278 return false; 291 cmd.CommandText = query;
292
293 return ExecuteNonQuery(cmd) > 0;
279 } 294 }
280 } 295 }
281 } 296 }
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index e14d775..3306968 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Data.MySQL
66 Initialise(connectionString); 66 Initialise(connectionString);
67 } 67 }
68 68
69 public void Initialise(string connectionString) 69 public virtual void Initialise(string connectionString)
70 { 70 {
71 m_connectionString = connectionString; 71 m_connectionString = connectionString;
72 72
@@ -130,7 +130,7 @@ namespace OpenSim.Data.MySQL
130 130
131 public void Dispose() {} 131 public void Dispose() {}
132 132
133 public void StoreObject(SceneObjectGroup obj, UUID regionUUID) 133 public virtual void StoreObject(SceneObjectGroup obj, UUID regionUUID)
134 { 134 {
135 uint flags = obj.RootPart.GetEffectiveObjectFlags(); 135 uint flags = obj.RootPart.GetEffectiveObjectFlags();
136 136
@@ -258,7 +258,7 @@ namespace OpenSim.Data.MySQL
258 } 258 }
259 } 259 }
260 260
261 public void RemoveObject(UUID obj, UUID regionUUID) 261 public virtual void RemoveObject(UUID obj, UUID regionUUID)
262 { 262 {
263// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID); 263// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID);
264 264
@@ -407,7 +407,7 @@ namespace OpenSim.Data.MySQL
407 } 407 }
408 } 408 }
409 409
410 public List<SceneObjectGroup> LoadObjects(UUID regionID) 410 public virtual List<SceneObjectGroup> LoadObjects(UUID regionID)
411 { 411 {
412 const int ROWS_PER_QUERY = 5000; 412 const int ROWS_PER_QUERY = 5000;
413 413
@@ -576,7 +576,7 @@ namespace OpenSim.Data.MySQL
576 } 576 }
577 } 577 }
578 578
579 public void StoreTerrain(double[,] ter, UUID regionID) 579 public virtual void StoreTerrain(double[,] ter, UUID regionID)
580 { 580 {
581 m_log.Info("[REGION DB]: Storing terrain"); 581 m_log.Info("[REGION DB]: Storing terrain");
582 582
@@ -605,7 +605,7 @@ namespace OpenSim.Data.MySQL
605 } 605 }
606 } 606 }
607 607
608 public double[,] LoadTerrain(UUID regionID) 608 public virtual double[,] LoadTerrain(UUID regionID)
609 { 609 {
610 double[,] terrain = null; 610 double[,] terrain = null;
611 611
@@ -655,7 +655,7 @@ namespace OpenSim.Data.MySQL
655 return terrain; 655 return terrain;
656 } 656 }
657 657
658 public void RemoveLandObject(UUID globalID) 658 public virtual void RemoveLandObject(UUID globalID)
659 { 659 {
660 lock (m_dbLock) 660 lock (m_dbLock)
661 { 661 {
@@ -674,7 +674,7 @@ namespace OpenSim.Data.MySQL
674 } 674 }
675 } 675 }
676 676
677 public void StoreLandObject(ILandObject parcel) 677 public virtual void StoreLandObject(ILandObject parcel)
678 { 678 {
679 lock (m_dbLock) 679 lock (m_dbLock)
680 { 680 {
@@ -731,7 +731,7 @@ namespace OpenSim.Data.MySQL
731 } 731 }
732 } 732 }
733 733
734 public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) 734 public virtual RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
735 { 735 {
736 RegionLightShareData nWP = new RegionLightShareData(); 736 RegionLightShareData nWP = new RegionLightShareData();
737 nWP.OnSave += StoreRegionWindlightSettings; 737 nWP.OnSave += StoreRegionWindlightSettings;
@@ -828,7 +828,7 @@ namespace OpenSim.Data.MySQL
828 return nWP; 828 return nWP;
829 } 829 }
830 830
831 public RegionSettings LoadRegionSettings(UUID regionUUID) 831 public virtual RegionSettings LoadRegionSettings(UUID regionUUID)
832 { 832 {
833 RegionSettings rs = null; 833 RegionSettings rs = null;
834 834
@@ -866,7 +866,7 @@ namespace OpenSim.Data.MySQL
866 return rs; 866 return rs;
867 } 867 }
868 868
869 public void StoreRegionWindlightSettings(RegionLightShareData wl) 869 public virtual void StoreRegionWindlightSettings(RegionLightShareData wl)
870 { 870 {
871 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 871 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
872 { 872 {
@@ -969,7 +969,7 @@ namespace OpenSim.Data.MySQL
969 } 969 }
970 } 970 }
971 971
972 public void RemoveRegionWindlightSettings(UUID regionID) 972 public virtual void RemoveRegionWindlightSettings(UUID regionID)
973 { 973 {
974 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 974 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
975 { 975 {
@@ -984,7 +984,7 @@ namespace OpenSim.Data.MySQL
984 } 984 }
985 } 985 }
986 986
987 public void StoreRegionSettings(RegionSettings rs) 987 public virtual void StoreRegionSettings(RegionSettings rs)
988 { 988 {
989 lock (m_dbLock) 989 lock (m_dbLock)
990 { 990 {
@@ -1036,7 +1036,7 @@ namespace OpenSim.Data.MySQL
1036 } 1036 }
1037 } 1037 }
1038 1038
1039 public List<LandData> LoadLandObjects(UUID regionUUID) 1039 public virtual List<LandData> LoadLandObjects(UUID regionUUID)
1040 { 1040 {
1041 List<LandData> landData = new List<LandData>(); 1041 List<LandData> landData = new List<LandData>();
1042 1042
@@ -1802,7 +1802,7 @@ namespace OpenSim.Data.MySQL
1802 cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); 1802 cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml());
1803 } 1803 }
1804 1804
1805 public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) 1805 public virtual void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
1806 { 1806 {
1807 lock (m_dbLock) 1807 lock (m_dbLock)
1808 { 1808 {
diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
index 481da49..caf18a4 100644
--- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
@@ -85,11 +85,21 @@ namespace OpenSim.Data.MySQL
85 return m_Folders.Delete(field, val); 85 return m_Folders.Delete(field, val);
86 } 86 }
87 87
88 public bool DeleteFolders(string[] fields, string[] vals)
89 {
90 return m_Folders.Delete(fields, vals);
91 }
92
88 public bool DeleteItems(string field, string val) 93 public bool DeleteItems(string field, string val)
89 { 94 {
90 return m_Items.Delete(field, val); 95 return m_Items.Delete(field, val);
91 } 96 }
92 97
98 public bool DeleteItems(string[] fields, string[] vals)
99 {
100 return m_Items.Delete(fields, vals);
101 }
102
93 public bool MoveItem(string id, string newParent) 103 public bool MoveItem(string id, string newParent)
94 { 104 {
95 return m_Items.MoveItem(id, newParent); 105 return m_Items.MoveItem(id, newParent);
diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
index 0d7b001..3fb2d3f 100644
--- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
+++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
@@ -258,17 +258,33 @@ namespace OpenSim.Data.SQLite
258 return false; 258 return false;
259 } 259 }
260 260
261 public bool Delete(string field, string val) 261 public virtual bool Delete(string field, string key)
262 { 262 {
263 return Delete(new string[] { field }, new string[] { key });
264 }
265
266 public bool Delete(string[] fields, string[] keys)
267 {
268 if (fields.Length != keys.Length)
269 return false;
270
271 List<string> terms = new List<string>();
272
263 SqliteCommand cmd = new SqliteCommand(); 273 SqliteCommand cmd = new SqliteCommand();
264 274
265 cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field); 275 for (int i = 0 ; i < fields.Length ; i++)
266 cmd.Parameters.Add(new SqliteParameter(field, val)); 276 {
277 cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i]));
278 terms.Add("`" + fields[i] + "` = :" + fields[i]);
279 }
280
281 string where = String.Join(" and ", terms.ToArray());
267 282
268 if (ExecuteNonQuery(cmd, m_Connection) > 0) 283 string query = String.Format("delete * from {0} where {1}", m_Realm, where);
269 return true;
270 284
271 return false; 285 cmd.CommandText = query;
286
287 return ExecuteNonQuery(cmd, m_Connection) > 0;
272 } 288 }
273 } 289 }
274} 290}
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index ccbd86e..02edc30 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -91,11 +91,21 @@ namespace OpenSim.Data.SQLite
91 return m_Folders.Delete(field, val); 91 return m_Folders.Delete(field, val);
92 } 92 }
93 93
94 public bool DeleteFolders(string[] fields, string[] vals)
95 {
96 return m_Folders.Delete(fields, vals);
97 }
98
94 public bool DeleteItems(string field, string val) 99 public bool DeleteItems(string field, string val)
95 { 100 {
96 return m_Items.Delete(field, val); 101 return m_Items.Delete(field, val);
97 } 102 }
98 103
104 public bool DeleteItems(string[] fields, string[] vals)
105 {
106 return m_Items.Delete(fields, vals);
107 }
108
99 public bool MoveItem(string id, string newParent) 109 public bool MoveItem(string id, string newParent)
100 { 110 {
101 return m_Items.MoveItem(id, newParent); 111 return m_Items.MoveItem(id, newParent);
diff --git a/OpenSim/Framework/Tests/AnimationTests.cs b/OpenSim/Framework/Tests/AnimationTests.cs
index 9aa95af..aa4c6aa 100644
--- a/OpenSim/Framework/Tests/AnimationTests.cs
+++ b/OpenSim/Framework/Tests/AnimationTests.cs
@@ -33,7 +33,6 @@ using OpenMetaverse.StructuredData;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Tests.Common; 34using OpenSim.Tests.Common;
35using OpenSim.Tests.Common.Mock; 35using OpenSim.Tests.Common.Mock;
36using OpenSim.Tests.Common.Setup;
37using Animation = OpenSim.Framework.Animation; 36using Animation = OpenSim.Framework.Animation;
38 37
39namespace OpenSim.Framework.Tests 38namespace OpenSim.Framework.Tests
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index f8691dc..f176485 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -974,7 +974,7 @@ namespace OpenSim.Framework
974 } 974 }
975 catch (Exception e) 975 catch (Exception e)
976 { 976 {
977 m_log.WarnFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e); 977 m_log.DebugFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e);
978 return deserial; 978 return deserial;
979 } 979 }
980 finally 980 finally
@@ -999,18 +999,18 @@ namespace OpenSim.Framework
999 respStream.Close(); 999 respStream.Close();
1000 } 1000 }
1001 else 1001 else
1002 m_log.WarnFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); 1002 m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);
1003 1003
1004 } 1004 }
1005 } 1005 }
1006 catch (System.InvalidOperationException) 1006 catch (System.InvalidOperationException)
1007 { 1007 {
1008 // This is what happens when there is invalid XML 1008 // This is what happens when there is invalid XML
1009 m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); 1009 m_log.DebugFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString());
1010 } 1010 }
1011 catch (Exception e) 1011 catch (Exception e)
1012 { 1012 {
1013 m_log.WarnFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e); 1013 m_log.DebugFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e);
1014 } 1014 }
1015 1015
1016 return deserial; 1016 return deserial;
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index 5ba08ee..aadeedb 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -44,7 +44,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
44using OpenSim.Services.Interfaces; 44using OpenSim.Services.Interfaces;
45using OpenSim.Tests.Common; 45using OpenSim.Tests.Common;
46using OpenSim.Tests.Common.Mock; 46using OpenSim.Tests.Common.Mock;
47using OpenSim.Tests.Common.Setup;
48 47
49namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests 48namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
50{ 49{
@@ -104,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
104 Scene scene = SceneSetupHelpers.SetupScene(); 103 Scene scene = SceneSetupHelpers.SetupScene();
105 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 104 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
106 105
107 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 106 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
108 107
109 MemoryStream archiveWriteStream = new MemoryStream(); 108 MemoryStream archiveWriteStream = new MemoryStream();
110 109
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 52232a0..d97311a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -44,7 +44,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
44using OpenSim.Services.Interfaces; 44using OpenSim.Services.Interfaces;
45using OpenSim.Tests.Common; 45using OpenSim.Tests.Common;
46using OpenSim.Tests.Common.Mock; 46using OpenSim.Tests.Common.Mock;
47using OpenSim.Tests.Common.Setup;
48 47
49namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests 48namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
50{ 49{
@@ -72,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
72 TestHelper.InMethod(); 71 TestHelper.InMethod();
73// log4net.Config.XmlConfigurator.Configure(); 72// log4net.Config.XmlConfigurator.Configure();
74 73
75 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL1, "password"); 74 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password");
76 m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream); 75 m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream);
77 76
78 InventoryItemBase coaItem 77 InventoryItemBase coaItem
@@ -138,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
138 string userLastName = "Stirrup"; 137 string userLastName = "Stirrup";
139 string userPassword = "troll"; 138 string userPassword = "troll";
140 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); 139 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
141 UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); 140 UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword);
142 141
143 // Create asset 142 // Create asset
144 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); 143 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
@@ -229,7 +228,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
229 TestHelper.InMethod(); 228 TestHelper.InMethod();
230// log4net.Config.XmlConfigurator.Configure(); 229// log4net.Config.XmlConfigurator.Configure();
231 230
232 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); 231 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
233 232
234 m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream); 233 m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream);
235 InventoryItemBase foundItem1 234 InventoryItemBase foundItem1
@@ -261,8 +260,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
261 TestHelper.InMethod(); 260 TestHelper.InMethod();
262// log4net.Config.XmlConfigurator.Configure(); 261// log4net.Config.XmlConfigurator.Configure();
263 262
264 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); 263 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
265 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); 264 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire");
266 265
267 m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); 266 m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
268 InventoryItemBase foundItem1 267 InventoryItemBase foundItem1
@@ -294,7 +293,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
294 TestHelper.InMethod(); 293 TestHelper.InMethod();
295// log4net.Config.XmlConfigurator.Configure(); 294// log4net.Config.XmlConfigurator.Configure();
296 295
297 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaMT, "password"); 296 UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password");
298 m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream); 297 m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream);
299 298
300 InventoryItemBase foundItem1 299 InventoryItemBase foundItem1
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index c7dae52..127d5f8 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -44,7 +44,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
44using OpenSim.Services.Interfaces; 44using OpenSim.Services.Interfaces;
45using OpenSim.Tests.Common; 45using OpenSim.Tests.Common;
46using OpenSim.Tests.Common.Mock; 46using OpenSim.Tests.Common.Mock;
47using OpenSim.Tests.Common.Setup;
48 47
49namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests 48namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
50{ 49{
@@ -71,7 +70,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
71 string userLastName = "Stirrup"; 70 string userLastName = "Stirrup";
72 string userPassword = "troll"; 71 string userPassword = "troll";
73 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); 72 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
74 UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword); 73 UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword);
75 74
76 // Create asset 75 // Create asset
77 SceneObjectGroup object1; 76 SceneObjectGroup object1;
@@ -184,8 +183,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
184 183
185 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 184 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
186 185
187 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "meowfood"); 186 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood");
188 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 187 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
189 188
190 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); 189 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
191 InventoryItemBase foundItem1 190 InventoryItemBase foundItem1
@@ -194,7 +193,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
194 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); 193 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
195 194
196 // Now try loading to a root child folder 195 // Now try loading to a root child folder
197 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA"); 196 UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA");
198 MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray()); 197 MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray());
199 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xA", "meowfood", archiveReadStream); 198 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xA", "meowfood", archiveReadStream);
200 199
@@ -203,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
203 Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); 202 Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2");
204 203
205 // Now try loading to a more deeply nested folder 204 // Now try loading to a more deeply nested folder
206 UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC"); 205 UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC");
207 archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); 206 archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
208 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xB/xC", "meowfood", archiveReadStream); 207 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xB/xC", "meowfood", archiveReadStream);
209 208
@@ -226,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
226 Scene scene = SceneSetupHelpers.SetupScene(); 225 Scene scene = SceneSetupHelpers.SetupScene();
227 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 226 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
228 227
229 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password"); 228 UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
230 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); 229 archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream);
231 230
232 InventoryItemBase foundItem1 231 InventoryItemBase foundItem1
@@ -255,7 +254,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
255 string userFirstName = "Jock"; 254 string userFirstName = "Jock";
256 string userLastName = "Stirrup"; 255 string userLastName = "Stirrup";
257 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); 256 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
258 UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); 257 UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood");
259 258
260 // Create asset 259 // Create asset
261 SceneObjectGroup object1; 260 SceneObjectGroup object1;
@@ -328,7 +327,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
328// log4net.Config.XmlConfigurator.Configure(); 327// log4net.Config.XmlConfigurator.Configure();
329 328
330 Scene scene = SceneSetupHelpers.SetupScene(); 329 Scene scene = SceneSetupHelpers.SetupScene();
331 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); 330 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
332 331
333 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); 332 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
334 HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>(); 333 HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>();
@@ -395,13 +394,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
395 //log4net.Config.XmlConfigurator.Configure(); 394 //log4net.Config.XmlConfigurator.Configure();
396 395
397 Scene scene = SceneSetupHelpers.SetupScene(); 396 Scene scene = SceneSetupHelpers.SetupScene();
398 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); 397 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
399 398
400 string folder1ExistingName = "a"; 399 string folder1ExistingName = "a";
401 string folder2Name = "b"; 400 string folder2Name = "b";
402 401
403 InventoryFolderBase folder1 402 InventoryFolderBase folder1
404 = UserInventoryTestUtils.CreateInventoryFolder( 403 = UserInventoryHelpers.CreateInventoryFolder(
405 scene.InventoryService, ua1.PrincipalID, folder1ExistingName); 404 scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
406 405
407 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); 406 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random());
@@ -446,13 +445,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
446// log4net.Config.XmlConfigurator.Configure(); 445// log4net.Config.XmlConfigurator.Configure();
447 446
448 Scene scene = SceneSetupHelpers.SetupScene(); 447 Scene scene = SceneSetupHelpers.SetupScene();
449 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); 448 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
450 449
451 string folder1ExistingName = "a"; 450 string folder1ExistingName = "a";
452 string folder2Name = "b"; 451 string folder2Name = "b";
453 452
454 InventoryFolderBase folder1 453 InventoryFolderBase folder1
455 = UserInventoryTestUtils.CreateInventoryFolder( 454 = UserInventoryHelpers.CreateInventoryFolder(
456 scene.InventoryService, ua1.PrincipalID, folder1ExistingName); 455 scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
457 456
458 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); 457 string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random());
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index 8d53cf1..733ad25 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -45,7 +45,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
45using OpenSim.Services.Interfaces; 45using OpenSim.Services.Interfaces;
46using OpenSim.Tests.Common; 46using OpenSim.Tests.Common;
47using OpenSim.Tests.Common.Mock; 47using OpenSim.Tests.Common.Mock;
48using OpenSim.Tests.Common.Setup;
49 48
50namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests 49namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
51{ 50{
@@ -73,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
73 string userFirstName = "Jock"; 72 string userFirstName = "Jock";
74 string userLastName = "Stirrup"; 73 string userLastName = "Stirrup";
75 string userPassword = "troll"; 74 string userPassword = "troll";
76 UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); 75 UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword);
77 76
78 AgentCircuitData acd = new AgentCircuitData(); 77 AgentCircuitData acd = new AgentCircuitData();
79 acd.AgentID = m_userId; 78 acd.AgentID = m_userId;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
index 7128d2b..150a4d5 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
@@ -40,7 +40,6 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
40using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion; 41using GridRegion = OpenSim.Services.Interfaces.GridRegion;
42using OpenSim.Tests.Common; 42using OpenSim.Tests.Common;
43using OpenSim.Tests.Common.Setup;
44 43
45namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests 44namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
46{ 45{
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
index e471f75..4556df3 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
@@ -40,7 +40,6 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
40using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
41using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; 41using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
42using OpenSim.Tests.Common; 42using OpenSim.Tests.Common;
43using OpenSim.Tests.Common.Setup;
44 43
45namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests 44namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
46{ 45{
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 729e9f7..2eb2861 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -43,7 +43,6 @@ using OpenSim.Region.Framework.Scenes;
43using OpenSim.Region.Framework.Scenes.Serialization; 43using OpenSim.Region.Framework.Scenes.Serialization;
44using OpenSim.Tests.Common; 44using OpenSim.Tests.Common;
45using OpenSim.Tests.Common.Mock; 45using OpenSim.Tests.Common.Mock;
46using OpenSim.Tests.Common.Setup;
47using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants; 46using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants;
48using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader; 47using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader;
49using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter; 48using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter;
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index 67b00ac..a3aa38d 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -37,7 +37,6 @@ using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Tests.Common; 38using OpenSim.Tests.Common;
39using OpenSim.Tests.Common.Mock; 39using OpenSim.Tests.Common.Mock;
40using OpenSim.Tests.Common.Setup;
41 40
42namespace OpenSim.Region.CoreModules.World.Land.Tests 41namespace OpenSim.Region.CoreModules.World.Land.Tests
43{ 42{
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
index 5b85830..d5b7082 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
@@ -40,7 +40,6 @@ using OpenSim.Region.Framework.Scenes;
40using OpenSim.Region.Framework.Scenes.Serialization; 40using OpenSim.Region.Framework.Scenes.Serialization;
41using OpenSim.Tests.Common; 41using OpenSim.Tests.Common;
42using OpenSim.Tests.Common.Mock; 42using OpenSim.Tests.Common.Mock;
43using OpenSim.Tests.Common.Setup;
44 43
45namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests 44namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests
46{ 45{
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index a866fd9..4f752ab 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -35,7 +35,6 @@ using OpenSim.Framework;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Scenes.Serialization; 36using OpenSim.Region.Framework.Scenes.Serialization;
37using OpenSim.Tests.Common; 37using OpenSim.Tests.Common;
38using OpenSim.Tests.Common.Setup;
39 38
40namespace OpenSim.Region.CoreModules.World.Serialiser.Tests 39namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
41{ 40{
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index 4a3c634..641e226 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -52,5 +52,7 @@ namespace OpenSim.Region.Framework.Interfaces
52 ArrayList GetScriptErrors(UUID itemID); 52 ArrayList GetScriptErrors(UUID itemID);
53 53
54 bool HasScript(UUID itemID, out bool running); 54 bool HasScript(UUID itemID, out bool running);
55
56 void SaveAllState();
55 } 57 }
56} 58}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 4ce7a6c..d326141 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -115,6 +115,10 @@ namespace OpenSim.Region.Framework.Scenes
115 115
116 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; 116 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
117 117
118 public delegate void SceneShuttingDownDelegate(Scene scene);
119
120 public event SceneShuttingDownDelegate OnSceneShuttingDown;
121
118 /// <summary> 122 /// <summary>
119 /// Fired when an object is touched/grabbed. 123 /// Fired when an object is touched/grabbed.
120 /// </summary> 124 /// </summary>
@@ -2217,5 +2221,26 @@ namespace OpenSim.Region.Framework.Scenes
2217 } 2221 }
2218 } 2222 }
2219 } 2223 }
2224
2225 public void TriggerSceneShuttingDown(Scene s)
2226 {
2227 SceneShuttingDownDelegate handler = OnSceneShuttingDown;
2228 if (handler != null)
2229 {
2230 foreach (SceneShuttingDownDelegate d in handler.GetInvocationList())
2231 {
2232 try
2233 {
2234 d(s);
2235 }
2236 catch (Exception e)
2237 {
2238 m_log.ErrorFormat(
2239 "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}",
2240 e.Message, e.StackTrace);
2241 }
2242 }
2243 }
2244 }
2220 } 2245 }
2221} 2246}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 17242dc..0b92818 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1423,7 +1423,10 @@ namespace OpenSim.Region.Framework.Scenes
1423 if (item.AssetType == (int)AssetType.Link) 1423 if (item.AssetType == (int)AssetType.Link)
1424 { 1424 {
1425 InventoryItemBase linkedItem = InventoryService.GetItem(new InventoryItemBase(item.AssetID)); 1425 InventoryItemBase linkedItem = InventoryService.GetItem(new InventoryItemBase(item.AssetID));
1426 linkedItemFolderIdsToSend.Add(linkedItem.Folder); 1426
1427 // Take care of genuinely broken links where the target doesn't exist
1428 if (linkedItem != null)
1429 linkedItemFolderIdsToSend.Add(linkedItem.Folder);
1427 } 1430 }
1428 } 1431 }
1429 1432
@@ -2142,19 +2145,7 @@ namespace OpenSim.Region.Framework.Scenes
2142 sourcePart.Inventory.RemoveInventoryItem(item.ItemID); 2145 sourcePart.Inventory.RemoveInventoryItem(item.ItemID);
2143 } 2146 }
2144 2147
2145 AddNewSceneObject(group, true); 2148 AddNewSceneObject(group, true, pos, rot, vel);
2146
2147 group.AbsolutePosition = pos;
2148 group.Velocity = vel;
2149
2150 if (rot != null)
2151 group.UpdateGroupRotationR((Quaternion)rot);
2152
2153 // TODO: This needs to be refactored with the similar code in
2154 // SceneGraph.AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel)
2155 // possibly by allowing this method to take a null rotation.
2156 if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
2157 group.RootPart.ApplyImpulse((vel * group.GetMass()), false);
2158 2149
2159 // We can only call this after adding the scene object, since the scene object references the scene 2150 // We can only call this after adding the scene object, since the scene object references the scene
2160 // to find out if scripts should be activated at all. 2151 // to find out if scripts should be activated at all.
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index bac66cb..254ad05 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -209,6 +209,7 @@ namespace OpenSim.Region.Framework.Scenes
209 209
210 private Timer m_mapGenerationTimer = new Timer(); 210 private Timer m_mapGenerationTimer = new Timer();
211 private bool m_generateMaptiles; 211 private bool m_generateMaptiles;
212 private bool m_useBackup = true;
212 213
213// private Dictionary<UUID, string[]> m_UserNamesCache = new Dictionary<UUID, string[]>(); 214// private Dictionary<UUID, string[]> m_UserNamesCache = new Dictionary<UUID, string[]>();
214 215
@@ -477,6 +478,11 @@ namespace OpenSim.Region.Framework.Scenes
477 get { return m_sceneGraph; } 478 get { return m_sceneGraph; }
478 } 479 }
479 480
481 public bool UseBackup
482 {
483 get { return m_useBackup; }
484 }
485
480 // an instance to the physics plugin's Scene object. 486 // an instance to the physics plugin's Scene object.
481 public PhysicsScene PhysicsScene 487 public PhysicsScene PhysicsScene
482 { 488 {
@@ -620,7 +626,7 @@ namespace OpenSim.Region.Framework.Scenes
620 "delete object uuid <UUID>", 626 "delete object uuid <UUID>",
621 "Delete object by uuid", HandleDeleteObject); 627 "Delete object by uuid", HandleDeleteObject);
622 MainConsole.Instance.Commands.AddCommand("region", false, "delete object name", 628 MainConsole.Instance.Commands.AddCommand("region", false, "delete object name",
623 "delete object name <UUID>", 629 "delete object name <name>",
624 "Delete object by name", HandleDeleteObject); 630 "Delete object by name", HandleDeleteObject);
625 631
626 //Bind Storage Manager functions to some land manager functions for this scene 632 //Bind Storage Manager functions to some land manager functions for this scene
@@ -670,6 +676,9 @@ namespace OpenSim.Region.Framework.Scenes
670 IConfig startupConfig = m_config.Configs["Startup"]; 676 IConfig startupConfig = m_config.Configs["Startup"];
671 677
672 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); 678 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
679 m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup);
680 if (!m_useBackup)
681 m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
673 682
674 //Animation states 683 //Animation states
675 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 684 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
@@ -1091,6 +1100,8 @@ namespace OpenSim.Region.Framework.Scenes
1091 shuttingdown = true; 1100 shuttingdown = true;
1092 1101
1093 m_log.Debug("[SCENE]: Persisting changed objects"); 1102 m_log.Debug("[SCENE]: Persisting changed objects");
1103 EventManager.TriggerSceneShuttingDown(this);
1104
1094 EntityBase[] entities = GetEntities(); 1105 EntityBase[] entities = GetEntities();
1095 foreach (EntityBase entity in entities) 1106 foreach (EntityBase entity in entities)
1096 { 1107 {
@@ -2014,16 +2025,17 @@ namespace OpenSim.Region.Framework.Scenes
2014 /// <summary> 2025 /// <summary>
2015 /// Add a newly created object to the scene. 2026 /// Add a newly created object to the scene.
2016 /// </summary> 2027 /// </summary>
2017 /// 2028 /// <remarks>
2018 /// This method does not send updates to the client - callers need to handle this themselves. 2029 /// This method does not send updates to the client - callers need to handle this themselves.
2030 /// </remarks>
2019 /// <param name="sceneObject"></param> 2031 /// <param name="sceneObject"></param>
2020 /// <param name="attachToBackup"></param> 2032 /// <param name="attachToBackup"></param>
2021 /// <param name="pos">Position of the object</param> 2033 /// <param name="pos">Position of the object. If null then the position stored in the object is used.</param>
2022 /// <param name="rot">Rotation of the object</param> 2034 /// <param name="rot">Rotation of the object. If null then the rotation stored in the object is used.</param>
2023 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param> 2035 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param>
2024 /// <returns></returns> 2036 /// <returns></returns>
2025 public bool AddNewSceneObject( 2037 public bool AddNewSceneObject(
2026 SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel) 2038 SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
2027 { 2039 {
2028 if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel)) 2040 if (m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel))
2029 { 2041 {
@@ -4436,7 +4448,28 @@ namespace OpenSim.Region.Framework.Scenes
4436 // } 4448 // }
4437 4449
4438 /// <summary> 4450 /// <summary>
4439 /// Get a named prim contained in this scene (will return the first 4451 /// Get a group via its UUID
4452 /// </summary>
4453 /// <param name="fullID"></param>
4454 /// <returns>null if no group with that name exists</returns>
4455 public SceneObjectGroup GetSceneObjectGroup(UUID fullID)
4456 {
4457 return m_sceneGraph.GetSceneObjectGroup(fullID);
4458 }
4459
4460 /// <summary>
4461 /// Get a group by name from the scene (will return the first
4462 /// found, if there are more than one prim with the same name)
4463 /// </summary>
4464 /// <param name="name"></param>
4465 /// <returns>null if no group with that name exists</returns>
4466 public SceneObjectGroup GetSceneObjectGroup(string name)
4467 {
4468 return m_sceneGraph.GetSceneObjectGroup(name);
4469 }
4470
4471 /// <summary>
4472 /// Get a prim by name from the scene (will return the first
4440 /// found, if there are more than one prim with the same name) 4473 /// found, if there are more than one prim with the same name)
4441 /// </summary> 4474 /// </summary>
4442 /// <param name="name"></param> 4475 /// <param name="name"></param>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 3d6057b..c0236f4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -352,25 +352,26 @@ namespace OpenSim.Region.Framework.Scenes
352 /// This method does not send updates to the client - callers need to handle this themselves. 352 /// This method does not send updates to the client - callers need to handle this themselves.
353 /// <param name="sceneObject"></param> 353 /// <param name="sceneObject"></param>
354 /// <param name="attachToBackup"></param> 354 /// <param name="attachToBackup"></param>
355 /// <param name="pos">Position of the object</param> 355 /// <param name="pos">Position of the object. If null then the position stored in the object is used.</param>
356 /// <param name="rot">Rotation of the object</param> 356 /// <param name="rot">Rotation of the object. If null then the rotation stored in the object is used.</param>
357 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param> 357 /// <param name="vel">Velocity of the object. This parameter only has an effect if the object is physical</param>
358 /// <returns></returns> 358 /// <returns></returns>
359 public bool AddNewSceneObject( 359 public bool AddNewSceneObject(
360 SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel) 360 SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
361 { 361 {
362 AddNewSceneObject(sceneObject, true, false); 362 AddNewSceneObject(sceneObject, true, false);
363 363
364 // we set it's position in world. 364 if (pos != null)
365 sceneObject.AbsolutePosition = pos; 365 sceneObject.AbsolutePosition = (Vector3)pos;
366 366
367 if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) 367 if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim)
368 { 368 {
369 sceneObject.ClearPartAttachmentData(); 369 sceneObject.ClearPartAttachmentData();
370 } 370 }
371 371
372 sceneObject.UpdateGroupRotationR(rot); 372 if (rot != null)
373 373 sceneObject.UpdateGroupRotationR((Quaternion)rot);
374
374 //group.ApplyPhysics(m_physicalPrim); 375 //group.ApplyPhysics(m_physicalPrim);
375 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) 376 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
376 { 377 {
@@ -385,6 +386,9 @@ namespace OpenSim.Region.Framework.Scenes
385 /// Add an object to the scene. This will both update the scene, and send information about the 386 /// Add an object to the scene. This will both update the scene, and send information about the
386 /// new object to all clients interested in the scene. 387 /// new object to all clients interested in the scene.
387 /// </summary> 388 /// </summary>
389 /// <remarks>
390 /// The object's stored position, rotation and velocity are used.
391 /// </remarks>
388 /// <param name="sceneObject"></param> 392 /// <param name="sceneObject"></param>
389 /// <param name="attachToBackup"> 393 /// <param name="attachToBackup">
390 /// If true, the object is made persistent into the scene. 394 /// If true, the object is made persistent into the scene.
@@ -1048,6 +1052,51 @@ namespace OpenSim.Region.Framework.Scenes
1048 } 1052 }
1049 1053
1050 /// <summary> 1054 /// <summary>
1055 /// Get a group in the scene
1056 /// </summary>
1057 /// <param name="fullID">UUID of the group</param>
1058 /// <returns>null if no such group was found</returns>
1059 protected internal SceneObjectGroup GetSceneObjectGroup(UUID fullID)
1060 {
1061 lock (SceneObjectGroupsByFullID)
1062 {
1063 if (SceneObjectGroupsByFullID.ContainsKey(fullID))
1064 return SceneObjectGroupsByFullID[fullID];
1065 }
1066
1067 return null;
1068 }
1069
1070 /// <summary>
1071 /// Get a group by name from the scene (will return the first
1072 /// found, if there are more than one prim with the same name)
1073 /// </summary>
1074 /// <param name="name"></param>
1075 /// <returns>null if the part was not found</returns>
1076 protected internal SceneObjectGroup GetSceneObjectGroup(string name)
1077 {
1078 SceneObjectGroup so = null;
1079
1080 Entities.Find(
1081 delegate(EntityBase entity)
1082 {
1083 if (entity is SceneObjectGroup)
1084 {
1085 if (entity.Name == name)
1086 {
1087 so = (SceneObjectGroup)entity;
1088 return true;
1089 }
1090 }
1091
1092 return false;
1093 }
1094 );
1095
1096 return so;
1097 }
1098
1099 /// <summary>
1051 /// Get a part contained in this scene. 1100 /// Get a part contained in this scene.
1052 /// </summary> 1101 /// </summary>
1053 /// <param name="localID"></param> 1102 /// <param name="localID"></param>
@@ -1061,7 +1110,7 @@ namespace OpenSim.Region.Framework.Scenes
1061 } 1110 }
1062 1111
1063 /// <summary> 1112 /// <summary>
1064 /// Get a named prim contained in this scene (will return the first 1113 /// Get a prim by name from the scene (will return the first
1065 /// found, if there are more than one prim with the same name) 1114 /// found, if there are more than one prim with the same name)
1066 /// </summary> 1115 /// </summary>
1067 /// <param name="name"></param> 1116 /// <param name="name"></param>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b100b39..62277ff 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1613,7 +1613,7 @@ namespace OpenSim.Region.Framework.Scenes
1613 1613
1614 } 1614 }
1615 1615
1616 if (HasGroupChanged) 1616 if (m_scene.UseBackup && HasGroupChanged)
1617 { 1617 {
1618 // don't backup while it's selected or you're asking for changes mid stream. 1618 // don't backup while it's selected or you're asking for changes mid stream.
1619 if (isTimeToPersist() || forcedBackup) 1619 if (isTimeToPersist() || forcedBackup)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index e7e3014..4e1d6b6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -145,7 +145,6 @@ namespace OpenSim.Region.Framework.Scenes
145 145
146 public Vector3 StatusSandboxPos; 146 public Vector3 StatusSandboxPos;
147 147
148 // TODO: This needs to be persisted in next XML version update!
149 [XmlIgnore] 148 [XmlIgnore]
150 public int[] PayPrice = {-2,-2,-2,-2,-2}; 149 public int[] PayPrice = {-2,-2,-2,-2,-2};
151 150
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 769d8a5..c42302f 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -341,6 +341,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
341 m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); 341 m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl);
342 m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); 342 m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation);
343 m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); 343 m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem);
344 m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0);
345 m_SOPXmlProcessors.Add("PayPrice1", ProcessPayPrice1);
346 m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2);
347 m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3);
348 m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4);
344 #endregion 349 #endregion
345 350
346 #region TaskInventoryXmlProcessors initialization 351 #region TaskInventoryXmlProcessors initialization
@@ -698,6 +703,32 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
698 { 703 {
699 obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty)); 704 obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty));
700 } 705 }
706
707 private static void ProcessPayPrice0(SceneObjectPart obj, XmlTextReader reader)
708 {
709 obj.PayPrice[0] = (int)reader.ReadElementContentAsInt("PayPrice0", String.Empty);
710 }
711
712 private static void ProcessPayPrice1(SceneObjectPart obj, XmlTextReader reader)
713 {
714 obj.PayPrice[1] = (int)reader.ReadElementContentAsInt("PayPrice1", String.Empty);
715 }
716
717 private static void ProcessPayPrice2(SceneObjectPart obj, XmlTextReader reader)
718 {
719 obj.PayPrice[2] = (int)reader.ReadElementContentAsInt("PayPrice2", String.Empty);
720 }
721
722 private static void ProcessPayPrice3(SceneObjectPart obj, XmlTextReader reader)
723 {
724 obj.PayPrice[3] = (int)reader.ReadElementContentAsInt("PayPrice3", String.Empty);
725 }
726
727 private static void ProcessPayPrice4(SceneObjectPart obj, XmlTextReader reader)
728 {
729 obj.PayPrice[4] = (int)reader.ReadElementContentAsInt("PayPrice4", String.Empty);
730 }
731
701 #endregion 732 #endregion
702 733
703 #region TaskInventoryXmlProcessors 734 #region TaskInventoryXmlProcessors
@@ -1069,7 +1100,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1069 shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); 1100 shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
1070 } 1101 }
1071 1102
1072
1073 #endregion 1103 #endregion
1074 1104
1075 ////////// Write ///////// 1105 ////////// Write /////////
@@ -1175,6 +1205,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1175 writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); 1205 writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString());
1176 WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); 1206 WriteBytes(writer, "TextureAnimation", sop.TextureAnimation);
1177 WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); 1207 WriteBytes(writer, "ParticleSystem", sop.ParticleSystem);
1208 writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString());
1209 writer.WriteElementString("PayPrice1", sop.PayPrice[1].ToString());
1210 writer.WriteElementString("PayPrice2", sop.PayPrice[2].ToString());
1211 writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString());
1212 writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString());
1178 1213
1179 writer.WriteEndElement(); 1214 writer.WriteEndElement();
1180 } 1215 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
index 855b589..cff649b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/AttachmentTests.cs
@@ -43,7 +43,6 @@ using OpenSim.Region.CoreModules.World.Serialiser;
43using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; 43using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
44using OpenSim.Tests.Common; 44using OpenSim.Tests.Common;
45using OpenSim.Tests.Common.Mock; 45using OpenSim.Tests.Common.Mock;
46using OpenSim.Tests.Common.Setup;
47 46
48namespace OpenSim.Region.Framework.Scenes.Tests 47namespace OpenSim.Region.Framework.Scenes.Tests
49{ 48{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
index 667b74e..f69a4b4 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
@@ -37,7 +37,6 @@ using OpenSim.Framework;
37using OpenSim.Framework.Communications; 37using OpenSim.Framework.Communications;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Tests.Common; 39using OpenSim.Tests.Common;
40using OpenSim.Tests.Common.Setup;
41 40
42namespace OpenSim.Region.Framework.Scenes.Tests 41namespace OpenSim.Region.Framework.Scenes.Tests
43{ 42{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
index ca635d7..895f2bb 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
@@ -34,7 +34,6 @@ using OpenSim.Framework.Communications;
34using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
35using OpenSim.Tests.Common; 35using OpenSim.Tests.Common;
36using OpenSim.Tests.Common.Mock; 36using OpenSim.Tests.Common.Mock;
37using OpenSim.Tests.Common.Setup;
38 37
39namespace OpenSim.Region.Framework.Scenes.Tests 38namespace OpenSim.Region.Framework.Scenes.Tests
40{ 39{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index a6a95ef..0a82c4f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -34,7 +34,6 @@ using OpenSim.Framework.Communications;
34using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
35using OpenSim.Tests.Common; 35using OpenSim.Tests.Common;
36using OpenSim.Tests.Common.Mock; 36using OpenSim.Tests.Common.Mock;
37using OpenSim.Tests.Common.Setup;
38 37
39namespace OpenSim.Region.Framework.Scenes.Tests 38namespace OpenSim.Region.Framework.Scenes.Tests
40{ 39{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index 0d26026..5357a06 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -37,7 +37,6 @@ using OpenSim.Region.CoreModules.World.Permissions;
37using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Tests.Common; 38using OpenSim.Tests.Common;
39using OpenSim.Tests.Common.Mock; 39using OpenSim.Tests.Common.Mock;
40using OpenSim.Tests.Common.Setup;
41 40
42namespace OpenSim.Region.Framework.Scenes.Tests 41namespace OpenSim.Region.Framework.Scenes.Tests
43{ 42{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index bdfcd1d..cb1d531 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -35,7 +35,6 @@ using OpenSim.Framework.Communications;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Tests.Common; 36using OpenSim.Tests.Common;
37using OpenSim.Tests.Common.Mock; 37using OpenSim.Tests.Common.Mock;
38using OpenSim.Tests.Common.Setup;
39using log4net; 38using log4net;
40 39
41namespace OpenSim.Region.Framework.Scenes.Tests 40namespace OpenSim.Region.Framework.Scenes.Tests
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
index 8876a43..77bd4c2 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -40,7 +40,6 @@ using OpenSim.Region.Framework.Scenes;
40using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; 40using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
41using OpenSim.Tests.Common; 41using OpenSim.Tests.Common;
42using OpenSim.Tests.Common.Mock; 42using OpenSim.Tests.Common.Mock;
43using OpenSim.Tests.Common.Setup;
44 43
45namespace OpenSim.Region.Framework.Scenes.Tests 44namespace OpenSim.Region.Framework.Scenes.Tests
46{ 45{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index efb757f..03ac252 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -44,7 +44,6 @@ using OpenSim.Region.CoreModules.World.Serialiser;
44using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; 44using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
45using OpenSim.Tests.Common; 45using OpenSim.Tests.Common;
46using OpenSim.Tests.Common.Mock; 46using OpenSim.Tests.Common.Mock;
47using OpenSim.Tests.Common.Setup;
48 47
49namespace OpenSim.Region.Framework.Scenes.Tests 48namespace OpenSim.Region.Framework.Scenes.Tests
50{ 49{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index abcce66..13d93f9 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -43,7 +43,6 @@ using OpenSim.Region.CoreModules.World.Serialiser;
43using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; 43using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
44using OpenSim.Tests.Common; 44using OpenSim.Tests.Common;
45using OpenSim.Tests.Common.Mock; 45using OpenSim.Tests.Common.Mock;
46using OpenSim.Tests.Common.Setup;
47 46
48namespace OpenSim.Region.Framework.Scenes.Tests 47namespace OpenSim.Region.Framework.Scenes.Tests
49{ 48{
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
index dd28416..1b5a54e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
@@ -36,7 +36,6 @@ using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; 36using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
37using OpenSim.Tests.Common; 37using OpenSim.Tests.Common;
38using OpenSim.Tests.Common.Mock; 38using OpenSim.Tests.Common.Mock;
39using OpenSim.Tests.Common.Setup;
40using System.Threading; 39using System.Threading;
41 40
42namespace OpenSim.Region.Framework.Scenes.Tests 41namespace OpenSim.Region.Framework.Scenes.Tests
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 2aef4b0..f4e14d4 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -46,55 +46,55 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
46using OpenSim.Services.Interfaces; 46using OpenSim.Services.Interfaces;
47using OpenSim.Tests.Common; 47using OpenSim.Tests.Common;
48using OpenSim.Tests.Common.Mock; 48using OpenSim.Tests.Common.Mock;
49using OpenSim.Tests.Common.Setup;
50 49
51namespace OpenSim.Region.Framework.Tests 50namespace OpenSim.Region.Framework.Tests
52{ 51{
53 [TestFixture] 52 [TestFixture]
54 public class TaskInventoryTests 53 public class TaskInventoryTests
55 { 54 {
56 protected UserAccount CreateUser(Scene scene) 55 [Test]
57 { 56 public void TestRezObjectFromInventoryItem()
58 string userFirstName = "Jock";
59 string userLastName = "Stirrup";
60 string userPassword = "troll";
61 UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
62 return UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword);
63 }
64
65 protected SceneObjectGroup CreateSO1(Scene scene, UUID ownerId)
66 {
67 string part1Name = "part1";
68 UUID part1Id = UUID.Parse("10000000-0000-0000-0000-000000000000");
69 SceneObjectPart part1
70 = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
71 { Name = part1Name, UUID = part1Id };
72 return new SceneObjectGroup(part1);
73 }
74
75 protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part)
76 { 57 {
77 AssetNotecard nc = new AssetNotecard(); 58 TestHelper.InMethod();
78 nc.BodyText = "Hello World!"; 59// log4net.Config.XmlConfigurator.Configure();
79 nc.Encode();
80 UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
81 UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
82 AssetBase ncAsset
83 = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero);
84 scene.AssetService.Store(ncAsset);
85 TaskInventoryItem ncItem
86 = new TaskInventoryItem
87 { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid,
88 Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard };
89 part.Inventory.AddInventoryItem(ncItem, true);
90 60
91 return ncItem; 61 Scene scene = SceneSetupHelpers.SetupScene();
62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
63 SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
64 SceneObjectPart sop1 = sog1.RootPart;
65
66 // Create an object embedded inside the first
67 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
68 TaskInventoryItem taskSceneObjectItem
69 = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId);
70
71 scene.AddSceneObject(sog1);
72
73 Vector3 rezPos = new Vector3(10, 10, 10);
74 Quaternion rezRot = new Quaternion(0.5f, 0.5f, 0.5f, 0.5f);
75 Vector3 rezVel = new Vector3(2, 2, 2);
76
77 scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0);
78
79 SceneObjectGroup rezzedObject = scene.GetSceneObjectGroup("tso");
80
81 Assert.That(rezzedObject, Is.Not.Null);
82 Assert.That(rezzedObject.AbsolutePosition, Is.EqualTo(rezPos));
83
84 // Velocity doesn't get applied, probably because there is no physics in tests (yet)
85// Assert.That(rezzedObject.Velocity, Is.EqualTo(rezVel));
86 Assert.That(rezzedObject.Velocity, Is.EqualTo(Vector3.Zero));
87
88 // Confusingly, this isn't the rezzedObject.Rotation
89 Assert.That(rezzedObject.RootPart.RotationOffset, Is.EqualTo(rezRot));
92 } 90 }
93 91
94 /// <summary> 92 /// <summary>
95 /// Test MoveTaskInventoryItem where the item has no parent folder assigned. 93 /// Test MoveTaskInventoryItem where the item has no parent folder assigned.
96 /// </summary> 94 /// </summary>
95 /// <remarks>
97 /// This should place it in the most suitable user folder. 96 /// This should place it in the most suitable user folder.
97 /// </remarks>
98 [Test] 98 [Test]
99 public void TestMoveTaskInventoryItem() 99 public void TestMoveTaskInventoryItem()
100 { 100 {
@@ -102,10 +102,11 @@ namespace OpenSim.Region.Framework.Tests
102// log4net.Config.XmlConfigurator.Configure(); 102// log4net.Config.XmlConfigurator.Configure();
103 103
104 Scene scene = SceneSetupHelpers.SetupScene(); 104 Scene scene = SceneSetupHelpers.SetupScene();
105 UserAccount user1 = CreateUser(scene); 105 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
106 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); 106 SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
107 SceneObjectPart sop1 = sog1.RootPart; 107 SceneObjectPart sop1 = sog1.RootPart;
108 TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1); 108 TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
109
109 InventoryFolderBase folder 110 InventoryFolderBase folder
110 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; 111 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0];
111 112
@@ -128,10 +129,10 @@ namespace OpenSim.Region.Framework.Tests
128// log4net.Config.XmlConfigurator.Configure(); 129// log4net.Config.XmlConfigurator.Configure();
129 130
130 Scene scene = SceneSetupHelpers.SetupScene(); 131 Scene scene = SceneSetupHelpers.SetupScene();
131 UserAccount user1 = CreateUser(scene); 132 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
132 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); 133 SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
133 SceneObjectPart sop1 = sog1.RootPart; 134 SceneObjectPart sop1 = sog1.RootPart;
134 TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1); 135 TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
135 136
136 // Perform test 137 // Perform test
137 scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); 138 scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index dbf9e0f..4da8df1 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -33,7 +33,6 @@ using OpenSim.Framework;
33using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
34using OpenSim.Services.Interfaces; 34using OpenSim.Services.Interfaces;
35using OpenSim.Tests.Common; 35using OpenSim.Tests.Common;
36using OpenSim.Tests.Common.Setup;
37using OpenSim.Tests.Common.Mock; 36using OpenSim.Tests.Common.Mock;
38 37
39namespace OpenSim.Region.Framework.Scenes.Tests 38namespace OpenSim.Region.Framework.Scenes.Tests
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
index 6de97b7..ee52a39 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -35,7 +35,6 @@ using OpenSim.Framework.Communications;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Tests.Common; 36using OpenSim.Tests.Common;
37using OpenSim.Tests.Common.Mock; 37using OpenSim.Tests.Common.Mock;
38using OpenSim.Tests.Common.Setup;
39 38
40namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests 39namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
41{ 40{
diff --git a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
index ce9a448..ec9f157 100644
--- a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
+++ b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModule.cs
@@ -58,12 +58,9 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
58 /// </summary> 58 /// </summary>
59 /// <remarks> 59 /// <remarks>
60 /// Config Settings Documentation. 60 /// Config Settings Documentation.
61 /// At the TOP LEVEL, e.g. in OpenSim.ini, we have the following options: 61 /// Each configuration setting can be specified in two places: OpenSim.ini or Regions.ini.
62 /// EACH REGION, in OpenSim.ini, can have the following settings under the [AutoBackupModule] section. 62 /// If specified in Regions.ini, the settings should be within the region's section name.
63 /// IMPORTANT: You may optionally specify the key name as follows for a per-region key: [Region Name].[Key Name] 63 /// If specified in OpenSim.ini, the settings should be within the [AutoBackupModule] section.
64 /// Example: My region is named Foo.
65 /// If I wanted to specify the "AutoBackupInterval" key just for this region, I would name my key "Foo.AutoBackupInterval", under the [AutoBackupModule] section of OpenSim.ini.
66 /// Instead of specifying them on a per-region basis, you can also omit the region name to specify the default setting for all regions.
67 /// Region-specific settings take precedence. 64 /// Region-specific settings take precedence.
68 /// 65 ///
69 /// AutoBackupModuleEnabled: True/False. Default: False. If True, use the auto backup module. This setting does not support per-region basis. 66 /// AutoBackupModuleEnabled: True/False. Default: False. If True, use the auto backup module. This setting does not support per-region basis.
@@ -71,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
71 /// AutoBackup: True/False. Default: False. If True, activate auto backup functionality. 68 /// AutoBackup: True/False. Default: False. If True, activate auto backup functionality.
72 /// This is the only required option for enabling auto-backup; the other options have sane defaults. 69 /// This is the only required option for enabling auto-backup; the other options have sane defaults.
73 /// If False for a particular region, the auto-backup module becomes a no-op for the region, and all other AutoBackup* settings are ignored. 70 /// If False for a particular region, the auto-backup module becomes a no-op for the region, and all other AutoBackup* settings are ignored.
74 /// If False globally (the default), only regions that specifically override this with "FooRegion.AutoBackup = true" will get AutoBackup functionality. 71 /// If False globally (the default), only regions that specifically override it in Regions.ini will get AutoBackup functionality.
75 /// AutoBackupInterval: Double, non-negative value. Default: 720 (12 hours). 72 /// AutoBackupInterval: Double, non-negative value. Default: 720 (12 hours).
76 /// The number of minutes between each backup attempt. 73 /// The number of minutes between each backup attempt.
77 /// If a negative or zero value is given, it is equivalent to setting AutoBackup = False. 74 /// If a negative or zero value is given, it is equivalent to setting AutoBackup = False.
@@ -281,21 +278,21 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
281 { 278 {
282 string sRegionName; 279 string sRegionName;
283 string sRegionLabel; 280 string sRegionLabel;
284 string prepend; 281// string prepend;
285 AutoBackupModuleState state; 282 AutoBackupModuleState state;
286 283
287 if (parseDefault) 284 if (parseDefault)
288 { 285 {
289 sRegionName = null; 286 sRegionName = null;
290 sRegionLabel = "DEFAULT"; 287 sRegionLabel = "DEFAULT";
291 prepend = ""; 288// prepend = "";
292 state = this.m_defaultState; 289 state = this.m_defaultState;
293 } 290 }
294 else 291 else
295 { 292 {
296 sRegionName = scene.RegionInfo.RegionName; 293 sRegionName = scene.RegionInfo.RegionName;
297 sRegionLabel = sRegionName; 294 sRegionLabel = sRegionName;
298 prepend = sRegionName + "."; 295// prepend = sRegionName + ".";
299 state = null; 296 state = null;
300 } 297 }
301 298
diff --git a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
index 88f9658..a622745 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
@@ -1553,7 +1553,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1553 removeprims = new List<OdePrim>(); 1553 removeprims = new List<OdePrim>();
1554 } 1554 }
1555 removeprims.Add(chr); 1555 removeprims.Add(chr);
1556 m_log.Debug("[PHYSICS]: unable to collide test active prim against space. The space was zero, the geom was zero or it was in the process of being removed. Removed it from the active prim list. This needs to be fixed!"); 1556 /// Commented this because it triggers on every bullet
1557 //m_log.Debug("[PHYSICS]: unable to collide test active prim against space. The space was zero, the geom was zero or it was in the process of being removed. Removed it from the active prim list. This needs to be fixed!");
1557 } 1558 }
1558 } 1559 }
1559 } 1560 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 48a7953..f7c44d1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -46,6 +46,7 @@ using OpenSim.Region.CoreModules.World.Land;
46using OpenSim.Region.CoreModules.World.Terrain; 46using OpenSim.Region.CoreModules.World.Terrain;
47using OpenSim.Region.Framework.Interfaces; 47using OpenSim.Region.Framework.Interfaces;
48using OpenSim.Region.Framework.Scenes; 48using OpenSim.Region.Framework.Scenes;
49using OpenSim.Region.Framework.Scenes.Serialization;
49using OpenSim.Region.Framework.Scenes.Animation; 50using OpenSim.Region.Framework.Scenes.Animation;
50using OpenSim.Region.Physics.Manager; 51using OpenSim.Region.Physics.Manager;
51using OpenSim.Region.ScriptEngine.Shared; 52using OpenSim.Region.ScriptEngine.Shared;
@@ -3635,12 +3636,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3635 return m_ScriptEngine.GetStartParameter(m_itemID); 3636 return m_ScriptEngine.GetStartParameter(m_itemID);
3636 } 3637 }
3637 3638
3638 public void llGodLikeRezObject(string inventory, LSL_Vector pos)
3639 {
3640 m_host.AddScriptLPS(1);
3641 NotImplemented("llGodLikeRezObject");
3642 }
3643
3644 public void llRequestPermissions(string agent, int perm) 3639 public void llRequestPermissions(string agent, int perm)
3645 { 3640 {
3646 UUID agentID = new UUID(); 3641 UUID agentID = new UUID();
@@ -4305,7 +4300,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4305 m_host.AbsolutePosition.ToString(), 4300 m_host.AbsolutePosition.ToString(),
4306 agentItem.ID, true, m_host.AbsolutePosition, 4301 agentItem.ID, true, m_host.AbsolutePosition,
4307 bucket); 4302 bucket);
4308
4309 if (m_TransferModule != null) 4303 if (m_TransferModule != null)
4310 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 4304 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
4311 4305
@@ -4618,12 +4612,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4618 m_host.CollisionSoundVolume = (float)impact_volume; 4612 m_host.CollisionSoundVolume = (float)impact_volume;
4619 } 4613 }
4620 4614
4621 public void llCollisionSprite(string impact_sprite)
4622 {
4623 m_host.AddScriptLPS(1);
4624 NotImplemented("llCollisionSprite");
4625 }
4626
4627 public LSL_String llGetAnimation(string id) 4615 public LSL_String llGetAnimation(string id)
4628 { 4616 {
4629 // This should only return a value if the avatar is in the same region 4617 // This should only return a value if the avatar is in the same region
@@ -4887,6 +4875,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4887 return result; 4875 return result;
4888 } 4876 }
4889 4877
4878 public LSL_Integer llGetLinkNumberOfSides(int link)
4879 {
4880 m_host.AddScriptLPS(1);
4881
4882 SceneObjectPart linkedPart;
4883
4884 if (link == ScriptBaseClass.LINK_ROOT)
4885 linkedPart = m_host.ParentGroup.RootPart;
4886 else if (link == ScriptBaseClass.LINK_THIS)
4887 linkedPart = m_host;
4888 else
4889 linkedPart = m_host.ParentGroup.GetLinkNumPart(link);
4890
4891 return GetNumberOfSides(linkedPart);
4892 }
4893
4890 public LSL_Integer llGetNumberOfSides() 4894 public LSL_Integer llGetNumberOfSides()
4891 { 4895 {
4892 m_host.AddScriptLPS(1); 4896 m_host.AddScriptLPS(1);
@@ -5947,11 +5951,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5947 ScriptSleep(100); 5951 ScriptSleep(100);
5948 } 5952 }
5949 5953
5950 public void llSetSoundQueueing(int queue)
5951 {
5952 m_host.AddScriptLPS(1);
5953 }
5954
5955 public void llSetSoundRadius(double radius) 5954 public void llSetSoundRadius(double radius)
5956 { 5955 {
5957 m_host.AddScriptLPS(1); 5956 m_host.AddScriptLPS(1);
@@ -10984,6 +10983,121 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10984 { 10983 {
10985 m_SayShoutCount = 0; 10984 m_SayShoutCount = 0;
10986 } 10985 }
10986
10987 #region Not Implemented
10988 //
10989 // Listing the unimplemented lsl functions here, please move
10990 // them from this region as they are completed
10991 //
10992 public void llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options)
10993 {
10994 m_host.AddScriptLPS(1);
10995 NotImplemented("llCastRay");
10996
10997 }
10998
10999 public void llGetEnv(LSL_String name)
11000 {
11001 m_host.AddScriptLPS(1);
11002 NotImplemented("llGetEnv");
11003
11004 }
11005
11006 public void llGetSPMaxMemory()
11007 {
11008 m_host.AddScriptLPS(1);
11009 NotImplemented("llGetSPMaxMemory");
11010
11011 }
11012
11013 public virtual LSL_Integer llGetUsedMemory()
11014 {
11015 m_host.AddScriptLPS(1);
11016 NotImplemented("llGetUsedMemory");
11017 return 0;
11018 }
11019
11020 public void llRegionSayTo( LSL_Key target, LSL_Integer channel, LSL_String msg )
11021 {
11022 m_host.AddScriptLPS(1);
11023 NotImplemented("llRegionSayTo");
11024
11025 }
11026
11027 public void llScriptProfiler( LSL_Integer flags )
11028 {
11029 m_host.AddScriptLPS(1);
11030 //NotImplemented("llScriptProfiler");
11031
11032 }
11033
11034 public void llSetSoundQueueing(int queue)
11035 {
11036 m_host.AddScriptLPS(1);
11037 }
11038
11039 public void llCollisionSprite(string impact_sprite)
11040 {
11041 m_host.AddScriptLPS(1);
11042 NotImplemented("llCollisionSprite");
11043 }
11044
11045 public void llGodLikeRezObject(string inventory, LSL_Vector pos)
11046 {
11047 m_host.AddScriptLPS(1);
11048
11049 if (!World.Permissions.IsGod(m_host.OwnerID))
11050 NotImplemented("llGodLikeRezObject");
11051
11052 AssetBase rezAsset = World.AssetService.Get(inventory);
11053 if (rezAsset == null)
11054 {
11055 llSay(0, "Asset not found");
11056 return;
11057 }
11058
11059 SceneObjectGroup group = null;
11060
11061 try
11062 {
11063 string xmlData = Utils.BytesToString(rezAsset.Data);
11064 group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
11065 }
11066 catch
11067 {
11068 llSay(0, "Asset not found");
11069 return;
11070 }
11071
11072 if (group == null)
11073 {
11074 llSay(0, "Asset not found");
11075 return;
11076 }
11077
11078 group.RootPart.AttachPoint = group.RootPart.Shape.State;
11079 group.RootPart.AttachOffset = group.AbsolutePosition;
11080
11081 group.ResetIDs();
11082
11083 Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
11084 World.AddNewSceneObject(group, true, llpos, Quaternion.Identity, Vector3.Zero);
11085 group.CreateScriptInstances(0, true, World.DefaultScriptEngine, 3);
11086 group.ScheduleGroupForFullUpdate();
11087
11088 // objects rezzed with this method are die_at_edge by default.
11089 group.RootPart.SetDieAtEdge(true);
11090
11091 group.ResumeScripts();
11092
11093 m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
11094 "object_rez", new Object[] {
11095 new LSL_String(
11096 group.RootPart.UUID.ToString()) },
11097 new DetectParams[0]));
11098 }
11099
11100 #endregion
10987 } 11101 }
10988 11102
10989 public class NotecardCache 11103 public class NotecardCache
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 0ae2388..ce13d6b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -121,6 +121,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
121 LSL_Float llGetEnergy(); 121 LSL_Float llGetEnergy();
122 LSL_Vector llGetForce(); 122 LSL_Vector llGetForce();
123 LSL_Integer llGetFreeMemory(); 123 LSL_Integer llGetFreeMemory();
124 LSL_Integer llGetUsedMemory();
124 LSL_Integer llGetFreeURLs(); 125 LSL_Integer llGetFreeURLs();
125 LSL_Vector llGetGeometricCenter(); 126 LSL_Vector llGetGeometricCenter();
126 LSL_Float llGetGMTclock(); 127 LSL_Float llGetGMTclock();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 63cac9a..7d7e54e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -461,6 +461,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
461 return m_LSL_Functions.llGetFreeMemory(); 461 return m_LSL_Functions.llGetFreeMemory();
462 } 462 }
463 463
464 public LSL_Integer llGetUsedMemory()
465 {
466 return m_LSL_Functions.llGetUsedMemory();
467 }
468
464 public LSL_Integer llGetFreeURLs() 469 public LSL_Integer llGetFreeURLs()
465 { 470 {
466 return m_LSL_Functions.llGetFreeURLs(); 471 return m_LSL_Functions.llGetFreeURLs();
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 665f4a6..6bfee91 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1530,6 +1530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
1530 public struct LSLInteger 1530 public struct LSLInteger
1531 { 1531 {
1532 public int value; 1532 public int value;
1533 private static readonly Regex castRegex = new Regex(@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)");
1533 1534
1534 #region Constructors 1535 #region Constructors
1535 public LSLInteger(int i) 1536 public LSLInteger(int i)
@@ -1549,9 +1550,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
1549 1550
1550 public LSLInteger(string s) 1551 public LSLInteger(string s)
1551 { 1552 {
1552 Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)"); 1553 Match m = castRegex.Match(s);
1553 Match m = r.Match(s);
1554 string v = m.Groups[0].Value; 1554 string v = m.Groups[0].Value;
1555 // Leading plus sign is allowed, but ignored
1556 v = v.Replace("+", "");
1555 1557
1556 if (v == String.Empty) 1558 if (v == String.Empty)
1557 { 1559 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 1d55b95..80b60a4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -29,7 +29,6 @@ using System.Collections.Generic;
29using NUnit.Framework; 29using NUnit.Framework;
30using OpenSim.Tests.Common; 30using OpenSim.Tests.Common;
31using OpenSim.Region.ScriptEngine.Shared; 31using OpenSim.Region.ScriptEngine.Shared;
32using OpenSim.Tests.Common.Setup;
33using OpenSim.Region.Framework.Scenes; 32using OpenSim.Region.Framework.Scenes;
34using Nini.Config; 33using Nini.Config;
35using OpenSim.Region.ScriptEngine.Shared.Api; 34using OpenSim.Region.ScriptEngine.Shared.Api;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
index 045abb4..b635d5c 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
@@ -29,7 +29,6 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Nini.Config; 30using Nini.Config;
31using NUnit.Framework; 31using NUnit.Framework;
32using OpenSim.Tests.Common.Setup;
33using OpenSim.Tests.Common.Mock; 32using OpenSim.Tests.Common.Mock;
34using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
35using OpenMetaverse; 34using OpenMetaverse;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 9a78a42..4f3432d 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -461,11 +461,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
461 return 0; 461 return 0;
462 } 462 }
463 463
464 public object DoMaintenance(object p) 464 public void SaveAllState()
465 { 465 {
466 object[] parms = (object[])p;
467 int sleepTime = (int)parms[0];
468
469 foreach (IScriptInstance inst in m_Scripts.Values) 466 foreach (IScriptInstance inst in m_Scripts.Values)
470 { 467 {
471 if (inst.EventTime() > m_EventLimit) 468 if (inst.EventTime() > m_EventLimit)
@@ -475,6 +472,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
475 inst.Start(); 472 inst.Start();
476 } 473 }
477 } 474 }
475 }
476
477 public object DoMaintenance(object p)
478 {
479 object[] parms = (object[])p;
480 int sleepTime = (int)parms[0];
481
482 SaveAllState();
478 483
479 System.Threading.Thread.Sleep(sleepTime); 484 System.Threading.Thread.Sleep(sleepTime);
480 485
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 0af35c8..2282ee8 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -393,6 +393,10 @@ namespace OpenSim.Services.InventoryService
393 393
394 public virtual bool UpdateItem(InventoryItemBase item) 394 public virtual bool UpdateItem(InventoryItemBase item)
395 { 395 {
396 if (!m_AllowDelete)
397 if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder)
398 return false;
399
396 return m_Database.StoreItem(ConvertFromOpenSim(item)); 400 return m_Database.StoreItem(ConvertFromOpenSim(item));
397 } 401 }
398 402
@@ -411,12 +415,30 @@ namespace OpenSim.Services.InventoryService
411 public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) 415 public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs)
412 { 416 {
413 if (!m_AllowDelete) 417 if (!m_AllowDelete)
414 return false; 418 {
415 419 // We must still allow links and links to folders to be deleted, otherwise they will build up
416 // Just use the ID... *facepalms* 420 // in the player's inventory until they can no longer log in. Deletions of links due to code bugs or
417 // 421 // similar is inconvenient but on a par with accidental movement of items. The original item is never
418 foreach (UUID id in itemIDs) 422 // touched.
419 m_Database.DeleteItems("inventoryID", id.ToString()); 423 foreach (UUID id in itemIDs)
424 {
425 if (!m_Database.DeleteItems(
426 new string[] { "inventoryID", "assetType" },
427 new string[] { id.ToString(), ((sbyte)AssetType.Link).ToString() }));
428 {
429 m_Database.DeleteItems(
430 new string[] { "inventoryID", "assetType" },
431 new string[] { id.ToString(), ((sbyte)AssetType.LinkFolder).ToString() });
432 }
433 }
434 }
435 else
436 {
437 // Just use the ID... *facepalms*
438 //
439 foreach (UUID id in itemIDs)
440 m_Database.DeleteItems("inventoryID", id.ToString());
441 }
420 442
421 return true; 443 return true;
422 } 444 }
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs
index d572249..aa55bcd 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs
@@ -56,10 +56,24 @@ namespace OpenSim.Tests.Common
56 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); 56 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
57 scene.AssetService.Store(asset); 57 scene.AssetService.Store(asset);
58 return asset; 58 return asset;
59 } 59 }
60
61 /// <summary>
62 /// Create an asset from the given object.
63 /// </summary>
64 /// <param name="assetUuidTail">
65 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
66 /// will be used.
67 /// </param>
68 /// <param name="sog"></param>
69 /// <returns></returns>
70 public static AssetBase CreateAsset(int assetUuidTail, SceneObjectGroup sog)
71 {
72 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), sog);
73 }
60 74
61 /// <summary> 75 /// <summary>
62 /// Create an asset from the given scene object. 76 /// Create an asset from the given object.
63 /// </summary> 77 /// </summary>
64 /// <param name="assetUuid"></param> 78 /// <param name="assetUuid"></param>
65 /// <param name="sog"></param> 79 /// <param name="sog"></param>
@@ -76,7 +90,7 @@ namespace OpenSim.Tests.Common
76 /// <summary> 90 /// <summary>
77 /// Create an asset from the given scene object. 91 /// Create an asset from the given scene object.
78 /// </summary> 92 /// </summary>
79 /// <param name="assetUuidTailZ"> 93 /// <param name="assetUuidTail">
80 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}" 94 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
81 /// will be used. 95 /// will be used.
82 /// </param> 96 /// </param>
diff --git a/OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs
index eaf8b39..49c99c5 100644
--- a/OpenSim/Tests/Common/Setup/BaseRequestHandlerTestHelper.cs
+++ b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs
@@ -34,9 +34,9 @@ using OpenSim.Framework.Servers;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Tests.Common.Mock; 35using OpenSim.Tests.Common.Mock;
36 36
37namespace OpenSim.Tests.Common.Setup 37namespace OpenSim.Tests.Common
38{ 38{
39 public class BaseRequestHandlerTestHelper 39 public class BaseRequestHandlerHelpers
40 { 40 {
41 private static string[] m_emptyStringArray = new string[] { }; 41 private static string[] m_emptyStringArray = new string[] { };
42 42
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneSetupHelpers.cs
index d122409..bef0481 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneSetupHelpers.cs
@@ -49,7 +49,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
49using OpenSim.Services.Interfaces; 49using OpenSim.Services.Interfaces;
50using OpenSim.Tests.Common.Mock; 50using OpenSim.Tests.Common.Mock;
51 51
52namespace OpenSim.Tests.Common.Setup 52namespace OpenSim.Tests.Common
53{ 53{
54 /// <summary> 54 /// <summary>
55 /// Helpers for setting up scenes. 55 /// Helpers for setting up scenes.
diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
new file mode 100644
index 0000000..5215c34
--- /dev/null
+++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
@@ -0,0 +1,89 @@
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 OpenMetaverse;
30using OpenMetaverse.Assets;
31using OpenSim.Framework;
32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Services.Interfaces;
34
35namespace OpenSim.Tests.Common
36{
37 /// <summary>
38 /// Utility functions for carrying out task inventory tests.
39 /// </summary>
40 ///
41 public static class TaskInventoryHelpers
42 {
43 /// <summary>
44 /// Add a notecard item to the given part.
45 /// </summary>
46 /// <param name="scene"></param>
47 /// <param name="part"></param>
48 /// <returns>The item that was added</returns>
49 public static TaskInventoryItem AddNotecard(Scene scene, SceneObjectPart part)
50 {
51 AssetNotecard nc = new AssetNotecard();
52 nc.BodyText = "Hello World!";
53 nc.Encode();
54 UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
55 UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
56 AssetBase ncAsset
57 = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero);
58 scene.AssetService.Store(ncAsset);
59 TaskInventoryItem ncItem
60 = new TaskInventoryItem
61 { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid,
62 Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard };
63 part.Inventory.AddInventoryItem(ncItem, true);
64
65 return ncItem;
66 }
67
68 /// <summary>
69 /// Add a scene object item to the given part.
70 /// </summary>
71 /// <param name="scene"></param>
72 /// <param name="sop"></param>
73 /// <param name="itemName"></param>
74 /// <param name="id"></param>
75 public static TaskInventoryItem AddSceneObject(Scene scene, SceneObjectPart sop, string itemName, UUID id)
76 {
77 SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero);
78 AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
79 scene.AssetService.Store(taskSceneObjectAsset);
80 TaskInventoryItem taskSceneObjectItem
81 = new TaskInventoryItem
82 { Name = itemName, AssetID = taskSceneObjectAsset.FullID, ItemID = id,
83 Type = (int)AssetType.Object, InvType = (int)InventoryType.Object };
84 sop.Inventory.AddInventoryItem(taskSceneObjectItem, true);
85
86 return taskSceneObjectItem;
87 }
88 }
89} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs
index d01521d..8cfad79 100644
--- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
+++ b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs
@@ -31,12 +31,12 @@ using OpenSim.Framework.Communications;
31using OpenSim.Region.Framework.Scenes; 31using OpenSim.Region.Framework.Scenes;
32using OpenSim.Services.Interfaces; 32using OpenSim.Services.Interfaces;
33 33
34namespace OpenSim.Tests.Common.Setup 34namespace OpenSim.Tests.Common
35{ 35{
36 /// <summary> 36 /// <summary>
37 /// Utility functions for carrying out user profile related tests. 37 /// Utility functions for carrying out user profile related tests.
38 /// </summary> 38 /// </summary>
39 public static class UserProfileTestUtils 39 public static class UserAccountHelpers
40 { 40 {
41// /// <summary> 41// /// <summary>
42// /// Create a test user with a standard inventory 42// /// Create a test user with a standard inventory
diff --git a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
index 135c50e..0419134 100644
--- a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs
+++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs
@@ -34,9 +34,9 @@ using OpenSim.Services.Interfaces;
34namespace OpenSim.Tests.Common 34namespace OpenSim.Tests.Common
35{ 35{
36 /// <summary> 36 /// <summary>
37 /// Utility functions for carrying out user inventory related tests. 37 /// Utility functions for carrying out user inventory tests.
38 /// </summary> 38 /// </summary>
39 public static class UserInventoryTestUtils 39 public static class UserInventoryHelpers
40 { 40 {
41 public static readonly string PATH_DELIMITER = "/"; 41 public static readonly string PATH_DELIMITER = "/";
42 42