aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2012-02-02 21:36:45 +0100
committerMelanie2012-02-02 21:36:45 +0100
commit07c487a28f6ce6d85cf32fba0c2ded724f7b5af7 (patch)
tree7852ae5fa1c6a9d91f6c5b7930615a45245b694e /OpenSim
parentStreamline banning code using existing methods. (diff)
downloadopensim-SC-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.zip
opensim-SC-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.tar.gz
opensim-SC-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.tar.bz2
opensim-SC-07c487a28f6ce6d85cf32fba0c2ded724f7b5af7.tar.xz
Make ban, eject, freeze and the scripted versions of those work.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLSimulationData.cs12
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs17
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs12
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Framework/ILandObject.cs4
-rw-r--r--OpenSim/Framework/LandData.cs19
-rw-r--r--OpenSim/Framework/Serialization/External/LandDataSerializer.cs12
-rw-r--r--OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs12
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs14
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs78
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs101
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
15 files changed, 188 insertions, 109 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();
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 0e0c218..c4c61ff 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -177,7 +177,7 @@ namespace OpenSim.Framework
177 177
178 public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags, 178 public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags,
179 int landLocalID, UUID transactionID, int sequenceID, 179 int landLocalID, UUID transactionID, int sequenceID,
180 int sections, List<ParcelManager.ParcelAccessEntry> entries, 180 int sections, List<LandAccessEntry> entries,
181 IClientAPI remote_client); 181 IClientAPI remote_client);
182 182
183 public delegate void ParcelPropertiesRequest( 183 public delegate void ParcelPropertiesRequest(
@@ -1259,7 +1259,7 @@ namespace OpenSim.Framework
1259 float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, 1259 float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity,
1260 uint regionFlags); 1260 uint regionFlags);
1261 1261
1262 void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID); 1262 void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID);
1263 void SendForceClientSelectObjects(List<uint> objectIDs); 1263 void SendForceClientSelectObjects(List<uint> objectIDs);
1264 void SendCameraConstraint(Vector4 ConstraintPlane); 1264 void SendCameraConstraint(Vector4 ConstraintPlane);
1265 void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount); 1265 void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount);
diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs
index f75a990..dd73b3f 100644
--- a/OpenSim/Framework/ILandObject.cs
+++ b/OpenSim/Framework/ILandObject.cs
@@ -73,9 +73,9 @@ namespace OpenSim.Framework
73 bool IsRestrictedFromLand(UUID avatar); 73 bool IsRestrictedFromLand(UUID avatar);
74 void SendLandUpdateToClient(IClientAPI remote_client); 74 void SendLandUpdateToClient(IClientAPI remote_client);
75 void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); 75 void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
76 List<UUID> CreateAccessListArrayByFlag(AccessList flag); 76 List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);
77 void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); 77 void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
78 void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); 78 void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<LandAccessEntry> entries, IClientAPI remote_client);
79 void UpdateLandBitmapByteArray(); 79 void UpdateLandBitmapByteArray();
80 void SetLandBitmapFromByteArray(); 80 void SetLandBitmapFromByteArray();
81 bool[,] GetLandBitmap(); 81 bool[,] GetLandBitmap();
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index 282a128..27fadfa 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -34,6 +34,13 @@ using OpenMetaverse;
34 34
35namespace OpenSim.Framework 35namespace OpenSim.Framework
36{ 36{
37 public struct LandAccessEntry
38 {
39 public UUID AgentID;
40 public int Expires;
41 public AccessList Flags;
42 }
43
37 /// <summary> 44 /// <summary>
38 /// Details of a Parcel of land 45 /// Details of a Parcel of land
39 /// </summary> 46 /// </summary>
@@ -73,7 +80,7 @@ namespace OpenSim.Framework
73 private string _mediaURL = String.Empty; 80 private string _mediaURL = String.Empty;
74 private string _musicURL = String.Empty; 81 private string _musicURL = String.Empty;
75 private UUID _ownerID = UUID.Zero; 82 private UUID _ownerID = UUID.Zero;
76 private List<ParcelManager.ParcelAccessEntry> _parcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 83 private List<LandAccessEntry> _parcelAccessList = new List<LandAccessEntry>();
77 private float _passHours = 0; 84 private float _passHours = 0;
78 private int _passPrice = 0; 85 private int _passPrice = 0;
79 private int _salePrice = 0; //Unemeplemented. Parcels price. 86 private int _salePrice = 0; //Unemeplemented. Parcels price.
@@ -450,7 +457,7 @@ namespace OpenSim.Framework
450 /// <summary> 457 /// <summary>
451 /// List of access data for the parcel. User data, some bitflags, and a time 458 /// List of access data for the parcel. User data, some bitflags, and a time
452 /// </summary> 459 /// </summary>
453 public List<ParcelManager.ParcelAccessEntry> ParcelAccessList { 460 public List<LandAccessEntry> ParcelAccessList {
454 get { 461 get {
455 return _parcelAccessList; 462 return _parcelAccessList;
456 } 463 }
@@ -638,12 +645,12 @@ namespace OpenSim.Framework
638 landData._simwidePrims = _simwidePrims; 645 landData._simwidePrims = _simwidePrims;
639 646
640 landData._parcelAccessList.Clear(); 647 landData._parcelAccessList.Clear();
641 foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList) 648 foreach (LandAccessEntry entry in _parcelAccessList)
642 { 649 {
643 ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry(); 650 LandAccessEntry newEntry = new LandAccessEntry();
644 newEntry.AgentID = entry.AgentID; 651 newEntry.AgentID = entry.AgentID;
645 newEntry.Flags = entry.Flags; 652 newEntry.Flags = entry.Flags;
646 newEntry.Time = entry.Time; 653 newEntry.Expires = entry.Expires;
647 654
648 landData._parcelAccessList.Add(newEntry); 655 landData._parcelAccessList.Add(newEntry);
649 } 656 }
@@ -668,4 +675,4 @@ namespace OpenSim.Framework
668 return land; 675 return land;
669 } 676 }
670 } 677 }
671} \ No newline at end of file 678}
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
index fc0387b..c61b9e8 100644
--- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Framework.Serialization.External
90 landData.MusicURL = xtr.ReadElementString("MusicURL"); 90 landData.MusicURL = xtr.ReadElementString("MusicURL");
91 landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID")); 91 landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID"));
92 92
93 landData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 93 landData.ParcelAccessList = new List<LandAccessEntry>();
94 xtr.Read(); 94 xtr.Read();
95 if (xtr.Name != "ParcelAccessList") 95 if (xtr.Name != "ParcelAccessList")
96 throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name)); 96 throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name));
@@ -99,11 +99,13 @@ namespace OpenSim.Framework.Serialization.External
99 { 99 {
100 while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) 100 while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
101 { 101 {
102 ParcelManager.ParcelAccessEntry pae = new ParcelManager.ParcelAccessEntry(); 102 LandAccessEntry pae = new LandAccessEntry();
103 103
104 xtr.ReadStartElement("ParcelAccessEntry"); 104 xtr.ReadStartElement("ParcelAccessEntry");
105 pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID")); 105 pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID"));
106 pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); 106 // We really don't care about temp vs perm here and this
107 // would break on old oars. Assume all bans are perm
108 pae.Expires = 0; // Convert.ToUint( xtr.ReadElementString("Time"));
107 pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); 109 pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList"));
108 xtr.ReadEndElement(); 110 xtr.ReadEndElement();
109 111
@@ -162,11 +164,11 @@ namespace OpenSim.Framework.Serialization.External
162 xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); 164 xtw.WriteElementString("OwnerID", landData.OwnerID.ToString());
163 165
164 xtw.WriteStartElement("ParcelAccessList"); 166 xtw.WriteStartElement("ParcelAccessList");
165 foreach (ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList) 167 foreach (LandAccessEntry pal in landData.ParcelAccessList)
166 { 168 {
167 xtw.WriteStartElement("ParcelAccessEntry"); 169 xtw.WriteStartElement("ParcelAccessEntry");
168 xtw.WriteElementString("AgentID", pal.AgentID.ToString()); 170 xtw.WriteElementString("AgentID", pal.AgentID.ToString());
169 xtw.WriteElementString("Time", pal.Time.ToString("s")); 171 xtw.WriteElementString("Time", pal.Expires.ToString());
170 xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags)); 172 xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags));
171 xtw.WriteEndElement(); 173 xtw.WriteEndElement();
172 } 174 }
diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
index c69c89d..3607ce8 100644
--- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
+++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Framework.Serialization.Tests
42 private LandData landWithParcelAccessList; 42 private LandData landWithParcelAccessList;
43 43
44 private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; 44 private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
45 private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>2009-10-01T00:00:00</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>2010-10-20T00:00:00</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; 45 private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
46 46
47 [SetUp] 47 [SetUp]
48 public void setup() 48 public void setup()
@@ -73,16 +73,16 @@ namespace OpenSim.Framework.Serialization.Tests
73 this.landWithParcelAccessList = this.land.Copy(); 73 this.landWithParcelAccessList = this.land.Copy();
74 this.landWithParcelAccessList.ParcelAccessList.Clear(); 74 this.landWithParcelAccessList.ParcelAccessList.Clear();
75 75
76 ParcelManager.ParcelAccessEntry pae0 = new ParcelManager.ParcelAccessEntry(); 76 LandAccessEntry pae0 = new LandAccessEntry();
77 pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c"); 77 pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c");
78 pae0.Flags = AccessList.Ban; 78 pae0.Flags = AccessList.Ban;
79 pae0.Time = new DateTime(2009, 10, 01); 79 pae0.Expires = 0;
80 this.landWithParcelAccessList.ParcelAccessList.Add(pae0); 80 this.landWithParcelAccessList.ParcelAccessList.Add(pae0);
81 81
82 ParcelManager.ParcelAccessEntry pae1 = new ParcelManager.ParcelAccessEntry(); 82 LandAccessEntry pae1 = new LandAccessEntry();
83 pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e"); 83 pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e");
84 pae1.Flags = AccessList.Access; 84 pae1.Flags = AccessList.Access;
85 pae1.Time = new DateTime(2010, 10, 20); 85 pae1.Expires = 0;
86 this.landWithParcelAccessList.ParcelAccessList.Add(pae1); 86 this.landWithParcelAccessList.ParcelAccessList.Add(pae1);
87 } 87 }
88 88
@@ -128,4 +128,4 @@ namespace OpenSim.Framework.Serialization.Tests
128 "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)"); 128 "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)");
129 } 129 }
130 } 130 }
131} \ No newline at end of file 131}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d126f5f..8c0a7e9 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -4684,7 +4684,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4684 } 4684 }
4685 } 4685 }
4686 4686
4687 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 4687 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
4688 { 4688 {
4689 ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply); 4689 ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply);
4690 replyPacket.Data.AgentID = AgentId; 4690 replyPacket.Data.AgentID = AgentId;
@@ -4693,12 +4693,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4693 replyPacket.Data.SequenceID = 0; 4693 replyPacket.Data.SequenceID = 0;
4694 4694
4695 List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>(); 4695 List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>();
4696 foreach (UUID avatar in avatars) 4696 foreach (LandAccessEntry entry in accessList)
4697 { 4697 {
4698 ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock(); 4698 ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock();
4699 block.Flags = accessFlag; 4699 block.Flags = accessFlag;
4700 block.ID = avatar; 4700 block.ID = entry.AgentID;
4701 block.Time = 0; 4701 block.Time = entry.Expires;
4702 list.Add(block); 4702 list.Add(block);
4703 } 4703 }
4704 4704
@@ -8641,13 +8641,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8641 } 8641 }
8642 #endregion 8642 #endregion
8643 8643
8644 List<ParcelManager.ParcelAccessEntry> entries = new List<ParcelManager.ParcelAccessEntry>(); 8644 List<LandAccessEntry> entries = new List<LandAccessEntry>();
8645 foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) 8645 foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List)
8646 { 8646 {
8647 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 8647 LandAccessEntry entry = new LandAccessEntry();
8648 entry.AgentID = block.ID; 8648 entry.AgentID = block.ID;
8649 entry.Flags = (AccessList)block.Flags; 8649 entry.Flags = (AccessList)block.Flags;
8650 entry.Time = Util.ToDateTime(block.Time); 8650 entry.Expires = block.Time;
8651 entries.Add(entry); 8651 entries.Add(entry);
8652 } 8652 }
8653 8653
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 5db56b0..0f83d82 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -508,7 +508,7 @@ namespace OpenSim.Region.CoreModules.World.Land
508 508
509 public void ClientOnParcelAccessListUpdateRequest(UUID agentID, 509 public void ClientOnParcelAccessListUpdateRequest(UUID agentID,
510 uint flags, int landLocalID, UUID transactionID, int sequenceID, 510 uint flags, int landLocalID, UUID transactionID, int sequenceID,
511 int sections, List<ParcelManager.ParcelAccessEntry> entries, 511 int sections, List<LandAccessEntry> entries,
512 IClientAPI remote_client) 512 IClientAPI remote_client)
513 { 513 {
514 // Flags is the list to update, it can mean either the ban or 514 // Flags is the list to update, it can mean either the ban or
@@ -1777,10 +1777,10 @@ namespace OpenSim.Region.CoreModules.World.Land
1777 1777
1778 if ((flags & 1) != 0) // Ban TODO: Remove magic number 1778 if ((flags & 1) != 0) // Ban TODO: Remove magic number
1779 { 1779 {
1780 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 1780 LandAccessEntry entry = new LandAccessEntry();
1781 entry.AgentID = targetAvatar.UUID; 1781 entry.AgentID = targetAvatar.UUID;
1782 entry.Flags = AccessList.Ban; 1782 entry.Flags = AccessList.Ban;
1783 entry.Time = new DateTime(); 1783 entry.Expires = 0; // Perm
1784 1784
1785 land.LandData.ParcelAccessList.Add(entry); 1785 land.LandData.ParcelAccessList.Add(entry);
1786 } 1786 }
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 07b28c7..debf6d2 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -467,21 +467,26 @@ namespace OpenSim.Region.CoreModules.World.Land
467 467
468 public bool IsBannedFromLand(UUID avatar) 468 public bool IsBannedFromLand(UUID avatar)
469 { 469 {
470 ExpireAccessList();
471
470 if (m_scene.Permissions.IsAdministrator(avatar)) 472 if (m_scene.Permissions.IsAdministrator(avatar))
471 return false; 473 return false;
472 474
473 if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar)) 475 if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
474 return false; 476 return false;
475 477
478 if (avatar == LandData.OwnerID)
479 return false;
480
476 if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) 481 if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0)
477 { 482 {
478 if (LandData.ParcelAccessList.FindIndex( 483 if (LandData.ParcelAccessList.FindIndex(
479 delegate(ParcelManager.ParcelAccessEntry e) 484 delegate(LandAccessEntry e)
480 { 485 {
481 if (e.AgentID == avatar && e.Flags == AccessList.Ban) 486 if (e.AgentID == avatar && e.Flags == AccessList.Ban)
482 return true; 487 return true;
483 return false; 488 return false;
484 }) != -1 && LandData.OwnerID != avatar) 489 }) != -1)
485 { 490 {
486 return true; 491 return true;
487 } 492 }
@@ -491,21 +496,26 @@ namespace OpenSim.Region.CoreModules.World.Land
491 496
492 public bool IsRestrictedFromLand(UUID avatar) 497 public bool IsRestrictedFromLand(UUID avatar)
493 { 498 {
499 ExpireAccessList();
500
494 if (m_scene.Permissions.IsAdministrator(avatar)) 501 if (m_scene.Permissions.IsAdministrator(avatar))
495 return false; 502 return false;
496 503
497 if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar)) 504 if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
498 return false; 505 return false;
499 506
507 if (avatar == LandData.OwnerID)
508 return false;
509
500 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) 510 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
501 { 511 {
502 if (LandData.ParcelAccessList.FindIndex( 512 if (LandData.ParcelAccessList.FindIndex(
503 delegate(ParcelManager.ParcelAccessEntry e) 513 delegate(LandAccessEntry e)
504 { 514 {
505 if (e.AgentID == avatar && e.Flags == AccessList.Access) 515 if (e.AgentID == avatar && e.Flags == AccessList.Access)
506 return true; 516 return true;
507 return false; 517 return false;
508 }) == -1 && LandData.OwnerID != avatar) 518 }) == -1)
509 { 519 {
510 if (!HasGroupAccess(avatar)) 520 if (!HasGroupAccess(avatar))
511 { 521 {
@@ -570,19 +580,24 @@ namespace OpenSim.Region.CoreModules.World.Land
570 580
571 #region AccessList Functions 581 #region AccessList Functions
572 582
573 public List<UUID> CreateAccessListArrayByFlag(AccessList flag) 583 public List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag)
574 { 584 {
575 List<UUID> list = new List<UUID>(); 585 ExpireAccessList();
576 foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList) 586
587 List<LandAccessEntry> list = new List<LandAccessEntry>();
588 foreach (LandAccessEntry entry in LandData.ParcelAccessList)
577 { 589 {
578 if (entry.Flags == flag) 590 if (entry.Flags == flag)
579 { 591 list.Add(entry);
580 list.Add(entry.AgentID);
581 }
582 } 592 }
583 if (list.Count == 0) 593 if (list.Count == 0)
584 { 594 {
585 list.Add(UUID.Zero); 595 LandAccessEntry e = new LandAccessEntry();
596 e.AgentID = UUID.Zero;
597 e.Flags = 0;
598 e.Expires = 0;
599
600 list.Add(e);
586 } 601 }
587 602
588 return list; 603 return list;
@@ -594,20 +609,20 @@ namespace OpenSim.Region.CoreModules.World.Land
594 609
595 if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) 610 if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both)
596 { 611 {
597 List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Access); 612 List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Access);
598 remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,LandData.LocalID); 613 remote_client.SendLandAccessListData(accessEntries,(uint) AccessList.Access,LandData.LocalID);
599 } 614 }
600 615
601 if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) 616 if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both)
602 { 617 {
603 List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Ban); 618 List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Ban);
604 remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, LandData.LocalID); 619 remote_client.SendLandAccessListData(accessEntries, (uint)AccessList.Ban, LandData.LocalID);
605 } 620 }
606 } 621 }
607 622
608 public void UpdateAccessList(uint flags, UUID transactionID, 623 public void UpdateAccessList(uint flags, UUID transactionID,
609 int sequenceID, int sections, 624 int sequenceID, int sections,
610 List<ParcelManager.ParcelAccessEntry> entries, 625 List<LandAccessEntry> entries,
611 IClientAPI remote_client) 626 IClientAPI remote_client)
612 { 627 {
613 LandData newData = LandData.Copy(); 628 LandData newData = LandData.Copy();
@@ -617,16 +632,16 @@ namespace OpenSim.Region.CoreModules.World.Land
617 { 632 {
618 m_listTransactions[flags] = transactionID; 633 m_listTransactions[flags] = transactionID;
619 634
620 List<ParcelManager.ParcelAccessEntry> toRemove = 635 List<LandAccessEntry> toRemove =
621 new List<ParcelManager.ParcelAccessEntry>(); 636 new List<LandAccessEntry>();
622 637
623 foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) 638 foreach (LandAccessEntry entry in newData.ParcelAccessList)
624 { 639 {
625 if (entry.Flags == (AccessList)flags) 640 if (entry.Flags == (AccessList)flags)
626 toRemove.Add(entry); 641 toRemove.Add(entry);
627 } 642 }
628 643
629 foreach (ParcelManager.ParcelAccessEntry entry in toRemove) 644 foreach (LandAccessEntry entry in toRemove)
630 { 645 {
631 newData.ParcelAccessList.Remove(entry); 646 newData.ParcelAccessList.Remove(entry);
632 } 647 }
@@ -641,13 +656,13 @@ namespace OpenSim.Region.CoreModules.World.Land
641 } 656 }
642 } 657 }
643 658
644 foreach (ParcelManager.ParcelAccessEntry entry in entries) 659 foreach (LandAccessEntry entry in entries)
645 { 660 {
646 ParcelManager.ParcelAccessEntry temp = 661 LandAccessEntry temp =
647 new ParcelManager.ParcelAccessEntry(); 662 new LandAccessEntry();
648 663
649 temp.AgentID = entry.AgentID; 664 temp.AgentID = entry.AgentID;
650 temp.Time = entry.Time; 665 temp.Expires = entry.Expires;
651 temp.Flags = (AccessList)flags; 666 temp.Flags = (AccessList)flags;
652 667
653 newData.ParcelAccessList.Add(temp); 668 newData.ParcelAccessList.Add(temp);
@@ -1164,5 +1179,20 @@ namespace OpenSim.Region.CoreModules.World.Land
1164 } 1179 }
1165 1180
1166 #endregion 1181 #endregion
1182
1183 private void ExpireAccessList()
1184 {
1185 List<LandAccessEntry> delete = new List<LandAccessEntry>();
1186
1187 foreach (LandAccessEntry entry in LandData.ParcelAccessList)
1188 {
1189 if (entry.Expires != 0 && entry.Expires < Util.UnixTimeSinceEpoch())
1190 delete.Add(entry);
1191 }
1192 foreach (LandAccessEntry entry in delete)
1193 LandData.ParcelAccessList.Remove(entry);
1194
1195 m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);
1196 }
1167 } 1197 }
1168} 1198}
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index d4d0ad7..8fe3199 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1260,7 +1260,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1260 1260
1261 } 1261 }
1262 1262
1263 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 1263 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
1264 { 1264 {
1265 1265
1266 } 1266 }
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 17fd6b1..7f5372c 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -944,7 +944,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
944 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 944 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
945 { 945 {
946 } 946 }
947 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 947 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
948 { 948 {
949 } 949 }
950 public void SendForceClientSelectObjects(List<uint> objectIDs) 950 public void SendForceClientSelectObjects(List<uint> objectIDs)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 3e9529f..b0b1b16 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6101,16 +6101,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6101 public void llEjectFromLand(string pest) 6101 public void llEjectFromLand(string pest)
6102 { 6102 {
6103 m_host.AddScriptLPS(1); 6103 m_host.AddScriptLPS(1);
6104 UUID agentId = new UUID(); 6104 UUID agentID = new UUID();
6105 if (UUID.TryParse(pest, out agentId)) 6105 if (UUID.TryParse(pest, out agentID))
6106 { 6106 {
6107 ScenePresence presence = World.GetScenePresence(agentId); 6107 ScenePresence presence = World.GetScenePresence(agentID);
6108 if (presence != null) 6108 if (presence != null)
6109 { 6109 {
6110 // agent must be over the owners land 6110 // agent must be over the owners land
6111 if (m_host.OwnerID == World.LandChannel.GetLandObject( 6111 ILandObject land = World.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
6112 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 6112 if (land == null)
6113 World.TeleportClientHome(agentId, presence.ControllingClient); 6113 return;
6114
6115 if (m_host.OwnerID == land.LandData.OwnerID)
6116 {
6117 Vector3 pos = World.GetNearestAllowedPosition(presence, land);
6118 presence.TeleportWithMomentum(pos);
6119 presence.ControllingClient.SendAlertMessage("You have been ejected from this land");
6120 }
6114 } 6121 }
6115 } 6122 }
6116 ScriptSleep(5000); 6123 ScriptSleep(5000);
@@ -6804,24 +6811,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6804 m_host.AddScriptLPS(1); 6811 m_host.AddScriptLPS(1);
6805 UUID key; 6812 UUID key;
6806 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 6813 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
6807 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) 6814 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
6808 { 6815 {
6809 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 6816 int expires = 0;
6817 if (hours != 0)
6818 expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * hours);
6819
6810 if (UUID.TryParse(avatar, out key)) 6820 if (UUID.TryParse(avatar, out key))
6811 { 6821 {
6812 if (land.LandData.ParcelAccessList.FindIndex( 6822 int idx = land.LandData.ParcelAccessList.FindIndex(
6813 delegate(ParcelManager.ParcelAccessEntry e) 6823 delegate(LandAccessEntry e)
6814 { 6824 {
6815 if (e.AgentID == key && e.Flags == AccessList.Access) 6825 if (e.AgentID == key && e.Flags == AccessList.Access)
6816 return true; 6826 return true;
6817 return false; 6827 return false;
6818 }) == -1) 6828 });
6819 { 6829
6820 entry.AgentID = key; 6830 if (idx != -1 && (land.LandData.ParcelAccessList[idx].Expires == 0 || (expires != 0 && expires < land.LandData.ParcelAccessList[idx].Expires)))
6821 entry.Flags = AccessList.Access; 6831 return;
6822 entry.Time = DateTime.Now.AddHours(hours); 6832
6823 land.LandData.ParcelAccessList.Add(entry); 6833 if (idx != -1)
6824 } 6834 land.LandData.ParcelAccessList.RemoveAt(idx);
6835
6836 LandAccessEntry entry = new LandAccessEntry();
6837
6838 entry.AgentID = key;
6839 entry.Flags = AccessList.Access;
6840 entry.Expires = expires;
6841
6842 land.LandData.ParcelAccessList.Add(entry);
6843
6844 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
6825 } 6845 }
6826 } 6846 }
6827 ScriptSleep(100); 6847 ScriptSleep(100);
@@ -10242,22 +10262,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10242 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 10262 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
10243 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) 10263 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
10244 { 10264 {
10245 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 10265 int expires = 0;
10266 if (hours != 0)
10267 expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * hours);
10268
10246 if (UUID.TryParse(avatar, out key)) 10269 if (UUID.TryParse(avatar, out key))
10247 { 10270 {
10248 if (land.LandData.ParcelAccessList.FindIndex( 10271 int idx = land.LandData.ParcelAccessList.FindIndex(
10249 delegate(ParcelManager.ParcelAccessEntry e) 10272 delegate(LandAccessEntry e)
10250 { 10273 {
10251 if (e.AgentID == key && e.Flags == AccessList.Ban) 10274 if (e.AgentID == key && e.Flags == AccessList.Ban)
10252 return true; 10275 return true;
10253 return false; 10276 return false;
10254 }) == -1) 10277 });
10255 { 10278
10256 entry.AgentID = key; 10279 if (idx != -1 && (land.LandData.ParcelAccessList[idx].Expires == 0 || (expires != 0 && expires < land.LandData.ParcelAccessList[idx].Expires)))
10257 entry.Flags = AccessList.Ban; 10280 return;
10258 entry.Time = DateTime.Now.AddHours(hours); 10281
10259 land.LandData.ParcelAccessList.Add(entry); 10282 if (idx != -1)
10260 } 10283 land.LandData.ParcelAccessList.RemoveAt(idx);
10284
10285 LandAccessEntry entry = new LandAccessEntry();
10286
10287 entry.AgentID = key;
10288 entry.Flags = AccessList.Ban;
10289 entry.Expires = expires;
10290
10291 land.LandData.ParcelAccessList.Add(entry);
10292
10293 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
10261 } 10294 }
10262 } 10295 }
10263 ScriptSleep(100); 10296 ScriptSleep(100);
@@ -10273,7 +10306,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10273 if (UUID.TryParse(avatar, out key)) 10306 if (UUID.TryParse(avatar, out key))
10274 { 10307 {
10275 int idx = land.LandData.ParcelAccessList.FindIndex( 10308 int idx = land.LandData.ParcelAccessList.FindIndex(
10276 delegate(ParcelManager.ParcelAccessEntry e) 10309 delegate(LandAccessEntry e)
10277 { 10310 {
10278 if (e.AgentID == key && e.Flags == AccessList.Access) 10311 if (e.AgentID == key && e.Flags == AccessList.Access)
10279 return true; 10312 return true;
@@ -10281,7 +10314,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10281 }); 10314 });
10282 10315
10283 if (idx != -1) 10316 if (idx != -1)
10317 {
10284 land.LandData.ParcelAccessList.RemoveAt(idx); 10318 land.LandData.ParcelAccessList.RemoveAt(idx);
10319 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
10320 }
10285 } 10321 }
10286 } 10322 }
10287 ScriptSleep(100); 10323 ScriptSleep(100);
@@ -10297,7 +10333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10297 if (UUID.TryParse(avatar, out key)) 10333 if (UUID.TryParse(avatar, out key))
10298 { 10334 {
10299 int idx = land.LandData.ParcelAccessList.FindIndex( 10335 int idx = land.LandData.ParcelAccessList.FindIndex(
10300 delegate(ParcelManager.ParcelAccessEntry e) 10336 delegate(LandAccessEntry e)
10301 { 10337 {
10302 if (e.AgentID == key && e.Flags == AccessList.Ban) 10338 if (e.AgentID == key && e.Flags == AccessList.Ban)
10303 return true; 10339 return true;
@@ -10305,7 +10341,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10305 }); 10341 });
10306 10342
10307 if (idx != -1) 10343 if (idx != -1)
10344 {
10308 land.LandData.ParcelAccessList.RemoveAt(idx); 10345 land.LandData.ParcelAccessList.RemoveAt(idx);
10346 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
10347 }
10309 } 10348 }
10310 } 10349 }
10311 ScriptSleep(100); 10350 ScriptSleep(100);
@@ -10625,7 +10664,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10625 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 10664 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
10626 if (land.OwnerID == m_host.OwnerID) 10665 if (land.OwnerID == m_host.OwnerID)
10627 { 10666 {
10628 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 10667 foreach (LandAccessEntry entry in land.ParcelAccessList)
10629 { 10668 {
10630 if (entry.Flags == AccessList.Ban) 10669 if (entry.Flags == AccessList.Ban)
10631 { 10670 {
@@ -10642,7 +10681,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10642 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 10681 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
10643 if (land.OwnerID == m_host.OwnerID) 10682 if (land.OwnerID == m_host.OwnerID)
10644 { 10683 {
10645 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 10684 foreach (LandAccessEntry entry in land.ParcelAccessList)
10646 { 10685 {
10647 if (entry.Flags == AccessList.Access) 10686 if (entry.Flags == AccessList.Access)
10648 { 10687 {
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index b06bff6..c32dbf5 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -985,7 +985,7 @@ namespace OpenSim.Tests.Common.Mock
985 { 985 {
986 } 986 }
987 987
988 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 988 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
989 { 989 {
990 } 990 }
991 991