From 447a66d66005c5ec54a786d1d0a532738729251c Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Feb 2012 23:40:56 +0000 Subject: 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) --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 17 +++++++++-------- OpenSim/Data/MySQL/Resources/RegionStore.migrations | 6 ++++++ 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'OpenSim/Data/MySQL') 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 cmd.Parameters.Clear(); cmd.CommandText = "insert into landaccesslist (LandUUID, " + - "AccessUUID, Flags) values (?LandUUID, ?AccessUUID, " + - "?Flags)"; + "AccessUUID, Flags, Expires) values (?LandUUID, ?AccessUUID, " + + "?Flags, ?Expires)"; - foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) + foreach (LandAccessEntry entry in parcel.LandData.ParcelAccessList) { FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID); ExecuteNonQuery(cmd); @@ -1377,7 +1377,7 @@ namespace OpenSim.Data.MySQL newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); - newData.ParcelAccessList = new List(); + newData.ParcelAccessList = new List(); return newData; } @@ -1387,12 +1387,12 @@ namespace OpenSim.Data.MySQL /// /// /// - private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataReader row) + private static LandAccessEntry BuildLandAccessData(IDataReader row) { - ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); + LandAccessEntry entry = new LandAccessEntry(); entry.AgentID = DBGuid.FromDB(row["AccessUUID"]); entry.Flags = (AccessList) Convert.ToInt32(row["Flags"]); - entry.Time = new DateTime(); + entry.Expires = Convert.ToInt32(row["Expires"]); return entry; } @@ -1697,11 +1697,12 @@ namespace OpenSim.Data.MySQL /// /// /// - private static void FillLandAccessCommand(MySqlCommand cmd, ParcelManager.ParcelAccessEntry entry, UUID parcelID) + private static void FillLandAccessCommand(MySqlCommand cmd, LandAccessEntry entry, UUID parcelID) { cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString()); cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString()); cmd.Parameters.AddWithValue("Flags", entry.Flags); + cmd.Parameters.AddWithValue("Expires", entry.Expires.ToString()); } /// 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; ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; COMMIT; +:VERSION 41 #---------------- Timed bans/access + +BEGIN; +ALTER TABLE `landaccesslist` ADD COLUMN `Expires` INTEGER NOT NULL DEFAULT 0; +COMMIT; + -- cgit v1.1