aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs2
-rw-r--r--OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs2
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs113
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs11
-rw-r--r--OpenSim/Framework/Console/LocalConsole.cs14
-rw-r--r--OpenSim/Framework/Console/RemoteConsole.cs4
-rw-r--r--OpenSim/Framework/IClientAPI.cs8
-rw-r--r--OpenSim/Framework/LandData.cs26
-rwxr-xr-xOpenSim/Region/Application/OpenSim.cs7
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs58
-rw-r--r--OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Access/AccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs24
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs41
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISoundModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/ITerrainModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IWorldComm.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs172
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs49
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs139
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs342
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs92
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs79
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs5
-rw-r--r--OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs5
-rw-r--r--OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs5
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs19
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs6
-rw-r--r--OpenSim/Region/Physics/Manager/VehicleConstants.cs12
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs5
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs451
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs5
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSCharacter.cs2
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPrim.cs2
-rw-r--r--OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs257
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs2
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs2
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs4
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs2
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
57 files changed, 1684 insertions, 396 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index 94a81f0..d414f08 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -692,6 +692,8 @@ namespace OpenSim.Client.MXP.ClientStack
692 public event UUIDNameRequest OnTeleportHomeRequest; 692 public event UUIDNameRequest OnTeleportHomeRequest;
693 public event ScriptAnswer OnScriptAnswer; 693 public event ScriptAnswer OnScriptAnswer;
694 public event AgentSit OnUndo; 694 public event AgentSit OnUndo;
695 public event AgentSit OnRedo;
696 public event LandUndo OnLandUndo;
695 public event ForceReleaseControls OnForceReleaseControls; 697 public event ForceReleaseControls OnForceReleaseControls;
696 public event GodLandStatRequest OnLandStatRequest; 698 public event GodLandStatRequest OnLandStatRequest;
697 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 699 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
index eac20bc..d305ffe 100644
--- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
+++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
@@ -338,6 +338,8 @@ namespace OpenSim.Client.Sirikata.ClientStack
338 public event UUIDNameRequest OnTeleportHomeRequest; 338 public event UUIDNameRequest OnTeleportHomeRequest;
339 public event ScriptAnswer OnScriptAnswer; 339 public event ScriptAnswer OnScriptAnswer;
340 public event AgentSit OnUndo; 340 public event AgentSit OnUndo;
341 public event AgentSit OnRedo;
342 public event LandUndo OnLandUndo;
341 public event ForceReleaseControls OnForceReleaseControls; 343 public event ForceReleaseControls OnForceReleaseControls;
342 public event GodLandStatRequest OnLandStatRequest; 344 public event GodLandStatRequest OnLandStatRequest;
343 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 345 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index 2012211..ef74677 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -343,6 +343,8 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
343 public event UUIDNameRequest OnTeleportHomeRequest = delegate { }; 343 public event UUIDNameRequest OnTeleportHomeRequest = delegate { };
344 public event ScriptAnswer OnScriptAnswer = delegate { }; 344 public event ScriptAnswer OnScriptAnswer = delegate { };
345 public event AgentSit OnUndo = delegate { }; 345 public event AgentSit OnUndo = delegate { };
346 public event AgentSit OnRedo = delegate { };
347 public event LandUndo OnLandUndo = delegate { };
346 public event ForceReleaseControls OnForceReleaseControls = delegate { }; 348 public event ForceReleaseControls OnForceReleaseControls = delegate { };
347 public event GodLandStatRequest OnLandStatRequest = delegate { }; 349 public event GodLandStatRequest OnLandStatRequest = delegate { };
348 public event DetailedEstateDataRequest OnDetailedEstateDataRequest = delegate { }; 350 public event DetailedEstateDataRequest OnDetailedEstateDataRequest = delegate { };
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index b68de1a..5a4ee2a 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -617,18 +617,42 @@ namespace OpenSim.Data.SQLite
617 { 617 {
618 lock (ds) 618 lock (ds)
619 { 619 {
620 using (SqliteCommand cmd = new SqliteCommand("delete from land where UUID=:UUID", m_conn)) 620 // Can't use blanket SQL statements when using SqlAdapters unless you re-read the data into the adapter
621 // after you're done.
622 // replaced below code with the SqliteAdapter version.
623 //using (SqliteCommand cmd = new SqliteCommand("delete from land where UUID=:UUID", m_conn))
624 //{
625 // cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString()));
626 // cmd.ExecuteNonQuery();
627 //}
628
629 //using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:UUID", m_conn))
630 //{
631 // cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString()));
632 // cmd.ExecuteNonQuery();
633 //}
634
635 DataTable land = ds.Tables["land"];
636 DataTable landaccesslist = ds.Tables["landaccesslist"];
637 DataRow landRow = land.Rows.Find(globalID.ToString());
638 if (landRow != null)
621 { 639 {
622 cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString())); 640 land.Rows.Remove(landRow);
623 cmd.ExecuteNonQuery();
624 } 641 }
625 642 List<DataRow> rowsToDelete = new List<DataRow>();
626 using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:UUID", m_conn)) 643 foreach (DataRow rowToCheck in landaccesslist.Rows)
627 { 644 {
628 cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString())); 645 if (rowToCheck["LandUUID"].ToString() == globalID.ToString())
629 cmd.ExecuteNonQuery(); 646 rowsToDelete.Add(rowToCheck);
647 }
648 for (int iter = 0; iter < rowsToDelete.Count; iter++)
649 {
650 landaccesslist.Rows.Remove(rowsToDelete[iter]);
630 } 651 }
652
653
631 } 654 }
655 Commit();
632 } 656 }
633 657
634 /// <summary> 658 /// <summary>
@@ -655,12 +679,27 @@ namespace OpenSim.Data.SQLite
655 } 679 }
656 680
657 // I know this caused someone issues before, but OpenSim is unusable if we leave this stuff around 681 // I know this caused someone issues before, but OpenSim is unusable if we leave this stuff around
658 using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", m_conn)) 682 //using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", m_conn))
683 //{
684 // cmd.Parameters.Add(new SqliteParameter(":LandUUID", parcel.LandData.GlobalID.ToString()));
685 // cmd.ExecuteNonQuery();
686
687// }
688
689 // This is the slower.. but more appropriate thing to do
690
691 // We can't modify the table with direct queries before calling Commit() and re-filling them.
692 List<DataRow> rowsToDelete = new List<DataRow>();
693 foreach (DataRow rowToCheck in landaccesslist.Rows)
659 { 694 {
660 cmd.Parameters.Add(new SqliteParameter(":LandUUID", parcel.LandData.GlobalID.ToString())); 695 if (rowToCheck["LandUUID"].ToString() == parcel.LandData.GlobalID.ToString())
661 cmd.ExecuteNonQuery(); 696 rowsToDelete.Add(rowToCheck);
662 } 697 }
663 698 for (int iter = 0; iter < rowsToDelete.Count; iter++)
699 {
700 landaccesslist.Rows.Remove(rowsToDelete[iter]);
701 }
702 rowsToDelete.Clear();
664 foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) 703 foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList)
665 { 704 {
666 DataRow newAccessRow = landaccesslist.NewRow(); 705 DataRow newAccessRow = landaccesslist.NewRow();
@@ -1711,7 +1750,7 @@ namespace OpenSim.Data.SQLite
1711 row["terrain_raise_limit"] = settings.TerrainRaiseLimit; 1750 row["terrain_raise_limit"] = settings.TerrainRaiseLimit;
1712 row["terrain_lower_limit"] = settings.TerrainLowerLimit; 1751 row["terrain_lower_limit"] = settings.TerrainLowerLimit;
1713 row["use_estate_sun"] = settings.UseEstateSun; 1752 row["use_estate_sun"] = settings.UseEstateSun;
1714 row["sandbox"] = settings.Sandbox; 1753 row["Sandbox"] = settings.Sandbox; // database uses upper case S for sandbox
1715 row["sunvectorx"] = settings.SunVector.X; 1754 row["sunvectorx"] = settings.SunVector.X;
1716 row["sunvectory"] = settings.SunVector.Y; 1755 row["sunvectory"] = settings.SunVector.Y;
1717 row["sunvectorz"] = settings.SunVector.Z; 1756 row["sunvectorz"] = settings.SunVector.Z;
@@ -1813,6 +1852,7 @@ namespace OpenSim.Data.SQLite
1813 /// <param name="regionUUID"></param> 1852 /// <param name="regionUUID"></param>
1814 private void addPrim(SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) 1853 private void addPrim(SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID)
1815 { 1854 {
1855
1816 DataTable prims = ds.Tables["prims"]; 1856 DataTable prims = ds.Tables["prims"];
1817 DataTable shapes = ds.Tables["primshapes"]; 1857 DataTable shapes = ds.Tables["primshapes"];
1818 1858
@@ -1962,6 +2002,40 @@ namespace OpenSim.Data.SQLite
1962 } 2002 }
1963 2003
1964 /// <summary> 2004 /// <summary>
2005 /// create an update command
2006 /// </summary>
2007 /// <param name="table">table name</param>
2008 /// <param name="pk"></param>
2009 /// <param name="dt"></param>
2010 /// <returns>the created command</returns>
2011 private static SqliteCommand createUpdateCommand(string table, string pk1, string pk2, DataTable dt)
2012 {
2013 string sql = "update " + table + " set ";
2014 string subsql = String.Empty;
2015 foreach (DataColumn col in dt.Columns)
2016 {
2017 if (subsql.Length > 0)
2018 {
2019 // a map function would rock so much here
2020 subsql += ", ";
2021 }
2022 subsql += col.ColumnName + "= :" + col.ColumnName;
2023 }
2024 sql += subsql;
2025 sql += " where " + pk1 + " and " + pk2;
2026 SqliteCommand cmd = new SqliteCommand(sql);
2027
2028 // this provides the binding for all our parameters, so
2029 // much less code than it used to be
2030
2031 foreach (DataColumn col in dt.Columns)
2032 {
2033 cmd.Parameters.Add(createSqliteParameter(col.ColumnName, col.DataType));
2034 }
2035 return cmd;
2036 }
2037
2038 /// <summary>
1965 /// 2039 ///
1966 /// </summary> 2040 /// </summary>
1967 /// <param name="dt">Data Table</param> 2041 /// <param name="dt">Data Table</param>
@@ -2079,6 +2153,11 @@ namespace OpenSim.Data.SQLite
2079 2153
2080 da.UpdateCommand = createUpdateCommand("land", "UUID=:UUID", ds.Tables["land"]); 2154 da.UpdateCommand = createUpdateCommand("land", "UUID=:UUID", ds.Tables["land"]);
2081 da.UpdateCommand.Connection = conn; 2155 da.UpdateCommand.Connection = conn;
2156
2157 SqliteCommand delete = new SqliteCommand("delete from land where UUID=:UUID");
2158 delete.Parameters.Add(createSqliteParameter("UUID", typeof(String)));
2159 da.DeleteCommand = delete;
2160 da.DeleteCommand.Connection = conn;
2082 } 2161 }
2083 2162
2084 /// <summary> 2163 /// <summary>
@@ -2090,6 +2169,16 @@ namespace OpenSim.Data.SQLite
2090 { 2169 {
2091 da.InsertCommand = createInsertCommand("landaccesslist", ds.Tables["landaccesslist"]); 2170 da.InsertCommand = createInsertCommand("landaccesslist", ds.Tables["landaccesslist"]);
2092 da.InsertCommand.Connection = conn; 2171 da.InsertCommand.Connection = conn;
2172
2173 da.UpdateCommand = createUpdateCommand("landaccesslist", "LandUUID=:landUUID", "AccessUUID=:AccessUUID", ds.Tables["landaccesslist"]);
2174 da.UpdateCommand.Connection = conn;
2175
2176 SqliteCommand delete = new SqliteCommand("delete from landaccesslist where LandUUID= :LandUUID and AccessUUID= :AccessUUID");
2177 delete.Parameters.Add(createSqliteParameter("LandUUID", typeof(String)));
2178 delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String)));
2179 da.DeleteCommand = delete;
2180 da.DeleteCommand.Connection = conn;
2181
2093 } 2182 }
2094 2183
2095 private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) 2184 private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn)
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index a3ea499..a2a5c84 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Framework
69 private static UUID HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); 69 private static UUID HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66");
70 private static UUID HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); 70 private static UUID HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66");
71 71
72 public readonly static int VISUALPARAM_COUNT = 218; 72 public readonly static int VISUALPARAM_COUNT = 218;
73 73
74 protected UUID m_owner; 74 protected UUID m_owner;
75 75
@@ -361,7 +361,7 @@ namespace OpenSim.Framework
361 // This sets Visual Params with *less* weirder values then default. Instead of a ugly alien, it looks like a fat scientist 361 // This sets Visual Params with *less* weirder values then default. Instead of a ugly alien, it looks like a fat scientist
362 SetDefaultParams(m_visualparams); 362 SetDefaultParams(m_visualparams);
363 SetDefaultWearables(); 363 SetDefaultWearables();
364 m_texture = GetDefaultTexture(); 364 m_texture = GetDefaultTexture();
365 } 365 }
366 366
367 public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, byte[] visualParams) 367 public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, byte[] visualParams)
@@ -390,11 +390,12 @@ namespace OpenSim.Framework
390 + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height 390 + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height
391 + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height 391 + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height
392 + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; // Neck length 392 + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; // Neck length
393 m_hipOffset = (0.615385f // Half of avatar 393 m_hipOffset = (((1.23077f // Half of avatar
394 + 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height
395 + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length
394 + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height 396 + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height
395 + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height 397 + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height
396 + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length 398 ) / 2) - m_avatarHeight / 2) * 0.31f - 0.0425f;
397 - m_avatarHeight / 2) * 0.3f - 0.04f;
398 399
399 400
400 401
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs
index b7e191b..be936b6 100644
--- a/OpenSim/Framework/Console/LocalConsole.cs
+++ b/OpenSim/Framework/Console/LocalConsole.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console
38{ 38{
39 /// <summary> 39 /// <summary>
40 /// A console that uses cursor control and color 40 /// A console that uses cursor control and color
41 /// </summary> 41 /// </summary>
42 public class LocalConsole : CommandConsole 42 public class LocalConsole : CommandConsole
43 { 43 {
44// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -100,8 +100,8 @@ namespace OpenSim.Framework.Console
100 private int SetCursorTop(int top) 100 private int SetCursorTop(int top)
101 { 101 {
102 // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try 102 // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
103 // to set a cursor row position with a currently invalid column, mono will throw an exception. 103 // to set a cursor row position with a currently invalid column, mono will throw an exception.
104 // Therefore, we need to make sure that the column position is valid first. 104 // Therefore, we need to make sure that the column position is valid first.
105 int left = System.Console.CursorLeft; 105 int left = System.Console.CursorLeft;
106 106
107 if (left < 0) 107 if (left < 0)
@@ -129,12 +129,12 @@ namespace OpenSim.Framework.Console
129 /// </param> 129 /// </param>
130 /// <returns> 130 /// <returns>
131 /// The new cursor column. 131 /// The new cursor column.
132 /// </returns> 132 /// </returns>
133 private int SetCursorLeft(int left) 133 private int SetCursorLeft(int left)
134 { 134 {
135 // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try 135 // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
136 // to set a cursor column position with a currently invalid row, mono will throw an exception. 136 // to set a cursor column position with a currently invalid row, mono will throw an exception.
137 // Therefore, we need to make sure that the row position is valid first. 137 // Therefore, we need to make sure that the row position is valid first.
138 int top = System.Console.CursorTop; 138 int top = System.Console.CursorTop;
139 139
140 if (top < 0) 140 if (top < 0)
@@ -183,7 +183,7 @@ namespace OpenSim.Framework.Console
183 System.Console.Write("{0}", prompt); 183 System.Console.Write("{0}", prompt);
184 184
185 SetCursorTop(new_y); 185 SetCursorTop(new_y);
186 SetCursorLeft(new_x); 186 SetCursorLeft(new_x);
187 } 187 }
188 } 188 }
189 189
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index 9fdd1b8..6f8348d 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -302,9 +302,9 @@ namespace OpenSim.Framework.Console
302 if (!UUID.TryParse(post["ID"].ToString(), out id)) 302 if (!UUID.TryParse(post["ID"].ToString(), out id))
303 return reply; 303 return reply;
304 304
305 lock(m_Connections) 305 lock (m_Connections)
306 { 306 {
307 if(!m_Connections.ContainsKey(id)) 307 if (!m_Connections.ContainsKey(id))
308 return reply; 308 return reply;
309 } 309 }
310 310
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 3f53258..222bae0 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -152,6 +152,8 @@ namespace OpenSim.Framework
152 152
153 public delegate void AgentSit(IClientAPI remoteClient, UUID agentID); 153 public delegate void AgentSit(IClientAPI remoteClient, UUID agentID);
154 154
155 public delegate void LandUndo(IClientAPI remoteClient);
156
155 public delegate void AvatarPickerRequest(IClientAPI remoteClient, UUID agentdata, UUID queryID, string UserQuery); 157 public delegate void AvatarPickerRequest(IClientAPI remoteClient, UUID agentdata, UUID queryID, string UserQuery);
156 158
157 public delegate void GrabObject( 159 public delegate void GrabObject(
@@ -419,9 +421,9 @@ namespace OpenSim.Framework
419 public delegate void AcceptCallingCard(IClientAPI remoteClient, UUID transactionID, UUID folderID); 421 public delegate void AcceptCallingCard(IClientAPI remoteClient, UUID transactionID, UUID folderID);
420 422
421 public delegate void DeclineCallingCard(IClientAPI remoteClient, UUID transactionID); 423 public delegate void DeclineCallingCard(IClientAPI remoteClient, UUID transactionID);
422 424
423 public delegate void SoundTrigger( 425 public delegate void SoundTrigger(
424 UUID soundId, UUID ownerid, UUID objid, UUID parentid, double Gain, Vector3 Position, UInt64 Handle); 426 UUID soundId, UUID ownerid, UUID objid, UUID parentid, double Gain, Vector3 Position, UInt64 Handle, float radius);
425 427
426 public delegate void StartLure(byte lureType, string message, UUID targetID, IClientAPI client); 428 public delegate void StartLure(byte lureType, string message, UUID targetID, IClientAPI client);
427 public delegate void TeleportLureRequest(UUID lureID, uint teleportFlags, IClientAPI client); 429 public delegate void TeleportLureRequest(UUID lureID, uint teleportFlags, IClientAPI client);
@@ -988,6 +990,8 @@ namespace OpenSim.Framework
988 event ScriptAnswer OnScriptAnswer; 990 event ScriptAnswer OnScriptAnswer;
989 991
990 event AgentSit OnUndo; 992 event AgentSit OnUndo;
993 event AgentSit OnRedo;
994 event LandUndo OnLandUndo;
991 995
992 event ForceReleaseControls OnForceReleaseControls; 996 event ForceReleaseControls OnForceReleaseControls;
993 event GodLandStatRequest OnLandStatRequest; 997 event GodLandStatRequest OnLandStatRequest;
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index 071a667..060e886 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -358,6 +358,32 @@ namespace OpenSim.Framework
358 } 358 }
359 } 359 }
360 360
361 private int[] _mediaSize = new int[2];
362 public int[] MediaSize
363 {
364 get
365 {
366 return _mediaSize;
367 }
368 set
369 {
370 _mediaSize = value;
371 }
372 }
373
374 private string _mediaType = "";
375 public string MediaType
376 {
377 get
378 {
379 return _mediaType;
380 }
381 set
382 {
383 _mediaType = value;
384 }
385 }
386
361 /// <summary> 387 /// <summary>
362 /// URL to the shoutcast music stream to play on the parcel 388 /// URL to the shoutcast music stream to play on the parcel
363 /// </summary> 389 /// </summary>
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index a86a831..96eceb0 100755
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -367,7 +367,6 @@ namespace OpenSim
367 m_console.Commands.AddCommand("hypergrid", false, "unlink-region", 367 m_console.Commands.AddCommand("hypergrid", false, "unlink-region",
368 "unlink-region <local name> or <HostName>:<HttpPort> <cr>", 368 "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
369 "Unlink a hypergrid region", RunCommand); 369 "Unlink a hypergrid region", RunCommand);
370
371 } 370 }
372 371
373 public override void ShutdownSpecific() 372 public override void ShutdownSpecific()
@@ -433,7 +432,7 @@ namespace OpenSim
433 // kick client... 432 // kick client...
434 if (alert != null) 433 if (alert != null)
435 presence.ControllingClient.Kick(alert); 434 presence.ControllingClient.Kick(alert);
436 else 435 else
437 presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); 436 presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
438 437
439 // ...and close on our side 438 // ...and close on our side
@@ -640,7 +639,6 @@ namespace OpenSim
640 } 639 }
641 } 640 }
642 641
643
644 /// <summary> 642 /// <summary>
645 /// Load, Unload, and list Region modules in use 643 /// Load, Unload, and list Region modules in use
646 /// </summary> 644 /// </summary>
@@ -972,7 +970,6 @@ namespace OpenSim
972 scene.RegionInfo.RegionLocX, 970 scene.RegionInfo.RegionLocX,
973 scene.RegionInfo.RegionLocY, 971 scene.RegionInfo.RegionLocY,
974 scene.RegionInfo.InternalEndPoint.Port)); 972 scene.RegionInfo.InternalEndPoint.Port));
975
976 }); 973 });
977 break; 974 break;
978 975
@@ -1097,7 +1094,7 @@ namespace OpenSim
1097 } 1094 }
1098 else 1095 else
1099 { 1096 {
1100 MainConsole.Instance.Output(string.Format("A user with the name {0} {1} already exists!", firstName, lastName)); 1097 MainConsole.Instance.Output(string.Format("A user with the name {0} {1} already exists!", firstName, lastName));
1101 } 1098 }
1102 } 1099 }
1103 1100
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index e39323f..6cc0bd2 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -233,6 +233,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
233 public event ObjectBuy OnObjectBuy; 233 public event ObjectBuy OnObjectBuy;
234 public event BuyObjectInventory OnBuyObjectInventory; 234 public event BuyObjectInventory OnBuyObjectInventory;
235 public event AgentSit OnUndo; 235 public event AgentSit OnUndo;
236 public event AgentSit OnRedo;
237 public event LandUndo OnLandUndo;
236 public event ForceReleaseControls OnForceReleaseControls; 238 public event ForceReleaseControls OnForceReleaseControls;
237 public event GodLandStatRequest OnLandStatRequest; 239 public event GodLandStatRequest OnLandStatRequest;
238 public event RequestObjectPropertiesFamily OnObjectGroupRequest; 240 public event RequestObjectPropertiesFamily OnObjectGroupRequest;
@@ -4667,6 +4669,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4667 AddLocalPacketHandler(PacketType.ObjectName, HandleObjectName, false); 4669 AddLocalPacketHandler(PacketType.ObjectName, HandleObjectName, false);
4668 AddLocalPacketHandler(PacketType.ObjectPermissions, HandleObjectPermissions, false); 4670 AddLocalPacketHandler(PacketType.ObjectPermissions, HandleObjectPermissions, false);
4669 AddLocalPacketHandler(PacketType.Undo, HandleUndo, false); 4671 AddLocalPacketHandler(PacketType.Undo, HandleUndo, false);
4672 AddLocalPacketHandler(PacketType.UndoLand, HandleLandUndo, false);
4673 AddLocalPacketHandler(PacketType.Redo, HandleRedo, false);
4670 AddLocalPacketHandler(PacketType.ObjectDuplicateOnRay, HandleObjectDuplicateOnRay); 4674 AddLocalPacketHandler(PacketType.ObjectDuplicateOnRay, HandleObjectDuplicateOnRay);
4671 AddLocalPacketHandler(PacketType.RequestObjectPropertiesFamily, HandleRequestObjectPropertiesFamily, false); 4675 AddLocalPacketHandler(PacketType.RequestObjectPropertiesFamily, HandleRequestObjectPropertiesFamily, false);
4672 AddLocalPacketHandler(PacketType.ObjectIncludeInSearch, HandleObjectIncludeInSearch); 4676 AddLocalPacketHandler(PacketType.ObjectIncludeInSearch, HandleObjectIncludeInSearch);
@@ -5212,7 +5216,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5212 args.Type = ChatTypeEnum.Shout; 5216 args.Type = ChatTypeEnum.Shout;
5213 args.Position = new Vector3(); 5217 args.Position = new Vector3();
5214 args.Scene = Scene; 5218 args.Scene = Scene;
5215 args.Sender = this; 5219 args.Sender = this;
5216 ChatMessage handlerChatFromClient2 = OnChatFromClient; 5220 ChatMessage handlerChatFromClient2 = OnChatFromClient;
5217 if (handlerChatFromClient2 != null) 5221 if (handlerChatFromClient2 != null)
5218 handlerChatFromClient2(this, args); 5222 handlerChatFromClient2(this, args);
@@ -5836,7 +5840,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5836 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, 5840 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID,
5837 soundTriggerPacket.SoundData.ObjectID, soundTriggerPacket.SoundData.ParentID, 5841 soundTriggerPacket.SoundData.ObjectID, soundTriggerPacket.SoundData.ParentID,
5838 soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position, 5842 soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position,
5839 soundTriggerPacket.SoundData.Handle); 5843 soundTriggerPacket.SoundData.Handle, 0);
5840 5844
5841 } 5845 }
5842 return true; 5846 return true;
@@ -6734,6 +6738,56 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6734 return true; 6738 return true;
6735 } 6739 }
6736 6740
6741 private bool HandleLandUndo(IClientAPI sender, Packet Pack)
6742 {
6743 UndoLandPacket undolanditem = (UndoLandPacket)Pack;
6744
6745 #region Packet Session and User Check
6746 if (m_checkPackets)
6747 {
6748 if (undolanditem.AgentData.SessionID != SessionId ||
6749 undolanditem.AgentData.AgentID != AgentId)
6750 return true;
6751 }
6752 #endregion
6753
6754 LandUndo handlerOnUndo = OnLandUndo;
6755 if (handlerOnUndo != null)
6756 {
6757 handlerOnUndo(this);
6758 }
6759 return true;
6760 }
6761
6762 private bool HandleRedo(IClientAPI sender, Packet Pack)
6763 {
6764 RedoPacket redoitem = (RedoPacket)Pack;
6765
6766 #region Packet Session and User Check
6767 if (m_checkPackets)
6768 {
6769 if (redoitem.AgentData.SessionID != SessionId ||
6770 redoitem.AgentData.AgentID != AgentId)
6771 return true;
6772 }
6773 #endregion
6774
6775 if (redoitem.ObjectData.Length > 0)
6776 {
6777 for (int i = 0; i < redoitem.ObjectData.Length; i++)
6778 {
6779 UUID objiD = redoitem.ObjectData[i].ObjectID;
6780 AgentSit handlerOnRedo = OnRedo;
6781 if (handlerOnRedo != null)
6782 {
6783 handlerOnRedo(this, objiD);
6784 }
6785
6786 }
6787 }
6788 return true;
6789 }
6790
6737 private bool HandleObjectDuplicateOnRay(IClientAPI sender, Packet Pack) 6791 private bool HandleObjectDuplicateOnRay(IClientAPI sender, Packet Pack)
6738 { 6792 {
6739 ObjectDuplicateOnRayPacket dupeOnRay = (ObjectDuplicateOnRayPacket)Pack; 6793 ObjectDuplicateOnRayPacket dupeOnRay = (ObjectDuplicateOnRayPacket)Pack;
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
index 1903eb9..b1b7b27 100644
--- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
@@ -330,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Asset
330 //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); 330 //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
331 331
332 if (name != Name) 332 if (name != Name)
333 return; 333 return;
334 334
335 long maxSize = DefaultMaxSize; 335 long maxSize = DefaultMaxSize;
336 int maxCount = DefaultMaxCount; 336 int maxCount = DefaultMaxCount;
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
index 61b6d65..4069991 100644
--- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
@@ -148,13 +148,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
148 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) 148 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
149 { 149 {
150 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); 150 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
151 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) 151 try
152 { 152 {
153 avatar.Invulnerable = false; 153 if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
154 {
155 avatar.Invulnerable = false;
156 }
157 else
158 {
159 avatar.Invulnerable = true;
160 }
154 } 161 }
155 else 162 catch (Exception ex)
156 { 163 {
157 avatar.Invulnerable = true;
158 } 164 }
159 } 165 }
160 } 166 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
index 2f21e6d..50348da 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
224 m_Cache.Cache(a); 224 m_Cache.Cache(a);
225 225
226// if (null == a) 226// if (null == a)
227// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id); 227// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id);
228 228
229 Util.FireAndForget(delegate { handler(assetID, s, a); }); 229 Util.FireAndForget(delegate { handler(assetID, s, a); });
230 }); 230 });
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs
index 73f7ae3..e4fe352 100644
--- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs
+++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs
@@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.World
109 { 109 {
110 foreach (Scene s in m_SceneList) 110 foreach (Scene s in m_SceneList)
111 { 111 {
112 if(!ProcessCommand(s, cmd)) 112 if (!ProcessCommand(s, cmd))
113 break; 113 break;
114 } 114 }
115 } 115 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index c3e57f0..e77a23b 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
99 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); 99 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
100 Vector3 offsetPosition = new Vector3(5, 10, 15); 100 Vector3 offsetPosition = new Vector3(5, 10, 15);
101 101
102 return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; 102 return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
103 } 103 }
104 104
105 protected SceneObjectPart CreateSceneObjectPart2() 105 protected SceneObjectPart CreateSceneObjectPart2()
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
112 Vector3 offsetPosition = new Vector3(20, 25, 30); 112 Vector3 offsetPosition = new Vector3(20, 25, 30);
113 113
114 return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; 114 return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
115 } 115 }
116 116
117 /// <summary> 117 /// <summary>
118 /// Test saving a V0.2 OpenSim Region Archive. 118 /// Test saving a V0.2 OpenSim Region Archive.
@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
231 foreach (string name in names) 231 foreach (string name in names)
232 { 232 {
233 if (name.EndsWith(".Resources.test-sound.wav")) 233 if (name.EndsWith(".Resources.test-sound.wav"))
234 soundDataResourceName = name; 234 soundDataResourceName = name;
235 } 235 }
236 Assert.That(soundDataResourceName, Is.Not.Null); 236 Assert.That(soundDataResourceName, Is.Not.Null);
237 237
@@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
259 = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName }; 259 = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName };
260 part1.Inventory.AddInventoryItem(item1, true); 260 part1.Inventory.AddInventoryItem(item1, true);
261 } 261 }
262 } 262 }
263 263
264 m_scene.AddNewSceneObject(object1, false); 264 m_scene.AddNewSceneObject(object1, false);
265 265
@@ -306,15 +306,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
306 /// Test loading the region settings of a V0.2 OpenSim Region Archive. 306 /// Test loading the region settings of a V0.2 OpenSim Region Archive.
307 /// </summary> 307 /// </summary>
308 [Test] 308 [Test]
309 public void TestLoadOarV0_2RegionSettings() 309 public void TestLoadOarV0_2RegionSettings()
310 { 310 {
311 TestHelper.InMethod(); 311 TestHelper.InMethod();
312 //log4net.Config.XmlConfigurator.Configure(); 312 //log4net.Config.XmlConfigurator.Configure();
313 313
314 MemoryStream archiveWriteStream = new MemoryStream(); 314 MemoryStream archiveWriteStream = new MemoryStream();
315 TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); 315 TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
316 316
317 tar.WriteDir(ArchiveConstants.TERRAINS_PATH); 317 tar.WriteDir(ArchiveConstants.TERRAINS_PATH);
318 tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); 318 tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
319 319
320 RegionSettings rs = new RegionSettings(); 320 RegionSettings rs = new RegionSettings();
@@ -329,11 +329,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
329 rs.DisablePhysics = true; 329 rs.DisablePhysics = true;
330 rs.DisableScripts = true; 330 rs.DisableScripts = true;
331 rs.Elevation1NW = 15.9; 331 rs.Elevation1NW = 15.9;
332 rs.Elevation1NE = 45.3; 332 rs.Elevation1NE = 45.3;
333 rs.Elevation1SE = 49; 333 rs.Elevation1SE = 49;
334 rs.Elevation1SW = 1.9; 334 rs.Elevation1SW = 1.9;
335 rs.Elevation2NW = 4.5; 335 rs.Elevation2NW = 4.5;
336 rs.Elevation2NE = 19.2; 336 rs.Elevation2NE = 19.2;
337 rs.Elevation2SE = 9.2; 337 rs.Elevation2SE = 9.2;
338 rs.Elevation2SW = 2.1; 338 rs.Elevation2SW = 2.1;
339 rs.FixedSun = true; 339 rs.FixedSun = true;
@@ -411,7 +411,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
411// Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); 411// Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90);
412// Vector3 part2OffsetPosition = new Vector3(20, 25, 30); 412// Vector3 part2OffsetPosition = new Vector3(20, 25, 30);
413 413
414 SceneObjectPart part2 = CreateSceneObjectPart2(); 414 SceneObjectPart part2 = CreateSceneObjectPart2();
415 415
416 // Create an oar file that we can use for the merge 416 // Create an oar file that we can use for the merge
417 { 417 {
@@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
420 TerrainModule terrainModule = new TerrainModule(); 420 TerrainModule terrainModule = new TerrainModule();
421 421
422 Scene scene = SceneSetupHelpers.SetupScene(); 422 Scene scene = SceneSetupHelpers.SetupScene();
423 SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); 423 SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
424 424
425 m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); 425 m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
426 426
427 // Write out this scene 427 // Write out this scene
428 scene.EventManager.OnOarFileSaved += SaveCompleted; 428 scene.EventManager.OnOarFileSaved += SaveCompleted;
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index 37f1f2e..1f5a4ff 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
60 } 60 }
61 61
62 public virtual void PlayAttachedSound( 62 public virtual void PlayAttachedSound(
63 UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags) 63 UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
64 { 64 {
65 foreach (ScenePresence p in m_scene.GetAvatars()) 65 foreach (ScenePresence p in m_scene.GetAvatars())
66 { 66 {
@@ -69,14 +69,17 @@ namespace OpenSim.Region.CoreModules.World.Sound
69 continue; 69 continue;
70 70
71 // Scale by distance 71 // Scale by distance
72 gain = (float)((double)gain*((100.0 - dis) / 100.0)); 72 if (radius == 0)
73 gain = (float)((double)gain * ((100.0 - dis) / 100.0));
74 else
75 gain = (float)((double)gain * ((radius - dis) / radius));
73 76
74 p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); 77 p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
75 } 78 }
76 } 79 }
77 80
78 public virtual void TriggerSound( 81 public virtual void TriggerSound(
79 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle) 82 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
80 { 83 {
81 foreach (ScenePresence p in m_scene.GetAvatars()) 84 foreach (ScenePresence p in m_scene.GetAvatars())
82 { 85 {
@@ -85,7 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Sound
85 continue; 88 continue;
86 89
87 // Scale by distance 90 // Scale by distance
88 gain = (float)((double)gain*((100.0 - dis) / 100.0)); 91 if (radius == 0)
92 gain = (float)((double)gain * ((100.0 - dis) / 100.0));
93 else
94 gain = (float)((double)gain * ((radius - dis) / radius));
89 95
90 p.ControllingClient.SendTriggeredSound( 96 p.ControllingClient.SendTriggeredSound(
91 soundId, ownerID, objectID, parentID, handle, position, (float)gain); 97 soundId, ownerID, objectID, parentID, handle, position, (float)gain);
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index a40828b..1e7ea7b 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -84,6 +84,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
84 private ITerrainChannel m_revert; 84 private ITerrainChannel m_revert;
85 private Scene m_scene; 85 private Scene m_scene;
86 private volatile bool m_tainted; 86 private volatile bool m_tainted;
87 private readonly UndoStack<LandUndoState> m_undo = new UndoStack<LandUndoState>(5);
87 88
88 #region ICommandableModule Members 89 #region ICommandableModule Members
89 90
@@ -174,6 +175,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
174 175
175 #region ITerrainModule Members 176 #region ITerrainModule Members
176 177
178 public void UndoTerrain(ITerrainChannel channel)
179 {
180 m_channel = channel;
181 }
182
177 /// <summary> 183 /// <summary>
178 /// Loads a terrain file from disk and installs it in the scene. 184 /// Loads a terrain file from disk and installs it in the scene.
179 /// </summary> 185 /// </summary>
@@ -574,6 +580,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
574 { 580 {
575 client.OnModifyTerrain += client_OnModifyTerrain; 581 client.OnModifyTerrain += client_OnModifyTerrain;
576 client.OnBakeTerrain += client_OnBakeTerrain; 582 client.OnBakeTerrain += client_OnBakeTerrain;
583 client.OnLandUndo += client_OnLandUndo;
577 } 584 }
578 585
579 /// <summary> 586 /// <summary>
@@ -664,6 +671,19 @@ namespace OpenSim.Region.CoreModules.World.Terrain
664 return changesLimited; 671 return changesLimited;
665 } 672 }
666 673
674 private void client_OnLandUndo(IClientAPI client)
675 {
676 lock (m_undo)
677 {
678 if (m_undo.Count > 0)
679 {
680 LandUndoState goback = m_undo.Pop();
681 if (goback != null)
682 goback.PlaybackState();
683 }
684 }
685 }
686
667 /// <summary> 687 /// <summary>
668 /// Sends a copy of the current terrain to the scenes clients 688 /// Sends a copy of the current terrain to the scenes clients
669 /// </summary> 689 /// </summary>
@@ -718,6 +738,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
718 } 738 }
719 if (allowed) 739 if (allowed)
720 { 740 {
741 StoreUndoState();
721 m_painteffects[(StandardTerrainEffects) action].PaintEffect( 742 m_painteffects[(StandardTerrainEffects) action].PaintEffect(
722 m_channel, allowMask, west, south, height, size, seconds); 743 m_channel, allowMask, west, south, height, size, seconds);
723 744
@@ -758,6 +779,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
758 779
759 if (allowed) 780 if (allowed)
760 { 781 {
782 StoreUndoState();
761 m_floodeffects[(StandardTerrainEffects) action].FloodEffect( 783 m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
762 m_channel, fillArea, size); 784 m_channel, fillArea, size);
763 785
@@ -782,6 +804,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain
782 } 804 }
783 } 805 }
784 806
807 private void StoreUndoState()
808 {
809 lock (m_undo)
810 {
811 if (m_undo.Count > 0)
812 {
813 LandUndoState last = m_undo.Peek();
814 if (last != null)
815 {
816 if (last.Compare(m_channel))
817 return;
818 }
819 }
820
821 LandUndoState nUndo = new LandUndoState(this, m_channel);
822 m_undo.Push(nUndo);
823 }
824 }
825
785 #region Console Commands 826 #region Console Commands
786 827
787 private void InterfaceLoadFile(Object[] args) 828 private void InterfaceLoadFile(Object[] args)
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 0bd1a26..ce9362f 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -194,6 +194,8 @@ namespace OpenSim.Region.Examples.SimpleModule
194 public event ObjectBuy OnObjectBuy; 194 public event ObjectBuy OnObjectBuy;
195 public event BuyObjectInventory OnBuyObjectInventory; 195 public event BuyObjectInventory OnBuyObjectInventory;
196 public event AgentSit OnUndo; 196 public event AgentSit OnUndo;
197 public event AgentSit OnRedo;
198 public event LandUndo OnLandUndo;
197 199
198 public event ForceReleaseControls OnForceReleaseControls; 200 public event ForceReleaseControls OnForceReleaseControls;
199 201
diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
index c289cdb..8954513 100644
--- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces
65 /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need 65 /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need
66 /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture 66 /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture
67 /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID 67 /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID
68 /// </returns> 68 /// </returns>
69 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, 69 UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
70 int updateTimer, bool SetBlending, byte AlphaValue); 70 int updateTimer, bool SetBlending, byte AlphaValue);
71 71
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index fa9bf19..f58904f 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -150,7 +150,7 @@ namespace OpenSim.Region.Framework.Interfaces
150 /// <returns> 150 /// <returns>
151 /// A list of inventory items with that name. 151 /// A list of inventory items with that name.
152 /// If no inventory item has that name then an empty list is returned. 152 /// If no inventory item has that name then an empty list is returned.
153 /// </returns> 153 /// </returns>
154 IList<TaskInventoryItem> GetInventoryItems(string name); 154 IList<TaskInventoryItem> GetInventoryItems(string name);
155 155
156 /// <summary> 156 /// <summary>
diff --git a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
index 379fabd..6117a80 100644
--- a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
@@ -32,9 +32,9 @@ namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface ISoundModule 33 public interface ISoundModule
34 { 34 {
35 void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags); 35 void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius);
36 36
37 void TriggerSound( 37 void TriggerSound(
38 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle); 38 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius);
39 } 39 }
40} \ No newline at end of file 40} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs
index 7caac55..5947afb 100644
--- a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs
@@ -62,5 +62,7 @@ namespace OpenSim.Region.Framework.Interfaces
62 void SaveToStream(string filename, Stream stream); 62 void SaveToStream(string filename, Stream stream);
63 63
64 void InstallPlugin(string name, ITerrainEffect plug); 64 void InstallPlugin(string name, ITerrainEffect plug);
65
66 void UndoTerrain(ITerrainChannel channel);
65 } 67 }
66} 68}
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs
index 948b9dc..8da99a0 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Framework.Interfaces
62 /// <param name="name">name to filter on</param> 62 /// <param name="name">name to filter on</param>
63 /// <param name="id">key to filter on (user given, could be totally faked)</param> 63 /// <param name="id">key to filter on (user given, could be totally faked)</param>
64 /// <param name="msg">msg to filter on</param> 64 /// <param name="msg">msg to filter on</param>
65 /// <returns>number of the scripts handle</returns> 65 /// <returns>number of the scripts handle</returns>
66 int Listen(uint LocalID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg); 66 int Listen(uint LocalID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg);
67 67
68 /// <summary> 68 /// <summary>
@@ -77,19 +77,19 @@ namespace OpenSim.Region.Framework.Interfaces
77 /// <param name="channel">channel to sent on</param> 77 /// <param name="channel">channel to sent on</param>
78 /// <param name="name">name of sender (object or avatar)</param> 78 /// <param name="name">name of sender (object or avatar)</param>
79 /// <param name="id">key of sender (object or avatar)</param> 79 /// <param name="id">key of sender (object or avatar)</param>
80 /// <param name="msg">msg to sent</param> 80 /// <param name="msg">msg to sent</param>
81 void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); 81 void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg);
82 82
83 /// <summary> 83 /// <summary>
84 /// Are there any listen events ready to be dispatched? 84 /// Are there any listen events ready to be dispatched?
85 /// </summary> 85 /// </summary>
86 /// <returns>boolean indication</returns> 86 /// <returns>boolean indication</returns>
87 bool HasMessages(); 87 bool HasMessages();
88 88
89 /// <summary> 89 /// <summary>
90 /// Pop the first availlable listen event from the queue 90 /// Pop the first availlable listen event from the queue
91 /// </summary> 91 /// </summary>
92 /// <returns>ListenerInfo with filter filled in</returns> 92 /// <returns>ListenerInfo with filter filled in</returns>
93 IWorldCommListenerInfo GetNextMessage(); 93 IWorldCommListenerInfo GetNextMessage();
94 94
95 void ListenControl(UUID itemID, int handle, int active); 95 void ListenControl(UUID itemID, int handle, int active);
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index fd526eb..712dcc7 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -418,15 +418,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation
418 { 418 {
419 if (m_scenePresence.IsChildAgent) 419 if (m_scenePresence.IsChildAgent)
420 return; 420 return;
421
422 UUID[] animIDs;
423 int[] sequenceNums;
424 UUID[] objectIDs;
425 421
426 m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs); 422 m_scenePresence.Scene.ForEachScenePresence(
427 423 delegate(ScenePresence SP)
428 m_scenePresence.ControllingClient.SendAnimations( 424 {
429 animIDs, sequenceNums, m_scenePresence.ControllingClient.AgentId, objectIDs); 425 SP.Animator.SendAnimPack();
426 });
430 } 427 }
431 428
432 /// <summary> 429 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 9f74b2a..57e1c37 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -209,7 +209,7 @@ namespace OpenSim.Region.Framework.Scenes
209 /// Triggered when an object or attachment enters a scene 209 /// Triggered when an object or attachment enters a scene
210 /// </summary> 210 /// </summary>
211 public event OnIncomingSceneObjectDelegate OnIncomingSceneObject; 211 public event OnIncomingSceneObjectDelegate OnIncomingSceneObject;
212 public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); 212 public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so);
213 213
214 public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); 214 public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel);
215 215
@@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes
413 } 413 }
414 } 414 }
415 } 415 }
416 } 416 }
417 417
418 public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) 418 public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
419 { 419 {
@@ -433,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes
433 e.Message, e.StackTrace); 433 e.Message, e.StackTrace);
434 } 434 }
435 } 435 }
436 } 436 }
437 } 437 }
438 438
439 public void TriggerOnScriptChangedEvent(uint localID, uint change) 439 public void TriggerOnScriptChangedEvent(uint localID, uint change)
@@ -454,7 +454,7 @@ namespace OpenSim.Region.Framework.Scenes
454 e.Message, e.StackTrace); 454 e.Message, e.StackTrace);
455 } 455 }
456 } 456 }
457 } 457 }
458 } 458 }
459 459
460 public void TriggerOnClientMovement(ScenePresence avatar) 460 public void TriggerOnClientMovement(ScenePresence avatar)
@@ -475,7 +475,7 @@ namespace OpenSim.Region.Framework.Scenes
475 e.Message, e.StackTrace); 475 e.Message, e.StackTrace);
476 } 476 }
477 } 477 }
478 } 478 }
479 } 479 }
480 480
481 public void TriggerPermissionError(UUID user, string reason) 481 public void TriggerPermissionError(UUID user, string reason)
@@ -496,7 +496,7 @@ namespace OpenSim.Region.Framework.Scenes
496 e.Message, e.StackTrace); 496 e.Message, e.StackTrace);
497 } 497 }
498 } 498 }
499 } 499 }
500 } 500 }
501 501
502 public void TriggerOnPluginConsole(string[] args) 502 public void TriggerOnPluginConsole(string[] args)
@@ -517,7 +517,7 @@ namespace OpenSim.Region.Framework.Scenes
517 e.Message, e.StackTrace); 517 e.Message, e.StackTrace);
518 } 518 }
519 } 519 }
520 } 520 }
521 } 521 }
522 522
523 public void TriggerOnFrame() 523 public void TriggerOnFrame()
@@ -538,11 +538,11 @@ namespace OpenSim.Region.Framework.Scenes
538 e.Message, e.StackTrace); 538 e.Message, e.StackTrace);
539 } 539 }
540 } 540 }
541 } 541 }
542 } 542 }
543 543
544 public void TriggerOnNewClient(IClientAPI client) 544 public void TriggerOnNewClient(IClientAPI client)
545 { 545 {
546 OnNewClientDelegate handlerNewClient = OnNewClient; 546 OnNewClientDelegate handlerNewClient = OnNewClient;
547 if (handlerNewClient != null) 547 if (handlerNewClient != null)
548 { 548 {
@@ -559,10 +559,10 @@ namespace OpenSim.Region.Framework.Scenes
559 e.Message, e.StackTrace); 559 e.Message, e.StackTrace);
560 } 560 }
561 } 561 }
562 } 562 }
563 563
564 if (client is IClientCore) 564 if (client is IClientCore)
565 { 565 {
566 OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect; 566 OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect;
567 if (handlerClientConnect != null) 567 if (handlerClientConnect != null)
568 { 568 {
@@ -579,7 +579,7 @@ namespace OpenSim.Region.Framework.Scenes
579 e.Message, e.StackTrace); 579 e.Message, e.StackTrace);
580 } 580 }
581 } 581 }
582 } 582 }
583 } 583 }
584 } 584 }
585 585
@@ -601,11 +601,11 @@ namespace OpenSim.Region.Framework.Scenes
601 e.Message, e.StackTrace); 601 e.Message, e.StackTrace);
602 } 602 }
603 } 603 }
604 } 604 }
605 } 605 }
606 606
607 public void TriggerOnRemovePresence(UUID agentId) 607 public void TriggerOnRemovePresence(UUID agentId)
608 { 608 {
609 OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence; 609 OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence;
610 if (handlerRemovePresence != null) 610 if (handlerRemovePresence != null)
611 { 611 {
@@ -622,11 +622,11 @@ namespace OpenSim.Region.Framework.Scenes
622 e.Message, e.StackTrace); 622 e.Message, e.StackTrace);
623 } 623 }
624 } 624 }
625 } 625 }
626 } 626 }
627 627
628 public void TriggerOnBackup(IRegionDataStore dstore) 628 public void TriggerOnBackup(IRegionDataStore dstore)
629 { 629 {
630 OnBackupDelegate handlerOnAttach = OnBackup; 630 OnBackupDelegate handlerOnAttach = OnBackup;
631 if (handlerOnAttach != null) 631 if (handlerOnAttach != null)
632 { 632 {
@@ -643,7 +643,7 @@ namespace OpenSim.Region.Framework.Scenes
643 e.Message, e.StackTrace); 643 e.Message, e.StackTrace);
644 } 644 }
645 } 645 }
646 } 646 }
647 } 647 }
648 648
649 public void TriggerParcelPrimCountUpdate() 649 public void TriggerParcelPrimCountUpdate()
@@ -664,7 +664,7 @@ namespace OpenSim.Region.Framework.Scenes
664 e.Message, e.StackTrace); 664 e.Message, e.StackTrace);
665 } 665 }
666 } 666 }
667 } 667 }
668 } 668 }
669 669
670 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args) 670 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args)
@@ -685,7 +685,7 @@ namespace OpenSim.Region.Framework.Scenes
685 e.Message, e.StackTrace); 685 e.Message, e.StackTrace);
686 } 686 }
687 } 687 }
688 } 688 }
689 } 689 }
690 690
691 public void TriggerTerrainTick() 691 public void TriggerTerrainTick()
@@ -706,7 +706,7 @@ namespace OpenSim.Region.Framework.Scenes
706 e.Message, e.StackTrace); 706 e.Message, e.StackTrace);
707 } 707 }
708 } 708 }
709 } 709 }
710 } 710 }
711 711
712 public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) 712 public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
@@ -727,7 +727,7 @@ namespace OpenSim.Region.Framework.Scenes
727 e.Message, e.StackTrace); 727 e.Message, e.StackTrace);
728 } 728 }
729 } 729 }
730 } 730 }
731 } 731 }
732 732
733 public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) 733 public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
@@ -748,11 +748,11 @@ namespace OpenSim.Region.Framework.Scenes
748 e.Message, e.StackTrace); 748 e.Message, e.StackTrace);
749 } 749 }
750 } 750 }
751 } 751 }
752 } 752 }
753 753
754 public void TriggerShutdown() 754 public void TriggerShutdown()
755 { 755 {
756 OnShutdownDelegate handlerShutdown = OnShutdown; 756 OnShutdownDelegate handlerShutdown = OnShutdown;
757 if (handlerShutdown != null) 757 if (handlerShutdown != null)
758 { 758 {
@@ -769,11 +769,11 @@ namespace OpenSim.Region.Framework.Scenes
769 e.Message, e.StackTrace); 769 e.Message, e.StackTrace);
770 } 770 }
771 } 771 }
772 } 772 }
773 } 773 }
774 774
775 public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) 775 public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
776 { 776 {
777 ObjectGrabDelegate handlerObjectGrab = OnObjectGrab; 777 ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
778 if (handlerObjectGrab != null) 778 if (handlerObjectGrab != null)
779 { 779 {
@@ -790,11 +790,11 @@ namespace OpenSim.Region.Framework.Scenes
790 e.Message, e.StackTrace); 790 e.Message, e.StackTrace);
791 } 791 }
792 } 792 }
793 } 793 }
794 } 794 }
795 795
796 public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) 796 public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
797 { 797 {
798 ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing; 798 ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
799 if (handlerObjectGrabbing != null) 799 if (handlerObjectGrabbing != null)
800 { 800 {
@@ -811,11 +811,11 @@ namespace OpenSim.Region.Framework.Scenes
811 e.Message, e.StackTrace); 811 e.Message, e.StackTrace);
812 } 812 }
813 } 813 }
814 } 814 }
815 } 815 }
816 816
817 public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) 817 public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
818 { 818 {
819 ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab; 819 ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
820 if (handlerObjectDeGrab != null) 820 if (handlerObjectDeGrab != null)
821 { 821 {
@@ -832,11 +832,11 @@ namespace OpenSim.Region.Framework.Scenes
832 e.Message, e.StackTrace); 832 e.Message, e.StackTrace);
833 } 833 }
834 } 834 }
835 } 835 }
836 } 836 }
837 837
838 public void TriggerScriptReset(uint localID, UUID itemID) 838 public void TriggerScriptReset(uint localID, UUID itemID)
839 { 839 {
840 ScriptResetDelegate handlerScriptReset = OnScriptReset; 840 ScriptResetDelegate handlerScriptReset = OnScriptReset;
841 if (handlerScriptReset != null) 841 if (handlerScriptReset != null)
842 { 842 {
@@ -853,11 +853,11 @@ namespace OpenSim.Region.Framework.Scenes
853 e.Message, e.StackTrace); 853 e.Message, e.StackTrace);
854 } 854 }
855 } 855 }
856 } 856 }
857 } 857 }
858 858
859 public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) 859 public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
860 { 860 {
861 NewRezScript handlerRezScript = OnRezScript; 861 NewRezScript handlerRezScript = OnRezScript;
862 if (handlerRezScript != null) 862 if (handlerRezScript != null)
863 { 863 {
@@ -874,7 +874,7 @@ namespace OpenSim.Region.Framework.Scenes
874 e.Message, e.StackTrace); 874 e.Message, e.StackTrace);
875 } 875 }
876 } 876 }
877 } 877 }
878 } 878 }
879 879
880 public void TriggerStartScript(uint localID, UUID itemID) 880 public void TriggerStartScript(uint localID, UUID itemID)
@@ -895,7 +895,7 @@ namespace OpenSim.Region.Framework.Scenes
895 e.Message, e.StackTrace); 895 e.Message, e.StackTrace);
896 } 896 }
897 } 897 }
898 } 898 }
899 } 899 }
900 900
901 public void TriggerStopScript(uint localID, UUID itemID) 901 public void TriggerStopScript(uint localID, UUID itemID)
@@ -916,11 +916,11 @@ namespace OpenSim.Region.Framework.Scenes
916 e.Message, e.StackTrace); 916 e.Message, e.StackTrace);
917 } 917 }
918 } 918 }
919 } 919 }
920 } 920 }
921 921
922 public void TriggerRemoveScript(uint localID, UUID itemID) 922 public void TriggerRemoveScript(uint localID, UUID itemID)
923 { 923 {
924 RemoveScript handlerRemoveScript = OnRemoveScript; 924 RemoveScript handlerRemoveScript = OnRemoveScript;
925 if (handlerRemoveScript != null) 925 if (handlerRemoveScript != null)
926 { 926 {
@@ -937,7 +937,7 @@ namespace OpenSim.Region.Framework.Scenes
937 e.Message, e.StackTrace); 937 e.Message, e.StackTrace);
938 } 938 }
939 } 939 }
940 } 940 }
941 } 941 }
942 942
943 public bool TriggerGroupMove(UUID groupID, Vector3 delta) 943 public bool TriggerGroupMove(UUID groupID, Vector3 delta)
@@ -1036,7 +1036,7 @@ namespace OpenSim.Region.Framework.Scenes
1036 e.Message, e.StackTrace); 1036 e.Message, e.StackTrace);
1037 } 1037 }
1038 } 1038 }
1039 } 1039 }
1040 } 1040 }
1041 1041
1042 public void TriggerLandObjectAdded(ILandObject newParcel) 1042 public void TriggerLandObjectAdded(ILandObject newParcel)
@@ -1057,7 +1057,7 @@ namespace OpenSim.Region.Framework.Scenes
1057 e.Message, e.StackTrace); 1057 e.Message, e.StackTrace);
1058 } 1058 }
1059 } 1059 }
1060 } 1060 }
1061 } 1061 }
1062 1062
1063 public void TriggerLandObjectRemoved(UUID globalID) 1063 public void TriggerLandObjectRemoved(UUID globalID)
@@ -1078,7 +1078,7 @@ namespace OpenSim.Region.Framework.Scenes
1078 e.Message, e.StackTrace); 1078 e.Message, e.StackTrace);
1079 } 1079 }
1080 } 1080 }
1081 } 1081 }
1082 } 1082 }
1083 1083
1084 public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) 1084 public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
@@ -1104,7 +1104,7 @@ namespace OpenSim.Region.Framework.Scenes
1104 e.Message, e.StackTrace); 1104 e.Message, e.StackTrace);
1105 } 1105 }
1106 } 1106 }
1107 } 1107 }
1108 } 1108 }
1109 1109
1110 public void TriggerIncomingInstantMessage(GridInstantMessage message) 1110 public void TriggerIncomingInstantMessage(GridInstantMessage message)
@@ -1125,7 +1125,7 @@ namespace OpenSim.Region.Framework.Scenes
1125 e.Message, e.StackTrace); 1125 e.Message, e.StackTrace);
1126 } 1126 }
1127 } 1127 }
1128 } 1128 }
1129 } 1129 }
1130 1130
1131 public void TriggerUnhandledInstantMessage(GridInstantMessage message) 1131 public void TriggerUnhandledInstantMessage(GridInstantMessage message)
@@ -1146,7 +1146,7 @@ namespace OpenSim.Region.Framework.Scenes
1146 e.Message, e.StackTrace); 1146 e.Message, e.StackTrace);
1147 } 1147 }
1148 } 1148 }
1149 } 1149 }
1150 } 1150 }
1151 1151
1152 public void TriggerClientClosed(UUID ClientID, Scene scene) 1152 public void TriggerClientClosed(UUID ClientID, Scene scene)
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.Framework.Scenes
1167 e.Message, e.StackTrace); 1167 e.Message, e.StackTrace);
1168 } 1168 }
1169 } 1169 }
1170 } 1170 }
1171 } 1171 }
1172 1172
1173 public void TriggerOnMakeChildAgent(ScenePresence presence) 1173 public void TriggerOnMakeChildAgent(ScenePresence presence)
@@ -1188,7 +1188,7 @@ namespace OpenSim.Region.Framework.Scenes
1188 e.Message, e.StackTrace); 1188 e.Message, e.StackTrace);
1189 } 1189 }
1190 } 1190 }
1191 } 1191 }
1192 } 1192 }
1193 1193
1194 public void TriggerOnMakeRootAgent(ScenePresence presence) 1194 public void TriggerOnMakeRootAgent(ScenePresence presence)
@@ -1209,7 +1209,7 @@ namespace OpenSim.Region.Framework.Scenes
1209 e.Message, e.StackTrace); 1209 e.Message, e.StackTrace);
1210 } 1210 }
1211 } 1211 }
1212 } 1212 }
1213 } 1213 }
1214 1214
1215 public void TriggerOnIncomingSceneObject(SceneObjectGroup so) 1215 public void TriggerOnIncomingSceneObject(SceneObjectGroup so)
@@ -1229,12 +1229,12 @@ namespace OpenSim.Region.Framework.Scenes
1229 "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}", 1229 "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}",
1230 e.Message, e.StackTrace); 1230 e.Message, e.StackTrace);
1231 } 1231 }
1232 } 1232 }
1233 } 1233 }
1234 } 1234 }
1235 1235
1236 public void TriggerOnRegisterCaps(UUID agentID, Caps caps) 1236 public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
1237 { 1237 {
1238 RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps; 1238 RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps;
1239 if (handlerRegisterCaps != null) 1239 if (handlerRegisterCaps != null)
1240 { 1240 {
@@ -1251,7 +1251,7 @@ namespace OpenSim.Region.Framework.Scenes
1251 e.Message, e.StackTrace); 1251 e.Message, e.StackTrace);
1252 } 1252 }
1253 } 1253 }
1254 } 1254 }
1255 } 1255 }
1256 1256
1257 public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) 1257 public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
@@ -1272,7 +1272,7 @@ namespace OpenSim.Region.Framework.Scenes
1272 e.Message, e.StackTrace); 1272 e.Message, e.StackTrace);
1273 } 1273 }
1274 } 1274 }
1275 } 1275 }
1276 } 1276 }
1277 1277
1278 public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) 1278 public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
@@ -1293,7 +1293,7 @@ namespace OpenSim.Region.Framework.Scenes
1293 e.Message, e.StackTrace); 1293 e.Message, e.StackTrace);
1294 } 1294 }
1295 } 1295 }
1296 } 1296 }
1297 } 1297 }
1298 1298
1299 public void TriggerLandBuy(Object sender, LandBuyArgs args) 1299 public void TriggerLandBuy(Object sender, LandBuyArgs args)
@@ -1314,7 +1314,7 @@ namespace OpenSim.Region.Framework.Scenes
1314 e.Message, e.StackTrace); 1314 e.Message, e.StackTrace);
1315 } 1315 }
1316 } 1316 }
1317 } 1317 }
1318 } 1318 }
1319 1319
1320 public void TriggerValidateLandBuy(Object sender, LandBuyArgs args) 1320 public void TriggerValidateLandBuy(Object sender, LandBuyArgs args)
@@ -1335,11 +1335,11 @@ namespace OpenSim.Region.Framework.Scenes
1335 e.Message, e.StackTrace); 1335 e.Message, e.StackTrace);
1336 } 1336 }
1337 } 1337 }
1338 } 1338 }
1339 } 1339 }
1340 1340
1341 public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) 1341 public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
1342 { 1342 {
1343 ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent; 1343 ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
1344 if (handlerScriptAtTargetEvent != null) 1344 if (handlerScriptAtTargetEvent != null)
1345 { 1345 {
@@ -1356,7 +1356,7 @@ namespace OpenSim.Region.Framework.Scenes
1356 e.Message, e.StackTrace); 1356 e.Message, e.StackTrace);
1357 } 1357 }
1358 } 1358 }
1359 } 1359 }
1360 } 1360 }
1361 1361
1362 public void TriggerNotAtTargetEvent(uint localID) 1362 public void TriggerNotAtTargetEvent(uint localID)
@@ -1377,11 +1377,11 @@ namespace OpenSim.Region.Framework.Scenes
1377 e.Message, e.StackTrace); 1377 e.Message, e.StackTrace);
1378 } 1378 }
1379 } 1379 }
1380 } 1380 }
1381 } 1381 }
1382 1382
1383 public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) 1383 public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot)
1384 { 1384 {
1385 ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; 1385 ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent;
1386 if (handlerScriptAtRotTargetEvent != null) 1386 if (handlerScriptAtRotTargetEvent != null)
1387 { 1387 {
@@ -1398,7 +1398,7 @@ namespace OpenSim.Region.Framework.Scenes
1398 e.Message, e.StackTrace); 1398 e.Message, e.StackTrace);
1399 } 1399 }
1400 } 1400 }
1401 } 1401 }
1402 } 1402 }
1403 1403
1404 public void TriggerNotAtRotTargetEvent(uint localID) 1404 public void TriggerNotAtRotTargetEvent(uint localID)
@@ -1419,7 +1419,7 @@ namespace OpenSim.Region.Framework.Scenes
1419 e.Message, e.StackTrace); 1419 e.Message, e.StackTrace);
1420 } 1420 }
1421 } 1421 }
1422 } 1422 }
1423 } 1423 }
1424 1424
1425 public void TriggerRequestChangeWaterHeight(float height) 1425 public void TriggerRequestChangeWaterHeight(float height)
@@ -1440,7 +1440,7 @@ namespace OpenSim.Region.Framework.Scenes
1440 e.Message, e.StackTrace); 1440 e.Message, e.StackTrace);
1441 } 1441 }
1442 } 1442 }
1443 } 1443 }
1444 } 1444 }
1445 1445
1446 public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) 1446 public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
@@ -1461,7 +1461,7 @@ namespace OpenSim.Region.Framework.Scenes
1461 e.Message, e.StackTrace); 1461 e.Message, e.StackTrace);
1462 } 1462 }
1463 } 1463 }
1464 } 1464 }
1465 } 1465 }
1466 1466
1467 public void TriggerSignificantClientMovement(IClientAPI client) 1467 public void TriggerSignificantClientMovement(IClientAPI client)
@@ -1482,7 +1482,7 @@ namespace OpenSim.Region.Framework.Scenes
1482 e.Message, e.StackTrace); 1482 e.Message, e.StackTrace);
1483 } 1483 }
1484 } 1484 }
1485 } 1485 }
1486 } 1486 }
1487 1487
1488 public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) 1488 public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
@@ -1503,7 +1503,7 @@ namespace OpenSim.Region.Framework.Scenes
1503 e.Message, e.StackTrace); 1503 e.Message, e.StackTrace);
1504 } 1504 }
1505 } 1505 }
1506 } 1506 }
1507 } 1507 }
1508 1508
1509 public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) 1509 public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
@@ -1524,7 +1524,7 @@ namespace OpenSim.Region.Framework.Scenes
1524 e.Message, e.StackTrace); 1524 e.Message, e.StackTrace);
1525 } 1525 }
1526 } 1526 }
1527 } 1527 }
1528 } 1528 }
1529 1529
1530 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) 1530 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
@@ -1545,7 +1545,7 @@ namespace OpenSim.Region.Framework.Scenes
1545 e.Message, e.StackTrace); 1545 e.Message, e.StackTrace);
1546 } 1546 }
1547 } 1547 }
1548 } 1548 }
1549 } 1549 }
1550 1550
1551 internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) 1551 internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed)
@@ -1566,7 +1566,7 @@ namespace OpenSim.Region.Framework.Scenes
1566 e.Message, e.StackTrace); 1566 e.Message, e.StackTrace);
1567 } 1567 }
1568 } 1568 }
1569 } 1569 }
1570 } 1570 }
1571 1571
1572 public void TriggerNoticeNoLandDataFromStorage() 1572 public void TriggerNoticeNoLandDataFromStorage()
@@ -1587,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes
1587 e.Message, e.StackTrace); 1587 e.Message, e.StackTrace);
1588 } 1588 }
1589 } 1589 }
1590 } 1590 }
1591 } 1591 }
1592 1592
1593 public void TriggerIncomingLandDataFromStorage(List<LandData> landData) 1593 public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
@@ -1608,7 +1608,7 @@ namespace OpenSim.Region.Framework.Scenes
1608 e.Message, e.StackTrace); 1608 e.Message, e.StackTrace);
1609 } 1609 }
1610 } 1610 }
1611 } 1611 }
1612 } 1612 }
1613 1613
1614 public void TriggerSetAllowForcefulBan(bool allow) 1614 public void TriggerSetAllowForcefulBan(bool allow)
@@ -1629,7 +1629,7 @@ namespace OpenSim.Region.Framework.Scenes
1629 e.Message, e.StackTrace); 1629 e.Message, e.StackTrace);
1630 } 1630 }
1631 } 1631 }
1632 } 1632 }
1633 } 1633 }
1634 1634
1635 public void TriggerRequestParcelPrimCountUpdate() 1635 public void TriggerRequestParcelPrimCountUpdate()
@@ -1650,7 +1650,7 @@ namespace OpenSim.Region.Framework.Scenes
1650 e.Message, e.StackTrace); 1650 e.Message, e.StackTrace);
1651 } 1651 }
1652 } 1652 }
1653 } 1653 }
1654 } 1654 }
1655 1655
1656 public void TriggerParcelPrimCountTainted() 1656 public void TriggerParcelPrimCountTainted()
@@ -1671,7 +1671,7 @@ namespace OpenSim.Region.Framework.Scenes
1671 e.Message, e.StackTrace); 1671 e.Message, e.StackTrace);
1672 } 1672 }
1673 } 1673 }
1674 } 1674 }
1675 } 1675 }
1676 1676
1677 // this lets us keep track of nasty script events like timer, etc. 1677 // this lets us keep track of nasty script events like timer, etc.
@@ -1710,7 +1710,7 @@ namespace OpenSim.Region.Framework.Scenes
1710 e.Message, e.StackTrace); 1710 e.Message, e.StackTrace);
1711 } 1711 }
1712 } 1712 }
1713 } 1713 }
1714 } 1714 }
1715 1715
1716 public float GetCurrentTimeAsSunLindenHour() 1716 public float GetCurrentTimeAsSunLindenHour()
@@ -1737,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes
1737 } 1737 }
1738 1738
1739 public void TriggerOarFileLoaded(Guid requestId, string message) 1739 public void TriggerOarFileLoaded(Guid requestId, string message)
1740 { 1740 {
1741 OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded; 1741 OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded;
1742 if (handlerOarFileLoaded != null) 1742 if (handlerOarFileLoaded != null)
1743 { 1743 {
@@ -1754,7 +1754,7 @@ namespace OpenSim.Region.Framework.Scenes
1754 e.Message, e.StackTrace); 1754 e.Message, e.StackTrace);
1755 } 1755 }
1756 } 1756 }
1757 } 1757 }
1758 } 1758 }
1759 1759
1760 public void TriggerOarFileSaved(Guid requestId, string message) 1760 public void TriggerOarFileSaved(Guid requestId, string message)
@@ -1775,7 +1775,7 @@ namespace OpenSim.Region.Framework.Scenes
1775 e.Message, e.StackTrace); 1775 e.Message, e.StackTrace);
1776 } 1776 }
1777 } 1777 }
1778 } 1778 }
1779 } 1779 }
1780 1780
1781 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) 1781 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
@@ -1796,7 +1796,7 @@ namespace OpenSim.Region.Framework.Scenes
1796 e.Message, e.StackTrace); 1796 e.Message, e.StackTrace);
1797 } 1797 }
1798 } 1798 }
1799 } 1799 }
1800 } 1800 }
1801 1801
1802 public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) 1802 public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
@@ -1817,7 +1817,7 @@ namespace OpenSim.Region.Framework.Scenes
1817 e.Message, e.StackTrace); 1817 e.Message, e.StackTrace);
1818 } 1818 }
1819 } 1819 }
1820 } 1820 }
1821 } 1821 }
1822 1822
1823 public void TriggerScriptColliding(uint localId, ColliderArgs colliders) 1823 public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
@@ -1838,7 +1838,7 @@ namespace OpenSim.Region.Framework.Scenes
1838 e.Message, e.StackTrace); 1838 e.Message, e.StackTrace);
1839 } 1839 }
1840 } 1840 }
1841 } 1841 }
1842 } 1842 }
1843 1843
1844 public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) 1844 public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
@@ -1859,7 +1859,7 @@ namespace OpenSim.Region.Framework.Scenes
1859 e.Message, e.StackTrace); 1859 e.Message, e.StackTrace);
1860 } 1860 }
1861 } 1861 }
1862 } 1862 }
1863 } 1863 }
1864 1864
1865 public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) 1865 public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders)
@@ -1880,7 +1880,7 @@ namespace OpenSim.Region.Framework.Scenes
1880 e.Message, e.StackTrace); 1880 e.Message, e.StackTrace);
1881 } 1881 }
1882 } 1882 }
1883 } 1883 }
1884 } 1884 }
1885 1885
1886 public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) 1886 public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
@@ -1901,7 +1901,7 @@ namespace OpenSim.Region.Framework.Scenes
1901 e.Message, e.StackTrace); 1901 e.Message, e.StackTrace);
1902 } 1902 }
1903 } 1903 }
1904 } 1904 }
1905 } 1905 }
1906 1906
1907 public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) 1907 public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
@@ -1922,11 +1922,11 @@ namespace OpenSim.Region.Framework.Scenes
1922 e.Message, e.StackTrace); 1922 e.Message, e.StackTrace);
1923 } 1923 }
1924 } 1924 }
1925 } 1925 }
1926 } 1926 }
1927 1927
1928 public void TriggerSetRootAgentScene(UUID agentID, Scene scene) 1928 public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
1929 { 1929 {
1930 OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene; 1930 OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene;
1931 if (handlerSetRootAgentScene != null) 1931 if (handlerSetRootAgentScene != null)
1932 { 1932 {
@@ -1943,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes
1943 e.Message, e.StackTrace); 1943 e.Message, e.StackTrace);
1944 } 1944 }
1945 } 1945 }
1946 } 1946 }
1947 } 1947 }
1948 1948
1949 public void TriggerOnRegionUp(GridRegion otherRegion) 1949 public void TriggerOnRegionUp(GridRegion otherRegion)
@@ -1964,7 +1964,7 @@ namespace OpenSim.Region.Framework.Scenes
1964 e.Message, e.StackTrace); 1964 e.Message, e.StackTrace);
1965 } 1965 }
1966 } 1966 }
1967 } 1967 }
1968 } 1968 }
1969 } 1969 }
1970} \ No newline at end of file 1970} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 7df3e50..c6cee75 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -585,6 +585,9 @@ namespace OpenSim.Region.Framework.Scenes
585 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString()); 585 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString());
586 return; 586 return;
587 } 587 }
588
589 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
590 return;
588 } 591 }
589 592
590 AssetBase asset = AssetService.Get(item.AssetID.ToString()); 593 AssetBase asset = AssetService.Get(item.AssetID.ToString());
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2909311..41fd1e1 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1976,6 +1976,23 @@ namespace OpenSim.Region.Framework.Scenes
1976 return; 1976 return;
1977 } 1977 }
1978 1978
1979 if (grp.RootPart.RETURN_AT_EDGE)
1980 {
1981 // We remove the object here
1982 try
1983 {
1984 List<SceneObjectGroup> objects = new List<SceneObjectGroup>();
1985 objects.Add(grp);
1986 SceneObjectGroup[] objectsArray = objects.ToArray();
1987 returnObjects(objectsArray, UUID.Zero);
1988 }
1989 catch (Exception)
1990 {
1991 m_log.Warn("[DATABASE]: exception when trying to return the prim that crossed the border.");
1992 }
1993 return;
1994 }
1995
1979 int thisx = (int)RegionInfo.RegionLocX; 1996 int thisx = (int)RegionInfo.RegionLocX;
1980 int thisy = (int)RegionInfo.RegionLocY; 1997 int thisy = (int)RegionInfo.RegionLocY;
1981 Vector3 EastCross = new Vector3(0.1f,0,0); 1998 Vector3 EastCross = new Vector3(0.1f,0,0);
@@ -2044,19 +2061,25 @@ namespace OpenSim.Region.Framework.Scenes
2044 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); 2061 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
2045 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) 2062 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
2046 2063
2047 if (crossedBordery.BorderLine.Z > 0) 2064 try
2048 { 2065 {
2049 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); 2066 if (crossedBordery.BorderLine.Z > 0)
2050 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); 2067 {
2051 } 2068 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
2052 else 2069 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
2053 pos.Y = ((pos.Y + Constants.RegionSize)); 2070 }
2071 else
2072 pos.Y = ((pos.Y + Constants.RegionSize));
2054 2073
2055 newRegionHandle 2074 newRegionHandle
2056 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), 2075 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
2057 (uint)((thisy + changeY) * Constants.RegionSize)); 2076 (uint)((thisy + changeY) * Constants.RegionSize));
2058 // x - 1 2077 // x - 1
2059 // y + 1 2078 // y + 1
2079 }
2080 catch (Exception ex)
2081 {
2082 }
2060 } 2083 }
2061 else 2084 else
2062 { 2085 {
@@ -2518,7 +2541,7 @@ namespace OpenSim.Region.Framework.Scenes
2518 AttachObject( 2541 AttachObject(
2519 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); 2542 sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
2520 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2543 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2521 grp.SendGroupFullUpdate(); 2544 grp.SendGroupFullUpdate();
2522 } 2545 }
2523 else 2546 else
2524 { 2547 {
@@ -2684,6 +2707,7 @@ namespace OpenSim.Region.Framework.Scenes
2684 client.OnGrabUpdate += ProcessObjectGrabUpdate; 2707 client.OnGrabUpdate += ProcessObjectGrabUpdate;
2685 client.OnDeGrabObject += ProcessObjectDeGrab; 2708 client.OnDeGrabObject += ProcessObjectDeGrab;
2686 client.OnUndo += m_sceneGraph.HandleUndo; 2709 client.OnUndo += m_sceneGraph.HandleUndo;
2710 client.OnRedo += m_sceneGraph.HandleRedo;
2687 client.OnObjectDescription += m_sceneGraph.PrimDescription; 2711 client.OnObjectDescription += m_sceneGraph.PrimDescription;
2688 client.OnObjectDrop += m_sceneGraph.DropObject; 2712 client.OnObjectDrop += m_sceneGraph.DropObject;
2689 client.OnObjectSaleInfo += ObjectSaleInfo; 2713 client.OnObjectSaleInfo += ObjectSaleInfo;
@@ -2838,6 +2862,7 @@ namespace OpenSim.Region.Framework.Scenes
2838 client.OnGrabObject -= ProcessObjectGrab; 2862 client.OnGrabObject -= ProcessObjectGrab;
2839 client.OnDeGrabObject -= ProcessObjectDeGrab; 2863 client.OnDeGrabObject -= ProcessObjectDeGrab;
2840 client.OnUndo -= m_sceneGraph.HandleUndo; 2864 client.OnUndo -= m_sceneGraph.HandleUndo;
2865 client.OnRedo -= m_sceneGraph.HandleRedo;
2841 client.OnObjectDescription -= m_sceneGraph.PrimDescription; 2866 client.OnObjectDescription -= m_sceneGraph.PrimDescription;
2842 client.OnObjectDrop -= m_sceneGraph.DropObject; 2867 client.OnObjectDrop -= m_sceneGraph.DropObject;
2843 client.OnObjectSaleInfo -= ObjectSaleInfo; 2868 client.OnObjectSaleInfo -= ObjectSaleInfo;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1ac061a..321cc45 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -452,6 +452,15 @@ namespace OpenSim.Region.Framework.Scenes
452 part.Undo(); 452 part.Undo();
453 } 453 }
454 } 454 }
455 protected internal void HandleRedo(IClientAPI remoteClient, UUID primId)
456 {
457 if (primId != UUID.Zero)
458 {
459 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId);
460 if (part != null)
461 part.Redo();
462 }
463 }
455 464
456 protected internal void HandleObjectGroupUpdate( 465 protected internal void HandleObjectGroupUpdate(
457 IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) 466 IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
@@ -633,7 +642,7 @@ namespace OpenSim.Region.Framework.Scenes
633 // it get cleaned up 642 // it get cleaned up
634 // 643 //
635 group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); 644 group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
636 group.HasGroupChanged = false; 645 group.HasGroupChanged = false;
637 } 646 }
638 else 647 else
639 { 648 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 94e64e4..6357192 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -298,7 +298,16 @@ namespace OpenSim.Region.Framework.Scenes
298 { 298 {
299 m_scene.CrossPrimGroupIntoNewRegion(val, this, true); 299 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
300 } 300 }
301 301 if (RootPart.GetStatusSandbox())
302 {
303 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
304 {
305 RootPart.ScriptSetPhysicsStatus(false);
306 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
307 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
308 return;
309 }
310 }
302 lock (m_parts) 311 lock (m_parts)
303 { 312 {
304 foreach (SceneObjectPart part in m_parts.Values) 313 foreach (SceneObjectPart part in m_parts.Values)
@@ -398,6 +407,34 @@ namespace OpenSim.Region.Framework.Scenes
398 } 407 }
399 } 408 }
400 409
410 private SceneObjectPart m_PlaySoundMasterPrim = null;
411 public SceneObjectPart PlaySoundMasterPrim
412 {
413 get { return m_PlaySoundMasterPrim; }
414 set { m_PlaySoundMasterPrim = value; }
415 }
416
417 private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>();
418 public List<SceneObjectPart> PlaySoundSlavePrims
419 {
420 get { return m_LoopSoundSlavePrims; }
421 set { m_LoopSoundSlavePrims = value; }
422 }
423
424 private SceneObjectPart m_LoopSoundMasterPrim = null;
425 public SceneObjectPart LoopSoundMasterPrim
426 {
427 get { return m_LoopSoundMasterPrim; }
428 set { m_LoopSoundMasterPrim = value; }
429 }
430
431 private List<SceneObjectPart> m_LoopSoundSlavePrims = new List<SceneObjectPart>();
432 public List<SceneObjectPart> LoopSoundSlavePrims
433 {
434 get { return m_LoopSoundSlavePrims; }
435 set { m_LoopSoundSlavePrims = value; }
436 }
437
401 // The UUID for the Region this Object is in. 438 // The UUID for the Region this Object is in.
402 public UUID RegionUUID 439 public UUID RegionUUID
403 { 440 {
@@ -1782,32 +1819,6 @@ namespace OpenSim.Region.Framework.Scenes
1782 } 1819 }
1783 } 1820 }
1784 1821
1785 public void rotLookAt(Quaternion target, float strength, float damping)
1786 {
1787 SceneObjectPart rootpart = m_rootPart;
1788 if (rootpart != null)
1789 {
1790 if (IsAttachment)
1791 {
1792 /*
1793 ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
1794 if (avatar != null)
1795 {
1796 Rotate the Av?
1797 } */
1798 }
1799 else
1800 {
1801 if (rootpart.PhysActor != null)
1802 {
1803 rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W);
1804 rootpart.PhysActor.APIDStrength = strength;
1805 rootpart.PhysActor.APIDDamping = damping;
1806 rootpart.PhysActor.APIDActive = true;
1807 }
1808 }
1809 }
1810 }
1811 public void stopLookAt() 1822 public void stopLookAt()
1812 { 1823 {
1813 SceneObjectPart rootpart = m_rootPart; 1824 SceneObjectPart rootpart = m_rootPart;
@@ -1966,6 +1977,8 @@ namespace OpenSim.Region.Framework.Scenes
1966 1977
1967 foreach (SceneObjectPart part in m_parts.Values) 1978 foreach (SceneObjectPart part in m_parts.Values)
1968 { 1979 {
1980 if (!IsSelected)
1981 part.UpdateLookAt();
1969 part.SendScheduledUpdates(); 1982 part.SendScheduledUpdates();
1970 } 1983 }
1971 } 1984 }
@@ -2467,11 +2480,14 @@ namespace OpenSim.Region.Framework.Scenes
2467 { 2480 {
2468 if (m_rootPart.PhysActor.IsPhysical) 2481 if (m_rootPart.PhysActor.IsPhysical)
2469 { 2482 {
2470 Vector3 llmoveforce = pos - AbsolutePosition; 2483 if (!m_rootPart.BlockGrab)
2471 Vector3 grabforce = llmoveforce; 2484 {
2472 grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; 2485 Vector3 llmoveforce = pos - AbsolutePosition;
2473 m_rootPart.PhysActor.AddForce(grabforce,true); 2486 Vector3 grabforce = llmoveforce;
2474 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); 2487 grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass;
2488 m_rootPart.PhysActor.AddForce(grabforce, true);
2489 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
2490 }
2475 } 2491 }
2476 else 2492 else
2477 { 2493 {
@@ -2827,6 +2843,7 @@ namespace OpenSim.Region.Framework.Scenes
2827 SceneObjectPart part = GetChildPart(localID); 2843 SceneObjectPart part = GetChildPart(localID);
2828 if (part != null) 2844 if (part != null)
2829 { 2845 {
2846 part.IgnoreUndoUpdate = true;
2830 if (scale.X > m_scene.m_maxNonphys) 2847 if (scale.X > m_scene.m_maxNonphys)
2831 scale.X = m_scene.m_maxNonphys; 2848 scale.X = m_scene.m_maxNonphys;
2832 if (scale.Y > m_scene.m_maxNonphys) 2849 if (scale.Y > m_scene.m_maxNonphys)
@@ -2854,6 +2871,7 @@ namespace OpenSim.Region.Framework.Scenes
2854 { 2871 {
2855 if (obPart.UUID != m_rootPart.UUID) 2872 if (obPart.UUID != m_rootPart.UUID)
2856 { 2873 {
2874 obPart.IgnoreUndoUpdate = true;
2857 Vector3 oldSize = new Vector3(obPart.Scale); 2875 Vector3 oldSize = new Vector3(obPart.Scale);
2858 2876
2859 float f = 1.0f; 2877 float f = 1.0f;
@@ -2913,6 +2931,8 @@ namespace OpenSim.Region.Framework.Scenes
2913 z *= a; 2931 z *= a;
2914 } 2932 }
2915 } 2933 }
2934 obPart.IgnoreUndoUpdate = false;
2935 obPart.StoreUndoState();
2916 } 2936 }
2917 } 2937 }
2918 } 2938 }
@@ -2928,6 +2948,7 @@ namespace OpenSim.Region.Framework.Scenes
2928 { 2948 {
2929 foreach (SceneObjectPart obPart in m_parts.Values) 2949 foreach (SceneObjectPart obPart in m_parts.Values)
2930 { 2950 {
2951 obPart.IgnoreUndoUpdate = true;
2931 if (obPart.UUID != m_rootPart.UUID) 2952 if (obPart.UUID != m_rootPart.UUID)
2932 { 2953 {
2933 Vector3 currentpos = new Vector3(obPart.OffsetPosition); 2954 Vector3 currentpos = new Vector3(obPart.OffsetPosition);
@@ -2941,6 +2962,8 @@ namespace OpenSim.Region.Framework.Scenes
2941 obPart.Resize(newSize); 2962 obPart.Resize(newSize);
2942 obPart.UpdateOffSet(currentpos); 2963 obPart.UpdateOffSet(currentpos);
2943 } 2964 }
2965 obPart.IgnoreUndoUpdate = false;
2966 obPart.StoreUndoState();
2944 } 2967 }
2945 } 2968 }
2946 2969
@@ -2950,6 +2973,8 @@ namespace OpenSim.Region.Framework.Scenes
2950 m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); 2973 m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
2951 } 2974 }
2952 2975
2976 part.IgnoreUndoUpdate = false;
2977 part.StoreUndoState();
2953 HasGroupChanged = true; 2978 HasGroupChanged = true;
2954 ScheduleGroupForTerseUpdate(); 2979 ScheduleGroupForTerseUpdate();
2955 } 2980 }
@@ -2965,13 +2990,26 @@ namespace OpenSim.Region.Framework.Scenes
2965 /// <param name="pos"></param> 2990 /// <param name="pos"></param>
2966 public void UpdateGroupPosition(Vector3 pos) 2991 public void UpdateGroupPosition(Vector3 pos)
2967 { 2992 {
2993 foreach (SceneObjectPart part in Children.Values)
2994 {
2995 part.StoreUndoState();
2996 }
2968 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 2997 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
2969 { 2998 {
2970 if (IsAttachment) 2999 if (IsAttachment)
2971 { 3000 {
2972 m_rootPart.AttachedPos = pos; 3001 m_rootPart.AttachedPos = pos;
2973 } 3002 }
2974 3003 if (RootPart.GetStatusSandbox())
3004 {
3005 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, pos) > 10)
3006 {
3007 RootPart.ScriptSetPhysicsStatus(false);
3008 pos = AbsolutePosition;
3009 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
3010 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
3011 }
3012 }
2975 AbsolutePosition = pos; 3013 AbsolutePosition = pos;
2976 3014
2977 HasGroupChanged = true; 3015 HasGroupChanged = true;
@@ -2990,7 +3028,10 @@ namespace OpenSim.Region.Framework.Scenes
2990 public void UpdateSinglePosition(Vector3 pos, uint localID) 3028 public void UpdateSinglePosition(Vector3 pos, uint localID)
2991 { 3029 {
2992 SceneObjectPart part = GetChildPart(localID); 3030 SceneObjectPart part = GetChildPart(localID);
2993 3031 foreach (SceneObjectPart parts in Children.Values)
3032 {
3033 parts.StoreUndoState();
3034 }
2994 if (part != null) 3035 if (part != null)
2995 { 3036 {
2996 if (part.UUID == m_rootPart.UUID) 3037 if (part.UUID == m_rootPart.UUID)
@@ -3012,6 +3053,10 @@ namespace OpenSim.Region.Framework.Scenes
3012 /// <param name="pos"></param> 3053 /// <param name="pos"></param>
3013 private void UpdateRootPosition(Vector3 pos) 3054 private void UpdateRootPosition(Vector3 pos)
3014 { 3055 {
3056 foreach (SceneObjectPart part in Children.Values)
3057 {
3058 part.StoreUndoState();
3059 }
3015 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); 3060 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
3016 Vector3 oldPos = 3061 Vector3 oldPos =
3017 new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, 3062 new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X,
@@ -3055,6 +3100,10 @@ namespace OpenSim.Region.Framework.Scenes
3055 /// <param name="rot"></param> 3100 /// <param name="rot"></param>
3056 public void UpdateGroupRotationR(Quaternion rot) 3101 public void UpdateGroupRotationR(Quaternion rot)
3057 { 3102 {
3103 foreach (SceneObjectPart parts in Children.Values)
3104 {
3105 parts.StoreUndoState();
3106 }
3058 m_rootPart.UpdateRotation(rot); 3107 m_rootPart.UpdateRotation(rot);
3059 3108
3060 PhysicsActor actor = m_rootPart.PhysActor; 3109 PhysicsActor actor = m_rootPart.PhysActor;
@@ -3075,6 +3124,10 @@ namespace OpenSim.Region.Framework.Scenes
3075 /// <param name="rot"></param> 3124 /// <param name="rot"></param>
3076 public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot) 3125 public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot)
3077 { 3126 {
3127 foreach (SceneObjectPart parts in Children.Values)
3128 {
3129 parts.StoreUndoState();
3130 }
3078 m_rootPart.UpdateRotation(rot); 3131 m_rootPart.UpdateRotation(rot);
3079 3132
3080 PhysicsActor actor = m_rootPart.PhysActor; 3133 PhysicsActor actor = m_rootPart.PhysActor;
@@ -3098,6 +3151,10 @@ namespace OpenSim.Region.Framework.Scenes
3098 public void UpdateSingleRotation(Quaternion rot, uint localID) 3151 public void UpdateSingleRotation(Quaternion rot, uint localID)
3099 { 3152 {
3100 SceneObjectPart part = GetChildPart(localID); 3153 SceneObjectPart part = GetChildPart(localID);
3154 foreach (SceneObjectPart parts in Children.Values)
3155 {
3156 parts.StoreUndoState();
3157 }
3101 if (part != null) 3158 if (part != null)
3102 { 3159 {
3103 if (part.UUID == m_rootPart.UUID) 3160 if (part.UUID == m_rootPart.UUID)
@@ -3128,8 +3185,11 @@ namespace OpenSim.Region.Framework.Scenes
3128 } 3185 }
3129 else 3186 else
3130 { 3187 {
3188 part.IgnoreUndoUpdate = true;
3131 part.UpdateRotation(rot); 3189 part.UpdateRotation(rot);
3132 part.OffsetPosition = pos; 3190 part.OffsetPosition = pos;
3191 part.IgnoreUndoUpdate = false;
3192 part.StoreUndoState();
3133 } 3193 }
3134 } 3194 }
3135 } 3195 }
@@ -3143,6 +3203,7 @@ namespace OpenSim.Region.Framework.Scenes
3143 Quaternion axRot = rot; 3203 Quaternion axRot = rot;
3144 Quaternion oldParentRot = m_rootPart.RotationOffset; 3204 Quaternion oldParentRot = m_rootPart.RotationOffset;
3145 3205
3206 m_rootPart.StoreUndoState();
3146 m_rootPart.UpdateRotation(rot); 3207 m_rootPart.UpdateRotation(rot);
3147 if (m_rootPart.PhysActor != null) 3208 if (m_rootPart.PhysActor != null)
3148 { 3209 {
@@ -3156,6 +3217,7 @@ namespace OpenSim.Region.Framework.Scenes
3156 { 3217 {
3157 if (prim.UUID != m_rootPart.UUID) 3218 if (prim.UUID != m_rootPart.UUID)
3158 { 3219 {
3220 prim.IgnoreUndoUpdate = true;
3159 Vector3 axPos = prim.OffsetPosition; 3221 Vector3 axPos = prim.OffsetPosition;
3160 axPos *= oldParentRot; 3222 axPos *= oldParentRot;
3161 axPos *= Quaternion.Inverse(axRot); 3223 axPos *= Quaternion.Inverse(axRot);
@@ -3168,7 +3230,14 @@ namespace OpenSim.Region.Framework.Scenes
3168 } 3230 }
3169 } 3231 }
3170 } 3232 }
3171 3233 foreach (SceneObjectPart childpart in Children.Values)
3234 {
3235 if (childpart != m_rootPart)
3236 {
3237 childpart.IgnoreUndoUpdate = false;
3238 childpart.StoreUndoState();
3239 }
3240 }
3172 m_rootPart.ScheduleTerseUpdate(); 3241 m_rootPart.ScheduleTerseUpdate();
3173 } 3242 }
3174 3243
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index dd797fc..5c283bc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -133,6 +133,18 @@ namespace OpenSim.Region.Framework.Scenes
133 [XmlIgnore] 133 [XmlIgnore]
134 public bool DIE_AT_EDGE; 134 public bool DIE_AT_EDGE;
135 135
136 [XmlIgnore]
137 public bool RETURN_AT_EDGE;
138
139 [XmlIgnore]
140 public bool BlockGrab;
141
142 [XmlIgnore]
143 public bool StatusSandbox;
144
145 [XmlIgnore]
146 public Vector3 StatusSandboxPos;
147
136 // TODO: This needs to be persisted in next XML version update! 148 // TODO: This needs to be persisted in next XML version update!
137 [XmlIgnore] 149 [XmlIgnore]
138 public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; 150 public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
@@ -219,6 +231,15 @@ namespace OpenSim.Region.Framework.Scenes
219 [XmlIgnore] 231 [XmlIgnore]
220 public Quaternion SpinOldOrientation = Quaternion.Identity; 232 public Quaternion SpinOldOrientation = Quaternion.Identity;
221 233
234 [XmlIgnore]
235 public Quaternion m_APIDTarget = Quaternion.Identity;
236
237 [XmlIgnore]
238 public float m_APIDDamp = 0;
239
240 [XmlIgnore]
241 public float m_APIDStrength = 0;
242
222 /// <summary> 243 /// <summary>
223 /// This part's inventory 244 /// This part's inventory
224 /// </summary> 245 /// </summary>
@@ -233,6 +254,9 @@ namespace OpenSim.Region.Framework.Scenes
233 public bool Undoing; 254 public bool Undoing;
234 255
235 [XmlIgnore] 256 [XmlIgnore]
257 public bool IgnoreUndoUpdate = false;
258
259 [XmlIgnore]
236 private PrimFlags LocalFlags; 260 private PrimFlags LocalFlags;
237 [XmlIgnore] 261 [XmlIgnore]
238 private float m_damage = -1.0f; 262 private float m_damage = -1.0f;
@@ -253,6 +277,7 @@ namespace OpenSim.Region.Framework.Scenes
253 private string m_text = String.Empty; 277 private string m_text = String.Empty;
254 private string m_touchName = String.Empty; 278 private string m_touchName = String.Empty;
255 private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5); 279 private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5);
280 private readonly UndoStack<UndoState> m_redo = new UndoStack<UndoState>(5);
256 private UUID _creatorID; 281 private UUID _creatorID;
257 282
258 private bool m_passTouches; 283 private bool m_passTouches;
@@ -501,6 +526,27 @@ namespace OpenSim.Region.Framework.Scenes
501 } 526 }
502 } 527 }
503 528
529 [XmlIgnore]
530 public Quaternion APIDTarget
531 {
532 get { return m_APIDTarget; }
533 set { m_APIDTarget = value; }
534 }
535
536 [XmlIgnore]
537 public float APIDDamp
538 {
539 get { return m_APIDDamp; }
540 set { m_APIDDamp = value; }
541 }
542
543 [XmlIgnore]
544 public float APIDStrength
545 {
546 get { return m_APIDStrength; }
547 set { m_APIDStrength = value; }
548 }
549
504 public ulong RegionHandle 550 public ulong RegionHandle
505 { 551 {
506 get { return m_regionHandle; } 552 get { return m_regionHandle; }
@@ -512,6 +558,33 @@ namespace OpenSim.Region.Framework.Scenes
512 get { return m_scriptAccessPin; } 558 get { return m_scriptAccessPin; }
513 set { m_scriptAccessPin = (int)value; } 559 set { m_scriptAccessPin = (int)value; }
514 } 560 }
561 private SceneObjectPart m_PlaySoundMasterPrim = null;
562 public SceneObjectPart PlaySoundMasterPrim
563 {
564 get { return m_PlaySoundMasterPrim; }
565 set { m_PlaySoundMasterPrim = value; }
566 }
567
568 private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>();
569 public List<SceneObjectPart> PlaySoundSlavePrims
570 {
571 get { return m_LoopSoundSlavePrims; }
572 set { m_LoopSoundSlavePrims = value; }
573 }
574
575 private SceneObjectPart m_LoopSoundMasterPrim = null;
576 public SceneObjectPart LoopSoundMasterPrim
577 {
578 get { return m_LoopSoundMasterPrim; }
579 set { m_LoopSoundMasterPrim = value; }
580 }
581
582 private List<SceneObjectPart> m_LoopSoundSlavePrims = new List<SceneObjectPart>();
583 public List<SceneObjectPart> LoopSoundSlavePrims
584 {
585 get { return m_LoopSoundSlavePrims; }
586 set { m_LoopSoundSlavePrims = value; }
587 }
515 588
516 [XmlIgnore] 589 [XmlIgnore]
517 public Byte[] TextureAnimation 590 public Byte[] TextureAnimation
@@ -573,8 +646,6 @@ namespace OpenSim.Region.Framework.Scenes
573 } 646 }
574 set 647 set
575 { 648 {
576 StoreUndoState();
577
578 m_groupPosition = value; 649 m_groupPosition = value;
579 650
580 PhysicsActor actor = PhysActor; 651 PhysicsActor actor = PhysActor;
@@ -1401,6 +1472,10 @@ namespace OpenSim.Region.Framework.Scenes
1401 { 1472 {
1402 m_undo.Clear(); 1473 m_undo.Clear();
1403 } 1474 }
1475 lock (m_redo)
1476 {
1477 m_redo.Clear();
1478 }
1404 StoreUndoState(); 1479 StoreUndoState();
1405 } 1480 }
1406 1481
@@ -1711,6 +1786,66 @@ namespace OpenSim.Region.Framework.Scenes
1711 return m_parentGroup.RootPart.DIE_AT_EDGE; 1786 return m_parentGroup.RootPart.DIE_AT_EDGE;
1712 } 1787 }
1713 1788
1789 public bool GetReturnAtEdge()
1790 {
1791 if (m_parentGroup == null)
1792 return false;
1793 if (m_parentGroup.IsDeleted)
1794 return false;
1795
1796 return m_parentGroup.RootPart.RETURN_AT_EDGE;
1797 }
1798
1799 public void SetReturnAtEdge(bool p)
1800 {
1801 if (m_parentGroup == null)
1802 return;
1803 if (m_parentGroup.IsDeleted)
1804 return;
1805
1806 m_parentGroup.RootPart.RETURN_AT_EDGE = p;
1807 }
1808
1809 public bool GetBlockGrab()
1810 {
1811 if (m_parentGroup == null)
1812 return false;
1813 if (m_parentGroup.IsDeleted)
1814 return false;
1815
1816 return m_parentGroup.RootPart.BlockGrab;
1817 }
1818
1819 public void SetBlockGrab(bool p)
1820 {
1821 if (m_parentGroup == null)
1822 return;
1823 if (m_parentGroup.IsDeleted)
1824 return;
1825
1826 m_parentGroup.RootPart.BlockGrab = p;
1827 }
1828
1829 public void SetStatusSandbox(bool p)
1830 {
1831 if (m_parentGroup == null)
1832 return;
1833 if (m_parentGroup.IsDeleted)
1834 return;
1835 StatusSandboxPos = m_parentGroup.RootPart.AbsolutePosition;
1836 m_parentGroup.RootPart.StatusSandbox = p;
1837 }
1838
1839 public bool GetStatusSandbox()
1840 {
1841 if (m_parentGroup == null)
1842 return false;
1843 if (m_parentGroup.IsDeleted)
1844 return false;
1845
1846 return m_parentGroup.RootPart.StatusSandbox;
1847 }
1848
1714 public int GetAxisRotation(int axis) 1849 public int GetAxisRotation(int axis)
1715 { 1850 {
1716 //Cannot use ScriptBaseClass constants as no referance to it currently. 1851 //Cannot use ScriptBaseClass constants as no referance to it currently.
@@ -1917,7 +2052,7 @@ namespace OpenSim.Region.Framework.Scenes
1917 // play the sound. 2052 // play the sound.
1918 if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f) 2053 if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f)
1919 { 2054 {
1920 SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0); 2055 SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false);
1921 } 2056 }
1922 2057
1923 if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) 2058 if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0)
@@ -2491,9 +2626,8 @@ namespace OpenSim.Region.Framework.Scenes
2491 List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); 2626 List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
2492 foreach (ScenePresence p in avatarts) 2627 foreach (ScenePresence p in avatarts)
2493 { 2628 {
2494 // TODO: some filtering by distance of avatar 2629 if (!(Util.GetDistanceTo(p.AbsolutePosition, AbsolutePosition) >= 100))
2495 2630 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2496 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2497 } 2631 }
2498 } 2632 }
2499 2633
@@ -2554,7 +2688,38 @@ namespace OpenSim.Region.Framework.Scenes
2554 2688
2555 public void RotLookAt(Quaternion target, float strength, float damping) 2689 public void RotLookAt(Quaternion target, float strength, float damping)
2556 { 2690 {
2557 m_parentGroup.rotLookAt(target, strength, damping); 2691 rotLookAt(target, strength, damping);
2692 }
2693
2694 public void rotLookAt(Quaternion target, float strength, float damping)
2695 {
2696 if (IsAttachment)
2697 {
2698 /*
2699 ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
2700 if (avatar != null)
2701 {
2702 Rotate the Av?
2703 } */
2704 }
2705 else
2706 {
2707 APIDDamp = damping;
2708 APIDStrength = strength;
2709 APIDTarget = target;
2710 }
2711 }
2712
2713 public void startLookAt(Quaternion rot, float damp, float strength)
2714 {
2715 APIDDamp = damp;
2716 APIDStrength = strength;
2717 APIDTarget = rot;
2718 }
2719
2720 public void stopLookAt()
2721 {
2722 APIDTarget = Quaternion.Identity;
2558 } 2723 }
2559 2724
2560 /// <summary> 2725 /// <summary>
@@ -2814,7 +2979,7 @@ namespace OpenSim.Region.Framework.Scenes
2814 /// <param name="volume"></param> 2979 /// <param name="volume"></param>
2815 /// <param name="triggered"></param> 2980 /// <param name="triggered"></param>
2816 /// <param name="flags"></param> 2981 /// <param name="flags"></param>
2817 public void SendSound(string sound, double volume, bool triggered, byte flags) 2982 public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster)
2818 { 2983 {
2819 if (volume > 1) 2984 if (volume > 1)
2820 volume = 1; 2985 volume = 1;
@@ -2850,10 +3015,51 @@ namespace OpenSim.Region.Framework.Scenes
2850 ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface<ISoundModule>(); 3015 ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface<ISoundModule>();
2851 if (soundModule != null) 3016 if (soundModule != null)
2852 { 3017 {
2853 if (triggered) 3018 if (useMaster)
2854 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle); 3019 {
3020 if (isMaster)
3021 {
3022 if (triggered)
3023 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3024 else
3025 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3026 ParentGroup.PlaySoundMasterPrim = this;
3027 ownerID = this._ownerID;
3028 objectID = this.UUID;
3029 parentID = this.GetRootPartUUID();
3030 position = this.AbsolutePosition; // region local
3031 regionHandle = this.ParentGroup.Scene.RegionInfo.RegionHandle;
3032 if (triggered)
3033 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3034 else
3035 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3036 foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
3037 {
3038 ownerID = prim._ownerID;
3039 objectID = prim.UUID;
3040 parentID = prim.GetRootPartUUID();
3041 position = prim.AbsolutePosition; // region local
3042 regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle;
3043 if (triggered)
3044 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3045 else
3046 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3047 }
3048 ParentGroup.PlaySoundSlavePrims.Clear();
3049 ParentGroup.PlaySoundMasterPrim = null;
3050 }
3051 else
3052 {
3053 ParentGroup.PlaySoundSlavePrims.Add(this);
3054 }
3055 }
2855 else 3056 else
2856 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags); 3057 {
3058 if (triggered)
3059 soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
3060 else
3061 soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
3062 }
2857 } 3063 }
2858 } 3064 }
2859 3065
@@ -3156,6 +3362,14 @@ namespace OpenSim.Region.Framework.Scenes
3156 hasProfileCut = hasDimple; // is it the same thing? 3362 hasProfileCut = hasDimple; // is it the same thing?
3157 } 3363 }
3158 3364
3365 public void SetVehicleFlags(int param, bool remove)
3366 {
3367 if (PhysActor != null)
3368 {
3369 PhysActor.VehicleFlags(param, remove);
3370 }
3371 }
3372
3159 public void SetGroup(UUID groupID, IClientAPI client) 3373 public void SetGroup(UUID groupID, IClientAPI client)
3160 { 3374 {
3161 _groupID = groupID; 3375 _groupID = groupID;
@@ -3260,27 +3474,30 @@ namespace OpenSim.Region.Framework.Scenes
3260 { 3474 {
3261 if (!Undoing) 3475 if (!Undoing)
3262 { 3476 {
3263 if (m_parentGroup != null) 3477 if (!IgnoreUndoUpdate)
3264 { 3478 {
3265 lock (m_undo) 3479 if (m_parentGroup != null)
3266 { 3480 {
3267 if (m_undo.Count > 0) 3481 lock (m_undo)
3268 { 3482 {
3269 UndoState last = m_undo.Peek(); 3483 if (m_undo.Count > 0)
3270 if (last != null)
3271 { 3484 {
3272 if (last.Compare(this)) 3485 UndoState last = m_undo.Peek();
3273 return; 3486 if (last != null)
3487 {
3488 if (last.Compare(this))
3489 return;
3490 }
3274 } 3491 }
3275 }
3276 3492
3277 if (m_parentGroup.GetSceneMaxUndo() > 0) 3493 if (m_parentGroup.GetSceneMaxUndo() > 0)
3278 { 3494 {
3279 UndoState nUndo = new UndoState(this); 3495 UndoState nUndo = new UndoState(this);
3280 3496
3281 m_undo.Push(nUndo); 3497 m_undo.Push(nUndo);
3282 } 3498 }
3283 3499
3500 }
3284 } 3501 }
3285 } 3502 }
3286 } 3503 }
@@ -3751,11 +3968,36 @@ namespace OpenSim.Region.Framework.Scenes
3751 lock (m_undo) 3968 lock (m_undo)
3752 { 3969 {
3753 if (m_undo.Count > 0) 3970 if (m_undo.Count > 0)
3971 {
3972 UndoState nUndo = null;
3973 if (m_parentGroup.GetSceneMaxUndo() > 0)
3754 { 3974 {
3755 UndoState goback = m_undo.Pop(); 3975 nUndo = new UndoState(this);
3756 if (goback != null) 3976 }
3757 goback.PlaybackState(this); 3977 UndoState goback = m_undo.Pop();
3978 if (goback != null)
3979 {
3980 goback.PlaybackState(this);
3981 if (nUndo != null)
3982 m_redo.Push(nUndo);
3983 }
3984 }
3985 }
3986 }
3987
3988 public void Redo()
3989 {
3990 lock (m_redo)
3991 {
3992 if (m_parentGroup.GetSceneMaxUndo() > 0)
3993 {
3994 UndoState nUndo = new UndoState(this);
3995
3996 m_undo.Push(nUndo);
3758 } 3997 }
3998 UndoState gofwd = m_redo.Pop();
3999 if (gofwd != null)
4000 gofwd.PlayfwdState(this);
3759 } 4001 }
3760 } 4002 }
3761 4003
@@ -3802,6 +4044,18 @@ namespace OpenSim.Region.Framework.Scenes
3802 (pos.Z != OffsetPosition.Z)) 4044 (pos.Z != OffsetPosition.Z))
3803 { 4045 {
3804 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); 4046 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
4047
4048 if (ParentGroup.RootPart.GetStatusSandbox())
4049 {
4050 if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10)
4051 {
4052 ParentGroup.RootPart.ScriptSetPhysicsStatus(false);
4053 newPos = OffsetPosition;
4054 ParentGroup.Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
4055 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, ParentGroup.RootPart.AbsolutePosition, Name, UUID, false);
4056 }
4057 }
4058
3805 OffsetPosition = newPos; 4059 OffsetPosition = newPos;
3806 ScheduleTerseUpdate(); 4060 ScheduleTerseUpdate();
3807 } 4061 }
@@ -4094,7 +4348,6 @@ namespace OpenSim.Region.Framework.Scenes
4094 (rot.Z != RotationOffset.Z) || 4348 (rot.Z != RotationOffset.Z) ||
4095 (rot.W != RotationOffset.W)) 4349 (rot.W != RotationOffset.W))
4096 { 4350 {
4097 //StoreUndoState();
4098 RotationOffset = rot; 4351 RotationOffset = rot;
4099 ParentGroup.HasGroupChanged = true; 4352 ParentGroup.HasGroupChanged = true;
4100 ScheduleTerseUpdate(); 4353 ScheduleTerseUpdate();
@@ -4278,7 +4531,7 @@ namespace OpenSim.Region.Framework.Scenes
4278 else 4531 else
4279 { 4532 {
4280// m_log.DebugFormat( 4533// m_log.DebugFormat(
4281// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); 4534// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
4282 ScheduleFullUpdate(); 4535 ScheduleFullUpdate();
4283 } 4536 }
4284 } 4537 }
@@ -4396,5 +4649,36 @@ namespace OpenSim.Region.Framework.Scenes
4396 4649
4397 Inventory.ApplyNextOwnerPermissions(); 4650 Inventory.ApplyNextOwnerPermissions();
4398 } 4651 }
4652 public void UpdateLookAt()
4653 {
4654 try
4655 {
4656 if (APIDTarget != Quaternion.Identity)
4657 {
4658 if (Single.IsNaN(APIDTarget.W) == true)
4659 {
4660 APIDTarget = Quaternion.Identity;
4661 return;
4662 }
4663 Quaternion rot = RotationOffset;
4664 Quaternion dir = (rot - APIDTarget);
4665 float speed = ((APIDStrength / APIDDamp) * (float)(Math.PI / 180.0f));
4666 if (dir.Z > speed)
4667 {
4668 rot.Z -= speed;
4669 }
4670 if (dir.Z < -speed)
4671 {
4672 rot.Z += speed;
4673 }
4674 rot.Normalize();
4675 UpdateRotation(rot);
4676 }
4677 }
4678 catch (Exception ex)
4679 {
4680 m_log.Error("[Physics] " + ex);
4681 }
4682 }
4399 } 4683 }
4400} 4684}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 298ede9..a555eae 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -314,7 +314,7 @@ namespace OpenSim.Region.Framework.Scenes
314 } 314 }
315 ); 315 );
316 } 316 }
317 } 317 }
318 318
319 private void RestoreSavedScriptState(UUID oldID, UUID newID) 319 private void RestoreSavedScriptState(UUID oldID, UUID newID)
320 { 320 {
@@ -579,7 +579,7 @@ namespace OpenSim.Region.Framework.Scenes
579 m_items.TryGetValue(itemId, out item); 579 m_items.TryGetValue(itemId, out item);
580 580
581 return item; 581 return item;
582 } 582 }
583 583
584 /// <summary> 584 /// <summary>
585 /// Get inventory items by name. 585 /// Get inventory items by name.
@@ -588,7 +588,7 @@ namespace OpenSim.Region.Framework.Scenes
588 /// <returns> 588 /// <returns>
589 /// A list of inventory items with that name. 589 /// A list of inventory items with that name.
590 /// If no inventory item has that name then an empty list is returned. 590 /// If no inventory item has that name then an empty list is returned.
591 /// </returns> 591 /// </returns>
592 public IList<TaskInventoryItem> GetInventoryItems(string name) 592 public IList<TaskInventoryItem> GetInventoryItems(string name)
593 { 593 {
594 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); 594 IList<TaskInventoryItem> items = new List<TaskInventoryItem>();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9c7559b..4973663 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -164,6 +164,8 @@ namespace OpenSim.Region.Framework.Scenes
164 164
165 private Quaternion m_bodyRot= Quaternion.Identity; 165 private Quaternion m_bodyRot= Quaternion.Identity;
166 166
167 private Quaternion m_bodyRotPrevious = Quaternion.Identity;
168
167 private const int LAND_VELOCITYMAG_MAX = 12; 169 private const int LAND_VELOCITYMAG_MAX = 12;
168 170
169 public bool IsRestrictedToRegion; 171 public bool IsRestrictedToRegion;
@@ -225,7 +227,7 @@ namespace OpenSim.Region.Framework.Scenes
225 // Agent's Draw distance. 227 // Agent's Draw distance.
226 protected float m_DrawDistance; 228 protected float m_DrawDistance;
227 229
228 protected AvatarAppearance m_appearance; 230 protected AvatarAppearance m_appearance;
229 231
230 // neighbouring regions we have enabled a child agent in 232 // neighbouring regions we have enabled a child agent in
231 // holds the seed cap for the child agent in that region 233 // holds the seed cap for the child agent in that region
@@ -508,6 +510,12 @@ namespace OpenSim.Region.Framework.Scenes
508 set { m_bodyRot = value; } 510 set { m_bodyRot = value; }
509 } 511 }
510 512
513 public Quaternion PreviousRotation
514 {
515 get { return m_bodyRotPrevious; }
516 set { m_bodyRotPrevious = value; }
517 }
518
511 /// <summary> 519 /// <summary>
512 /// If this is true, agent doesn't have a representation in this scene. 520 /// If this is true, agent doesn't have a representation in this scene.
513 /// this is an agent 'looking into' this scene from a nearby scene(region) 521 /// this is an agent 'looking into' this scene from a nearby scene(region)
@@ -640,7 +648,7 @@ namespace OpenSim.Region.Framework.Scenes
640 #region Constructor(s) 648 #region Constructor(s)
641 649
642 public ScenePresence() 650 public ScenePresence()
643 { 651 {
644 m_sendCourseLocationsMethod = SendCoarseLocationsDefault; 652 m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
645 CreateSceneViewer(); 653 CreateSceneViewer();
646 m_animator = new ScenePresenceAnimator(this); 654 m_animator = new ScenePresenceAnimator(this);
@@ -824,6 +832,31 @@ namespace OpenSim.Region.Framework.Scenes
824 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) 832 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
825 { 833 {
826 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); 834 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
835
836 if (pos.X < 0)
837 {
838 emergencyPos.X = (int)Constants.RegionSize + pos.X;
839 if (!(pos.Y < 0))
840 emergencyPos.Y = pos.Y;
841 if (!(pos.Z < 0))
842 emergencyPos.X = pos.X;
843 }
844 if (pos.Y < 0)
845 {
846 emergencyPos.Y = (int)Constants.RegionSize + pos.Y;
847 if (!(pos.X < 0))
848 emergencyPos.X = pos.X;
849 if (!(pos.Z < 0))
850 emergencyPos.Z = pos.Z;
851 }
852 if (pos.Z < 0)
853 {
854 if (!(pos.X < 0))
855 emergencyPos.X = pos.X;
856 if (!(pos.Y < 0))
857 emergencyPos.Y = pos.Y;
858 //Leave as 128
859 }
827 860
828 m_log.WarnFormat( 861 m_log.WarnFormat(
829 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 862 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
@@ -2704,36 +2737,75 @@ namespace OpenSim.Region.Framework.Scenes
2704 { 2737 {
2705 // Checks if where it's headed exists a region 2738 // Checks if where it's headed exists a region
2706 2739
2740 bool needsTransit = false;
2707 if (m_scene.TestBorderCross(pos2, Cardinals.W)) 2741 if (m_scene.TestBorderCross(pos2, Cardinals.W))
2708 { 2742 {
2709 if (m_scene.TestBorderCross(pos2, Cardinals.S)) 2743 if (m_scene.TestBorderCross(pos2, Cardinals.S))
2744 {
2745 needsTransit = true;
2710 neighbor = HaveNeighbor(Cardinals.SW, ref fix); 2746 neighbor = HaveNeighbor(Cardinals.SW, ref fix);
2747 }
2711 else if (m_scene.TestBorderCross(pos2, Cardinals.N)) 2748 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2749 {
2750 needsTransit = true;
2712 neighbor = HaveNeighbor(Cardinals.NW, ref fix); 2751 neighbor = HaveNeighbor(Cardinals.NW, ref fix);
2752 }
2713 else 2753 else
2754 {
2755 needsTransit = true;
2714 neighbor = HaveNeighbor(Cardinals.W, ref fix); 2756 neighbor = HaveNeighbor(Cardinals.W, ref fix);
2757 }
2715 } 2758 }
2716 else if (m_scene.TestBorderCross(pos2, Cardinals.E)) 2759 else if (m_scene.TestBorderCross(pos2, Cardinals.E))
2717 { 2760 {
2718 if (m_scene.TestBorderCross(pos2, Cardinals.S)) 2761 if (m_scene.TestBorderCross(pos2, Cardinals.S))
2762 {
2763 needsTransit = true;
2719 neighbor = HaveNeighbor(Cardinals.SE, ref fix); 2764 neighbor = HaveNeighbor(Cardinals.SE, ref fix);
2765 }
2720 else if (m_scene.TestBorderCross(pos2, Cardinals.N)) 2766 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2767 {
2768 needsTransit = true;
2721 neighbor = HaveNeighbor(Cardinals.NE, ref fix); 2769 neighbor = HaveNeighbor(Cardinals.NE, ref fix);
2770 }
2722 else 2771 else
2772 {
2773 needsTransit = true;
2723 neighbor = HaveNeighbor(Cardinals.E, ref fix); 2774 neighbor = HaveNeighbor(Cardinals.E, ref fix);
2775 }
2724 } 2776 }
2725 else if (m_scene.TestBorderCross(pos2, Cardinals.S)) 2777 else if (m_scene.TestBorderCross(pos2, Cardinals.S))
2778 {
2779 needsTransit = true;
2726 neighbor = HaveNeighbor(Cardinals.S, ref fix); 2780 neighbor = HaveNeighbor(Cardinals.S, ref fix);
2781 }
2727 else if (m_scene.TestBorderCross(pos2, Cardinals.N)) 2782 else if (m_scene.TestBorderCross(pos2, Cardinals.N))
2783 {
2784 needsTransit = true;
2728 neighbor = HaveNeighbor(Cardinals.N, ref fix); 2785 neighbor = HaveNeighbor(Cardinals.N, ref fix);
2786 }
2787
2729 2788
2730
2731 // Makes sure avatar does not end up outside region 2789 // Makes sure avatar does not end up outside region
2732 if (neighbor < 0) 2790 if (neighbor <= 0)
2733 AbsolutePosition = new Vector3( 2791 {
2734 AbsolutePosition.X + 3*fix[0], 2792 if (!needsTransit)
2735 AbsolutePosition.Y + 3*fix[1], 2793 {
2736 AbsolutePosition.Z); 2794 if (m_requestedSitTargetUUID == UUID.Zero)
2795 {
2796 Vector3 pos = AbsolutePosition;
2797 if (AbsolutePosition.X < 0)
2798 pos.X += Velocity.X;
2799 else if (AbsolutePosition.X > Constants.RegionSize)
2800 pos.X -= Velocity.X;
2801 if (AbsolutePosition.Y < 0)
2802 pos.Y += Velocity.Y;
2803 else if (AbsolutePosition.Y > Constants.RegionSize)
2804 pos.Y -= Velocity.Y;
2805 AbsolutePosition = pos;
2806 }
2807 }
2808 }
2737 else if (neighbor > 0) 2809 else if (neighbor > 0)
2738 CrossToNewRegion(); 2810 CrossToNewRegion();
2739 } 2811 }
@@ -3193,7 +3265,7 @@ namespace OpenSim.Region.Framework.Scenes
3193 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3265 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3194 m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong 3266 m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
3195 m_physicsActor.SubscribeEvents(500); 3267 m_physicsActor.SubscribeEvents(500);
3196 m_physicsActor.LocalID = LocalId; 3268 m_physicsActor.LocalID = LocalId;
3197 } 3269 }
3198 3270
3199 private void OutOfBoundsCall(Vector3 pos) 3271 private void OutOfBoundsCall(Vector3 pos)
@@ -3285,7 +3357,7 @@ namespace OpenSim.Region.Framework.Scenes
3285 } 3357 }
3286 if (m_health <= 0) 3358 if (m_health <= 0)
3287 m_scene.EventManager.TriggerAvatarKill(killerObj, this); 3359 m_scene.EventManager.TriggerAvatarKill(killerObj, this);
3288 } 3360 }
3289 } 3361 }
3290 3362
3291 public void setHealthWithUpdate(float health) 3363 public void setHealthWithUpdate(float health)
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs
index 713ff69..55e407e 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using OpenMetaverse; 28using OpenMetaverse;
29using OpenSim.Region.Framework.Interfaces;
29 30
30namespace OpenSim.Region.Framework.Scenes 31namespace OpenSim.Region.Framework.Scenes
31{ 32{
@@ -35,29 +36,21 @@ namespace OpenSim.Region.Framework.Scenes
35 public Vector3 Scale = Vector3.Zero; 36 public Vector3 Scale = Vector3.Zero;
36 public Quaternion Rotation = Quaternion.Identity; 37 public Quaternion Rotation = Quaternion.Identity;
37 38
38 public UndoState(Vector3 pos, Quaternion rot, Vector3 scale)
39 {
40 Position = pos;
41 Rotation = rot;
42 Scale = scale;
43 }
44
45 public UndoState(SceneObjectPart part) 39 public UndoState(SceneObjectPart part)
46 { 40 {
47 if (part != null) 41 if (part != null)
48 { 42 {
49 if (part.ParentID == 0) 43 if (part.ParentID == 0)
50 { 44 {
51 Position = part.AbsolutePosition; 45 Position = part.ParentGroup.AbsolutePosition;
52 Rotation = part.RotationOffset; 46 Rotation = part.RotationOffset;
53 47 Scale = part.Shape.Scale;
54 } 48 }
55 else 49 else
56 { 50 {
57 Position = part.OffsetPosition; 51 Position = part.OffsetPosition;
58 Rotation = part.RotationOffset; 52 Rotation = part.RotationOffset;
59 Scale = part.Shape.Scale; 53 Scale = part.Shape.Scale;
60
61 } 54 }
62 } 55 }
63 } 56 }
@@ -68,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes
68 { 61 {
69 if (part.ParentID == 0) 62 if (part.ParentID == 0)
70 { 63 {
71 if (Position == part.AbsolutePosition && Rotation == part.RotationOffset) 64 if (Position == part.ParentGroup.AbsolutePosition && Rotation == part.ParentGroup.Rotation)
72 return true; 65 return true;
73 else 66 else
74 return false; 67 return false;
@@ -93,24 +86,78 @@ namespace OpenSim.Region.Framework.Scenes
93 86
94 if (part.ParentID == 0) 87 if (part.ParentID == 0)
95 { 88 {
96 part.ParentGroup.AbsolutePosition = Position; 89 if (Position != Vector3.Zero)
97 part.UpdateRotation(Rotation); 90 part.ParentGroup.AbsolutePosition = Position;
91 part.RotationOffset = Rotation;
92 if (Scale != Vector3.Zero)
93 part.Resize(Scale);
98 part.ParentGroup.ScheduleGroupForTerseUpdate(); 94 part.ParentGroup.ScheduleGroupForTerseUpdate();
99 } 95 }
100 else 96 else
101 { 97 {
102 part.OffsetPosition = Position; 98 if (Position != Vector3.Zero)
99 part.OffsetPosition = Position;
103 part.UpdateRotation(Rotation); 100 part.UpdateRotation(Rotation);
104 part.Resize(Scale); 101 if (Scale != Vector3.Zero)
102 part.Resize(Scale); part.ScheduleTerseUpdate();
103 }
104 part.Undoing = false;
105
106 }
107 }
108 public void PlayfwdState(SceneObjectPart part)
109 {
110 if (part != null)
111 {
112 part.Undoing = true;
113
114 if (part.ParentID == 0)
115 {
116 if (Position != Vector3.Zero)
117 part.ParentGroup.AbsolutePosition = Position;
118 if (Rotation != Quaternion.Identity)
119 part.UpdateRotation(Rotation);
120 if (Scale != Vector3.Zero)
121 part.Resize(Scale);
122 part.ParentGroup.ScheduleGroupForTerseUpdate();
123 }
124 else
125 {
126 if (Position != Vector3.Zero)
127 part.OffsetPosition = Position;
128 if (Rotation != Quaternion.Identity)
129 part.UpdateRotation(Rotation);
130 if (Scale != Vector3.Zero)
131 part.Resize(Scale);
105 part.ScheduleTerseUpdate(); 132 part.ScheduleTerseUpdate();
106 } 133 }
107 part.Undoing = false; 134 part.Undoing = false;
108 135
109 } 136 }
110 } 137 }
138 }
139 public class LandUndoState
140 {
141 public ITerrainModule m_terrainModule;
142 public ITerrainChannel m_terrainChannel;
143
144 public LandUndoState(ITerrainModule terrainModule, ITerrainChannel terrainChannel)
145 {
146 m_terrainModule = terrainModule;
147 m_terrainChannel = terrainChannel;
148 }
149
150 public bool Compare(ITerrainChannel terrainChannel)
151 {
152 if (m_terrainChannel != terrainChannel)
153 return false;
154 else
155 return false;
156 }
111 157
112 public UndoState() 158 public void PlaybackState()
113 { 159 {
160 m_terrainModule.UndoTerrain(m_terrainChannel);
114 } 161 }
115 } 162 }
116} 163}
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index b421623..009dd37 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -774,6 +774,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
774 public event UUIDNameRequest OnTeleportHomeRequest; 774 public event UUIDNameRequest OnTeleportHomeRequest;
775 public event ScriptAnswer OnScriptAnswer; 775 public event ScriptAnswer OnScriptAnswer;
776 public event AgentSit OnUndo; 776 public event AgentSit OnUndo;
777 public event AgentSit OnRedo;
778 public event LandUndo OnLandUndo;
777 public event ForceReleaseControls OnForceReleaseControls; 779 public event ForceReleaseControls OnForceReleaseControls;
778 public event GodLandStatRequest OnLandStatRequest; 780 public event GodLandStatRequest OnLandStatRequest;
779 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 781 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
index 31f28e0..5bfe4be 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
@@ -767,7 +767,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
767 if (!CanEdit()) 767 if (!CanEdit())
768 return; 768 return;
769 769
770 GetSOP().SendSound(asset.ToString(), volume, true, 0); 770 GetSOP().SendSound(asset.ToString(), volume, true, 0, 0, false, false);
771 } 771 }
772 772
773 #endregion 773 #endregion
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
index c7cd37b..45bb005 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
@@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
231 if (soundModule != null) 231 if (soundModule != null)
232 { 232 {
233 soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, volume, position, 233 soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, volume, position,
234 m_internalScene.RegionInfo.RegionHandle); 234 m_internalScene.RegionInfo.RegionHandle, 0);
235 } 235 }
236 } 236 }
237 237
@@ -241,7 +241,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
241 if (soundModule != null) 241 if (soundModule != null)
242 { 242 {
243 soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, 1.0, position, 243 soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, 1.0, position,
244 m_internalScene.RegionInfo.RegionHandle); 244 m_internalScene.RegionInfo.RegionHandle, 0);
245 } 245 }
246 } 246 }
247 247
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 1d15552..b331001 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -298,6 +298,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
298 public event ObjectBuy OnObjectBuy; 298 public event ObjectBuy OnObjectBuy;
299 public event BuyObjectInventory OnBuyObjectInventory; 299 public event BuyObjectInventory OnBuyObjectInventory;
300 public event AgentSit OnUndo; 300 public event AgentSit OnUndo;
301 public event AgentSit OnRedo;
302 public event LandUndo OnLandUndo;
301 303
302 public event ForceReleaseControls OnForceReleaseControls; 304 public event ForceReleaseControls OnForceReleaseControls;
303 public event GodLandStatRequest OnLandStatRequest; 305 public event GodLandStatRequest OnLandStatRequest;
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
index 31366db..5e2eeeb 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
@@ -185,6 +185,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
185 185
186 } 186 }
187 187
188 public override void VehicleFlags(int param, bool remove)
189 {
190
191 }
192
188 public override void SetVolumeDetect(int param) 193 public override void SetVolumeDetect(int param)
189 { 194 {
190 195
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
index 97eb6a2..6a54705 100644
--- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
+++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
@@ -362,6 +362,11 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
362 362
363 } 363 }
364 364
365 public override void VehicleFlags(int param, bool remove)
366 {
367
368 }
369
365 public override void SetVolumeDetect(int param) 370 public override void SetVolumeDetect(int param)
366 { 371 {
367 372
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs
index 9603ea4..920ed96 100644
--- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs
+++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs
@@ -397,6 +397,11 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
397 //TODO: 397 //TODO:
398 } 398 }
399 399
400 public override void VehicleFlags(int param, bool remove)
401 {
402
403 }
404
400 public override void SetVolumeDetect(int param) 405 public override void SetVolumeDetect(int param)
401 { 406 {
402 //TODO: GhostObject 407 //TODO: GhostObject
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index d5d146e..e2a6a2e 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -500,6 +500,18 @@ namespace OpenSim.Region.Physics.BulletXPlugin
500 public BulletXScene(String sceneIdentifier) 500 public BulletXScene(String sceneIdentifier)
501 { 501 {
502 //identifier = sceneIdentifier; 502 //identifier = sceneIdentifier;
503 cDispatcher = new CollisionDispatcherLocal(this);
504 Vector3 worldMinDim = new Vector3((float)minXY, (float)minXY, (float)minZ);
505 Vector3 worldMaxDim = new Vector3((float)maxXY, (float)maxXY, (float)maxZ);
506 opCache = new AxisSweep3(worldMinDim, worldMaxDim, maxHandles);
507 sicSolver = new SequentialImpulseConstraintSolver();
508
509 lock (BulletXLock)
510 {
511 ddWorld = new DiscreteDynamicsWorld(cDispatcher, opCache, sicSolver);
512 ddWorld.Gravity = new Vector3(0, 0, -gravity);
513 }
514 //this._heightmap = new float[65536];
503 } 515 }
504 516
505 public static float Gravity 517 public static float Gravity
@@ -582,12 +594,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin
582 pos.Y = position.Y; 594 pos.Y = position.Y;
583 pos.Z = position.Z + 20; 595 pos.Z = position.Z + 20;
584 BulletXCharacter newAv = null; 596 BulletXCharacter newAv = null;
585 newAv.Flying = isFlying;
586 lock (BulletXLock) 597 lock (BulletXLock)
587 { 598 {
588 newAv = new BulletXCharacter(avName, this, pos); 599 newAv = new BulletXCharacter(avName, this, pos);
589 _characters.Add(newAv.RigidBody, newAv); 600 _characters.Add(newAv.RigidBody, newAv);
590 } 601 }
602 newAv.Flying = isFlying;
591 return newAv; 603 return newAv;
592 } 604 }
593 605
@@ -984,6 +996,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin
984 { 996 {
985 997
986 } 998 }
999
1000 public override void VehicleFlags(int param, bool remove)
1001 {
1002
1003 }
987 1004
988 public override void SetVolumeDetect(int param) 1005 public override void SetVolumeDetect(int param)
989 { 1006 {
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index 9c192ed..880c3ea 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -208,6 +208,7 @@ namespace OpenSim.Region.Physics.Manager
208 public abstract void VehicleFloatParam(int param, float value); 208 public abstract void VehicleFloatParam(int param, float value);
209 public abstract void VehicleVectorParam(int param, Vector3 value); 209 public abstract void VehicleVectorParam(int param, Vector3 value);
210 public abstract void VehicleRotationParam(int param, Quaternion rotation); 210 public abstract void VehicleRotationParam(int param, Quaternion rotation);
211 public abstract void VehicleFlags(int param, bool remove);
211 212
212 public abstract void SetVolumeDetect(int param); // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more 213 public abstract void SetVolumeDetect(int param); // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more
213 214
@@ -352,6 +353,11 @@ namespace OpenSim.Region.Physics.Manager
352 353
353 } 354 }
354 355
356 public override void VehicleFlags(int param, bool remove)
357 {
358
359 }
360
355 public override void SetVolumeDetect(int param) 361 public override void SetVolumeDetect(int param)
356 { 362 {
357 363
diff --git a/OpenSim/Region/Physics/Manager/VehicleConstants.cs b/OpenSim/Region/Physics/Manager/VehicleConstants.cs
index 532e55e..f0775c1 100644
--- a/OpenSim/Region/Physics/Manager/VehicleConstants.cs
+++ b/OpenSim/Region/Physics/Manager/VehicleConstants.cs
@@ -91,7 +91,9 @@ namespace OpenSim.Region.Physics.Manager
91 BANKING_EFFICIENCY = 38, 91 BANKING_EFFICIENCY = 38,
92 BANKING_MIX = 39, 92 BANKING_MIX = 39,
93 BANKING_TIMESCALE = 40, 93 BANKING_TIMESCALE = 40,
94 REFERENCE_FRAME = 44 94 REFERENCE_FRAME = 44,
95 BLOCK_EXIT = 45,
96 ROLL_FRAME = 46
95 97
96 } 98 }
97 99
@@ -107,7 +109,13 @@ namespace OpenSim.Region.Physics.Manager
107 LIMIT_MOTOR_UP = 64, 109 LIMIT_MOTOR_UP = 64,
108 MOUSELOOK_STEER = 128, 110 MOUSELOOK_STEER = 128,
109 MOUSELOOK_BANK = 256, 111 MOUSELOOK_BANK = 256,
110 CAMERA_DECOUPLED = 512 112 CAMERA_DECOUPLED = 512,
113 NO_X = 1024,
114 NO_Y = 2048,
115 NO_Z = 4096,
116 LOCK_HOVER_HEIGHT = 8192,
117 NO_DEFLECTION = 16392,
118 LOCK_ROTATION = 32784
111 } 119 }
112 120
113} 121}
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 06ed8fb..a2229e8 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -734,6 +734,11 @@ namespace OpenSim.Region.Physics.OdePlugin
734 734
735 } 735 }
736 736
737 public override void VehicleFlags(int param, bool remove)
738 {
739
740 }
741
737 public override void SetVolumeDetect(int param) 742 public override void SetVolumeDetect(int param)
738 { 743 {
739 744
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs
index 008070b..9beeabb 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs
@@ -72,37 +72,40 @@ namespace OpenSim.Region.Physics.OdePlugin
72 72
73 73
74 // Vehicle properties 74 // Vehicle properties
75 private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind 75 private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind
76 // private Quaternion m_referenceFrame = Quaternion.Identity; // Axis modifier 76 // private Quaternion m_referenceFrame = Quaternion.Identity; // Axis modifier
77 private VehicleFlag m_flags = (VehicleFlag) 0; // Boolean settings: 77 private VehicleFlag m_flags = (VehicleFlag) 0; // Boolean settings:
78 // HOVER_TERRAIN_ONLY 78 // HOVER_TERRAIN_ONLY
79 // HOVER_GLOBAL_HEIGHT 79 // HOVER_GLOBAL_HEIGHT
80 // NO_DEFLECTION_UP 80 // NO_DEFLECTION_UP
81 // HOVER_WATER_ONLY 81 // HOVER_WATER_ONLY
82 // HOVER_UP_ONLY 82 // HOVER_UP_ONLY
83 // LIMIT_MOTOR_UP 83 // LIMIT_MOTOR_UP
84 // LIMIT_ROLL_ONLY 84 // LIMIT_ROLL_ONLY
85 85 private VehicleFlag m_Hoverflags = (VehicleFlag)0;
86 private Vector3 m_BlockingEndPoint = Vector3.Zero;
87 private Quaternion m_RollreferenceFrame = Quaternion.Identity;
86 // Linear properties 88 // Linear properties
87 private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time 89 private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time
88 private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL 90 private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL
89 private Vector3 m_dir = Vector3.Zero; // velocity applied to body 91 private Vector3 m_dir = Vector3.Zero; // velocity applied to body
90 private Vector3 m_linearFrictionTimescale = Vector3.Zero; 92 private Vector3 m_linearFrictionTimescale = Vector3.Zero;
91 private float m_linearMotorDecayTimescale = 0; 93 private float m_linearMotorDecayTimescale = 0;
92 private float m_linearMotorTimescale = 0; 94 private float m_linearMotorTimescale = 0;
93 private Vector3 m_lastLinearVelocityVector = Vector3.Zero; 95 private Vector3 m_lastLinearVelocityVector = Vector3.Zero;
96 private d.Vector3 m_lastPositionVector = new d.Vector3();
94 // private bool m_LinearMotorSetLastFrame = false; 97 // private bool m_LinearMotorSetLastFrame = false;
95 // private Vector3 m_linearMotorOffset = Vector3.Zero; 98 // private Vector3 m_linearMotorOffset = Vector3.Zero;
96 99
97 //Angular properties 100 //Angular properties
98 private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor 101 private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor
99 private int m_angularMotorApply = 0; // application frame counter 102 private int m_angularMotorApply = 0; // application frame counter
100 private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity 103 private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity
101 private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate 104 private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate
102 private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate 105 private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate
103 private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate 106 private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate
104 private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body 107 private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body
105 // private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body 108 // private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body
106 109
107 //Deflection properties 110 //Deflection properties
108 // private float m_angularDeflectionEfficiency = 0; 111 // private float m_angularDeflectionEfficiency = 0;
@@ -120,14 +123,14 @@ namespace OpenSim.Region.Physics.OdePlugin
120// private float m_VhoverEfficiency = 0f; 123// private float m_VhoverEfficiency = 0f;
121 private float m_VhoverTimescale = 0f; 124 private float m_VhoverTimescale = 0f;
122 private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height 125 private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height
123 private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle. 126 private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle.
124 // Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity) 127 // Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity)
125 // KF: So far I have found no good method to combine a script-requested .Z velocity and gravity. 128 // KF: So far I have found no good method to combine a script-requested .Z velocity and gravity.
126 // Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity. 129 // Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity.
127 130
128 //Attractor properties 131 //Attractor properties
129 private float m_verticalAttractionEfficiency = 1.0f; // damped 132 private float m_verticalAttractionEfficiency = 1.0f; // damped
130 private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor. 133 private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor.
131 134
132 internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) 135 internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue)
133 { 136 {
@@ -255,6 +258,9 @@ namespace OpenSim.Region.Physics.OdePlugin
255 case Vehicle.LINEAR_MOTOR_OFFSET: 258 case Vehicle.LINEAR_MOTOR_OFFSET:
256 // m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); 259 // m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z);
257 break; 260 break;
261 case Vehicle.BLOCK_EXIT:
262 m_BlockingEndPoint = new Vector3(pValue.X, pValue.Y, pValue.Z);
263 break;
258 } 264 }
259 }//end ProcessVectorVehicleParam 265 }//end ProcessVectorVehicleParam
260 266
@@ -265,15 +271,189 @@ namespace OpenSim.Region.Physics.OdePlugin
265 case Vehicle.REFERENCE_FRAME: 271 case Vehicle.REFERENCE_FRAME:
266 // m_referenceFrame = pValue; 272 // m_referenceFrame = pValue;
267 break; 273 break;
274 case Vehicle.ROLL_FRAME:
275 m_RollreferenceFrame = pValue;
276 break;
268 } 277 }
269 }//end ProcessRotationVehicleParam 278 }//end ProcessRotationVehicleParam
270 279
280 internal void ProcessVehicleFlags(int pParam, bool remove)
281 {
282 if (remove)
283 {
284 if (pParam == -1)
285 {
286 m_flags = (VehicleFlag)0;
287 m_Hoverflags = (VehicleFlag)0;
288 return;
289 }
290 if ((pParam & (int)VehicleFlag.HOVER_GLOBAL_HEIGHT) == (int)VehicleFlag.HOVER_GLOBAL_HEIGHT)
291 {
292 if ((m_Hoverflags & VehicleFlag.HOVER_GLOBAL_HEIGHT) != (VehicleFlag)0)
293 m_Hoverflags &= ~(VehicleFlag.HOVER_GLOBAL_HEIGHT);
294 }
295 if ((pParam & (int)VehicleFlag.HOVER_TERRAIN_ONLY) == (int)VehicleFlag.HOVER_TERRAIN_ONLY)
296 {
297 if ((m_Hoverflags & VehicleFlag.HOVER_TERRAIN_ONLY) != (VehicleFlag)0)
298 m_Hoverflags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY);
299 }
300 if ((pParam & (int)VehicleFlag.HOVER_UP_ONLY) == (int)VehicleFlag.HOVER_UP_ONLY)
301 {
302 if ((m_Hoverflags & VehicleFlag.HOVER_UP_ONLY) != (VehicleFlag)0)
303 m_Hoverflags &= ~(VehicleFlag.HOVER_UP_ONLY);
304 }
305 if ((pParam & (int)VehicleFlag.HOVER_WATER_ONLY) == (int)VehicleFlag.HOVER_WATER_ONLY)
306 {
307 if ((m_Hoverflags & VehicleFlag.HOVER_WATER_ONLY) != (VehicleFlag)0)
308 m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY);
309 }
310 if ((pParam & (int)VehicleFlag.LIMIT_MOTOR_UP) == (int)VehicleFlag.LIMIT_MOTOR_UP)
311 {
312 if ((m_flags & VehicleFlag.LIMIT_MOTOR_UP) != (VehicleFlag)0)
313 m_flags &= ~(VehicleFlag.LIMIT_MOTOR_UP);
314 }
315 if ((pParam & (int)VehicleFlag.LIMIT_ROLL_ONLY) == (int)VehicleFlag.LIMIT_ROLL_ONLY)
316 {
317 if ((m_flags & VehicleFlag.LIMIT_ROLL_ONLY) != (VehicleFlag)0)
318 m_flags &= ~(VehicleFlag.LIMIT_ROLL_ONLY);
319 }
320 if ((pParam & (int)VehicleFlag.MOUSELOOK_BANK) == (int)VehicleFlag.MOUSELOOK_BANK)
321 {
322 if ((m_flags & VehicleFlag.MOUSELOOK_BANK) != (VehicleFlag)0)
323 m_flags &= ~(VehicleFlag.MOUSELOOK_BANK);
324 }
325 if ((pParam & (int)VehicleFlag.MOUSELOOK_STEER) == (int)VehicleFlag.MOUSELOOK_STEER)
326 {
327 if ((m_flags & VehicleFlag.MOUSELOOK_STEER) != (VehicleFlag)0)
328 m_flags &= ~(VehicleFlag.MOUSELOOK_STEER);
329 }
330 if ((pParam & (int)VehicleFlag.NO_DEFLECTION_UP) == (int)VehicleFlag.NO_DEFLECTION_UP)
331 {
332 if ((m_flags & VehicleFlag.NO_DEFLECTION_UP) != (VehicleFlag)0)
333 m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP);
334 }
335 if ((pParam & (int)VehicleFlag.CAMERA_DECOUPLED) == (int)VehicleFlag.CAMERA_DECOUPLED)
336 {
337 if ((m_flags & VehicleFlag.CAMERA_DECOUPLED) != (VehicleFlag)0)
338 m_flags &= ~(VehicleFlag.CAMERA_DECOUPLED);
339 }
340 if ((pParam & (int)VehicleFlag.NO_X) == (int)VehicleFlag.NO_X)
341 {
342 if ((m_flags & VehicleFlag.NO_X) != (VehicleFlag)0)
343 m_flags &= ~(VehicleFlag.NO_X);
344 }
345 if ((pParam & (int)VehicleFlag.NO_Y) == (int)VehicleFlag.NO_Y)
346 {
347 if ((m_flags & VehicleFlag.NO_Y) != (VehicleFlag)0)
348 m_flags &= ~(VehicleFlag.NO_Y);
349 }
350 if ((pParam & (int)VehicleFlag.NO_Z) == (int)VehicleFlag.NO_Z)
351 {
352 if ((m_flags & VehicleFlag.NO_Z) != (VehicleFlag)0)
353 m_flags &= ~(VehicleFlag.NO_Z);
354 }
355 if ((pParam & (int)VehicleFlag.LOCK_HOVER_HEIGHT) == (int)VehicleFlag.LOCK_HOVER_HEIGHT)
356 {
357 if ((m_Hoverflags & VehicleFlag.LOCK_HOVER_HEIGHT) != (VehicleFlag)0)
358 m_Hoverflags &= ~(VehicleFlag.LOCK_HOVER_HEIGHT);
359 }
360 if ((pParam & (int)VehicleFlag.NO_DEFLECTION) == (int)VehicleFlag.NO_DEFLECTION)
361 {
362 if ((m_flags & VehicleFlag.NO_DEFLECTION) != (VehicleFlag)0)
363 m_flags &= ~(VehicleFlag.NO_DEFLECTION);
364 }
365 if ((pParam & (int)VehicleFlag.LOCK_ROTATION) == (int)VehicleFlag.LOCK_ROTATION)
366 {
367 if ((m_flags & VehicleFlag.LOCK_ROTATION) != (VehicleFlag)0)
368 m_flags &= ~(VehicleFlag.LOCK_ROTATION);
369 }
370 }
371 else
372 {
373 if ((pParam & (int)VehicleFlag.HOVER_GLOBAL_HEIGHT) == (int)VehicleFlag.HOVER_GLOBAL_HEIGHT)
374 {
375 m_Hoverflags |= (VehicleFlag.HOVER_GLOBAL_HEIGHT | m_flags);
376 }
377 if ((pParam & (int)VehicleFlag.HOVER_TERRAIN_ONLY) == (int)VehicleFlag.HOVER_TERRAIN_ONLY)
378 {
379 m_Hoverflags |= (VehicleFlag.HOVER_TERRAIN_ONLY | m_flags);
380 }
381 if ((pParam & (int)VehicleFlag.HOVER_UP_ONLY) == (int)VehicleFlag.HOVER_UP_ONLY)
382 {
383 m_Hoverflags |= (VehicleFlag.HOVER_UP_ONLY | m_flags);
384 }
385 if ((pParam & (int)VehicleFlag.HOVER_WATER_ONLY) == (int)VehicleFlag.HOVER_WATER_ONLY)
386 {
387 m_Hoverflags |= (VehicleFlag.HOVER_WATER_ONLY | m_flags);
388 }
389 if ((pParam & (int)VehicleFlag.LIMIT_MOTOR_UP) == (int)VehicleFlag.LIMIT_MOTOR_UP)
390 {
391 m_flags |= (VehicleFlag.LIMIT_MOTOR_UP | m_flags);
392 }
393 if ((pParam & (int)VehicleFlag.MOUSELOOK_BANK) == (int)VehicleFlag.MOUSELOOK_BANK)
394 {
395 m_flags |= (VehicleFlag.MOUSELOOK_BANK | m_flags);
396 }
397 if ((pParam & (int)VehicleFlag.MOUSELOOK_STEER) == (int)VehicleFlag.MOUSELOOK_STEER)
398 {
399 m_flags |= (VehicleFlag.MOUSELOOK_STEER | m_flags);
400 }
401 if ((pParam & (int)VehicleFlag.NO_DEFLECTION_UP) == (int)VehicleFlag.NO_DEFLECTION_UP)
402 {
403 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | m_flags);
404 }
405 if ((pParam & (int)VehicleFlag.CAMERA_DECOUPLED) == (int)VehicleFlag.CAMERA_DECOUPLED)
406 {
407 m_flags |= (VehicleFlag.CAMERA_DECOUPLED | m_flags);
408 }
409 if ((pParam & (int)VehicleFlag.NO_X) == (int)VehicleFlag.NO_X)
410 {
411 m_flags |= (VehicleFlag.NO_X);
412 }
413 if ((pParam & (int)VehicleFlag.NO_Y) == (int)VehicleFlag.NO_Y)
414 {
415 m_flags |= (VehicleFlag.NO_Y);
416 }
417 if ((pParam & (int)VehicleFlag.NO_Z) == (int)VehicleFlag.NO_Z)
418 {
419 m_flags |= (VehicleFlag.NO_Z);
420 }
421 if ((pParam & (int)VehicleFlag.LOCK_HOVER_HEIGHT) == (int)VehicleFlag.LOCK_HOVER_HEIGHT)
422 {
423 m_Hoverflags |= (VehicleFlag.LOCK_HOVER_HEIGHT);
424 }
425 if ((pParam & (int)VehicleFlag.NO_DEFLECTION) == (int)VehicleFlag.NO_DEFLECTION)
426 {
427 m_flags |= (VehicleFlag.NO_DEFLECTION);
428 }
429 if ((pParam & (int)VehicleFlag.LOCK_ROTATION) == (int)VehicleFlag.LOCK_ROTATION)
430 {
431 m_flags |= (VehicleFlag.LOCK_ROTATION);
432 }
433 }
434 }//end ProcessVehicleFlags
435
271 internal void ProcessTypeChange(Vehicle pType) 436 internal void ProcessTypeChange(Vehicle pType)
272 { 437 {
273 // Set Defaults For Type 438 // Set Defaults For Type
274 m_type = pType; 439 m_type = pType;
275 switch (pType) 440 switch (pType)
276 { 441 {
442 case Vehicle.TYPE_NONE:
443 m_linearFrictionTimescale = new Vector3(0, 0, 0);
444 m_angularFrictionTimescale = new Vector3(0, 0, 0);
445 m_linearMotorDirection = Vector3.Zero;
446 m_linearMotorTimescale = 0;
447 m_linearMotorDecayTimescale = 0;
448 m_angularMotorDirection = Vector3.Zero;
449 m_angularMotorTimescale = 0;
450 m_angularMotorDecayTimescale = 0;
451 m_VhoverHeight = 0;
452 m_VhoverTimescale = 0;
453 m_VehicleBuoyancy = 0;
454 m_flags = (VehicleFlag)0;
455 break;
456
277 case Vehicle.TYPE_SLED: 457 case Vehicle.TYPE_SLED:
278 m_linearFrictionTimescale = new Vector3(30, 1, 1000); 458 m_linearFrictionTimescale = new Vector3(30, 1, 1000);
279 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); 459 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000);
@@ -295,9 +475,9 @@ namespace OpenSim.Region.Physics.OdePlugin
295 // m_bankingMix = 1; 475 // m_bankingMix = 1;
296 // m_bankingTimescale = 10; 476 // m_bankingTimescale = 10;
297 // m_referenceFrame = Quaternion.Identity; 477 // m_referenceFrame = Quaternion.Identity;
298 m_flags &= 478 m_Hoverflags &=
299 ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | 479 ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
300 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY); 480 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
301 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.LIMIT_MOTOR_UP); 481 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.LIMIT_MOTOR_UP);
302 break; 482 break;
303 case Vehicle.TYPE_CAR: 483 case Vehicle.TYPE_CAR:
@@ -323,9 +503,10 @@ namespace OpenSim.Region.Physics.OdePlugin
323 // m_bankingMix = 1; 503 // m_bankingMix = 1;
324 // m_bankingTimescale = 1; 504 // m_bankingTimescale = 1;
325 // m_referenceFrame = Quaternion.Identity; 505 // m_referenceFrame = Quaternion.Identity;
326 m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT); 506 m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT);
327 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.HOVER_UP_ONLY | 507 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY |
328 VehicleFlag.LIMIT_MOTOR_UP); 508 VehicleFlag.LIMIT_MOTOR_UP);
509 m_Hoverflags |= (VehicleFlag.HOVER_UP_ONLY);
329 break; 510 break;
330 case Vehicle.TYPE_BOAT: 511 case Vehicle.TYPE_BOAT:
331 m_linearFrictionTimescale = new Vector3(10, 3, 2); 512 m_linearFrictionTimescale = new Vector3(10, 3, 2);
@@ -350,10 +531,12 @@ namespace OpenSim.Region.Physics.OdePlugin
350 // m_bankingMix = 0.8f; 531 // m_bankingMix = 0.8f;
351 // m_bankingTimescale = 1; 532 // m_bankingTimescale = 1;
352 // m_referenceFrame = Quaternion.Identity; 533 // m_referenceFrame = Quaternion.Identity;
353 m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.LIMIT_ROLL_ONLY | 534 m_Hoverflags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY |
354 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY); 535 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
355 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | 536 m_flags &= ~(VehicleFlag.LIMIT_ROLL_ONLY);
537 m_flags |= (VehicleFlag.NO_DEFLECTION_UP |
356 VehicleFlag.LIMIT_MOTOR_UP); 538 VehicleFlag.LIMIT_MOTOR_UP);
539 m_Hoverflags |= (VehicleFlag.HOVER_WATER_ONLY);
357 break; 540 break;
358 case Vehicle.TYPE_AIRPLANE: 541 case Vehicle.TYPE_AIRPLANE:
359 m_linearFrictionTimescale = new Vector3(200, 10, 5); 542 m_linearFrictionTimescale = new Vector3(200, 10, 5);
@@ -378,8 +561,9 @@ namespace OpenSim.Region.Physics.OdePlugin
378 // m_bankingMix = 0.7f; 561 // m_bankingMix = 0.7f;
379 // m_bankingTimescale = 2; 562 // m_bankingTimescale = 2;
380 // m_referenceFrame = Quaternion.Identity; 563 // m_referenceFrame = Quaternion.Identity;
381 m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | 564 m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
382 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY | VehicleFlag.LIMIT_MOTOR_UP); 565 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
566 m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_MOTOR_UP);
383 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY); 567 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY);
384 break; 568 break;
385 case Vehicle.TYPE_BALLOON: 569 case Vehicle.TYPE_BALLOON:
@@ -405,9 +589,11 @@ namespace OpenSim.Region.Physics.OdePlugin
405 // m_bankingMix = 0.7f; 589 // m_bankingMix = 0.7f;
406 // m_bankingTimescale = 5; 590 // m_bankingTimescale = 5;
407 // m_referenceFrame = Quaternion.Identity; 591 // m_referenceFrame = Quaternion.Identity;
408 m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | 592 m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
409 VehicleFlag.HOVER_UP_ONLY | VehicleFlag.LIMIT_MOTOR_UP); 593 VehicleFlag.HOVER_UP_ONLY);
410 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT); 594 m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_MOTOR_UP);
595 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY);
596 m_Hoverflags |= (VehicleFlag.HOVER_GLOBAL_HEIGHT);
411 break; 597 break;
412 598
413 } 599 }
@@ -431,6 +617,7 @@ namespace OpenSim.Region.Physics.OdePlugin
431 617
432 MoveLinear(pTimestep, pParentScene); 618 MoveLinear(pTimestep, pParentScene);
433 MoveAngular(pTimestep); 619 MoveAngular(pTimestep);
620 LimitRotation(pTimestep);
434 }// end Step 621 }// end Step
435 622
436 private void MoveLinear(float pTimestep, OdeScene _pParentScene) 623 private void MoveLinear(float pTimestep, OdeScene _pParentScene)
@@ -477,61 +664,152 @@ namespace OpenSim.Region.Physics.OdePlugin
477 // .Z velocity and gravity. Therefore only 0g will used script-requested 664 // .Z velocity and gravity. Therefore only 0g will used script-requested
478 // .Z velocity. >0g (m_VehicleBuoyancy < 1) will used modified gravity only. 665 // .Z velocity. >0g (m_VehicleBuoyancy < 1) will used modified gravity only.
479 Vector3 grav = Vector3.Zero; 666 Vector3 grav = Vector3.Zero;
480 if (m_VehicleBuoyancy < 1.0f) 667 // There is some gravity, make a gravity force vector
668 // that is applied after object velocity.
669 d.Mass objMass;
670 d.BodyGetMass(Body, out objMass);
671 // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g;
672 grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy);
673 // Preserve the current Z velocity
674 d.Vector3 vel_now = d.BodyGetLinearVel(Body);
675 m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity
676
677 d.Vector3 pos = d.BodyGetPosition(Body);
678 Vector3 accel = new Vector3(-(m_dir.X - m_lastLinearVelocityVector.X / 0.1f), -(m_dir.Y - m_lastLinearVelocityVector.Y / 0.1f), m_dir.Z - m_lastLinearVelocityVector.Z / 0.1f);
679 Vector3 posChange = new Vector3();
680 posChange.X = pos.X - m_lastPositionVector.X;
681 posChange.Y = pos.Y - m_lastPositionVector.Y;
682 posChange.Z = pos.Z - m_lastPositionVector.Z;
683 double Zchange = Math.Abs(posChange.Z);
684 if (m_BlockingEndPoint != Vector3.Zero)
685 {
686 if (pos.X >= (m_BlockingEndPoint.X - (float)1))
687 {
688 pos.X -= posChange.X + 1;
689 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
690 }
691 if (pos.Y >= (m_BlockingEndPoint.Y - (float)1))
692 {
693 pos.Y -= posChange.Y + 1;
694 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
695 }
696 if (pos.Z >= (m_BlockingEndPoint.Z - (float)1))
697 {
698 pos.Z -= posChange.Z + 1;
699 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
700 }
701 if (pos.X <= 0)
702 {
703 pos.X += posChange.X + 1;
704 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
705 }
706 if (pos.Y <= 0)
707 {
708 pos.Y += posChange.Y + 1;
709 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
710 }
711 }
712 if (pos.Z < _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y))
481 { 713 {
482 // There is some gravity, make a gravity force vector 714 pos.Z = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + 2;
483 // that is applied after object velocity. 715 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
484 d.Mass objMass; 716 }
485 d.BodyGetMass(Body, out objMass);
486 // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g;
487 grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy);
488 // Preserve the current Z velocity
489 d.Vector3 vel_now = d.BodyGetLinearVel(Body);
490 m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity
491 } // else its 1.0, no gravity.
492 717
493 // Check if hovering 718 // Check if hovering
494 if ((m_flags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0) 719 if ((m_Hoverflags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0)
495 { 720 {
496 // We should hover, get the target height 721 // We should hover, get the target height
497 d.Vector3 pos = d.BodyGetPosition(Body); 722 if ((m_Hoverflags & VehicleFlag.HOVER_WATER_ONLY) != 0)
498 if ((m_flags & VehicleFlag.HOVER_WATER_ONLY) == VehicleFlag.HOVER_WATER_ONLY)
499 { 723 {
500 m_VhoverTargetHeight = _pParentScene.GetWaterLevel() + m_VhoverHeight; 724 m_VhoverTargetHeight = _pParentScene.GetWaterLevel() + m_VhoverHeight;
501 } 725 }
502 else if ((m_flags & VehicleFlag.HOVER_TERRAIN_ONLY) == VehicleFlag.HOVER_TERRAIN_ONLY) 726 if ((m_Hoverflags & VehicleFlag.HOVER_TERRAIN_ONLY) != 0)
503 { 727 {
504 m_VhoverTargetHeight = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + m_VhoverHeight; 728 m_VhoverTargetHeight = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + m_VhoverHeight;
505 } 729 }
506 else if ((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == VehicleFlag.HOVER_GLOBAL_HEIGHT) 730 if ((m_Hoverflags & VehicleFlag.HOVER_GLOBAL_HEIGHT) != 0)
507 { 731 {
508 m_VhoverTargetHeight = m_VhoverHeight; 732 m_VhoverTargetHeight = m_VhoverHeight;
509 } 733 }
510 734
511 if ((m_flags & VehicleFlag.HOVER_UP_ONLY) == VehicleFlag.HOVER_UP_ONLY) 735 if ((m_Hoverflags & VehicleFlag.HOVER_UP_ONLY) != 0)
512 { 736 {
513 // If body is aready heigher, use its height as target height 737 // If body is aready heigher, use its height as target height
514 if (pos.Z > m_VhoverTargetHeight) m_VhoverTargetHeight = pos.Z; 738 if (pos.Z > m_VhoverTargetHeight) m_VhoverTargetHeight = pos.Z;
515 } 739 }
740 if ((m_Hoverflags & VehicleFlag.LOCK_HOVER_HEIGHT) != 0)
741 {
742 if ((pos.Z - m_VhoverTargetHeight) > .2 || (pos.Z - m_VhoverTargetHeight) < -.2)
743 {
744 d.BodySetPosition(Body, pos.X, pos.Y, m_VhoverTargetHeight);
745 }
746 }
747 else
748 {
749 float herr0 = pos.Z - m_VhoverTargetHeight;
750 // Replace Vertical speed with correction figure if significant
751 if (Math.Abs(herr0) > 0.01f)
752 {
753 m_dir.Z = -((herr0 * pTimestep * 50.0f) / m_VhoverTimescale);
754 //KF: m_VhoverEfficiency is not yet implemented
755 }
756 else
757 {
758 m_dir.Z = 0f;
759 }
760 }
516 761
517// m_VhoverEfficiency = 0f; // 0=boucy, 1=Crit.damped 762// m_VhoverEfficiency = 0f; // 0=boucy, 1=Crit.damped
518// m_VhoverTimescale = 0f; // time to acheive height 763// m_VhoverTimescale = 0f; // time to acheive height
519// pTimestep is time since last frame,in secs 764// pTimestep is time since last frame,in secs
520 float herr0 = pos.Z - m_VhoverTargetHeight; 765 }
521 // Replace Vertical speed with correction figure if significant 766
522 if (Math.Abs(herr0) > 0.01f) 767 if ((m_flags & (VehicleFlag.LIMIT_MOTOR_UP)) != 0)
768 {
769 //Start Experimental Values
770 if (Zchange > .3)
523 { 771 {
524 d.Mass objMass; 772 grav.Z = (float)(grav.Z * 3);
525 d.BodyGetMass(Body, out objMass);
526 m_dir.Z = - ((herr0 * pTimestep * 50.0f) / m_VhoverTimescale);
527 //KF: m_VhoverEfficiency is not yet implemented
528 } 773 }
529 else 774 if (Zchange > .15)
775 {
776 grav.Z = (float)(grav.Z * 2);
777 }
778 if (Zchange > .75)
779 {
780 grav.Z = (float)(grav.Z * 1.5);
781 }
782 if (Zchange > .05)
783 {
784 grav.Z = (float)(grav.Z * 1.25);
785 }
786 if (Zchange > .025)
787 {
788 grav.Z = (float)(grav.Z * 1.125);
789 }
790 float terraintemp = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y);
791 float postemp = (pos.Z - terraintemp);
792 if (postemp > 2.5f)
530 { 793 {
531 m_dir.Z = 0f; 794 grav.Z = (float)(grav.Z * 1.037125);
532 } 795 }
796 //End Experimental Values
797 }
798 if ((m_flags & (VehicleFlag.NO_X)) != 0)
799 {
800 m_dir.X = 0;
801 }
802 if ((m_flags & (VehicleFlag.NO_Y)) != 0)
803 {
804 m_dir.Y = 0;
805 }
806 if ((m_flags & (VehicleFlag.NO_Z)) != 0)
807 {
808 m_dir.Z = 0;
533 } 809 }
534 810
811 m_lastPositionVector = d.BodyGetPosition(Body);
812
535 // Apply velocity 813 // Apply velocity
536 d.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z); 814 d.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z);
537 // apply gravity force 815 // apply gravity force
@@ -629,6 +907,12 @@ namespace OpenSim.Region.Physics.OdePlugin
629 907
630 // Sum velocities 908 // Sum velocities
631 m_lastAngularVelocity = m_angularMotorVelocity + vertattr; // + bank + deflection 909 m_lastAngularVelocity = m_angularMotorVelocity + vertattr; // + bank + deflection
910
911 if ((m_flags & (VehicleFlag.NO_DEFLECTION_UP)) != 0)
912 {
913 m_lastAngularVelocity.X = 0;
914 m_lastAngularVelocity.Y = 0;
915 }
632 916
633 if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f)) 917 if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f))
634 { 918 {
@@ -647,5 +931,44 @@ namespace OpenSim.Region.Physics.OdePlugin
647 d.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z); 931 d.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z);
648 932
649 } //end MoveAngular 933 } //end MoveAngular
934 internal void LimitRotation(float timestep)
935 {
936 d.Quaternion rot = d.BodyGetQuaternion(Body);
937 Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object
938 d.Quaternion m_rot = new d.Quaternion();
939 bool changed = false;
940 m_rot.X = rotq.X;
941 m_rot.Y = rotq.Y;
942 m_rot.Z = rotq.Z;
943 m_rot.W = rotq.W;
944 if (m_RollreferenceFrame != Quaternion.Identity)
945 {
946 if (rotq.X >= m_RollreferenceFrame.X)
947 {
948 m_rot.X = rotq.X - (m_RollreferenceFrame.X / 2);
949 }
950 if (rotq.Y >= m_RollreferenceFrame.Y)
951 {
952 m_rot.Y = rotq.Y - (m_RollreferenceFrame.Y / 2);
953 }
954 if (rotq.X <= -m_RollreferenceFrame.X)
955 {
956 m_rot.X = rotq.X + (m_RollreferenceFrame.X / 2);
957 }
958 if (rotq.Y <= -m_RollreferenceFrame.Y)
959 {
960 m_rot.Y = rotq.Y + (m_RollreferenceFrame.Y / 2);
961 }
962 changed = true;
963 }
964 if ((m_flags & VehicleFlag.LOCK_ROTATION) != 0)
965 {
966 m_rot.X = 0;
967 m_rot.Y = 0;
968 changed = true;
969 }
970 if (changed)
971 d.BodySetQuaternion(Body, ref m_rot);
972 }
650 } 973 }
651} 974}
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 44b2727..03736d1 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -2355,6 +2355,11 @@ Console.WriteLine(" JointCreateFixed");
2355 m_vehicle.ProcessRotationVehicleParam((Vehicle) param, rotation); 2355 m_vehicle.ProcessRotationVehicleParam((Vehicle) param, rotation);
2356 } 2356 }
2357 2357
2358 public override void VehicleFlags(int param, bool remove)
2359 {
2360 m_vehicle.ProcessVehicleFlags(param, remove);
2361 }
2362
2358 public override void SetVolumeDetect(int param) 2363 public override void SetVolumeDetect(int param)
2359 { 2364 {
2360 lock (_parent_scene.OdeLock) 2365 lock (_parent_scene.OdeLock)
diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs
index 566b4e7..a70179b 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs
@@ -182,6 +182,8 @@ namespace OpenSim.Region.Physics.POSPlugin
182 182
183 } 183 }
184 184
185 public override void VehicleFlags(int param, bool remove) { }
186
185 public override void SetVolumeDetect(int param) 187 public override void SetVolumeDetect(int param)
186 { 188 {
187 189
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs
index 7447f76..91ec3df 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs
@@ -139,6 +139,8 @@ namespace OpenSim.Region.Physics.POSPlugin
139 139
140 } 140 }
141 141
142 public override void VehicleFlags(int param, bool remove) { }
143
142 public override void SetVolumeDetect(int param) 144 public override void SetVolumeDetect(int param)
143 { 145 {
144 146
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
index 24eb6b1..dd2c686 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
@@ -371,6 +371,8 @@ namespace OpenSim.Region.Physics.PhysXPlugin
371 371
372 } 372 }
373 373
374 public override void VehicleFlags(int param, bool remove) { }
375
374 public override void SetVolumeDetect(int param) 376 public override void SetVolumeDetect(int param)
375 { 377 {
376 378
@@ -775,6 +777,8 @@ namespace OpenSim.Region.Physics.PhysXPlugin
775 777
776 } 778 }
777 779
780 public override void VehicleFlags(int param, bool remove) { }
781
778 public override void SetVolumeDetect(int param) 782 public override void SetVolumeDetect(int param)
779 { 783 {
780 784
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index a1db77e..aa876ec 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1181,7 +1181,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1181 1181
1182 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB) 1182 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB)
1183 { 1183 {
1184 NotImplemented("llSetStatus - STATUS_BLOCK_GRAB"); 1184 if (value != 0)
1185 m_host.SetBlockGrab(true);
1186 else
1187 m_host.SetBlockGrab(false);
1185 } 1188 }
1186 1189
1187 if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) 1190 if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE)
@@ -1194,12 +1197,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1194 1197
1195 if ((status & ScriptBaseClass.STATUS_RETURN_AT_EDGE) == ScriptBaseClass.STATUS_RETURN_AT_EDGE) 1198 if ((status & ScriptBaseClass.STATUS_RETURN_AT_EDGE) == ScriptBaseClass.STATUS_RETURN_AT_EDGE)
1196 { 1199 {
1197 NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE"); 1200 if (value != 0)
1201 m_host.SetReturnAtEdge(true);
1202 else
1203 m_host.SetReturnAtEdge(false);
1198 } 1204 }
1199 1205
1200 if ((status & ScriptBaseClass.STATUS_SANDBOX) == ScriptBaseClass.STATUS_SANDBOX) 1206 if ((status & ScriptBaseClass.STATUS_SANDBOX) == ScriptBaseClass.STATUS_SANDBOX)
1201 { 1207 {
1202 NotImplemented("llSetStatus - STATUS_SANDBOX"); 1208 if (value != 0)
1209 m_host.SetStatusSandbox(true);
1210 else
1211 m_host.SetStatusSandbox(false);
1203 } 1212 }
1204 1213
1205 if (statusrotationaxis != 0) 1214 if (statusrotationaxis != 0)
@@ -1236,8 +1245,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1236 return 0; 1245 return 0;
1237 1246
1238 case ScriptBaseClass.STATUS_BLOCK_GRAB: 1247 case ScriptBaseClass.STATUS_BLOCK_GRAB:
1239 NotImplemented("llGetStatus - STATUS_BLOCK_GRAB"); 1248 if (m_host.GetBlockGrab())
1240 return 0; 1249 return 1;
1250 else
1251 return 0;
1241 1252
1242 case ScriptBaseClass.STATUS_DIE_AT_EDGE: 1253 case ScriptBaseClass.STATUS_DIE_AT_EDGE:
1243 if (m_host.GetDieAtEdge()) 1254 if (m_host.GetDieAtEdge())
@@ -1246,24 +1257,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1246 return 0; 1257 return 0;
1247 1258
1248 case ScriptBaseClass.STATUS_RETURN_AT_EDGE: 1259 case ScriptBaseClass.STATUS_RETURN_AT_EDGE:
1249 NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); 1260 if (m_host.GetReturnAtEdge())
1250 return 0; 1261 return 1;
1262 else
1263 return 0;
1251 1264
1252 case ScriptBaseClass.STATUS_ROTATE_X: 1265 case ScriptBaseClass.STATUS_ROTATE_X:
1253 NotImplemented("llGetStatus - STATUS_ROTATE_X"); 1266 if (m_host.GetAxisRotation(2) == 2)
1254 return 0; 1267 return 1;
1268 else
1269 return 0;
1255 1270
1256 case ScriptBaseClass.STATUS_ROTATE_Y: 1271 case ScriptBaseClass.STATUS_ROTATE_Y:
1257 NotImplemented("llGetStatus - STATUS_ROTATE_Y"); 1272 if (m_host.GetAxisRotation(4) == 4)
1258 return 0; 1273 return 1;
1274 else
1275 return 0;
1259 1276
1260 case ScriptBaseClass.STATUS_ROTATE_Z: 1277 case ScriptBaseClass.STATUS_ROTATE_Z:
1261 NotImplemented("llGetStatus - STATUS_ROTATE_Z"); 1278 if (m_host.GetAxisRotation(8) == 8)
1262 return 0; 1279 return 1;
1280 else
1281 return 0;
1263 1282
1264 case ScriptBaseClass.STATUS_SANDBOX: 1283 case ScriptBaseClass.STATUS_SANDBOX:
1265 NotImplemented("llGetStatus - STATUS_SANDBOX"); 1284 if (m_host.GetStatusSandbox())
1266 return 0; 1285 return 1;
1286 else
1287 return 0;
1267 } 1288 }
1268 return 0; 1289 return 0;
1269 } 1290 }
@@ -2201,7 +2222,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2201 m_host.AddScriptLPS(1); 2222 m_host.AddScriptLPS(1);
2202 2223
2203 // send the sound, once, to all clients in range 2224 // send the sound, once, to all clients in range
2204 m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0); 2225 m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false);
2205 } 2226 }
2206 2227
2207 // Xantor 20080528 we should do this differently. 2228 // Xantor 20080528 we should do this differently.
@@ -2231,42 +2252,98 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2231 public void llLoopSoundMaster(string sound, double volume) 2252 public void llLoopSoundMaster(string sound, double volume)
2232 { 2253 {
2233 m_host.AddScriptLPS(1); 2254 m_host.AddScriptLPS(1);
2234 NotImplemented("llLoopSoundMaster"); 2255 m_host.ParentGroup.LoopSoundMasterPrim = m_host;
2256 lock (m_host.ParentGroup.LoopSoundSlavePrims)
2257 {
2258 foreach (SceneObjectPart prim in m_host.ParentGroup.LoopSoundSlavePrims)
2259 {
2260 if (prim.Sound != UUID.Zero)
2261 llStopSound();
2262
2263 prim.Sound = KeyOrName(sound);
2264 prim.SoundGain = volume;
2265 prim.SoundFlags = 1; // looping
2266 prim.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
2267
2268 prim.ScheduleFullUpdate();
2269 prim.SendFullUpdateToAllClients();
2270 }
2271 }
2272 if (m_host.Sound != UUID.Zero)
2273 llStopSound();
2274
2275 m_host.Sound = KeyOrName(sound);
2276 m_host.SoundGain = volume;
2277 m_host.SoundFlags = 1; // looping
2278 m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
2279
2280 m_host.ScheduleFullUpdate();
2281 m_host.SendFullUpdateToAllClients();
2235 } 2282 }
2236 2283
2237 public void llLoopSoundSlave(string sound, double volume) 2284 public void llLoopSoundSlave(string sound, double volume)
2238 { 2285 {
2239 m_host.AddScriptLPS(1); 2286 m_host.AddScriptLPS(1);
2240 NotImplemented("llLoopSoundSlave"); 2287 lock (m_host.ParentGroup.LoopSoundSlavePrims)
2288 {
2289 m_host.ParentGroup.LoopSoundSlavePrims.Add(m_host);
2290 }
2241 } 2291 }
2242 2292
2243 public void llPlaySoundSlave(string sound, double volume) 2293 public void llPlaySoundSlave(string sound, double volume)
2244 { 2294 {
2245 m_host.AddScriptLPS(1); 2295 m_host.AddScriptLPS(1);
2246 NotImplemented("llPlaySoundSlave"); 2296
2297 // send the sound, once, to all clients in range
2298 m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, true, false);
2247 } 2299 }
2248 2300
2249 public void llTriggerSound(string sound, double volume) 2301 public void llTriggerSound(string sound, double volume)
2250 { 2302 {
2251 m_host.AddScriptLPS(1); 2303 m_host.AddScriptLPS(1);
2252 // send the sound, once, to all clients in range 2304 // send the sound, once, to all clients in range
2253 m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0); 2305 m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, 0, false, false);
2254 } 2306 }
2255 2307
2256 // Xantor 20080528: Clear prim data of sound instead 2308 // Xantor 20080528: Clear prim data of sound instead
2257 public void llStopSound() 2309 public void llStopSound()
2258 { 2310 {
2259 m_host.AddScriptLPS(1); 2311 m_host.AddScriptLPS(1);
2260 2312 if (m_host.ParentGroup.LoopSoundSlavePrims.Contains(m_host))
2261 m_host.Sound = UUID.Zero; 2313 {
2262 m_host.SoundGain = 0; 2314 if (m_host.ParentGroup.LoopSoundMasterPrim == m_host)
2263 m_host.SoundFlags = 0; 2315 {
2264 m_host.SoundRadius = 0; 2316 foreach (SceneObjectPart part in m_host.ParentGroup.LoopSoundSlavePrims)
2265 2317 {
2266 m_host.ScheduleFullUpdate(); 2318 part.Sound = UUID.Zero;
2267 m_host.SendFullUpdateToAllClients(); 2319 part.SoundGain = 0;
2268 2320 part.SoundFlags = 0;
2269 // m_host.SendSound(UUID.Zero.ToString(), 1.0, false, 2); 2321 part.SoundRadius = 0;
2322 part.ScheduleFullUpdate();
2323 part.SendFullUpdateToAllClients();
2324 }
2325 m_host.ParentGroup.LoopSoundMasterPrim = null;
2326 m_host.ParentGroup.LoopSoundSlavePrims.Clear();
2327 }
2328 else
2329 {
2330 m_host.Sound = UUID.Zero;
2331 m_host.SoundGain = 0;
2332 m_host.SoundFlags = 0;
2333 m_host.SoundRadius = 0;
2334 m_host.ScheduleFullUpdate();
2335 m_host.SendFullUpdateToAllClients();
2336 }
2337 }
2338 else
2339 {
2340 m_host.Sound = UUID.Zero;
2341 m_host.SoundGain = 0;
2342 m_host.SoundFlags = 0;
2343 m_host.SoundRadius = 0;
2344 m_host.ScheduleFullUpdate();
2345 m_host.SendFullUpdateToAllClients();
2346 }
2270 } 2347 }
2271 2348
2272 public void llPreloadSound(string sound) 2349 public void llPreloadSound(string sound)
@@ -2660,8 +2737,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2660 2737
2661 public void llLookAt(LSL_Vector target, double strength, double damping) 2738 public void llLookAt(LSL_Vector target, double strength, double damping)
2662 { 2739 {
2663 // partial implementation, rotates objects correctly but does not apply strength or damping attributes
2664
2665 m_host.AddScriptLPS(1); 2740 m_host.AddScriptLPS(1);
2666 // Determine where we are looking from 2741 // Determine where we are looking from
2667 LSL_Vector from = llGetPos(); 2742 LSL_Vector from = llGetPos();
@@ -2681,9 +2756,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2681 // the angles of rotation in radians into rotation value 2756 // the angles of rotation in radians into rotation value
2682 2757
2683 LSL_Types.Quaternion rot = llEuler2Rot(angle); 2758 LSL_Types.Quaternion rot = llEuler2Rot(angle);
2684 2759 Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
2760 m_host.startLookAt(rotation, (float)damping, (float)strength);
2685 // Orient the object to the angle calculated 2761 // Orient the object to the angle calculated
2686 llSetRot(rot); 2762 //llSetRot(rot);
2687 } 2763 }
2688 2764
2689 public void llStopLookAt() 2765 public void llStopLookAt()
@@ -3045,8 +3121,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3045 public void llRotLookAt(LSL_Rotation target, double strength, double damping) 3121 public void llRotLookAt(LSL_Rotation target, double strength, double damping)
3046 { 3122 {
3047 m_host.AddScriptLPS(1); 3123 m_host.AddScriptLPS(1);
3048// NotImplemented("llRotLookAt"); 3124 Quaternion rot = new Quaternion((float)target.x, (float)target.y, (float)target.z, (float)target.s);
3049 m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping); 3125 m_host.RotLookAt(rot, (float)strength, (float)damping);
3050 } 3126 }
3051 3127
3052 public LSL_Integer llStringLength(string str) 3128 public LSL_Integer llStringLength(string str)
@@ -3144,13 +3220,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3144 public void llPointAt(LSL_Vector pos) 3220 public void llPointAt(LSL_Vector pos)
3145 { 3221 {
3146 m_host.AddScriptLPS(1); 3222 m_host.AddScriptLPS(1);
3147 NotImplemented("llPointAt"); 3223 ScenePresence Owner = World.GetScenePresence(m_host.UUID);
3224 LSL_Rotation rot = llEuler2Rot(pos);
3225 Owner.PreviousRotation = Owner.Rotation;
3226 Owner.Rotation = (new Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s));
3148 } 3227 }
3149 3228
3150 public void llStopPointAt() 3229 public void llStopPointAt()
3151 { 3230 {
3152 m_host.AddScriptLPS(1); 3231 m_host.AddScriptLPS(1);
3153 NotImplemented("llStopPointAt"); 3232 ScenePresence Owner = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID);
3233 Owner.Rotation = Owner.PreviousRotation;
3154 } 3234 }
3155 3235
3156 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) 3236 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain)
@@ -3946,8 +4026,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3946 public void llCollisionSound(string impact_sound, double impact_volume) 4026 public void llCollisionSound(string impact_sound, double impact_volume)
3947 { 4027 {
3948 m_host.AddScriptLPS(1); 4028 m_host.AddScriptLPS(1);
3949 //NotImplemented("llCollisionSound");
3950
3951 // TODO: Parameter check logic required. 4029 // TODO: Parameter check logic required.
3952 UUID soundId = UUID.Zero; 4030 UUID soundId = UUID.Zero;
3953 if (!UUID.TryParse(impact_sound, out soundId)) 4031 if (!UUID.TryParse(impact_sound, out soundId))
@@ -4535,8 +4613,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4535 public LSL_Vector llGetCenterOfMass() 4613 public LSL_Vector llGetCenterOfMass()
4536 { 4614 {
4537 m_host.AddScriptLPS(1); 4615 m_host.AddScriptLPS(1);
4538 NotImplemented("llGetCenterOfMass"); 4616 Vector3 center = m_host.GetGeometricCenter();
4539 return new LSL_Vector(); 4617 return new LSL_Vector(center.X,center.Y,center.Z);
4540 } 4618 }
4541 4619
4542 public LSL_List llListSort(LSL_List src, int stride, int ascending) 4620 public LSL_List llListSort(LSL_List src, int stride, int ascending)
@@ -5269,8 +5347,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5269 flags |= ScriptBaseClass.AGENT_SITTING; 5347 flags |= ScriptBaseClass.AGENT_SITTING;
5270 } 5348 }
5271 5349
5272 //NotImplemented("llGetAgentInfo");
5273
5274 return flags; 5350 return flags;
5275 } 5351 }
5276 5352
@@ -5353,7 +5429,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5353 LSL_Vector bottom_south_west) 5429 LSL_Vector bottom_south_west)
5354 { 5430 {
5355 m_host.AddScriptLPS(1); 5431 m_host.AddScriptLPS(1);
5356 NotImplemented("llTriggerSoundLimited"); 5432 float radius1 = (float)llVecDist(llGetPos(), top_north_east);
5433 float radius2 = (float)llVecDist(llGetPos(), bottom_south_west);
5434 float radius = Math.Abs(radius1 - radius2);
5435 m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, radius, false, false);
5357 } 5436 }
5358 5437
5359 public void llEjectFromLand(string pest) 5438 public void llEjectFromLand(string pest)
@@ -5892,7 +5971,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5892 public void llGroundRepel(double height, int water, double tau) 5971 public void llGroundRepel(double height, int water, double tau)
5893 { 5972 {
5894 m_host.AddScriptLPS(1); 5973 m_host.AddScriptLPS(1);
5895 NotImplemented("llGroundRepel"); 5974 if (m_host.PhysActor != null)
5975 {
5976 float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0));
5977 float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0));
5978 PIDHoverType hoverType = PIDHoverType.Ground;
5979 if (water != 0)
5980 {
5981 hoverType = PIDHoverType.GroundAndWater;
5982 if (ground < waterLevel)
5983 height += waterLevel;
5984 else
5985 height += ground;
5986 }
5987 else
5988 {
5989 height += ground;
5990 }
5991
5992 m_host.SetHoverHeight((float)height, hoverType, (float)tau);
5993 }
5896 } 5994 }
5897 5995
5898 protected UUID GetTaskInventoryItem(string name) 5996 protected UUID GetTaskInventoryItem(string name)
@@ -6021,13 +6119,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6021 public void llSetVehicleFlags(int flags) 6119 public void llSetVehicleFlags(int flags)
6022 { 6120 {
6023 m_host.AddScriptLPS(1); 6121 m_host.AddScriptLPS(1);
6024 NotImplemented("llSetVehicleFlags"); 6122 if (m_host.ParentGroup != null)
6123 {
6124 if (!m_host.ParentGroup.IsDeleted)
6125 {
6126 m_host.ParentGroup.RootPart.SetVehicleFlags(flags, false);
6127 }
6128 }
6025 } 6129 }
6026 6130
6027 public void llRemoveVehicleFlags(int flags) 6131 public void llRemoveVehicleFlags(int flags)
6028 { 6132 {
6029 m_host.AddScriptLPS(1); 6133 m_host.AddScriptLPS(1);
6030 NotImplemented("llRemoveVehicleFlags"); 6134 if (m_host.ParentGroup != null)
6135 {
6136 if (!m_host.ParentGroup.IsDeleted)
6137 {
6138 m_host.ParentGroup.RootPart.SetVehicleFlags(flags, true);
6139 }
6140 }
6031 } 6141 }
6032 6142
6033 public void llSitTarget(LSL_Vector offset, LSL_Rotation rot) 6143 public void llSitTarget(LSL_Vector offset, LSL_Rotation rot)
@@ -7049,7 +7159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7049 public void llRemoteDataSetRegion() 7159 public void llRemoteDataSetRegion()
7050 { 7160 {
7051 m_host.AddScriptLPS(1); 7161 m_host.AddScriptLPS(1);
7052 NotImplemented("llRemoteDataSetRegion"); 7162 Deprecated("llRemoteDataSetRegion");
7053 } 7163 }
7054 7164
7055 public LSL_Float llLog10(double val) 7165 public LSL_Float llLog10(double val)
@@ -8081,7 +8191,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8081 public void llSetInventoryPermMask(string item, int mask, int value) 8191 public void llSetInventoryPermMask(string item, int mask, int value)
8082 { 8192 {
8083 m_host.AddScriptLPS(1); 8193 m_host.AddScriptLPS(1);
8084 NotImplemented("llSetInventoryPermMask"); 8194 if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false))
8195 {
8196 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
8197 {
8198 lock (m_host.TaskInventory)
8199 {
8200 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
8201 {
8202 if (inv.Value.Name == item)
8203 {
8204 switch (mask)
8205 {
8206 case 0:
8207 inv.Value.BasePermissions = (uint)value;
8208 break;
8209 case 1:
8210 inv.Value.CurrentPermissions = (uint)value;
8211 break;
8212 case 2:
8213 inv.Value.GroupPermissions = (uint)value;
8214 break;
8215 case 3:
8216 inv.Value.EveryonePermissions = (uint)value;
8217 break;
8218 case 4:
8219 inv.Value.NextPermissions = (uint)value;
8220 break;
8221 }
8222 }
8223 }
8224 }
8225 }
8226 }
8085 } 8227 }
8086 8228
8087 public LSL_String llGetInventoryCreator(string item) 8229 public LSL_String llGetInventoryCreator(string item)
@@ -8515,6 +8657,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8515 // we send to all 8657 // we send to all
8516 landData.MediaID = new UUID(texture); 8658 landData.MediaID = new UUID(texture);
8517 landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; 8659 landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0;
8660 landData.MediaSize[0] = width;
8661 landData.MediaSize[1] = height;
8662 landData.MediaType = mediaType;
8518 8663
8519 // do that one last, it will cause a ParcelPropertiesUpdate 8664 // do that one last, it will cause a ParcelPropertiesUpdate
8520 landObject.SetMediaUrl(url); 8665 landObject.SetMediaUrl(url);
@@ -8574,11 +8719,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8574 m_host.AddScriptLPS(1); 8719 m_host.AddScriptLPS(1);
8575 LSL_List list = new LSL_List(); 8720 LSL_List list = new LSL_List();
8576 //TO DO: make the implementation for the missing commands 8721 //TO DO: make the implementation for the missing commands
8577 //PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture.
8578 //PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url.
8579 //PARCEL_MEDIA_COMMAND_TYPE string mime_type Use this to get or set the parcel media MIME type (e.g. "text/html"). (1.19.1 RC0 or later)
8580 //PARCEL_MEDIA_COMMAND_SIZE integer x, integer y Use this to get or set the parcel media pixel resolution. (1.19.1 RC0 or later)
8581 //PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later)
8582 //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) 8722 //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later)
8583 for (int i = 0; i < aList.Data.Length; i++) 8723 for (int i = 0; i < aList.Data.Length; i++)
8584 { 8724 {
@@ -8596,6 +8736,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8596 case ParcelMediaCommandEnum.Texture: 8736 case ParcelMediaCommandEnum.Texture:
8597 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID.ToString())); 8737 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID.ToString()));
8598 break; 8738 break;
8739 case ParcelMediaCommandEnum.Type:
8740 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType));
8741 break;
8742 case ParcelMediaCommandEnum.Size:
8743 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0]));
8744 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1]));
8745 break;
8599 default: 8746 default:
8600 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; 8747 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url;
8601 NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString()); 8748 NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString());
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 13b855f..7cf82b2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -160,6 +160,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
160 public const int VEHICLE_BANKING_MIX = 39; 160 public const int VEHICLE_BANKING_MIX = 39;
161 public const int VEHICLE_BANKING_TIMESCALE = 40; 161 public const int VEHICLE_BANKING_TIMESCALE = 40;
162 public const int VEHICLE_REFERENCE_FRAME = 44; 162 public const int VEHICLE_REFERENCE_FRAME = 44;
163 public const int VEHICLE_RANGE_BLOCK = 45;
164 public const int VEHICLE_ROLL_FRAME = 46;
163 public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1; 165 public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1;
164 public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2; 166 public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2;
165 public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4; 167 public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4;
@@ -170,6 +172,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
170 public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128; 172 public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128;
171 public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256; 173 public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256;
172 public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512; 174 public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512;
175 public const int VEHICLE_FLAG_NO_X = 1024;
176 public const int VEHICLE_FLAG_NO_Y = 2048;
177 public const int VEHICLE_FLAG_NO_Z = 4096;
178 public const int VEHICLE_FLAG_LOCK_HOVER_HEIGHT = 8192;
179 public const int VEHICLE_FLAG_NO_DEFLECTION = 16392;
180 public const int VEHICLE_FLAG_LOCK_ROTATION = 32784;
173 181
174 public const int INVENTORY_ALL = -1; 182 public const int INVENTORY_ALL = -1;
175 public const int INVENTORY_NONE = -1; 183 public const int INVENTORY_NONE = -1;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index c552b92..98e77c0 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -841,7 +841,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
841 ObjectRemoved handlerObjectRemoved = OnObjectRemoved; 841 ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
842 if (handlerObjectRemoved != null) 842 if (handlerObjectRemoved != null)
843 { 843 {
844 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); 844 SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
845 handlerObjectRemoved(part.UUID); 845 handlerObjectRemoved(part.UUID);
846 } 846 }
847 847
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index c7d5ff1..03d4d7a 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -197,7 +197,7 @@ namespace OpenSim.Server.Handlers.Asset
197 if (!request.ContainsKey("PRINCIPAL")) 197 if (!request.ContainsKey("PRINCIPAL"))
198 return FailureResult(); 198 return FailureResult();
199 199
200 if(m_InventoryService.CreateUserInventory(new UUID(request["PRINCIPAL"].ToString()))) 200 if (m_InventoryService.CreateUserInventory(new UUID(request["PRINCIPAL"].ToString())))
201 result["RESULT"] = "True"; 201 result["RESULT"] = "True";
202 else 202 else
203 result["RESULT"] = "False"; 203 result["RESULT"] = "False";
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index a91b632..b9723a8 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -81,12 +81,12 @@ namespace OpenSim.Services.AssetService
81 } 81 }
82 82
83 public AssetBase Get(string id) 83 public AssetBase Get(string id)
84 { 84 {
85 UUID assetID; 85 UUID assetID;
86 86
87 if (!UUID.TryParse(id, out assetID)) 87 if (!UUID.TryParse(id, out assetID))
88 { 88 {
89 m_log.WarnFormat("[ASSET SERVICE]: Could not parse requested sset id {0}", id); 89 m_log.WarnFormat("[ASSET SERVICE]: Could not parse requested sset id {0}", id);
90 return null; 90 return null;
91 } 91 }
92 92
diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
index 6d442b7..8e311d7 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Services.Connectors
93 } 93 }
94 94
95 public AssetBase Get(string id) 95 public AssetBase Get(string id)
96 { 96 {
97 string uri = m_ServerURI + "/assets/" + id; 97 string uri = m_ServerURI + "/assets/" + id;
98 98
99 AssetBase asset = null; 99 AssetBase asset = null;
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index b5eaf43..7dab6a1 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -206,6 +206,8 @@ namespace OpenSim.Tests.Common.Mock
206 public event ObjectBuy OnObjectBuy; 206 public event ObjectBuy OnObjectBuy;
207 public event BuyObjectInventory OnBuyObjectInventory; 207 public event BuyObjectInventory OnBuyObjectInventory;
208 public event AgentSit OnUndo; 208 public event AgentSit OnUndo;
209 public event AgentSit OnRedo;
210 public event LandUndo OnLandUndo;
209 211
210 public event ForceReleaseControls OnForceReleaseControls; 212 public event ForceReleaseControls OnForceReleaseControls;
211 213