From 17a26c3701f7e8de8a4fc223c2069798223b245d Mon Sep 17 00:00:00 2001
From: Melanie Thielker <melanie@t-data.com>
Date: Fri, 3 Sep 2010 03:16:08 +0200
Subject: [PATCH 1/8] Fix an issue with rezzing scripted objects.

---
 OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index d7767bd644..ca089a1b94 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Framework.Scenes
 
             if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
             {
-                if (stateSource == 1 && // Prim crossing
+                if (stateSource == 2 && // Prim crossing
                         m_part.ParentGroup.Scene.m_trustBinaries)
                 {
                     lock (m_items)
@@ -1095,4 +1095,4 @@ namespace OpenSim.Region.Framework.Scenes
             }
         }
     }
-}
\ No newline at end of file
+}

From 85e9160552ea72e469863e077d1084da80e12222 Mon Sep 17 00:00:00 2001
From: Diva Canto <diva@metaverseink.com>
Date: Fri, 3 Sep 2010 09:02:08 -0700
Subject: [PATCH 2/8] More tweaks related to my previous commit. Tweaks sux.

---
 .../Connectors/Hypergrid/GatekeeperServiceConnector.cs        | 4 ++--
 .../Connectors/Simulation/SimulationServiceConnector.cs       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 77e3b20b22..dd156aa206 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
             paramList.Add(hash);
 
             XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
-            string uri = "http://" + ((info.ServerURI == string.Empty) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI);
+            string uri = "http://" + ((info.ServerURI == string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI);
             m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
             XmlRpcResponse response = null;
             try
@@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
             paramList.Add(hash);
 
             XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
-            string uri = "http://" + ((gatekeeper.ServerURI == string.Empty) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI);
+            string uri = "http://" + ((gatekeeper.ServerURI == string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI);
             m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
             XmlRpcResponse response = null;
             try
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index df818f5084..b2dec96ac7 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Services.Connectors.Simulation
             string uri = string.Empty;
 
             // HACK -- Simian grid make it work!!!
-            if (destination.ServerURI != string.Empty)
+            if (destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
                 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
             else
             {

From 77384eb28b51d89ac73bd76346790e7a6b68a2f3 Mon Sep 17 00:00:00 2001
From: Diva Canto <diva@metaverseink.com>
Date: Fri, 3 Sep 2010 09:26:33 -0700
Subject: [PATCH 3/8] Another tweak. Sux^2

---
 .../Connectors/Hypergrid/GatekeeperServiceConnector.cs        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index dd156aa206..7431f041bd 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
             paramList.Add(hash);
 
             XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
-            string uri = "http://" + ((info.ServerURI == string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI);
+            string uri = "http://" + ((info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" );
             m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
             XmlRpcResponse response = null;
             try
@@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
             paramList.Add(hash);
 
             XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
-            string uri = "http://" + ((gatekeeper.ServerURI == string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI);
+            string uri = "http://" + ((gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" );
             m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
             XmlRpcResponse response = null;
             try

From 5bbf793f9e7c1607d1ebb01e886375c1a74adafb Mon Sep 17 00:00:00 2001
From: Diva Canto <diva@metaverseink.com>
Date: Fri, 3 Sep 2010 10:01:18 -0700
Subject: [PATCH 4/8] One last tweak, hopefully.

---
 .../Connectors/Hypergrid/GatekeeperServiceConnector.cs        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 7431f041bd..f5b59823e6 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
             paramList.Add(hash);
 
             XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
-            string uri = "http://" + ((info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" );
+            string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" );
             m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
             XmlRpcResponse response = null;
             try
@@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
             paramList.Add(hash);
 
             XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
-            string uri = "http://" + ((gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" );
+            string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/");
             m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
             XmlRpcResponse response = null;
             try

From a5cce8d6d721da5e6f63a9564f531bf27be75320 Mon Sep 17 00:00:00 2001
From: Diva Canto <diva@metaverseink.com>
Date: Fri, 3 Sep 2010 10:13:41 -0700
Subject: [PATCH 5/8] Last+1 tweak.

---
 .../Connectors/Simulation/SimulationServiceConnector.cs         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index b2dec96ac7..c7d186966b 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Services.Connectors.Simulation
             string uri = string.Empty;
 
             // HACK -- Simian grid make it work!!!
-            if (destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
+            if (destination != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
                 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
             else
             {

From 0a0f38b23c2674d98ab055b23d4bbd20896cc4fd Mon Sep 17 00:00:00 2001
From: Diva Canto <diva@metaverseink.com>
Date: Fri, 3 Sep 2010 10:31:16 -0700
Subject: [PATCH 6/8] Last+2 tweak

---
 .../Connectors/Simulation/SimulationServiceConnector.cs         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index c7d186966b..a5f748f0c4 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Services.Connectors.Simulation
             string uri = string.Empty;
 
             // HACK -- Simian grid make it work!!!
-            if (destination != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
+            if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
                 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
             else
             {

From 8daea4d7c005d746989a5635c71bd11cdb034482 Mon Sep 17 00:00:00 2001
From: Micheil Merlin <micheil.merlin@gmail.com>
Date: Sat, 28 Aug 2010 22:44:18 -0500
Subject: [PATCH 7/8] llRot2Euler Tests

---
 .../ScriptEngine/Shared/Tests/LSL_ApiTest.cs  | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 358ce220b5..dfc9aa3dea 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -134,5 +134,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
 
         #endregion
 
+        [Test]
+        // llRot2Euler test.
+        public void TestllRot2Euler()
+        {
+            // 180, 90 and zero degree rotations.
+            CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 0.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, 0.0f));
+            CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 1.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, Math.PI));
+            CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 1.0f, 0.0f), new LSL_Types.Vector3(0.0f, 0.0f, Math.PI));
+            CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f), new LSL_Types.Vector3(0.0f, 0.0f, 0.0f));
+            CheckllRot2Euler(new LSL_Types.Quaternion(-0.5f, -0.5f, 0.5f, 0.5f), new LSL_Types.Vector3(0, -Math.PI / 2.0f, Math.PI / 2.0f));
+            CheckllRot2Euler(new LSL_Types.Quaternion(-0.707107f, 0.0f, 0.0f, -0.707107f), new LSL_Types.Vector3(Math.PI / 2.0f, 0.0f, 0.0f));
+            // A couple of messy rotations.
+            CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 5.651f, -3.1f, 67.023f), new LSL_Types.Vector3(0.037818f, 0.166447f, -0.095595f));
+            CheckllRot2Euler(new LSL_Types.Quaternion(0.719188f, -0.408934f, -0.363998f, -0.427841f), new LSL_Types.Vector3(-1.954769f, -0.174533f, 1.151917f));
+        }
+
+        private void CheckllRot2Euler(LSL_Types.Quaternion rot, LSL_Types.Vector3 eulerCheck)
+        {
+            // Call LSL function to convert quaternion rotaion to euler radians.
+            LSL_Types.Vector3 eulerCalc = m_lslApi.llRot2Euler(rot);
+            // Check upper and lower bounds of x, y and z.
+            // This type of check is performed as opposed to comparing for equal numbers, in order to allow slight
+            // differences in accuracy.
+            Assert.Greater(eulerCalc.x, eulerCheck.x - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X lower bounds check fail");
+            Assert.Less(eulerCalc.x, eulerCheck.x + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X upper bounds check fail");
+            Assert.Greater(eulerCalc.y, eulerCheck.y - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y lower bounds check fail");
+            Assert.Less(eulerCalc.y, eulerCheck.y + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y upper bounds check fail");
+            Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail");
+            Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail");
+        }
     }
 }

From 8d2e8b7d5c62cfd024ade222e27274e88c85d7d2 Mon Sep 17 00:00:00 2001
From: "Justin Clark-Casey (justincc)" <jjustincc@googlemail.com>
Date: Fri, 3 Sep 2010 21:28:57 +0100
Subject: [PATCH 8/8] minor: remove mono compiler warnings

---
 .../Inventory/Archiver/InventoryArchiveUtils.cs      |  2 +-
 .../Framework/EventQueue/EventQueueHelper.cs         | 12 ++++++------
 .../InventoryAccess/HGInventoryAccessModule.cs       |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index 8343091773..47e34dcdd6 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
     /// </summary>
     public static class InventoryArchiveUtils
     {
-        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+//        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
         // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings
         public static readonly char ESCAPE_CHARACTER = '\\';
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
index 6294935215..b62df18c10 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
@@ -54,12 +54,12 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
             };
         }
 
-        private static byte[] uintToByteArray(uint uIntValue)
-        {   
-            byte[] result = new byte[4];
-            Utils.UIntToBytesBig(uIntValue, result, 0);
-            return result;
-        }
+//        private static byte[] uintToByteArray(uint uIntValue)
+//        {   
+//            byte[] result = new byte[4];
+//            Utils.UIntToBytesBig(uIntValue, result, 0);
+//            return result;
+//        }
 
         public static OSD buildEvent(string eventName, OSD eventBody)
         {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index c673b31bbc..125a397d0e 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
         }
 
         // DO NOT OVERRIDE THE BASE METHOD
-        public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
+        public new virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
                 SceneObjectGroup objectGroup, IClientAPI remoteClient)
         {
             UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);