diff options
author | Melanie | 2012-02-02 21:36:45 +0100 |
---|---|---|
committer | Melanie | 2012-02-02 21:36:45 +0100 |
commit | 07c487a28f6ce6d85cf32fba0c2ded724f7b5af7 (patch) | |
tree | 7852ae5fa1c6a9d91f6c5b7930615a45245b694e /OpenSim/Data | |
parent | Streamline banning code using existing methods. (diff) | |
download | opensim-SC_OLD-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.zip opensim-SC_OLD-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.tar.gz opensim-SC_OLD-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.tar.bz2 opensim-SC_OLD-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.tar.xz |
Make ban, eject, freeze and the scripted versions of those work.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 12 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 17 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 12 |
3 files changed, 21 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 d459e08..48ef447 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -715,10 +715,10 @@ namespace OpenSim.Data.MySQL | |||
715 | 715 | ||
716 | cmd.Parameters.Clear(); | 716 | cmd.Parameters.Clear(); |
717 | cmd.CommandText = "insert into landaccesslist (LandUUID, " + | 717 | cmd.CommandText = "insert into landaccesslist (LandUUID, " + |
718 | "AccessUUID, Flags) values (?LandUUID, ?AccessUUID, " + | 718 | "AccessUUID, Flags, Expires) values (?LandUUID, ?AccessUUID, " + |
719 | "?Flags)"; | 719 | "?Flags, ?Expires)"; |
720 | 720 | ||
721 | foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) | 721 | foreach (LandAccessEntry entry in parcel.LandData.ParcelAccessList) |
722 | { | 722 | { |
723 | FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID); | 723 | FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID); |
724 | ExecuteNonQuery(cmd); | 724 | ExecuteNonQuery(cmd); |
@@ -1396,7 +1396,7 @@ namespace OpenSim.Data.MySQL | |||
1396 | newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); | 1396 | newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); |
1397 | newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); | 1397 | newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); |
1398 | 1398 | ||
1399 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); | 1399 | newData.ParcelAccessList = new List<LandAccessEntry>(); |
1400 | 1400 | ||
1401 | return newData; | 1401 | return newData; |
1402 | } | 1402 | } |
@@ -1406,12 +1406,12 @@ namespace OpenSim.Data.MySQL | |||
1406 | /// </summary> | 1406 | /// </summary> |
1407 | /// <param name="row"></param> | 1407 | /// <param name="row"></param> |
1408 | /// <returns></returns> | 1408 | /// <returns></returns> |
1409 | private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataReader row) | 1409 | private static LandAccessEntry BuildLandAccessData(IDataReader row) |
1410 | { | 1410 | { |
1411 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 1411 | LandAccessEntry entry = new LandAccessEntry(); |
1412 | entry.AgentID = DBGuid.FromDB(row["AccessUUID"]); | 1412 | entry.AgentID = DBGuid.FromDB(row["AccessUUID"]); |
1413 | entry.Flags = (AccessList) Convert.ToInt32(row["Flags"]); | 1413 | entry.Flags = (AccessList) Convert.ToInt32(row["Flags"]); |
1414 | entry.Time = new DateTime(); | 1414 | entry.Expires = Convert.ToInt32(row["Expires"]); |
1415 | return entry; | 1415 | return entry; |
1416 | } | 1416 | } |
1417 | 1417 | ||
@@ -1723,11 +1723,12 @@ namespace OpenSim.Data.MySQL | |||
1723 | /// <param name="row"></param> | 1723 | /// <param name="row"></param> |
1724 | /// <param name="entry"></param> | 1724 | /// <param name="entry"></param> |
1725 | /// <param name="parcelID"></param> | 1725 | /// <param name="parcelID"></param> |
1726 | private static void FillLandAccessCommand(MySqlCommand cmd, ParcelManager.ParcelAccessEntry entry, UUID parcelID) | 1726 | private static void FillLandAccessCommand(MySqlCommand cmd, LandAccessEntry entry, UUID parcelID) |
1727 | { | 1727 | { |
1728 | cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString()); | 1728 | cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString()); |
1729 | cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString()); | 1729 | cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString()); |
1730 | cmd.Parameters.AddWithValue("Flags", entry.Flags); | 1730 | cmd.Parameters.AddWithValue("Flags", entry.Flags); |
1731 | cmd.Parameters.AddWithValue("Expires", entry.Expires.ToString()); | ||
1731 | } | 1732 | } |
1732 | 1733 | ||
1733 | /// <summary> | 1734 | /// <summary> |
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(); |