aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorMelanie2012-02-02 23:40:56 +0000
committerMelanie2012-02-02 23:40:56 +0000
commit447a66d66005c5ec54a786d1d0a532738729251c (patch)
tree78c286a7c43586e7ce0747bd71369c3a3be344df /OpenSim/Data
parentOpenID: server connector had a copy-and-paste error that made identity querie... (diff)
downloadopensim-SC_OLD-447a66d66005c5ec54a786d1d0a532738729251c.zip
opensim-SC_OLD-447a66d66005c5ec54a786d1d0a532738729251c.tar.gz
opensim-SC_OLD-447a66d66005c5ec54a786d1d0a532738729251c.tar.bz2
opensim-SC_OLD-447a66d66005c5ec54a786d1d0a532738729251c.tar.xz
Replace ParcelAccessEntry with a new struct, LandAccessEntry, which more
accurately reflects the data sent by the viewer. Add times bans and the expiration of timed bans. Warning: Contains a Migration (and nuts)
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLSimulationData.cs12
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs17
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations6
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs12
4 files changed, 27 insertions, 20 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
index bb59bba..be60d4c 100644
--- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
@@ -681,7 +681,7 @@ VALUES
681 using (SqlCommand cmd = new SqlCommand(sql, conn)) 681 using (SqlCommand cmd = new SqlCommand(sql, conn))
682 { 682 {
683 conn.Open(); 683 conn.Open();
684 foreach (ParcelManager.ParcelAccessEntry parcelAccessEntry in parcel.LandData.ParcelAccessList) 684 foreach (LandAccessEntry parcelAccessEntry in parcel.LandData.ParcelAccessList)
685 { 685 {
686 cmd.Parameters.AddRange(CreateLandAccessParameters(parcelAccessEntry, parcel.RegionUUID)); 686 cmd.Parameters.AddRange(CreateLandAccessParameters(parcelAccessEntry, parcel.RegionUUID));
687 687
@@ -1453,7 +1453,7 @@ VALUES
1453 _Log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); 1453 _Log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
1454 } 1454 }
1455 1455
1456 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 1456 newData.ParcelAccessList = new List<LandAccessEntry>();
1457 1457
1458 return newData; 1458 return newData;
1459 } 1459 }
@@ -1463,12 +1463,12 @@ VALUES
1463 /// </summary> 1463 /// </summary>
1464 /// <param name="row">datarecord with landaccess data</param> 1464 /// <param name="row">datarecord with landaccess data</param>
1465 /// <returns></returns> 1465 /// <returns></returns>
1466 private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataRecord row) 1466 private static LandAccessEntry BuildLandAccessData(IDataRecord row)
1467 { 1467 {
1468 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 1468 LandAccessEntry entry = new LandAccessEntry();
1469 entry.AgentID = new UUID((Guid)row["AccessUUID"]); 1469 entry.AgentID = new UUID((Guid)row["AccessUUID"]);
1470 entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]); 1470 entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]);
1471 entry.Time = new DateTime(); 1471 entry.Expires = 0;
1472 return entry; 1472 return entry;
1473 } 1473 }
1474 1474
@@ -1851,7 +1851,7 @@ VALUES
1851 /// <param name="parcelAccessEntry">parcel access entry.</param> 1851 /// <param name="parcelAccessEntry">parcel access entry.</param>
1852 /// <param name="parcelID">parcel ID.</param> 1852 /// <param name="parcelID">parcel ID.</param>
1853 /// <returns></returns> 1853 /// <returns></returns>
1854 private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, UUID parcelID) 1854 private SqlParameter[] CreateLandAccessParameters(LandAccessEntry parcelAccessEntry, UUID parcelID)
1855 { 1855 {
1856 List<SqlParameter> parameters = new List<SqlParameter>(); 1856 List<SqlParameter> parameters = new List<SqlParameter>();
1857 1857
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 3123edf..3275146 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -700,10 +700,10 @@ namespace OpenSim.Data.MySQL
700 700
701 cmd.Parameters.Clear(); 701 cmd.Parameters.Clear();
702 cmd.CommandText = "insert into landaccesslist (LandUUID, " + 702 cmd.CommandText = "insert into landaccesslist (LandUUID, " +
703 "AccessUUID, Flags) values (?LandUUID, ?AccessUUID, " + 703 "AccessUUID, Flags, Expires) values (?LandUUID, ?AccessUUID, " +
704 "?Flags)"; 704 "?Flags, ?Expires)";
705 705
706 foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) 706 foreach (LandAccessEntry entry in parcel.LandData.ParcelAccessList)
707 { 707 {
708 FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID); 708 FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID);
709 ExecuteNonQuery(cmd); 709 ExecuteNonQuery(cmd);
@@ -1377,7 +1377,7 @@ namespace OpenSim.Data.MySQL
1377 newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); 1377 newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
1378 newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); 1378 newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
1379 1379
1380 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 1380 newData.ParcelAccessList = new List<LandAccessEntry>();
1381 1381
1382 return newData; 1382 return newData;
1383 } 1383 }
@@ -1387,12 +1387,12 @@ namespace OpenSim.Data.MySQL
1387 /// </summary> 1387 /// </summary>
1388 /// <param name="row"></param> 1388 /// <param name="row"></param>
1389 /// <returns></returns> 1389 /// <returns></returns>
1390 private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataReader row) 1390 private static LandAccessEntry BuildLandAccessData(IDataReader row)
1391 { 1391 {
1392 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 1392 LandAccessEntry entry = new LandAccessEntry();
1393 entry.AgentID = DBGuid.FromDB(row["AccessUUID"]); 1393 entry.AgentID = DBGuid.FromDB(row["AccessUUID"]);
1394 entry.Flags = (AccessList) Convert.ToInt32(row["Flags"]); 1394 entry.Flags = (AccessList) Convert.ToInt32(row["Flags"]);
1395 entry.Time = new DateTime(); 1395 entry.Expires = Convert.ToInt32(row["Expires"]);
1396 return entry; 1396 return entry;
1397 } 1397 }
1398 1398
@@ -1697,11 +1697,12 @@ namespace OpenSim.Data.MySQL
1697 /// <param name="row"></param> 1697 /// <param name="row"></param>
1698 /// <param name="entry"></param> 1698 /// <param name="entry"></param>
1699 /// <param name="parcelID"></param> 1699 /// <param name="parcelID"></param>
1700 private static void FillLandAccessCommand(MySqlCommand cmd, ParcelManager.ParcelAccessEntry entry, UUID parcelID) 1700 private static void FillLandAccessCommand(MySqlCommand cmd, LandAccessEntry entry, UUID parcelID)
1701 { 1701 {
1702 cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString()); 1702 cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString());
1703 cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString()); 1703 cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString());
1704 cmd.Parameters.AddWithValue("Flags", entry.Flags); 1704 cmd.Parameters.AddWithValue("Flags", entry.Flags);
1705 cmd.Parameters.AddWithValue("Expires", entry.Expires.ToString());
1705 } 1706 }
1706 1707
1707 /// <summary> 1708 /// <summary>
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index f9b5737..642e3b7 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -863,3 +863,9 @@ BEGIN;
863ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; 863ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
864COMMIT; 864COMMIT;
865 865
866:VERSION 41 #---------------- Timed bans/access
867
868BEGIN;
869ALTER TABLE `landaccesslist` ADD COLUMN `Expires` INTEGER NOT NULL DEFAULT 0;
870COMMIT;
871
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 5618772..2d06f82 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -759,7 +759,7 @@ namespace OpenSim.Data.SQLite
759 landaccesslist.Rows.Remove(rowsToDelete[iter]); 759 landaccesslist.Rows.Remove(rowsToDelete[iter]);
760 } 760 }
761 rowsToDelete.Clear(); 761 rowsToDelete.Clear();
762 foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) 762 foreach (LandAccessEntry entry in parcel.LandData.ParcelAccessList)
763 { 763 {
764 DataRow newAccessRow = landaccesslist.NewRow(); 764 DataRow newAccessRow = landaccesslist.NewRow();
765 fillLandAccessRow(newAccessRow, entry, parcel.LandData.GlobalID); 765 fillLandAccessRow(newAccessRow, entry, parcel.LandData.GlobalID);
@@ -1456,7 +1456,7 @@ namespace OpenSim.Data.SQLite
1456 newData.UserLocation = Vector3.Zero; 1456 newData.UserLocation = Vector3.Zero;
1457 newData.UserLookAt = Vector3.Zero; 1457 newData.UserLookAt = Vector3.Zero;
1458 } 1458 }
1459 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 1459 newData.ParcelAccessList = new List<LandAccessEntry>();
1460 UUID authBuyerID = UUID.Zero; 1460 UUID authBuyerID = UUID.Zero;
1461 1461
1462 UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID); 1462 UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID);
@@ -1519,12 +1519,12 @@ namespace OpenSim.Data.SQLite
1519 /// </summary> 1519 /// </summary>
1520 /// <param name="row"></param> 1520 /// <param name="row"></param>
1521 /// <returns></returns> 1521 /// <returns></returns>
1522 private static ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row) 1522 private static LandAccessEntry buildLandAccessData(DataRow row)
1523 { 1523 {
1524 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 1524 LandAccessEntry entry = new LandAccessEntry();
1525 entry.AgentID = new UUID((string) row["AccessUUID"]); 1525 entry.AgentID = new UUID((string) row["AccessUUID"]);
1526 entry.Flags = (AccessList) row["Flags"]; 1526 entry.Flags = (AccessList) row["Flags"];
1527 entry.Time = new DateTime(); 1527 entry.Expires = 0;
1528 return entry; 1528 return entry;
1529 } 1529 }
1530 1530
@@ -1787,7 +1787,7 @@ namespace OpenSim.Data.SQLite
1787 /// <param name="row"></param> 1787 /// <param name="row"></param>
1788 /// <param name="entry"></param> 1788 /// <param name="entry"></param>
1789 /// <param name="parcelID"></param> 1789 /// <param name="parcelID"></param>
1790 private static void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, UUID parcelID) 1790 private static void fillLandAccessRow(DataRow row, LandAccessEntry entry, UUID parcelID)
1791 { 1791 {
1792 row["LandUUID"] = parcelID.ToString(); 1792 row["LandUUID"] = parcelID.ToString();
1793 row["AccessUUID"] = entry.AgentID.ToString(); 1793 row["AccessUUID"] = entry.AgentID.ToString();