diff options
Diffstat (limited to 'OpenSim')
21 files changed, 278 insertions, 146 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index be60d4c..e58620a 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs | |||
@@ -1252,7 +1252,7 @@ VALUES | |||
1252 | ,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se | 1252 | ,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se |
1253 | ,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit | 1253 | ,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit |
1254 | ,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position | 1254 | ,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position |
1255 | ,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id | 1255 | ,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id |
1256 | WHERE [regionUUID] = @regionUUID"; | 1256 | WHERE [regionUUID] = @regionUUID"; |
1257 | 1257 | ||
1258 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | 1258 | using (SqlConnection conn = new SqlConnection(m_connectionString)) |
@@ -1307,14 +1307,14 @@ VALUES | |||
1307 | [block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics], | 1307 | [block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics], |
1308 | [terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne], | 1308 | [terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne], |
1309 | [elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit], | 1309 | [elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit], |
1310 | [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id] | 1310 | [terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[covenant_datetime],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id] |
1311 | ) | 1311 | ) |
1312 | VALUES | 1312 | VALUES |
1313 | (@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide, | 1313 | (@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide, |
1314 | @block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics, | 1314 | @block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics, |
1315 | @terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne, | 1315 | @terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne, |
1316 | @elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit, | 1316 | @elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit, |
1317 | @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)"; | 1317 | @terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant, @covenant_datetime, @sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)"; |
1318 | 1318 | ||
1319 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | 1319 | using (SqlConnection conn = new SqlConnection(m_connectionString)) |
1320 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | 1320 | using (SqlCommand cmd = new SqlCommand(sql, conn)) |
@@ -1376,7 +1376,7 @@ VALUES | |||
1376 | Convert.ToSingle(row["sunvectorz"]) | 1376 | Convert.ToSingle(row["sunvectorz"]) |
1377 | ); | 1377 | ); |
1378 | newSettings.Covenant = new UUID((Guid)row["covenant"]); | 1378 | newSettings.Covenant = new UUID((Guid)row["covenant"]); |
1379 | 1379 | newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); | |
1380 | newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); | 1380 | newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); |
1381 | 1381 | ||
1382 | if (row["loaded_creation_id"] is DBNull) | 1382 | if (row["loaded_creation_id"] is DBNull) |
@@ -1789,6 +1789,7 @@ VALUES | |||
1789 | parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y)); | 1789 | parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y)); |
1790 | parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z)); | 1790 | parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z)); |
1791 | parameters.Add(_Database.CreateParameter("covenant", settings.Covenant)); | 1791 | parameters.Add(_Database.CreateParameter("covenant", settings.Covenant)); |
1792 | parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime)); | ||
1792 | parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime)); | 1793 | parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime)); |
1793 | parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID)); | 1794 | parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID)); |
1794 | 1795 | ||
diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations index 3995e6c..a98690a 100644 --- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations | |||
@@ -1043,3 +1043,11 @@ FOR CreatorID | |||
1043 | ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL | 1043 | ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL |
1044 | 1044 | ||
1045 | COMMIT | 1045 | COMMIT |
1046 | |||
1047 | :VERSION 29 #--------------------- | ||
1048 | |||
1049 | BEGIN TRANSACTION | ||
1050 | |||
1051 | ALTER TABLE regionsettings ADD covenant_datetime int NOT NULL default 0 | ||
1052 | |||
1053 | COMMIT | ||
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 3275146..7c995ad 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -994,7 +994,7 @@ namespace OpenSim.Data.MySQL | |||
994 | "elevation_2_sw, water_height, " + | 994 | "elevation_2_sw, water_height, " + |
995 | "terrain_raise_limit, terrain_lower_limit, " + | 995 | "terrain_raise_limit, terrain_lower_limit, " + |
996 | "use_estate_sun, fixed_sun, sun_position, " + | 996 | "use_estate_sun, fixed_sun, sun_position, " + |
997 | "covenant, Sandbox, sunvectorx, sunvectory, " + | 997 | "covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " + |
998 | "sunvectorz, loaded_creation_datetime, " + | 998 | "sunvectorz, loaded_creation_datetime, " + |
999 | "loaded_creation_id, map_tile_ID, " + | 999 | "loaded_creation_id, map_tile_ID, " + |
1000 | "TelehubObject, parcel_tile_ID) " + | 1000 | "TelehubObject, parcel_tile_ID) " + |
@@ -1010,7 +1010,7 @@ namespace OpenSim.Data.MySQL | |||
1010 | "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " + | 1010 | "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " + |
1011 | "?WaterHeight, ?TerrainRaiseLimit, " + | 1011 | "?WaterHeight, ?TerrainRaiseLimit, " + |
1012 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + | 1012 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + |
1013 | "?SunPosition, ?Covenant, ?Sandbox, " + | 1013 | "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + |
1014 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 1014 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
1015 | "?LoadedCreationDateTime, ?LoadedCreationID, " + | 1015 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
1016 | "?TerrainImageID, ?TelehubObject, ?ParcelImageID) "; | 1016 | "?TerrainImageID, ?TelehubObject, ?ParcelImageID) "; |
@@ -1292,7 +1292,7 @@ namespace OpenSim.Data.MySQL | |||
1292 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); | 1292 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); |
1293 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); | 1293 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); |
1294 | newSettings.Covenant = DBGuid.FromDB(row["covenant"]); | 1294 | newSettings.Covenant = DBGuid.FromDB(row["covenant"]); |
1295 | 1295 | newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); | |
1296 | newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); | 1296 | newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); |
1297 | 1297 | ||
1298 | if (row["loaded_creation_id"] is DBNull) | 1298 | if (row["loaded_creation_id"] is DBNull) |
@@ -1630,6 +1630,7 @@ namespace OpenSim.Data.MySQL | |||
1630 | cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun); | 1630 | cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun); |
1631 | cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition); | 1631 | cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition); |
1632 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); | 1632 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); |
1633 | cmd.Parameters.AddWithValue("CovenantChangedDateTime", settings.CovenantChangedDateTime); | ||
1633 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); | 1634 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); |
1634 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1635 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1635 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); | 1636 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); |
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 642e3b7..9891f4b 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations | |||
@@ -869,3 +869,8 @@ BEGIN; | |||
869 | ALTER TABLE `landaccesslist` ADD COLUMN `Expires` INTEGER NOT NULL DEFAULT 0; | 869 | ALTER TABLE `landaccesslist` ADD COLUMN `Expires` INTEGER NOT NULL DEFAULT 0; |
870 | COMMIT; | 870 | COMMIT; |
871 | 871 | ||
872 | :VERSION 42 #--------------------- Region Covenant changed time | ||
873 | |||
874 | BEGIN; | ||
875 | ALTER TABLE regionsettings ADD COLUMN covenant_datetime int unsigned NOT NULL DEFAULT '0'; | ||
876 | COMMIT; | ||
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index 5e2045b..31195af 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations | |||
@@ -466,4 +466,9 @@ ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0'; | |||
466 | ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE; | 466 | ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE; |
467 | ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE; | 467 | ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE; |
468 | ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE; | 468 | ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE; |
469 | COMMIT; \ No newline at end of file | 469 | COMMIT; |
470 | |||
471 | :VERSION 22 | ||
472 | BEGIN; | ||
473 | ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0; | ||
474 | COMMIT; | ||
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 2d06f82..a313c4f 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -1185,6 +1185,7 @@ namespace OpenSim.Data.SQLite | |||
1185 | createCol(regionsettings, "fixed_sun", typeof (Int32)); | 1185 | createCol(regionsettings, "fixed_sun", typeof (Int32)); |
1186 | createCol(regionsettings, "sun_position", typeof (Double)); | 1186 | createCol(regionsettings, "sun_position", typeof (Double)); |
1187 | createCol(regionsettings, "covenant", typeof(String)); | 1187 | createCol(regionsettings, "covenant", typeof(String)); |
1188 | createCol(regionsettings, "covenant_datetime", typeof(Int32)); | ||
1188 | createCol(regionsettings, "map_tile_ID", typeof(String)); | 1189 | createCol(regionsettings, "map_tile_ID", typeof(String)); |
1189 | regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; | 1190 | regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; |
1190 | return regionsettings; | 1191 | return regionsettings; |
@@ -1509,6 +1510,7 @@ namespace OpenSim.Data.SQLite | |||
1509 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); | 1510 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); |
1510 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); | 1511 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); |
1511 | newSettings.Covenant = new UUID((String) row["covenant"]); | 1512 | newSettings.Covenant = new UUID((String) row["covenant"]); |
1513 | newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); | ||
1512 | newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); | 1514 | newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); |
1513 | 1515 | ||
1514 | return newSettings; | 1516 | return newSettings; |
@@ -1833,6 +1835,7 @@ namespace OpenSim.Data.SQLite | |||
1833 | row["fixed_sun"] = settings.FixedSun; | 1835 | row["fixed_sun"] = settings.FixedSun; |
1834 | row["sun_position"] = settings.SunPosition; | 1836 | row["sun_position"] = settings.SunPosition; |
1835 | row["covenant"] = settings.Covenant.ToString(); | 1837 | row["covenant"] = settings.Covenant.ToString(); |
1838 | row["covenant_datetime"] = settings.CovenantChangedDateTime; | ||
1836 | row["map_tile_ID"] = settings.TerrainImageID.ToString(); | 1839 | row["map_tile_ID"] = settings.TerrainImageID.ToString(); |
1837 | } | 1840 | } |
1838 | 1841 | ||
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index dd3e656..c85e599 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -1235,7 +1235,7 @@ namespace OpenSim.Framework | |||
1235 | void SendEstateCovenantInformation(UUID covenant); | 1235 | void SendEstateCovenantInformation(UUID covenant); |
1236 | 1236 | ||
1237 | void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, | 1237 | void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, |
1238 | uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner); | 1238 | uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner); |
1239 | 1239 | ||
1240 | /// <summary> | 1240 | /// <summary> |
1241 | /// Send land properties to the client. | 1241 | /// Send land properties to the client. |
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index 58a80ef..f6271ef 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs | |||
@@ -34,7 +34,7 @@ using OpenMetaverse; | |||
34 | 34 | ||
35 | namespace OpenSim.Framework | 35 | namespace OpenSim.Framework |
36 | { | 36 | { |
37 | public struct LandAccessEntry | 37 | public class LandAccessEntry |
38 | { | 38 | { |
39 | public UUID AgentID; | 39 | public UUID AgentID; |
40 | public int Expires; | 40 | public int Expires; |
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 91e07df..4ce3392 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs | |||
@@ -413,6 +413,14 @@ namespace OpenSim.Framework | |||
413 | set { m_Covenant = value; } | 413 | set { m_Covenant = value; } |
414 | } | 414 | } |
415 | 415 | ||
416 | private int m_CovenantChanged = 0; | ||
417 | |||
418 | public int CovenantChangedDateTime | ||
419 | { | ||
420 | get { return m_CovenantChanged; } | ||
421 | set { m_CovenantChanged = value; } | ||
422 | } | ||
423 | |||
416 | private int m_LoadedCreationDateTime; | 424 | private int m_LoadedCreationDateTime; |
417 | public int LoadedCreationDateTime | 425 | public int LoadedCreationDateTime |
418 | { | 426 | { |
@@ -492,4 +500,4 @@ namespace OpenSim.Framework | |||
492 | l_SpawnPoints.Clear(); | 500 | l_SpawnPoints.Clear(); |
493 | } | 501 | } |
494 | } | 502 | } |
495 | } | 503 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index 7447ac2..39a9f37 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | |||
@@ -24,11 +24,13 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
27 | using System; | 28 | using System; |
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | ||
30 | using System.Xml; | 32 | using System.Xml; |
31 | 33 | using log4net; | |
32 | using OpenMetaverse; | 34 | using OpenMetaverse; |
33 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
34 | 36 | ||
@@ -39,6 +41,55 @@ namespace OpenSim.Framework.Serialization.External | |||
39 | /// </summary> | 41 | /// </summary> |
40 | public class ExternalRepresentationUtils | 42 | public class ExternalRepresentationUtils |
41 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
46 | /// <summary> | ||
47 | /// Populate a node with data read from xml using a dictinoary of processors | ||
48 | /// </summary> | ||
49 | /// <param name="nodeToFill"></param> | ||
50 | /// <param name="processors"> | ||
51 | /// A <see cref="Dictionary<System.String, Action<NodeType, XmlTextReader>>"/> | ||
52 | /// </param> | ||
53 | /// <param name="xtr"> | ||
54 | /// A <see cref="XmlTextReader"/> | ||
55 | /// </param> | ||
56 | public static void ExecuteReadProcessors<NodeType>( | ||
57 | NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) | ||
58 | { | ||
59 | string nodeName = string.Empty; | ||
60 | while (xtr.NodeType != XmlNodeType.EndElement) | ||
61 | { | ||
62 | nodeName = xtr.Name; | ||
63 | |||
64 | // m_log.DebugFormat("[ExternalRepresentationUtils]: Processing: {0}", nodeName); | ||
65 | |||
66 | Action<NodeType, XmlTextReader> p = null; | ||
67 | if (processors.TryGetValue(xtr.Name, out p)) | ||
68 | { | ||
69 | // m_log.DebugFormat("[ExternalRepresentationUtils]: Found {0} processor, nodeName); | ||
70 | |||
71 | try | ||
72 | { | ||
73 | p(nodeToFill, xtr); | ||
74 | } | ||
75 | catch (Exception e) | ||
76 | { | ||
77 | m_log.ErrorFormat( | ||
78 | "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", | ||
79 | nodeName, e.Message, e.StackTrace); | ||
80 | |||
81 | if (xtr.NodeType == XmlNodeType.EndElement) | ||
82 | xtr.Read(); | ||
83 | } | ||
84 | } | ||
85 | else | ||
86 | { | ||
87 | // m_log.DebugFormat("[LandDataSerializer]: caught unknown element {0}", nodeName); | ||
88 | xtr.ReadOuterXml(); // ignore | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | |||
42 | /// <summary> | 93 | /// <summary> |
43 | /// Takes a XML representation of a SceneObjectPart and returns another XML representation | 94 | /// Takes a XML representation of a SceneObjectPart and returns another XML representation |
44 | /// with creator data added to it. | 95 | /// with creator data added to it. |
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index 3ae9a8e..a12877a 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs | |||
@@ -28,8 +28,10 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | ||
31 | using System.Text; | 32 | using System.Text; |
32 | using System.Xml; | 33 | using System.Xml; |
34 | using log4net; | ||
33 | using OpenMetaverse; | 35 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
35 | 37 | ||
@@ -40,8 +42,119 @@ namespace OpenSim.Framework.Serialization.External | |||
40 | /// </summary> | 42 | /// </summary> |
41 | public class LandDataSerializer | 43 | public class LandDataSerializer |
42 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
43 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); | 47 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); |
44 | 48 | ||
49 | private static Dictionary<string, Action<LandData, XmlTextReader>> m_ldProcessors | ||
50 | = new Dictionary<string, Action<LandData, XmlTextReader>>(); | ||
51 | |||
52 | private static Dictionary<string, Action<LandAccessEntry, XmlTextReader>> m_laeProcessors | ||
53 | = new Dictionary<string, Action<LandAccessEntry, XmlTextReader>>(); | ||
54 | |||
55 | static LandDataSerializer() | ||
56 | { | ||
57 | // LandData processors | ||
58 | m_ldProcessors.Add( | ||
59 | "Area", (ld, xtr) => ld.Area = Convert.ToInt32(xtr.ReadElementString("Area"))); | ||
60 | m_ldProcessors.Add( | ||
61 | "AuctionID", (ld, xtr) => ld.AuctionID = Convert.ToUInt32(xtr.ReadElementString("AuctionID"))); | ||
62 | m_ldProcessors.Add( | ||
63 | "AuthBuyerID", (ld, xtr) => ld.AuthBuyerID = UUID.Parse(xtr.ReadElementString("AuthBuyerID"))); | ||
64 | m_ldProcessors.Add( | ||
65 | "Category", (ld, xtr) => ld.Category = (ParcelCategory)Convert.ToSByte(xtr.ReadElementString("Category"))); | ||
66 | m_ldProcessors.Add( | ||
67 | "ClaimDate", (ld, xtr) => ld.ClaimDate = Convert.ToInt32(xtr.ReadElementString("ClaimDate"))); | ||
68 | m_ldProcessors.Add( | ||
69 | "ClaimPrice", (ld, xtr) => ld.ClaimPrice = Convert.ToInt32(xtr.ReadElementString("ClaimPrice"))); | ||
70 | m_ldProcessors.Add( | ||
71 | "GlobalID", (ld, xtr) => ld.GlobalID = UUID.Parse(xtr.ReadElementString("GlobalID"))); | ||
72 | m_ldProcessors.Add( | ||
73 | "GroupID", (ld, xtr) => ld.GroupID = UUID.Parse(xtr.ReadElementString("GroupID"))); | ||
74 | m_ldProcessors.Add( | ||
75 | "IsGroupOwned", (ld, xtr) => ld.IsGroupOwned = Convert.ToBoolean(xtr.ReadElementString("IsGroupOwned"))); | ||
76 | m_ldProcessors.Add( | ||
77 | "Bitmap", (ld, xtr) => ld.Bitmap = Convert.FromBase64String(xtr.ReadElementString("Bitmap"))); | ||
78 | m_ldProcessors.Add( | ||
79 | "Description", (ld, xtr) => ld.Description = xtr.ReadElementString("Description")); | ||
80 | m_ldProcessors.Add( | ||
81 | "Flags", (ld, xtr) => ld.Flags = Convert.ToUInt32(xtr.ReadElementString("Flags"))); | ||
82 | m_ldProcessors.Add( | ||
83 | "LandingType", (ld, xtr) => ld.LandingType = Convert.ToByte(xtr.ReadElementString("LandingType"))); | ||
84 | m_ldProcessors.Add( | ||
85 | "Name", (ld, xtr) => ld.Name = xtr.ReadElementString("Name")); | ||
86 | m_ldProcessors.Add( | ||
87 | "Status", (ld, xtr) => ld.Status = (ParcelStatus)Convert.ToSByte(xtr.ReadElementString("Status"))); | ||
88 | m_ldProcessors.Add( | ||
89 | "LocalID", (ld, xtr) => ld.LocalID = Convert.ToInt32(xtr.ReadElementString("LocalID"))); | ||
90 | m_ldProcessors.Add( | ||
91 | "MediaAutoScale", (ld, xtr) => ld.MediaAutoScale = Convert.ToByte(xtr.ReadElementString("MediaAutoScale"))); | ||
92 | m_ldProcessors.Add( | ||
93 | "MediaID", (ld, xtr) => ld.MediaID = UUID.Parse(xtr.ReadElementString("MediaID"))); | ||
94 | m_ldProcessors.Add( | ||
95 | "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL")); | ||
96 | m_ldProcessors.Add( | ||
97 | "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL")); | ||
98 | |||
99 | m_ldProcessors.Add( | ||
100 | "ParcelAccessList", ProcessParcelAccessList); | ||
101 | |||
102 | m_ldProcessors.Add( | ||
103 | "PassHours", (ld, xtr) => ld.PassHours = Convert.ToSingle(xtr.ReadElementString("PassHours"))); | ||
104 | m_ldProcessors.Add( | ||
105 | "PassPrice", (ld, xtr) => ld.PassPrice = Convert.ToInt32(xtr.ReadElementString("PassPrice"))); | ||
106 | m_ldProcessors.Add( | ||
107 | "SalePrice", (ld, xtr) => ld.SalePrice = Convert.ToInt32(xtr.ReadElementString("SalePrice"))); | ||
108 | m_ldProcessors.Add( | ||
109 | "SnapshotID", (ld, xtr) => ld.SnapshotID = UUID.Parse(xtr.ReadElementString("SnapshotID"))); | ||
110 | m_ldProcessors.Add( | ||
111 | "UserLocation", (ld, xtr) => ld.UserLocation = Vector3.Parse(xtr.ReadElementString("UserLocation"))); | ||
112 | m_ldProcessors.Add( | ||
113 | "UserLookAt", (ld, xtr) => ld.UserLookAt = Vector3.Parse(xtr.ReadElementString("UserLookAt"))); | ||
114 | |||
115 | // No longer used here // | ||
116 | // m_ldProcessors.Add("Dwell", (landData, xtr) => return); | ||
117 | |||
118 | m_ldProcessors.Add( | ||
119 | "OtherCleanTime", (ld, xtr) => ld.OtherCleanTime = Convert.ToInt32(xtr.ReadElementString("OtherCleanTime"))); | ||
120 | |||
121 | // LandAccessEntryProcessors | ||
122 | m_laeProcessors.Add( | ||
123 | "AgentID", (lae, xtr) => lae.AgentID = UUID.Parse(xtr.ReadElementString("AgentID"))); | ||
124 | m_laeProcessors.Add( | ||
125 | "Time", (lae, xtr) => | ||
126 | { | ||
127 | // We really don't care about temp vs perm here and this | ||
128 | // would break on old oars. Assume all bans are perm | ||
129 | xtr.ReadElementString("Time"); | ||
130 | lae.Expires = 0; // Convert.ToUint( xtr.ReadElementString("Time")); | ||
131 | } | ||
132 | ); | ||
133 | m_laeProcessors.Add( | ||
134 | "AccessList", (lae, xtr) => lae.Flags = (AccessList)Convert.ToUInt32(xtr.ReadElementString("AccessList"))); | ||
135 | } | ||
136 | |||
137 | public static void ProcessParcelAccessList(LandData ld, XmlTextReader xtr) | ||
138 | { | ||
139 | if (!xtr.IsEmptyElement) | ||
140 | { | ||
141 | while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) | ||
142 | { | ||
143 | LandAccessEntry lae = new LandAccessEntry(); | ||
144 | |||
145 | xtr.ReadStartElement("ParcelAccessEntry"); | ||
146 | |||
147 | ExternalRepresentationUtils.ExecuteReadProcessors<LandAccessEntry>(lae, m_laeProcessors, xtr); | ||
148 | |||
149 | xtr.ReadEndElement(); | ||
150 | |||
151 | ld.ParcelAccessList.Add(lae); | ||
152 | } | ||
153 | } | ||
154 | |||
155 | xtr.Read(); | ||
156 | } | ||
157 | |||
45 | /// <summary> | 158 | /// <summary> |
46 | /// Reify/deserialize landData | 159 | /// Reify/deserialize landData |
47 | /// </summary> | 160 | /// </summary> |
@@ -63,72 +176,14 @@ namespace OpenSim.Framework.Serialization.External | |||
63 | { | 176 | { |
64 | LandData landData = new LandData(); | 177 | LandData landData = new LandData(); |
65 | 178 | ||
66 | StringReader sr = new StringReader(serializedLandData); | 179 | using (XmlTextReader reader = new XmlTextReader(new StringReader(serializedLandData))) |
67 | XmlTextReader xtr = new XmlTextReader(sr); | ||
68 | |||
69 | xtr.ReadStartElement("LandData"); | ||
70 | |||
71 | landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); | ||
72 | landData.AuctionID = Convert.ToUInt32( xtr.ReadElementString("AuctionID")); | ||
73 | landData.AuthBuyerID = UUID.Parse( xtr.ReadElementString("AuthBuyerID")); | ||
74 | landData.Category = (ParcelCategory)Convert.ToSByte( xtr.ReadElementString("Category")); | ||
75 | landData.ClaimDate = Convert.ToInt32( xtr.ReadElementString("ClaimDate")); | ||
76 | landData.ClaimPrice = Convert.ToInt32( xtr.ReadElementString("ClaimPrice")); | ||
77 | landData.GlobalID = UUID.Parse( xtr.ReadElementString("GlobalID")); | ||
78 | landData.GroupID = UUID.Parse( xtr.ReadElementString("GroupID")); | ||
79 | landData.IsGroupOwned = Convert.ToBoolean( xtr.ReadElementString("IsGroupOwned")); | ||
80 | landData.Bitmap = Convert.FromBase64String( xtr.ReadElementString("Bitmap")); | ||
81 | landData.Description = xtr.ReadElementString("Description"); | ||
82 | landData.Flags = Convert.ToUInt32( xtr.ReadElementString("Flags")); | ||
83 | landData.LandingType = Convert.ToByte( xtr.ReadElementString("LandingType")); | ||
84 | landData.Name = xtr.ReadElementString("Name"); | ||
85 | landData.Status = (ParcelStatus)Convert.ToSByte( xtr.ReadElementString("Status")); | ||
86 | landData.LocalID = Convert.ToInt32( xtr.ReadElementString("LocalID")); | ||
87 | landData.MediaAutoScale = Convert.ToByte( xtr.ReadElementString("MediaAutoScale")); | ||
88 | landData.MediaID = UUID.Parse( xtr.ReadElementString("MediaID")); | ||
89 | landData.MediaURL = xtr.ReadElementString("MediaURL"); | ||
90 | landData.MusicURL = xtr.ReadElementString("MusicURL"); | ||
91 | landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID")); | ||
92 | |||
93 | landData.ParcelAccessList = new List<LandAccessEntry>(); | ||
94 | xtr.Read(); | ||
95 | if (xtr.Name != "ParcelAccessList") | ||
96 | throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name)); | ||
97 | |||
98 | if (!xtr.IsEmptyElement) | ||
99 | { | 180 | { |
100 | while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) | 181 | reader.ReadStartElement("LandData"); |
101 | { | ||
102 | LandAccessEntry pae = new LandAccessEntry(); | ||
103 | 182 | ||
104 | xtr.ReadStartElement("ParcelAccessEntry"); | 183 | ExternalRepresentationUtils.ExecuteReadProcessors<LandData>(landData, m_ldProcessors, reader); |
105 | pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID")); | ||
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")); | ||
110 | pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); | ||
111 | xtr.ReadEndElement(); | ||
112 | 184 | ||
113 | landData.ParcelAccessList.Add(pae); | 185 | reader.ReadEndElement(); |
114 | } | ||
115 | } | 186 | } |
116 | xtr.Read(); | ||
117 | |||
118 | landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours")); | ||
119 | landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice")); | ||
120 | landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice")); | ||
121 | landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); | ||
122 | landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); | ||
123 | landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); | ||
124 | // No longer used here | ||
125 | xtr.ReadElementString("Dwell"); | ||
126 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); | ||
127 | |||
128 | xtr.ReadEndElement(); | ||
129 | |||
130 | xtr.Close(); | ||
131 | sr.Close(); | ||
132 | 187 | ||
133 | return landData; | 188 | return landData; |
134 | } | 189 | } |
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index b351703..57da7ca 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | |||
@@ -41,14 +41,13 @@ namespace OpenSim.Framework.Serialization.External | |||
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// Serialize and deserialize user inventory items as an external format. | 43 | /// Serialize and deserialize user inventory items as an external format. |
44 | /// </summary> | 44 | /// </summary> |
45 | /// XXX: Please do not use yet. | ||
46 | public class UserInventoryItemSerializer | 45 | public class UserInventoryItemSerializer |
47 | { | 46 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 48 | ||
50 | private delegate void InventoryItemXmlProcessor(InventoryItemBase item, XmlTextReader reader); | 49 | private static Dictionary<string, Action<InventoryItemBase, XmlTextReader>> m_InventoryItemXmlProcessors |
51 | private static Dictionary<string, InventoryItemXmlProcessor> m_InventoryItemXmlProcessors = new Dictionary<string, InventoryItemXmlProcessor>(); | 50 | = new Dictionary<string, Action<InventoryItemBase, XmlTextReader>>(); |
52 | 51 | ||
53 | #region InventoryItemBase Processor initialization | 52 | #region InventoryItemBase Processor initialization |
54 | static UserInventoryItemSerializer() | 53 | static UserInventoryItemSerializer() |
@@ -205,39 +204,14 @@ namespace OpenSim.Framework.Serialization.External | |||
205 | { | 204 | { |
206 | reader.ReadStartElement("InventoryItem"); | 205 | reader.ReadStartElement("InventoryItem"); |
207 | 206 | ||
208 | string nodeName = string.Empty; | 207 | ExternalRepresentationUtils.ExecuteReadProcessors<InventoryItemBase>( |
209 | while (reader.NodeType != XmlNodeType.EndElement) | 208 | item, m_InventoryItemXmlProcessors, reader); |
210 | { | ||
211 | nodeName = reader.Name; | ||
212 | InventoryItemXmlProcessor p = null; | ||
213 | if (m_InventoryItemXmlProcessors.TryGetValue(reader.Name, out p)) | ||
214 | { | ||
215 | //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); | ||
216 | try | ||
217 | { | ||
218 | p(item, reader); | ||
219 | } | ||
220 | catch (Exception e) | ||
221 | { | ||
222 | m_log.DebugFormat("[InventoryItemSerializer]: exception while parsing {0}: {1}", nodeName, e); | ||
223 | if (reader.NodeType == XmlNodeType.EndElement) | ||
224 | reader.Read(); | ||
225 | } | ||
226 | } | ||
227 | else | ||
228 | { | ||
229 | // m_log.DebugFormat("[InventoryItemSerializer]: caught unknown element {0}", nodeName); | ||
230 | reader.ReadOuterXml(); // ignore | ||
231 | } | ||
232 | |||
233 | } | ||
234 | 209 | ||
235 | reader.ReadEndElement(); // InventoryItem | 210 | reader.ReadEndElement(); // InventoryItem |
236 | } | 211 | } |
237 | 212 | ||
238 | //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); | 213 | //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); |
239 | return item; | 214 | return item; |
240 | |||
241 | } | 215 | } |
242 | 216 | ||
243 | public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService) | 217 | public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService) |
diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index f50b49a..c685a15 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | |||
@@ -33,8 +33,11 @@ using OpenSim.Framework; | |||
33 | namespace OpenSim.Framework.Serialization.External | 33 | namespace OpenSim.Framework.Serialization.External |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// Serialize and deserialize region settings as an external format. | 36 | /// Serialize and deserialize user profiles as an external format. |
37 | /// </summary> | 37 | /// </summary> |
38 | /// <remarks> | ||
39 | /// Currently UNUSED. | ||
40 | /// </remarks> | ||
38 | public class UserProfileSerializer | 41 | public class UserProfileSerializer |
39 | { | 42 | { |
40 | public const int MAJOR_VERSION = 0; | 43 | public const int MAJOR_VERSION = 0; |
diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs index 3607ce8..11a3a0a 100644 --- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs | |||
@@ -27,11 +27,12 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenSim.Framework; | ||
31 | using OpenSim.Framework.Serialization.External; | ||
32 | using OpenMetaverse; | 30 | using OpenMetaverse; |
33 | using OpenMetaverse.StructuredData; | 31 | using OpenMetaverse.StructuredData; |
34 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Framework.Serialization.External; | ||
35 | using OpenSim.Tests.Common; | ||
35 | 36 | ||
36 | namespace OpenSim.Framework.Serialization.Tests | 37 | namespace OpenSim.Framework.Serialization.Tests |
37 | { | 38 | { |
@@ -92,6 +93,8 @@ namespace OpenSim.Framework.Serialization.Tests | |||
92 | [Test] | 93 | [Test] |
93 | public void LandDataSerializerSerializeTest() | 94 | public void LandDataSerializerSerializeTest() |
94 | { | 95 | { |
96 | TestHelpers.InMethod(); | ||
97 | |||
95 | string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n"); | 98 | string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n"); |
96 | Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); | 99 | Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); |
97 | 100 | ||
@@ -112,20 +115,32 @@ namespace OpenSim.Framework.Serialization.Tests | |||
112 | /// Test the LandDataSerializer.Deserialize() method | 115 | /// Test the LandDataSerializer.Deserialize() method |
113 | /// </summary> | 116 | /// </summary> |
114 | [Test] | 117 | [Test] |
115 | public void TestLandDataSerializerDeserializeFromStringTest() | 118 | public void TestLandDataDeserializeNoAccessLists() |
119 | { | ||
120 | TestHelpers.InMethod(); | ||
121 | log4net.Config.XmlConfigurator.Configure(); | ||
122 | |||
123 | LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized); | ||
124 | Assert.That(ld != null, "Deserialize(string) returned null"); | ||
125 | Assert.That(ld.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID"); | ||
126 | Assert.That(ld.Name == this.land.Name, "Reified LandData.Name != original LandData.Name"); | ||
127 | } | ||
128 | |||
129 | [Test] | ||
130 | public void TestLandDataDeserializeWithAccessLists() | ||
116 | { | 131 | { |
117 | LandData reifiedLandData = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized); | 132 | TestHelpers.InMethod(); |
118 | Assert.That(reifiedLandData != null, "Deserialize(string) returned null"); | 133 | // log4net.Config.XmlConfigurator.Configure(); |
119 | Assert.That(reifiedLandData.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID"); | ||
120 | Assert.That(reifiedLandData.Name == this.land.Name, "Reified LandData.Name != original LandData.Name"); | ||
121 | 134 | ||
122 | LandData reifiedLandDataWithParcelAccessList = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList); | 135 | LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList); |
123 | Assert.That(reifiedLandDataWithParcelAccessList != null, | 136 | Assert.That(ld != null, |
124 | "Deserialize(string) returned null (pre-serialized with parcel access list)"); | 137 | "Deserialize(string) returned null (pre-serialized with parcel access list)"); |
125 | Assert.That(reifiedLandDataWithParcelAccessList.GlobalID == this.landWithParcelAccessList.GlobalID, | 138 | Assert.That(ld.GlobalID == this.landWithParcelAccessList.GlobalID, |
126 | "Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)"); | 139 | "Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)"); |
127 | Assert.That(reifiedLandDataWithParcelAccessList.Name == this.landWithParcelAccessList.Name, | 140 | Assert.That(ld.Name == this.landWithParcelAccessList.Name, |
128 | "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)"); | 141 | "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)"); |
142 | Assert.That(ld.ParcelAccessList.Count, Is.EqualTo(2)); | ||
143 | Assert.That(ld.ParcelAccessList[0].AgentID, Is.EqualTo(UUID.Parse("62d65d45-c91a-4f77-862c-46557d978b6c"))); | ||
129 | } | 144 | } |
130 | } | 145 | } |
131 | } | 146 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index cdd4957..8273c6f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -4439,7 +4439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4439 | EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); | 4439 | EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); |
4440 | EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); | 4440 | EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); |
4441 | edata.CovenantID = covenant; | 4441 | edata.CovenantID = covenant; |
4442 | edata.CovenantTimestamp = 0; | 4442 | edata.CovenantTimestamp = (uint) m_scene.RegionInfo.RegionSettings.CovenantChangedDateTime; |
4443 | edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 4443 | edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
4444 | edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName); | 4444 | edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName); |
4445 | einfopack.Data = edata; | 4445 | einfopack.Data = edata; |
@@ -4447,8 +4447,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4447 | } | 4447 | } |
4448 | 4448 | ||
4449 | public void SendDetailedEstateData( | 4449 | public void SendDetailedEstateData( |
4450 | UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, | 4450 | UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, |
4451 | UUID covenant, string abuseEmail, UUID estateOwner) | 4451 | UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) |
4452 | { | 4452 | { |
4453 | // m_log.DebugFormat( | 4453 | // m_log.DebugFormat( |
4454 | // "[LLCLIENTVIEW]: Sending detailed estate data to {0} with covenant asset id {1}", Name, covenant); | 4454 | // "[LLCLIENTVIEW]: Sending detailed estate data to {0} with covenant asset id {1}", Name, covenant); |
@@ -4473,7 +4473,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4473 | returnblock[4].Parameter = Utils.StringToBytes(sunPosition.ToString()); | 4473 | returnblock[4].Parameter = Utils.StringToBytes(sunPosition.ToString()); |
4474 | returnblock[5].Parameter = Utils.StringToBytes(parentEstate.ToString()); | 4474 | returnblock[5].Parameter = Utils.StringToBytes(parentEstate.ToString()); |
4475 | returnblock[6].Parameter = Utils.StringToBytes(covenant.ToString()); | 4475 | returnblock[6].Parameter = Utils.StringToBytes(covenant.ToString()); |
4476 | returnblock[7].Parameter = Utils.StringToBytes("1160895077"); // what is this? | 4476 | returnblock[7].Parameter = Utils.StringToBytes(covenantChanged.ToString()); |
4477 | returnblock[8].Parameter = Utils.StringToBytes("1"); // what is this? | 4477 | returnblock[8].Parameter = Utils.StringToBytes("1"); // what is this? |
4478 | returnblock[9].Parameter = Utils.StringToBytes(abuseEmail); | 4478 | returnblock[9].Parameter = Utils.StringToBytes(abuseEmail); |
4479 | 4479 | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 2e1487f..c303d6d 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -80,6 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
80 | GetEstateFlags(), | 80 | GetEstateFlags(), |
81 | sun, | 81 | sun, |
82 | Scene.RegionInfo.RegionSettings.Covenant, | 82 | Scene.RegionInfo.RegionSettings.Covenant, |
83 | (uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime, | ||
83 | Scene.RegionInfo.EstateSettings.AbuseEmail, | 84 | Scene.RegionInfo.EstateSettings.AbuseEmail, |
84 | estateOwner); | 85 | estateOwner); |
85 | 86 | ||
@@ -268,6 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
268 | // remoteClient.Name, estateCovenantID); | 269 | // remoteClient.Name, estateCovenantID); |
269 | 270 | ||
270 | Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; | 271 | Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; |
272 | Scene.RegionInfo.RegionSettings.CovenantChangedDateTime = Util.UnixTimeSinceEpoch(); | ||
271 | Scene.RegionInfo.RegionSettings.Save(); | 273 | Scene.RegionInfo.RegionSettings.Save(); |
272 | TriggerRegionInfoChange(); | 274 | TriggerRegionInfoChange(); |
273 | } | 275 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 27bcc09..0e899ca 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2729,10 +2729,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2729 | if (ParentGroup == null) | 2729 | if (ParentGroup == null) |
2730 | return; | 2730 | return; |
2731 | 2731 | ||
2732 | // When running OpenSim tests, Scene (and EventManager can be null). | ||
2733 | // Need to fix tests before we can trigger this here | ||
2734 | // ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2735 | |||
2736 | ParentGroup.QueueForUpdateCheck(); | 2732 | ParentGroup.QueueForUpdateCheck(); |
2737 | 2733 | ||
2738 | int timeNow = Util.UnixTimeSinceEpoch(); | 2734 | int timeNow = Util.UnixTimeSinceEpoch(); |
@@ -2754,6 +2750,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2754 | // m_log.DebugFormat( | 2750 | // m_log.DebugFormat( |
2755 | // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", | 2751 | // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", |
2756 | // UUID, Name, TimeStampFull); | 2752 | // UUID, Name, TimeStampFull); |
2753 | |||
2754 | if (ParentGroup.Scene != null) | ||
2755 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2757 | } | 2756 | } |
2758 | 2757 | ||
2759 | /// <summary> | 2758 | /// <summary> |
@@ -2765,15 +2764,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2765 | if (ParentGroup == null) | 2764 | if (ParentGroup == null) |
2766 | return; | 2765 | return; |
2767 | 2766 | ||
2768 | // When running OpenSim tests, Scene (and EventManager can be null). | ||
2769 | // Need to fix tests before we can trigger this here | ||
2770 | // ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2771 | |||
2772 | // This was pulled from SceneViewer. Attachments always receive full updates. | 2767 | // This was pulled from SceneViewer. Attachments always receive full updates. |
2773 | // I could not verify if this is a requirement but this maintains existing behavior | 2768 | // I could not verify if this is a requirement but this maintains existing behavior |
2774 | if (ParentGroup.IsAttachment) | 2769 | if (ParentGroup.IsAttachment) |
2775 | { | 2770 | { |
2776 | ScheduleFullUpdate(); | 2771 | ScheduleFullUpdate(); |
2772 | return; | ||
2777 | } | 2773 | } |
2778 | 2774 | ||
2779 | if (UpdateFlag == UpdateRequired.NONE) | 2775 | if (UpdateFlag == UpdateRequired.NONE) |
@@ -2788,6 +2784,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2788 | // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", | 2784 | // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", |
2789 | // UUID, Name, TimeStampTerse); | 2785 | // UUID, Name, TimeStampTerse); |
2790 | } | 2786 | } |
2787 | |||
2788 | if (ParentGroup.Scene != null) | ||
2789 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2791 | } | 2790 | } |
2792 | 2791 | ||
2793 | public void ScriptSetPhysicsStatus(bool UsePhysics) | 2792 | public void ScriptSetPhysicsStatus(bool UsePhysics) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 11f927c..c928af7 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1243,7 +1243,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1243 | 1243 | ||
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) | 1246 | public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) |
1247 | { | 1247 | { |
1248 | 1248 | ||
1249 | } | 1249 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 81bf9ed..be0d56e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -933,7 +933,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
933 | public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint) | 933 | public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint) |
934 | { | 934 | { |
935 | } | 935 | } |
936 | public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) | 936 | public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) |
937 | { | 937 | { |
938 | } | 938 | } |
939 | 939 | ||
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 3831d7a..6a48b89 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -140,24 +140,26 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
140 | // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); | 140 | // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); |
141 | // } | 141 | // } |
142 | 142 | ||
143 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); | 143 | lock (m_avatars) |
144 | scene.AddNewClient(npcAvatar, PresenceType.Npc); | ||
145 | |||
146 | ScenePresence sp; | ||
147 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) | ||
148 | { | 144 | { |
149 | m_log.DebugFormat( | 145 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); |
150 | "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); | 146 | scene.AddNewClient(npcAvatar, PresenceType.Npc); |
151 | 147 | ||
152 | sp.CompleteMovement(npcAvatar, false); | 148 | ScenePresence sp; |
153 | } | 149 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) |
154 | else | 150 | { |
155 | { | 151 | m_log.DebugFormat( |
156 | m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); | 152 | "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); |
157 | } | 153 | |
154 | sp.CompleteMovement(npcAvatar, false); | ||
155 | } | ||
156 | else | ||
157 | { | ||
158 | m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); | ||
159 | } | ||
158 | 160 | ||
159 | lock (m_avatars) | ||
160 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); | 161 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); |
162 | } | ||
161 | 163 | ||
162 | m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); | 164 | m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); |
163 | 165 | ||
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4d3d257..14c1287 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -972,7 +972,7 @@ namespace OpenSim.Tests.Common.Mock | |||
972 | { | 972 | { |
973 | } | 973 | } |
974 | 974 | ||
975 | public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) | 975 | public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) |
976 | { | 976 | { |
977 | } | 977 | } |
978 | 978 | ||