From 39a748b47a5eb8020f167287c84a91bee0881cca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 20:23:53 +0100 Subject: refactor: Use SOP.Flags rather than SOP.ObjectFlags --- OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | 4 ++-- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 4 ++-- OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs | 4 ++-- OpenSim/Data/Tests/RegionTests.cs | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs index 7c176c7..7d017a6 100644 --- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs @@ -1017,7 +1017,7 @@ VALUES prim.SitName = (string)primRow["SitName"]; prim.TouchName = (string)primRow["TouchName"]; // permissions - prim.ObjectFlags = Convert.ToUInt32(primRow["ObjectFlags"]); + prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]); prim.CreatorID = new UUID((Guid)primRow["CreatorID"]); prim.OwnerID = new UUID((Guid)primRow["OwnerID"]); prim.GroupID = new UUID((Guid)primRow["GroupID"]); @@ -1408,7 +1408,7 @@ VALUES parameters.Add(_Database.CreateParameter("SitName", prim.SitName)); parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName)); // permissions - parameters.Add(_Database.CreateParameter("ObjectFlags", prim.ObjectFlags)); + parameters.Add(_Database.CreateParameter("ObjectFlags", (uint)prim.Flags)); parameters.Add(_Database.CreateParameter("CreatorID", prim.CreatorID)); parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID)); parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID)); diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index d8debc5..1edcb5d 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -1081,7 +1081,7 @@ namespace OpenSim.Data.MySQL prim.SitName = (string)row["SitName"]; prim.TouchName = (string)row["TouchName"]; // Permissions - prim.ObjectFlags = (uint)(int)row["ObjectFlags"]; + prim.Flags = (PrimFlags)(int)row["ObjectFlags"]; prim.OwnerMask = (uint)(int)row["OwnerMask"]; prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"]; prim.GroupMask = (uint)(int)row["GroupMask"]; @@ -1414,7 +1414,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("SitName", prim.SitName); cmd.Parameters.AddWithValue("TouchName", prim.TouchName); // permissions - cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags); + cmd.Parameters.AddWithValue("ObjectFlags", (uint)prim.Flags); cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString()); cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString()); cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs index eb78037..289fd94 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs @@ -1187,7 +1187,7 @@ namespace OpenSim.Data.SQLiteLegacy prim.SitName = (String) row["SitName"]; prim.TouchName = (String) row["TouchName"]; // permissions - prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); + prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]); prim.CreatorID = new UUID((String) row["CreatorID"]); prim.OwnerID = new UUID((String) row["OwnerID"]); prim.GroupID = new UUID((String) row["GroupID"]); @@ -1521,7 +1521,7 @@ namespace OpenSim.Data.SQLiteLegacy row["SitName"] = prim.SitName; row["TouchName"] = prim.TouchName; // permissions - row["ObjectFlags"] = prim.ObjectFlags; + row["ObjectFlags"] = (uint)prim.Flags; row["CreatorID"] = prim.CreatorID.ToString(); row["OwnerID"] = prim.OwnerID.ToString(); row["GroupID"] = prim.GroupID.ToString(); diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs index eeffdda..3cd9e0b 100644 --- a/OpenSim/Data/Tests/RegionTests.cs +++ b/OpenSim/Data/Tests/RegionTests.cs @@ -317,7 +317,7 @@ namespace OpenSim.Data.Tests sop.CreatorID = creator; sop.InventorySerial = iserial; sop.TaskInventory = dic; - sop.ObjectFlags = objf; + sop.Flags = (PrimFlags)objf; sop.Name = name; sop.Material = material; sop.ScriptAccessPin = pin; @@ -350,7 +350,7 @@ namespace OpenSim.Data.Tests // Modified in-class // Assert.That(iserial,Is.EqualTo(sop.InventorySerial), "Assert.That(iserial,Is.EqualTo(sop.InventorySerial))"); Assert.That(dic,Is.EqualTo(sop.TaskInventory), "Assert.That(dic,Is.EqualTo(sop.TaskInventory))"); - Assert.That(objf,Is.EqualTo(sop.ObjectFlags), "Assert.That(objf,Is.EqualTo(sop.ObjectFlags))"); + Assert.That(objf, Is.EqualTo((uint)sop.Flags), "Assert.That(objf,Is.EqualTo(sop.Flags))"); Assert.That(name,Is.EqualTo(sop.Name), "Assert.That(name,Is.EqualTo(sop.Name))"); Assert.That(material,Is.EqualTo(sop.Material), "Assert.That(material,Is.EqualTo(sop.Material))"); Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin))"); @@ -373,7 +373,7 @@ namespace OpenSim.Data.Tests Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); // This is necessary or object will not be inserted in DB - sop.ObjectFlags = 0; + sop.Flags = PrimFlags.None; SceneObjectGroup sog = new SceneObjectGroup(sop); @@ -398,7 +398,7 @@ namespace OpenSim.Data.Tests Assert.That(creator,Is.EqualTo(p.CreatorID), "Assert.That(creator,Is.EqualTo(p.CreatorID))"); //Assert.That(iserial,Is.EqualTo(p.InventorySerial), "Assert.That(iserial,Is.EqualTo(p.InventorySerial))"); Assert.That(dic,Is.EqualTo(p.TaskInventory), "Assert.That(dic,Is.EqualTo(p.TaskInventory))"); - //Assert.That(objf,Is.EqualTo(p.ObjectFlags), "Assert.That(objf,Is.EqualTo(p.ObjectFlags))"); + //Assert.That(objf, Is.EqualTo((uint)p.Flags), "Assert.That(objf,Is.EqualTo(p.Flags))"); Assert.That(name,Is.EqualTo(p.Name), "Assert.That(name,Is.EqualTo(p.Name))"); Assert.That(material,Is.EqualTo(p.Material), "Assert.That(material,Is.EqualTo(p.Material))"); Assert.That(pin,Is.EqualTo(p.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(p.ScriptAccessPin))"); -- cgit v1.1 From 30d0bf42071bf07f3f2ad30aa75126436e9360ae Mon Sep 17 00:00:00 2001 From: Marck Date: Sun, 15 Aug 2010 21:08:37 +0200 Subject: Fix SQLite database plugin for UserAccountData queries with a single word. --- OpenSim/Data/SQLite/SQLiteUserAccountData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs index 893f105..2706aea 100644 --- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs @@ -66,7 +66,7 @@ namespace OpenSim.Data.SQLite if (words.Length == 1) { - cmd.CommandText = String.Format("select * from {0} where ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", + cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", m_Realm, scopeID.ToString(), words[0]); } else -- cgit v1.1