aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
-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.cs13
-rw-r--r--OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs12
-rw-r--r--OpenSim/Framework/TaskInventoryItem.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs14
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs84
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs5
-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.cs99
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs5
-rw-r--r--OpenSim/Server/Handlers/Authentication/OpenIdServerConnector.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
-rw-r--r--OpenSim/Tests/Torture/ObjectTortureTests.cs51
23 files changed, 271 insertions, 138 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();
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 1326fe9..dd3e656 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(
@@ -1251,7 +1251,7 @@ namespace OpenSim.Framework
1251 float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, 1251 float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity,
1252 uint regionFlags); 1252 uint regionFlags);
1253 1253
1254 void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID); 1254 void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID);
1255 void SendForceClientSelectObjects(List<uint> objectIDs); 1255 void SendForceClientSelectObjects(List<uint> objectIDs);
1256 void SendCameraConstraint(Vector4 ConstraintPlane); 1256 void SendCameraConstraint(Vector4 ConstraintPlane);
1257 void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount); 1257 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 c107143..58a80ef 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..3ae9a8e 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,14 @@ 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 xtr.ReadElementString("Time");
109 pae.Expires = 0; // Convert.ToUint( xtr.ReadElementString("Time"));
107 pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); 110 pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList"));
108 xtr.ReadEndElement(); 111 xtr.ReadEndElement();
109 112
@@ -162,11 +165,11 @@ namespace OpenSim.Framework.Serialization.External
162 xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); 165 xtw.WriteElementString("OwnerID", landData.OwnerID.ToString());
163 166
164 xtw.WriteStartElement("ParcelAccessList"); 167 xtw.WriteStartElement("ParcelAccessList");
165 foreach (ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList) 168 foreach (LandAccessEntry pal in landData.ParcelAccessList)
166 { 169 {
167 xtw.WriteStartElement("ParcelAccessEntry"); 170 xtw.WriteStartElement("ParcelAccessEntry");
168 xtw.WriteElementString("AgentID", pal.AgentID.ToString()); 171 xtw.WriteElementString("AgentID", pal.AgentID.ToString());
169 xtw.WriteElementString("Time", pal.Time.ToString("s")); 172 xtw.WriteElementString("Time", pal.Expires.ToString());
170 xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags)); 173 xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags));
171 xtw.WriteEndElement(); 174 xtw.WriteEndElement();
172 } 175 }
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/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs
index ba2a306..d4bbbfb 100644
--- a/OpenSim/Framework/TaskInventoryItem.cs
+++ b/OpenSim/Framework/TaskInventoryItem.cs
@@ -65,6 +65,7 @@ namespace OpenSim.Framework
65 private int _permsMask; 65 private int _permsMask;
66 private int _type = 0; 66 private int _type = 0;
67 private UUID _oldID; 67 private UUID _oldID;
68 private UUID _loadedID = UUID.Zero;
68 69
69 private bool _ownerChanged = false; 70 private bool _ownerChanged = false;
70 71
@@ -231,6 +232,15 @@ namespace OpenSim.Framework
231 } 232 }
232 } 233 }
233 234
235 public UUID LoadedItemID {
236 get {
237 return _loadedID;
238 }
239 set {
240 _loadedID = value;
241 }
242 }
243
234 public UUID LastOwnerID { 244 public UUID LastOwnerID {
235 get { 245 get {
236 return _lastOwnerID; 246 return _lastOwnerID;
@@ -347,6 +357,7 @@ namespace OpenSim.Framework
347 /// <param name="partID">The new part ID to which this item belongs</param> 357 /// <param name="partID">The new part ID to which this item belongs</param>
348 public void ResetIDs(UUID partID) 358 public void ResetIDs(UUID partID)
349 { 359 {
360 LoadedItemID = OldItemID;
350 OldItemID = ItemID; 361 OldItemID = ItemID;
351 ItemID = UUID.Random(); 362 ItemID = UUID.Random();
352 ParentPartID = partID; 363 ParentPartID = partID;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index a7bf06d..cdd4957 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -4623,7 +4623,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4623 } 4623 }
4624 } 4624 }
4625 4625
4626 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 4626 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
4627 { 4627 {
4628 ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply); 4628 ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply);
4629 replyPacket.Data.AgentID = AgentId; 4629 replyPacket.Data.AgentID = AgentId;
@@ -4632,12 +4632,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4632 replyPacket.Data.SequenceID = 0; 4632 replyPacket.Data.SequenceID = 0;
4633 4633
4634 List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>(); 4634 List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>();
4635 foreach (UUID avatar in avatars) 4635 foreach (LandAccessEntry entry in accessList)
4636 { 4636 {
4637 ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock(); 4637 ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock();
4638 block.Flags = accessFlag; 4638 block.Flags = accessFlag;
4639 block.ID = avatar; 4639 block.ID = entry.AgentID;
4640 block.Time = 0; 4640 block.Time = entry.Expires;
4641 list.Add(block); 4641 list.Add(block);
4642 } 4642 }
4643 4643
@@ -8577,13 +8577,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8577 } 8577 }
8578 #endregion 8578 #endregion
8579 8579
8580 List<ParcelManager.ParcelAccessEntry> entries = new List<ParcelManager.ParcelAccessEntry>(); 8580 List<LandAccessEntry> entries = new List<LandAccessEntry>();
8581 foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) 8581 foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List)
8582 { 8582 {
8583 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 8583 LandAccessEntry entry = new LandAccessEntry();
8584 entry.AgentID = block.ID; 8584 entry.AgentID = block.ID;
8585 entry.Flags = (AccessList)block.Flags; 8585 entry.Flags = (AccessList)block.Flags;
8586 entry.Time = Util.ToDateTime(block.Time); 8586 entry.Expires = block.Time;
8587 entries.Add(entry); 8587 entries.Add(entry);
8588 } 8588 }
8589 8589
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 94bba83..1c503aa 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -550,7 +550,7 @@ namespace OpenSim.Region.CoreModules.World.Land
550 550
551 public void ClientOnParcelAccessListUpdateRequest(UUID agentID, 551 public void ClientOnParcelAccessListUpdateRequest(UUID agentID,
552 uint flags, int landLocalID, UUID transactionID, int sequenceID, 552 uint flags, int landLocalID, UUID transactionID, int sequenceID,
553 int sections, List<ParcelManager.ParcelAccessEntry> entries, 553 int sections, List<LandAccessEntry> entries,
554 IClientAPI remote_client) 554 IClientAPI remote_client)
555 { 555 {
556 // Flags is the list to update, it can mean either the ban or 556 // Flags is the list to update, it can mean either the ban or
@@ -1712,4 +1712,4 @@ namespace OpenSim.Region.CoreModules.World.Land
1712 MainConsole.Instance.Output(report.ToString()); 1712 MainConsole.Instance.Output(report.ToString());
1713 } 1713 }
1714 } 1714 }
1715} \ No newline at end of file 1715}
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 79b13c3..3b4336f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -418,13 +418,21 @@ namespace OpenSim.Region.CoreModules.World.Land
418 418
419 public bool IsBannedFromLand(UUID avatar) 419 public bool IsBannedFromLand(UUID avatar)
420 { 420 {
421 if (m_scene.Permissions.CanEditParcelProperties(avatar, this, 0)) 421 ExpireAccessList();
422
423 if (m_scene.Permissions.IsAdministrator(avatar))
424 return false;
425
426 if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
427 return false;
428
429 if (avatar == LandData.OwnerID)
422 return false; 430 return false;
423 431
424 if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) 432 if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0)
425 { 433 {
426 if (LandData.ParcelAccessList.FindIndex( 434 if (LandData.ParcelAccessList.FindIndex(
427 delegate(ParcelManager.ParcelAccessEntry e) 435 delegate(LandAccessEntry e)
428 { 436 {
429 if (e.AgentID == avatar && e.Flags == AccessList.Ban) 437 if (e.AgentID == avatar && e.Flags == AccessList.Ban)
430 return true; 438 return true;
@@ -439,13 +447,21 @@ namespace OpenSim.Region.CoreModules.World.Land
439 447
440 public bool IsRestrictedFromLand(UUID avatar) 448 public bool IsRestrictedFromLand(UUID avatar)
441 { 449 {
442 if (m_scene.Permissions.CanEditParcelProperties(avatar, this, 0)) 450 ExpireAccessList();
451
452 if (m_scene.Permissions.IsAdministrator(avatar))
453 return false;
454
455 if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
456 return false;
457
458 if (avatar == LandData.OwnerID)
443 return false; 459 return false;
444 460
445 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) 461 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
446 { 462 {
447 if (LandData.ParcelAccessList.FindIndex( 463 if (LandData.ParcelAccessList.FindIndex(
448 delegate(ParcelManager.ParcelAccessEntry e) 464 delegate(LandAccessEntry e)
449 { 465 {
450 if (e.AgentID == avatar && e.Flags == AccessList.Access) 466 if (e.AgentID == avatar && e.Flags == AccessList.Access)
451 return true; 467 return true;
@@ -511,19 +527,24 @@ namespace OpenSim.Region.CoreModules.World.Land
511 527
512 #region AccessList Functions 528 #region AccessList Functions
513 529
514 public List<UUID> CreateAccessListArrayByFlag(AccessList flag) 530 public List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag)
515 { 531 {
516 List<UUID> list = new List<UUID>(); 532 ExpireAccessList();
517 foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList) 533
534 List<LandAccessEntry> list = new List<LandAccessEntry>();
535 foreach (LandAccessEntry entry in LandData.ParcelAccessList)
518 { 536 {
519 if (entry.Flags == flag) 537 if (entry.Flags == flag)
520 { 538 list.Add(entry);
521 list.Add(entry.AgentID);
522 }
523 } 539 }
524 if (list.Count == 0) 540 if (list.Count == 0)
525 { 541 {
526 list.Add(UUID.Zero); 542 LandAccessEntry e = new LandAccessEntry();
543 e.AgentID = UUID.Zero;
544 e.Flags = 0;
545 e.Expires = 0;
546
547 list.Add(e);
527 } 548 }
528 549
529 return list; 550 return list;
@@ -535,20 +556,20 @@ namespace OpenSim.Region.CoreModules.World.Land
535 556
536 if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) 557 if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both)
537 { 558 {
538 List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Access); 559 List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Access);
539 remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,LandData.LocalID); 560 remote_client.SendLandAccessListData(accessEntries,(uint) AccessList.Access,LandData.LocalID);
540 } 561 }
541 562
542 if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) 563 if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both)
543 { 564 {
544 List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Ban); 565 List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Ban);
545 remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, LandData.LocalID); 566 remote_client.SendLandAccessListData(accessEntries, (uint)AccessList.Ban, LandData.LocalID);
546 } 567 }
547 } 568 }
548 569
549 public void UpdateAccessList(uint flags, UUID transactionID, 570 public void UpdateAccessList(uint flags, UUID transactionID,
550 int sequenceID, int sections, 571 int sequenceID, int sections,
551 List<ParcelManager.ParcelAccessEntry> entries, 572 List<LandAccessEntry> entries,
552 IClientAPI remote_client) 573 IClientAPI remote_client)
553 { 574 {
554 LandData newData = LandData.Copy(); 575 LandData newData = LandData.Copy();
@@ -558,16 +579,16 @@ namespace OpenSim.Region.CoreModules.World.Land
558 { 579 {
559 m_listTransactions[flags] = transactionID; 580 m_listTransactions[flags] = transactionID;
560 581
561 List<ParcelManager.ParcelAccessEntry> toRemove = 582 List<LandAccessEntry> toRemove =
562 new List<ParcelManager.ParcelAccessEntry>(); 583 new List<LandAccessEntry>();
563 584
564 foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) 585 foreach (LandAccessEntry entry in newData.ParcelAccessList)
565 { 586 {
566 if (entry.Flags == (AccessList)flags) 587 if (entry.Flags == (AccessList)flags)
567 toRemove.Add(entry); 588 toRemove.Add(entry);
568 } 589 }
569 590
570 foreach (ParcelManager.ParcelAccessEntry entry in toRemove) 591 foreach (LandAccessEntry entry in toRemove)
571 { 592 {
572 newData.ParcelAccessList.Remove(entry); 593 newData.ParcelAccessList.Remove(entry);
573 } 594 }
@@ -582,13 +603,13 @@ namespace OpenSim.Region.CoreModules.World.Land
582 } 603 }
583 } 604 }
584 605
585 foreach (ParcelManager.ParcelAccessEntry entry in entries) 606 foreach (LandAccessEntry entry in entries)
586 { 607 {
587 ParcelManager.ParcelAccessEntry temp = 608 LandAccessEntry temp =
588 new ParcelManager.ParcelAccessEntry(); 609 new LandAccessEntry();
589 610
590 temp.AgentID = entry.AgentID; 611 temp.AgentID = entry.AgentID;
591 temp.Time = entry.Time; 612 temp.Expires = entry.Expires;
592 temp.Flags = (AccessList)flags; 613 temp.Flags = (AccessList)flags;
593 614
594 newData.ParcelAccessList.Add(temp); 615 newData.ParcelAccessList.Add(temp);
@@ -1105,5 +1126,20 @@ namespace OpenSim.Region.CoreModules.World.Land
1105 } 1126 }
1106 1127
1107 #endregion 1128 #endregion
1129
1130 private void ExpireAccessList()
1131 {
1132 List<LandAccessEntry> delete = new List<LandAccessEntry>();
1133
1134 foreach (LandAccessEntry entry in LandData.ParcelAccessList)
1135 {
1136 if (entry.Expires != 0 && entry.Expires < Util.UnixTimeSinceEpoch())
1137 delete.Add(entry);
1138 }
1139 foreach (LandAccessEntry entry in delete)
1140 LandData.ParcelAccessList.Remove(entry);
1141
1142 m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);
1143 }
1108 } 1144 }
1109} 1145}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index daddb90..0c36dcd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -307,14 +307,15 @@ namespace OpenSim.Region.Framework.Scenes
307 else 307 else
308 { 308 {
309 if (m_part.ParentGroup.m_savedScriptState != null) 309 if (m_part.ParentGroup.m_savedScriptState != null)
310 RestoreSavedScriptState(item.OldItemID, item.ItemID); 310 item.OldItemID = RestoreSavedScriptState(item.LoadedItemID, item.OldItemID, item.ItemID);
311 311
312 lock (m_items) 312 lock (m_items)
313 { 313 {
314 m_items[item.ItemID].OldItemID = item.OldItemID;
314 m_items[item.ItemID].PermsMask = 0; 315 m_items[item.ItemID].PermsMask = 0;
315 m_items[item.ItemID].PermsGranter = UUID.Zero; 316 m_items[item.ItemID].PermsGranter = UUID.Zero;
316 } 317 }
317 318
318 string script = Utils.BytesToString(asset.Data); 319 string script = Utils.BytesToString(asset.Data);
319 m_part.ParentGroup.Scene.EventManager.TriggerRezScript( 320 m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
320 m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); 321 m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
@@ -324,17 +325,20 @@ namespace OpenSim.Region.Framework.Scenes
324 } 325 }
325 } 326 }
326 327
327 private void RestoreSavedScriptState(UUID oldID, UUID newID) 328 private UUID RestoreSavedScriptState(UUID loadedID, UUID oldID, UUID newID)
328 { 329 {
329 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 330 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
330 if (engines.Length == 0) // No engine at all 331 if (engines.Length == 0) // No engine at all
331 return; 332 return oldID;
332 333
333 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) 334 UUID stateID = oldID;
335 if (!m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID))
336 stateID = loadedID;
337 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(stateID))
334 { 338 {
335 XmlDocument doc = new XmlDocument(); 339 XmlDocument doc = new XmlDocument();
336 340
337 doc.LoadXml(m_part.ParentGroup.m_savedScriptState[oldID]); 341 doc.LoadXml(m_part.ParentGroup.m_savedScriptState[stateID]);
338 342
339 ////////// CRUFT WARNING /////////////////////////////////// 343 ////////// CRUFT WARNING ///////////////////////////////////
340 // 344 //
@@ -351,7 +355,7 @@ namespace OpenSim.Region.Framework.Scenes
351 355
352 XmlElement rootN = newDoc.CreateElement("", "State", ""); 356 XmlElement rootN = newDoc.CreateElement("", "State", "");
353 XmlAttribute uuidA = newDoc.CreateAttribute("", "UUID", ""); 357 XmlAttribute uuidA = newDoc.CreateAttribute("", "UUID", "");
354 uuidA.Value = oldID.ToString(); 358 uuidA.Value = stateID.ToString();
355 rootN.Attributes.Append(uuidA); 359 rootN.Attributes.Append(uuidA);
356 XmlAttribute engineA = newDoc.CreateAttribute("", "Engine", ""); 360 XmlAttribute engineA = newDoc.CreateAttribute("", "Engine", "");
357 engineA.Value = "XEngine"; 361 engineA.Value = "XEngine";
@@ -365,20 +369,22 @@ namespace OpenSim.Region.Framework.Scenes
365 // This created document has only the minimun data 369 // This created document has only the minimun data
366 // necessary for XEngine to parse it successfully 370 // necessary for XEngine to parse it successfully
367 371
368 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; 372 m_part.ParentGroup.m_savedScriptState[stateID] = newDoc.OuterXml;
369 } 373 }
370 374
371 foreach (IScriptModule e in engines) 375 foreach (IScriptModule e in engines)
372 { 376 {
373 if (e != null) 377 if (e != null)
374 { 378 {
375 if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) 379 if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[stateID]))
376 break; 380 break;
377 } 381 }
378 } 382 }
379 383
380 m_part.ParentGroup.m_savedScriptState.Remove(oldID); 384 m_part.ParentGroup.m_savedScriptState.Remove(stateID);
381 } 385 }
386
387 return stateID;
382 } 388 }
383 389
384 /// <summary> 390 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 3a08271..b54fcb7 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -794,10 +794,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
794 794
795 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader) 795 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader)
796 { 796 {
797 Util.ReadUUID(reader, "OldItemID"); 797 item.OldItemID = Util.ReadUUID(reader, "OldItemID");
798 // On deserialization, the old item id MUST BE UUID.Zero!!!!!
799 // Setting this to the saved value will BREAK script persistence!
800 // item.OldItemID = Util.ReadUUID(reader, "OldItemID");
801 } 798 }
802 799
803 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader) 800 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader)
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index bbf3729..11f927c 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1253,7 +1253,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1253 1253
1254 } 1254 }
1255 1255
1256 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 1256 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
1257 { 1257 {
1258 1258
1259 } 1259 }
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 6d40a92..81bf9ed 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -940,7 +940,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
940 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 940 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
941 { 941 {
942 } 942 }
943 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 943 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
944 { 944 {
945 } 945 }
946 public void SendForceClientSelectObjects(List<uint> objectIDs) 946 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 67dee02..0bdd84a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5714,16 +5714,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5714 public void llEjectFromLand(string pest) 5714 public void llEjectFromLand(string pest)
5715 { 5715 {
5716 m_host.AddScriptLPS(1); 5716 m_host.AddScriptLPS(1);
5717 UUID agentId = new UUID(); 5717 UUID agentID = new UUID();
5718 if (UUID.TryParse(pest, out agentId)) 5718 if (UUID.TryParse(pest, out agentID))
5719 { 5719 {
5720 ScenePresence presence = World.GetScenePresence(agentId); 5720 ScenePresence presence = World.GetScenePresence(agentID);
5721 if (presence != null) 5721 if (presence != null)
5722 { 5722 {
5723 // agent must be over the owners land 5723 // agent must be over the owners land
5724 if (m_host.OwnerID == World.LandChannel.GetLandObject( 5724 ILandObject land = World.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
5725 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 5725 if (land == null)
5726 World.TeleportClientHome(agentId, presence.ControllingClient); 5726 return;
5727
5728 if (m_host.OwnerID == land.LandData.OwnerID)
5729 {
5730 World.TeleportClientHome(agentID, presence.ControllingClient);
5731 }
5727 } 5732 }
5728 } 5733 }
5729 ScriptSleep(5000); 5734 ScriptSleep(5000);
@@ -6408,24 +6413,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6408 m_host.AddScriptLPS(1); 6413 m_host.AddScriptLPS(1);
6409 UUID key; 6414 UUID key;
6410 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 6415 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
6411 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) 6416 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
6412 { 6417 {
6413 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 6418 int expires = 0;
6419 if (hours != 0)
6420 expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * hours);
6421
6414 if (UUID.TryParse(avatar, out key)) 6422 if (UUID.TryParse(avatar, out key))
6415 { 6423 {
6416 if (land.LandData.ParcelAccessList.FindIndex( 6424 int idx = land.LandData.ParcelAccessList.FindIndex(
6417 delegate(ParcelManager.ParcelAccessEntry e) 6425 delegate(LandAccessEntry e)
6418 { 6426 {
6419 if (e.AgentID == key && e.Flags == AccessList.Access) 6427 if (e.AgentID == key && e.Flags == AccessList.Access)
6420 return true; 6428 return true;
6421 return false; 6429 return false;
6422 }) == -1) 6430 });
6423 { 6431
6424 entry.AgentID = key; 6432 if (idx != -1 && (land.LandData.ParcelAccessList[idx].Expires == 0 || (expires != 0 && expires < land.LandData.ParcelAccessList[idx].Expires)))
6425 entry.Flags = AccessList.Access; 6433 return;
6426 entry.Time = DateTime.Now.AddHours(hours); 6434
6427 land.LandData.ParcelAccessList.Add(entry); 6435 if (idx != -1)
6428 } 6436 land.LandData.ParcelAccessList.RemoveAt(idx);
6437
6438 LandAccessEntry entry = new LandAccessEntry();
6439
6440 entry.AgentID = key;
6441 entry.Flags = AccessList.Access;
6442 entry.Expires = expires;
6443
6444 land.LandData.ParcelAccessList.Add(entry);
6445
6446 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
6429 } 6447 }
6430 } 6448 }
6431 ScriptSleep(100); 6449 ScriptSleep(100);
@@ -9679,22 +9697,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9679 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 9697 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
9680 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) 9698 if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
9681 { 9699 {
9682 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 9700 int expires = 0;
9701 if (hours != 0)
9702 expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * hours);
9703
9683 if (UUID.TryParse(avatar, out key)) 9704 if (UUID.TryParse(avatar, out key))
9684 { 9705 {
9685 if (land.LandData.ParcelAccessList.FindIndex( 9706 int idx = land.LandData.ParcelAccessList.FindIndex(
9686 delegate(ParcelManager.ParcelAccessEntry e) 9707 delegate(LandAccessEntry e)
9687 { 9708 {
9688 if (e.AgentID == key && e.Flags == AccessList.Ban) 9709 if (e.AgentID == key && e.Flags == AccessList.Ban)
9689 return true; 9710 return true;
9690 return false; 9711 return false;
9691 }) == -1) 9712 });
9692 { 9713
9693 entry.AgentID = key; 9714 if (idx != -1 && (land.LandData.ParcelAccessList[idx].Expires == 0 || (expires != 0 && expires < land.LandData.ParcelAccessList[idx].Expires)))
9694 entry.Flags = AccessList.Ban; 9715 return;
9695 entry.Time = DateTime.Now.AddHours(hours); 9716
9696 land.LandData.ParcelAccessList.Add(entry); 9717 if (idx != -1)
9697 } 9718 land.LandData.ParcelAccessList.RemoveAt(idx);
9719
9720 LandAccessEntry entry = new LandAccessEntry();
9721
9722 entry.AgentID = key;
9723 entry.Flags = AccessList.Ban;
9724 entry.Expires = expires;
9725
9726 land.LandData.ParcelAccessList.Add(entry);
9727
9728 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
9698 } 9729 }
9699 } 9730 }
9700 ScriptSleep(100); 9731 ScriptSleep(100);
@@ -9710,7 +9741,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9710 if (UUID.TryParse(avatar, out key)) 9741 if (UUID.TryParse(avatar, out key))
9711 { 9742 {
9712 int idx = land.LandData.ParcelAccessList.FindIndex( 9743 int idx = land.LandData.ParcelAccessList.FindIndex(
9713 delegate(ParcelManager.ParcelAccessEntry e) 9744 delegate(LandAccessEntry e)
9714 { 9745 {
9715 if (e.AgentID == key && e.Flags == AccessList.Access) 9746 if (e.AgentID == key && e.Flags == AccessList.Access)
9716 return true; 9747 return true;
@@ -9718,7 +9749,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9718 }); 9749 });
9719 9750
9720 if (idx != -1) 9751 if (idx != -1)
9752 {
9721 land.LandData.ParcelAccessList.RemoveAt(idx); 9753 land.LandData.ParcelAccessList.RemoveAt(idx);
9754 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
9755 }
9722 } 9756 }
9723 } 9757 }
9724 ScriptSleep(100); 9758 ScriptSleep(100);
@@ -9734,7 +9768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9734 if (UUID.TryParse(avatar, out key)) 9768 if (UUID.TryParse(avatar, out key))
9735 { 9769 {
9736 int idx = land.LandData.ParcelAccessList.FindIndex( 9770 int idx = land.LandData.ParcelAccessList.FindIndex(
9737 delegate(ParcelManager.ParcelAccessEntry e) 9771 delegate(LandAccessEntry e)
9738 { 9772 {
9739 if (e.AgentID == key && e.Flags == AccessList.Ban) 9773 if (e.AgentID == key && e.Flags == AccessList.Ban)
9740 return true; 9774 return true;
@@ -9742,7 +9776,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9742 }); 9776 });
9743 9777
9744 if (idx != -1) 9778 if (idx != -1)
9779 {
9745 land.LandData.ParcelAccessList.RemoveAt(idx); 9780 land.LandData.ParcelAccessList.RemoveAt(idx);
9781 World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land);
9782 }
9746 } 9783 }
9747 } 9784 }
9748 ScriptSleep(100); 9785 ScriptSleep(100);
@@ -9997,7 +10034,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9997 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 10034 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
9998 if (land.OwnerID == m_host.OwnerID) 10035 if (land.OwnerID == m_host.OwnerID)
9999 { 10036 {
10000 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 10037 foreach (LandAccessEntry entry in land.ParcelAccessList)
10001 { 10038 {
10002 if (entry.Flags == AccessList.Ban) 10039 if (entry.Flags == AccessList.Ban)
10003 { 10040 {
@@ -10014,7 +10051,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10014 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; 10051 LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData;
10015 if (land.OwnerID == m_host.OwnerID) 10052 if (land.OwnerID == m_host.OwnerID)
10016 { 10053 {
10017 foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) 10054 foreach (LandAccessEntry entry in land.ParcelAccessList)
10018 { 10055 {
10019 if (entry.Flags == AccessList.Access) 10056 if (entry.Flags == AccessList.Access)
10020 { 10057 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index b66537f..6106a65 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -138,7 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
138 LSL_Key llGetLinkKey(int linknum); 138 LSL_Key llGetLinkKey(int linknum);
139 LSL_String llGetLinkName(int linknum); 139 LSL_String llGetLinkName(int linknum);
140 LSL_Integer llGetLinkNumber(); 140 LSL_Integer llGetLinkNumber();
141 LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); 141 LSL_Integer llGetLinkNumberOfSides(int link);
142 LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules);
142 LSL_Integer llGetListEntryType(LSL_List src, int index); 143 LSL_Integer llGetListEntryType(LSL_List src, int index);
143 LSL_Integer llGetListLength(LSL_List src); 144 LSL_Integer llGetListLength(LSL_List src);
144 LSL_Vector llGetLocalPos(); 145 LSL_Vector llGetLocalPos();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 840d3a4..83550a5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -539,6 +539,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
539 return m_LSL_Functions.llGetLinkNumber(); 539 return m_LSL_Functions.llGetLinkNumber();
540 } 540 }
541 541
542 public LSL_Integer llGetLinkNumberOfSides(int link)
543 {
544 return m_LSL_Functions.llGetLinkNumberOfSides(link);
545 }
546
542 public LSL_Integer llGetListEntryType(LSL_List src, int index) 547 public LSL_Integer llGetListEntryType(LSL_List src, int index)
543 { 548 {
544 return m_LSL_Functions.llGetListEntryType(src, index); 549 return m_LSL_Functions.llGetListEntryType(src, index);
diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerConnector.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerConnector.cs
index a0a92ed..6464399 100644
--- a/OpenSim/Server/Handlers/Authentication/OpenIdServerConnector.cs
+++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerConnector.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Server.Handlers.Authentication
63 63
64 Object[] args = new Object[] { config }; 64 Object[] args = new Object[] { config };
65 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); 65 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
66 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(authService, args); 66 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userService, args);
67 67
68 // Handler for OpenID user identity pages 68 // Handler for OpenID user identity pages
69 server.AddStreamHandler(new OpenIdStreamHandler("GET", "/users/", m_UserAccountService, m_AuthenticationService)); 69 server.AddStreamHandler(new OpenIdStreamHandler("GET", "/users/", m_UserAccountService, m_AuthenticationService));
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index ab89fe0..4d3d257 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -980,7 +980,7 @@ namespace OpenSim.Tests.Common.Mock
980 { 980 {
981 } 981 }
982 982
983 public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) 983 public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
984 { 984 {
985 } 985 }
986 986
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs
index cdbaa66..b9764d7 100644
--- a/OpenSim/Tests/Torture/ObjectTortureTests.cs
+++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs
@@ -59,33 +59,60 @@ namespace OpenSim.Tests.Torture
59// } 59// }
60 60
61 [Test] 61 [Test]
62 public void Test0001TenThousandObjects() 62 public void Test0001_10K_1PrimObjects()
63 { 63 {
64 TestHelpers.InMethod(); 64 TestHelpers.InMethod();
65// log4net.Config.XmlConfigurator.Configure(); 65// log4net.Config.XmlConfigurator.Configure();
66 66
67 TestAddObjects(10000); 67 TestAddObjects(1, 10000);
68 } 68 }
69 69
70 [Test] 70 [Test]
71 public void Test0002OneHundredThousandObjects() 71 public void Test0002_100K_1PrimObjects()
72 { 72 {
73 TestHelpers.InMethod(); 73 TestHelpers.InMethod();
74// log4net.Config.XmlConfigurator.Configure(); 74// log4net.Config.XmlConfigurator.Configure();
75 75
76 TestAddObjects(100000); 76 TestAddObjects(1, 100000);
77 } 77 }
78 78
79 [Test] 79 [Test]
80 public void Test0003TwoHundredThousandObjects() 80 public void Test0003_200K_1PrimObjects()
81 { 81 {
82 TestHelpers.InMethod(); 82 TestHelpers.InMethod();
83// log4net.Config.XmlConfigurator.Configure(); 83// log4net.Config.XmlConfigurator.Configure();
84 84
85 TestAddObjects(200000); 85 TestAddObjects(1, 200000);
86 } 86 }
87 87
88 private void TestAddObjects(int objectsToAdd) 88 [Test]
89 public void Test0011_100_100PrimObjects()
90 {
91 TestHelpers.InMethod();
92// log4net.Config.XmlConfigurator.Configure();
93
94 TestAddObjects(100, 100);
95 }
96
97 [Test]
98 public void Test0012_1K_100PrimObjects()
99 {
100 TestHelpers.InMethod();
101// log4net.Config.XmlConfigurator.Configure();
102
103 TestAddObjects(100, 1000);
104 }
105
106 [Test]
107 public void Test0013_2K_100PrimObjects()
108 {
109 TestHelpers.InMethod();
110// log4net.Config.XmlConfigurator.Configure();
111
112 TestAddObjects(100, 2000);
113 }
114
115 private void TestAddObjects(int primsInEachObject, int objectsToAdd)
89 { 116 {
90 UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000"); 117 UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000");
91 118
@@ -98,7 +125,7 @@ namespace OpenSim.Tests.Torture
98 125
99 for (int i = 1; i <= objectsToAdd; i++) 126 for (int i = 1; i <= objectsToAdd; i++)
100 { 127 {
101 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, ownerId, "part_", i); 128 SceneObjectGroup so = SceneHelpers.CreateSceneObject(primsInEachObject, ownerId, "part_", i);
102 Assert.That(scene.AddNewSceneObject(so, false), Is.True, string.Format("Object {0} was not created", i)); 129 Assert.That(scene.AddNewSceneObject(so, false), Is.True, string.Format("Object {0} was not created", i));
103 } 130 }
104 131
@@ -114,13 +141,9 @@ namespace OpenSim.Tests.Torture
114 string.Format("Object {0} could not be retrieved", i)); 141 string.Format("Object {0} could not be retrieved", i));
115 } 142 }
116 143
117// Console.WriteLine(
118// "Took {0}ms, {1}MB to create {2} single prim scene objects",
119// elapsed.Milliseconds, processGcAlloc / 1024 / 1024, objectsToAdd);
120
121 Console.WriteLine( 144 Console.WriteLine(
122 "Took {0}MB to create {1} single prim scene objects", 145 "Took {0}ms, {1}MB to create {2} objects each containing {3} prim(s)",
123 processGcAlloc / 1024 / 1024, objectsToAdd); 146 Math.Round(elapsed.TotalMilliseconds), processGcAlloc / 1024 / 1024, objectsToAdd, primsInEachObject);
124 } 147 }
125 } 148 }
126} \ No newline at end of file 149} \ No newline at end of file