From 8643db3ef0c4dca709d85fc37240a18fd9049520 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 19 Jun 2010 22:48:43 +0100
Subject: This is a HACK! Downright nasty. For some reason, the devs of the
 mysql connector have decided that their vision of timeouts is the only valid
 one. This uses reflection to show them the finger. Please test.

---
 OpenSim/Data/MySQL/MySQLMigrations.cs | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Data/MySQL/MySQLMigrations.cs b/OpenSim/Data/MySQL/MySQLMigrations.cs
index 81a0e83..b6f714c 100644
--- a/OpenSim/Data/MySQL/MySQLMigrations.cs
+++ b/OpenSim/Data/MySQL/MySQLMigrations.cs
@@ -66,6 +66,12 @@ namespace OpenSim.Data.MySQL
                 return;
             }
 
+            MySqlConnection c = (MySqlConnection)conn;
+
+            Type tc = c.GetType();
+            MethodInfo miSetCommandTimeout = tc.GetMethod("SetCommandTimeout", BindingFlags.NonPublic | BindingFlags.Instance);
+            MethodInfo miClearCommandTimeout = tc.GetMethod("ClearCommandTimeout", BindingFlags.NonPublic | BindingFlags.Instance);
+            miSetCommandTimeout.Invoke(c, new Object[] { 2147483 });  // INT_MAX / 1000;
             MySqlScript scr = new MySqlScript((MySqlConnection)conn);
             {
                 foreach (string sql in script)
@@ -78,6 +84,7 @@ namespace OpenSim.Data.MySQL
                     scr.Execute();
                 }
             }
+            miClearCommandTimeout.Invoke(c, new Object[] { });
         }
     }
 }
-- 
cgit v1.1


From a3ebd4db3fce78544a7d0f0069b4aa386ff605e8 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 19 Jun 2010 23:45:56 +0100
Subject: Revert "This is a HACK! Downright nasty. For some reason, the devs of
 the mysql" Didn't do what it said on the package!

This reverts commit 8643db3ef0c4dca709d85fc37240a18fd9049520.
---
 OpenSim/Data/MySQL/MySQLMigrations.cs | 7 -------
 1 file changed, 7 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Data/MySQL/MySQLMigrations.cs b/OpenSim/Data/MySQL/MySQLMigrations.cs
index b6f714c..81a0e83 100644
--- a/OpenSim/Data/MySQL/MySQLMigrations.cs
+++ b/OpenSim/Data/MySQL/MySQLMigrations.cs
@@ -66,12 +66,6 @@ namespace OpenSim.Data.MySQL
                 return;
             }
 
-            MySqlConnection c = (MySqlConnection)conn;
-
-            Type tc = c.GetType();
-            MethodInfo miSetCommandTimeout = tc.GetMethod("SetCommandTimeout", BindingFlags.NonPublic | BindingFlags.Instance);
-            MethodInfo miClearCommandTimeout = tc.GetMethod("ClearCommandTimeout", BindingFlags.NonPublic | BindingFlags.Instance);
-            miSetCommandTimeout.Invoke(c, new Object[] { 2147483 });  // INT_MAX / 1000;
             MySqlScript scr = new MySqlScript((MySqlConnection)conn);
             {
                 foreach (string sql in script)
@@ -84,7 +78,6 @@ namespace OpenSim.Data.MySQL
                     scr.Execute();
                 }
             }
-            miClearCommandTimeout.Invoke(c, new Object[] { });
         }
     }
 }
-- 
cgit v1.1


From c571c33b6b0ace77e3626556ee1e048e588a3705 Mon Sep 17 00:00:00 2001
From: dahlia
Date: Sat, 19 Jun 2010 16:07:35 -0700
Subject: fix faulty profile cut parameter checking in llSetPrimitiveParams() -
 see Mantis #4510

---
 .../Shared/Api/Implementation/LSL_Api.cs           | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 59ab26b..86d0c30 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6516,10 +6516,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
             if (cut.y > 1f)
             {
                 cut.y = 1f;
-            }
-            if (cut.y - cut.x < 0.05f)
-            {
-                cut.x = cut.y - 0.05f;
+            }
+            if (cut.y - cut.x < 0.05f)
+            {
+                cut.x = cut.y - 0.05f;
+                if (cut.x < 0.0f)
+                {
+                    cut.x = 0.0f;
+                    cut.y = 0.05f;
+                }
             }
             shapeBlock.ProfileBegin = (ushort)(50000 * cut.x);
             shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y));
@@ -6715,9 +6720,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
             {
                 profilecut.y = 1f;
             }
-            if (profilecut.y - cut.x < 0.05f)
+            if (profilecut.y - profilecut.x < 0.05f)
             {
-                profilecut.x = cut.y - 0.05f;
+                profilecut.x = profilecut.y - 0.05f;
+                if (profilecut.x < 0.0f)
+                {
+                    profilecut.x = 0.0f;
+                    profilecut.y = 0.05f;
+                }
             }
             shapeBlock.ProfileBegin = (ushort)(50000 * profilecut.x);
             shapeBlock.ProfileEnd = (ushort)(50000 * (1 - profilecut.y));
-- 
cgit v1.1


From 854a8b91723afb98dc29dbd3afacaa895e58ea73 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 22 Jun 2010 17:35:00 +0200
Subject: Security fix: Allow only textures to be fetched using HTTP texture
 cap

---
 OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
index f8e3d59..75efb79 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
@@ -131,6 +131,12 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
 
                     if (texture != null)
                     {
+                        if (texture.Type != (sbyte)AssetType.Texture)
+                        {
+                            httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
+                            httpResponse.Send();
+                            return null;
+                        }
                         SendTexture(httpRequest, httpResponse, texture);
                     }
                     else
@@ -147,6 +153,12 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
 
                     if (texture != null)
                     {
+                        if (texture.Type != (sbyte)AssetType.Texture)
+                        {
+                            httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
+                            httpResponse.Send();
+                            return null;
+                        }
                         SendTexture(httpRequest, httpResponse, texture);
                     }
                     else
-- 
cgit v1.1


From 68551675dfcd0e159185345e8cb7ac54b3530abf Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 22 Jun 2010 02:33:20 +0200
Subject: Guard prioritizer agains null values as those produced by a bullet
 dying before it can be updated

---
 OpenSim/Region/Framework/Scenes/Prioritizer.cs | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 7b7677b..de3c360 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -52,6 +52,9 @@ namespace OpenSim.Region.Framework.Scenes
         public double GetUpdatePriority(IClientAPI client, ISceneEntity entity)
         {
             double priority = 0;
+
+            if (entity == null)
+                return 100000;
             
             switch (m_scene.UpdatePrioritizationScheme)
             {
-- 
cgit v1.1


From 1e1485de5b48248ffeec75e49e792b321164c547 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Tue, 22 Jun 2010 16:09:30 -0700
Subject: * Fixed SimianGrid map tile uploads not having any objects in the
 images

---
 .../SimianAuthenticationServiceConnector.cs        |  2 ++
 .../SimianGrid/SimianGridServiceConnector.cs       | 32 +++++++++++++++++++---
 2 files changed, 30 insertions(+), 4 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
index 3c784f2..7a96a05 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
@@ -198,6 +198,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
                 if (!String.IsNullOrEmpty(identifier))
                 {
                     // Add/update the md5hash identity
+                    // TODO: Support salts when AddIdentity does
+                    // TODO: Create an a1hash too for WebDAV logins
                     requestArgs = new NameValueCollection
                     {
                         { "RequestMethod", "AddIdentity" },
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index db9027a..bea8172 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -59,18 +59,35 @@ namespace OpenSim.Services.Connectors.SimianGrid
                 MethodBase.GetCurrentMethod().DeclaringType);
 
         private string m_serverUrl = String.Empty;
+        private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
 
         #region ISharedRegionModule
 
         public Type ReplaceableInterface { get { return null; } }
-        public void RegionLoaded(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { UploadMapTile(scene); } }
+        public void RegionLoaded(Scene scene) { }
         public void PostInitialise() { }
         public void Close() { }
 
         public SimianGridServiceConnector() { }
         public string Name { get { return "SimianGridServiceConnector"; } }
-        public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IGridService>(this); } }
-        public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IGridService>(this); } }
+        public void AddRegion(Scene scene)
+        {
+            // Every shared region module has to maintain an indepedent list of
+            // currently running regions
+            lock (m_scenes)
+                m_scenes[scene.RegionInfo.RegionID] = scene;
+
+            if (!String.IsNullOrEmpty(m_serverUrl))
+                scene.RegisterModuleInterface<IGridService>(this);
+        }
+        public void RemoveRegion(Scene scene)
+        {
+            lock (m_scenes)
+                m_scenes.Remove(scene.RegionInfo.RegionID);
+
+            if (!String.IsNullOrEmpty(m_serverUrl))
+                scene.UnregisterModuleInterface<IGridService>(this);
+        }
 
         #endregion ISharedRegionModule
 
@@ -105,6 +122,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
 
         public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
         {
+            // Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service
+            Scene scene;
+            if (m_scenes.TryGetValue(regionInfo.RegionID, out scene))
+                UploadMapTile(scene);
+            else
+                m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking");
+
             Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
             Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
 
@@ -430,7 +454,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
             if (!String.IsNullOrEmpty(errorMessage))
             {
                 m_log.WarnFormat("[SIMIAN GRID CONNECTOR]: Failed to store {0} byte PNG map tile for {1}: {2}",
-                    pngData.Length, scene.RegionInfo.RegionName, errorMessage);
+                    pngData.Length, scene.RegionInfo.RegionName, errorMessage.Replace('\n', ' '));
             }
         }
 
-- 
cgit v1.1


From c96a6940a9b1d1e00bbaeff8ee9113435848e151 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Tue, 22 Jun 2010 16:11:36 -0700
Subject: Line ending fix

---
 .../Shared/Api/Implementation/LSL_Api.cs           | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 86d0c30..1feb153 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6516,15 +6516,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
             if (cut.y > 1f)
             {
                 cut.y = 1f;
-            }
-            if (cut.y - cut.x < 0.05f)
-            {
-                cut.x = cut.y - 0.05f;
-                if (cut.x < 0.0f)
-                {
-                    cut.x = 0.0f;
-                    cut.y = 0.05f;
-                }
+            }
+            if (cut.y - cut.x < 0.05f)
+            {
+                cut.x = cut.y - 0.05f;
+                if (cut.x < 0.0f)
+                {
+                    cut.x = 0.0f;
+                    cut.y = 0.05f;
+                }
             }
             shapeBlock.ProfileBegin = (ushort)(50000 * cut.x);
             shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y));
@@ -6722,11 +6722,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
             }
             if (profilecut.y - profilecut.x < 0.05f)
             {
-                profilecut.x = profilecut.y - 0.05f;
-                if (profilecut.x < 0.0f)
-                {
-                    profilecut.x = 0.0f;
-                    profilecut.y = 0.05f;
+                profilecut.x = profilecut.y - 0.05f;
+                if (profilecut.x < 0.0f)
+                {
+                    profilecut.x = 0.0f;
+                    profilecut.y = 0.05f;
                 }
             }
             shapeBlock.ProfileBegin = (ushort)(50000 * profilecut.x);
-- 
cgit v1.1


From c404c5fb5405eac24cc8b7cd402eb8d8fb0ff0cf Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 23 Jun 2010 21:14:28 +0100
Subject: Thank you, Snoopy, for a patch to reduce sim script startup CPU usage

---
 .../Framework/Scenes/SceneObjectPartInventory.cs   | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 866bb6e..3a8f168 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -31,6 +31,7 @@ using System.IO;
 using System.Collections.Generic;
 using System.Collections;
 using System.Reflection;
+using System.Threading;
 using OpenMetaverse;
 using log4net;
 using OpenSim.Framework;
@@ -200,6 +201,7 @@ namespace OpenSim.Region.Framework.Scenes
                     if ((int)InventoryType.LSL == item.InvType)
                     {
                         CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
+                        Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
                     }
                 }
             }
@@ -257,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes
             // m_log.InfoFormat(
             //     "[PRIM INVENTORY]: " +
             //     "Starting script {0}, {1} in prim {2}, {3}",
-            //     item.Name, item.ItemID, Name, UUID);
+            //     item.Name, item.ItemID, m_part.Name, m_part.UUID);
 
             if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
                 return;
@@ -293,20 +295,20 @@ namespace OpenSim.Region.Framework.Scenes
                 }
                 else
                 {
-                    if (m_part.ParentGroup.m_savedScriptState != null)
-                        RestoreSavedScriptState(item.OldItemID, item.ItemID);
-
                     lock (m_items)
                     {
+                        if (m_part.ParentGroup.m_savedScriptState != null)
+                            RestoreSavedScriptState(item.OldItemID, item.ItemID);
+
                         m_items[item.ItemID].PermsMask = 0;
                         m_items[item.ItemID].PermsGranter = UUID.Zero;
+
+                        string script = Utils.BytesToString(asset.Data);
+                        m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
+                            m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
+                        m_part.ParentGroup.AddActiveScriptCount(1);
+                        m_part.ScheduleFullUpdate();
                     }
-                
-                    string script = Utils.BytesToString(asset.Data);
-                    m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
-                        m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
-                    m_part.ParentGroup.AddActiveScriptCount(1);
-                    m_part.ScheduleFullUpdate();
                 }
             }
         }
-- 
cgit v1.1


From 5a071dc7986c5e262d9e9513b07fc59797724e55 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 24 Jun 2010 03:24:38 +0100
Subject: Move loading of parcels to before script start. Scripts using parcel
 functions can fail if no land is loaded

---
 OpenSim/Region/Application/OpenSimBase.cs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 83be61e..f535fe8 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -367,13 +367,13 @@ namespace OpenSim
                 Environment.Exit(1);
             }
 
+            scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
+            scene.EventManager.TriggerParcelPrimCountUpdate();
+
             // We need to do this after we've initialized the
             // scripting engines.
             scene.CreateScriptInstances();
 
-            scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
-            scene.EventManager.TriggerParcelPrimCountUpdate();
-
             m_sceneManager.Add(scene);
 
             if (m_autoCreateClientStack)
-- 
cgit v1.1


From 6848465ae24f2069c2cc3e67ff317ad2d085f5cb Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Thu, 24 Jun 2010 13:43:38 -0700
Subject: * SimianAssetServiceConnector Delete() was expecting the wrong type
 of response, reporting false errors * Fixed a typo in a WebUtil error message

---
 OpenSim/Framework/WebUtil.cs                       |  2 +-
 .../SimianGrid/SimianAssetServiceConnector.cs      | 29 ++++++++++++++++------
 2 files changed, 23 insertions(+), 8 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 94862a6..e20866e 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -114,7 +114,7 @@ namespace OpenSim.Framework
             }
             catch (Exception ex)
             {
-                m_log.Warn("GET from URL " + url + " failed: " + ex.Message);
+                m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
                 errorMessage = ex.Message;
             }
 
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 3fdee9c..34bb8b3 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -371,18 +371,33 @@ namespace OpenSim.Services.Connectors.SimianGrid
         /// <returns></returns>
         public bool Delete(string id)
         {
+            string errorMessage = String.Empty;
+            string url = m_serverUrl + id;
+
             if (m_cache != null)
                 m_cache.Expire(id);
 
-            string url = m_serverUrl + id;
+            try
+            {
+                HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
+                request.Method = "DELETE";
 
-            OSDMap response = WebUtil.ServiceRequest(url, "DELETE");
-            if (response["Success"].AsBoolean())
-                return true;
-            else
-                m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service");
+                using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
+                {
+                    if (response.StatusCode != HttpStatusCode.NoContent)
+                    {
+                        m_log.Warn("[SIMIAN ASSET CONNECTOR]: Unexpected response when deleting asset " + url + ": " +
+                            response.StatusCode + " (" + response.StatusDescription + ")");
+                    }
+                }
 
-            return false;
+                return true;
+            }
+            catch (Exception ex)
+            {
+                m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service: " + ex.Message);
+                return false;
+            }
         }
 
         #endregion IAssetService
-- 
cgit v1.1


From 2c4df19805f9b8d819071c55302450cca1febbc1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 18:29:02 +0100
Subject: minor: Move log information about SYSTEMIP to the place where it's
 resolved

---
 OpenSim/Framework/RegionInfo.cs       | 20 +++++++++++++-------
 OpenSim/Region/Application/OpenSim.cs |  4 +---
 2 files changed, 14 insertions(+), 10 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index ad98816..afc4060 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -29,14 +29,15 @@ using System;
 using System.Collections.Generic;
 using System.Net;
 using System.Net.Sockets;
+using System.Reflection;
 using System.Xml;
 using System.IO;
+using log4net;
 using Nini.Config;
 using OpenMetaverse;
 using OpenMetaverse.StructuredData;
 using OpenSim.Framework.Console;
 
-
 namespace OpenSim.Framework
 {
     public class RegionLightShareData : ICloneable
@@ -96,10 +97,9 @@ namespace OpenSim.Framework
 
     [Serializable]
     public class SimpleRegionInfo
-    {
-        // private static readonly log4net.ILog m_log
-        //     = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
+    {    
+//        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+        
         /// <summary>
         /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
         /// </summary>
@@ -327,8 +327,7 @@ namespace OpenSim.Framework
 
     public class RegionInfo
     {
-        // private static readonly log4net.ILog m_log
-        //     = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
         public bool commFailTF = false;
         public ConfigurationMember configMember;
@@ -772,9 +771,16 @@ namespace OpenSim.Framework
             }
 
             if (externalName == "SYSTEMIP")
+            {
                 m_externalHostName = Util.GetLocalHost().ToString();
+                m_log.InfoFormat(
+                    "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", 
+                    m_externalHostName, name);
+            }
             else
+            {
                 m_externalHostName = externalName;
+            }
 
             m_regionType = config.GetString("RegionType", String.Empty);
 
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index a09b903..501d47f 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -192,9 +192,7 @@ namespace OpenSim
             // Hook up to the watchdog timer
             Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
 
-            PrintFileToConsole("startuplogo.txt");
-
-            m_log.InfoFormat("[NETWORK]: Using {0} as SYSTEMIP", Util.GetLocalHost().ToString());
+            PrintFileToConsole("startuplogo.txt");            
 
             // For now, start at the 'root' level by default
             if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
-- 
cgit v1.1


From 52b711af824eff047f8e65139cf7bdfb150f270f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 18:55:20 +0100
Subject: stop KeyNotFoundException() being thrown in RemoveScenePresence if
 the agent isn't present in the presence dictionary

the code to do this was there but was being circumvented by newmap[agentID] before the check actually took place
---
 OpenSim/Region/Framework/Scenes/SceneGraph.cs | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 673674d..240c688 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -599,7 +599,7 @@ namespace OpenSim.Region.Framework.Scenes
             if (!Entities.Remove(agentID))
             {
                 m_log.WarnFormat(
-                    "[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene Entities list",
+                    "[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene Entities list",
                     agentID);
             }
 
@@ -607,12 +607,13 @@ namespace OpenSim.Region.Framework.Scenes
             {
                 Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
                 List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
-
-                // Remember the old presene reference from the dictionary
-                ScenePresence oldref = newmap[agentID];
+                
                 // Remove the presence reference from the dictionary
-                if (newmap.Remove(agentID))
+                if (newmap.ContainsKey(agentID))
                 {
+                    ScenePresence oldref = newmap[agentID];
+                    newmap.Remove(agentID);
+
                     // Find the index in the list where the old ref was stored and remove the reference
                     newlist.RemoveAt(newlist.IndexOf(oldref));
                     // Swap out the dictionary and list with new references
@@ -621,7 +622,7 @@ namespace OpenSim.Region.Framework.Scenes
                 }
                 else
                 {
-                    m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
+                    m_log.WarnFormat("[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
                 }
             }
         }
-- 
cgit v1.1


From c09451a034babe6de7a2ffec44852a19946ec76d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 19:11:22 +0100
Subject: Report http server onRequest() exception properly.

---
 OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index a6e00c2..8c9ed65 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -310,7 +310,7 @@ namespace OpenSim.Framework.Servers.HttpServer
             }
             catch (Exception e)
             {
-                m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e);
+                m_log.Error("[BASE HTTP SERVER]: OnRequest() failed with ", e);
             }
         }
 
-- 
cgit v1.1


From 8629ba80bfb5e9e038a3d25054e0b03a727c6e81 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 20:51:21 +0100
Subject: Revert "Report http server onRequest() exception properly."

This reverts commit c09451a034babe6de7a2ffec44852a19946ec76d.
---
 OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 8c9ed65..a6e00c2 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -310,7 +310,7 @@ namespace OpenSim.Framework.Servers.HttpServer
             }
             catch (Exception e)
             {
-                m_log.Error("[BASE HTTP SERVER]: OnRequest() failed with ", e);
+                m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e);
             }
         }
 
-- 
cgit v1.1


From c7e7cb04a3b8612c660b4fa308f77795d62f629e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 20:57:38 +0100
Subject: fix web request exception reporting properly this time

---
 OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index a6e00c2..8123f2f 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -310,7 +310,7 @@ namespace OpenSim.Framework.Servers.HttpServer
             }
             catch (Exception e)
             {
-                m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e);
+                m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace);
             }
         }
 
-- 
cgit v1.1


From 4a5979c31114272ec3f2e8742783b6918be93ad2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 21:09:15 +0100
Subject: minor: remove some mono compiler warnings

---
 OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs |  2 +-
 OpenSim/Region/Physics/OdePlugin/ODEPrim.cs     | 26 ++++++++++++-------------
 2 files changed, 14 insertions(+), 14 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs
index 9beeabb..2342bfa 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs
@@ -675,7 +675,7 @@ namespace OpenSim.Region.Physics.OdePlugin
             m_dir.Z = vel_now.Z;        // Preserve the accumulated falling velocity
 
             d.Vector3 pos = d.BodyGetPosition(Body);
-            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);
+//            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);
             Vector3 posChange = new Vector3();
             posChange.X = pos.X - m_lastPositionVector.X;
             posChange.Y = pos.Y - m_lastPositionVector.Y;
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 0720b5e..3cf4501 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -1576,19 +1576,19 @@ Console.WriteLine(" JointCreateFixed");
 //Console.WriteLine("Move " +  m_primName);
                     if (!d.BodyIsEnabled (Body))  d.BodyEnable (Body); // KF add 161009
                     // NON-'VEHICLES' are dealt with here
-                    if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f))
-                    {
-                        d.Vector3 avel2 = d.BodyGetAngularVel(Body);
-                        /*
-                        if (m_angularlock.X == 1)
-                            avel2.X = 0;
-                        if (m_angularlock.Y == 1)
-                            avel2.Y = 0;
-                        if (m_angularlock.Z == 1)
-                            avel2.Z = 0;
-                        d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z);
-                         */
-                    }
+//                    if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f))
+//                    {
+//                        d.Vector3 avel2 = d.BodyGetAngularVel(Body);
+//                        /*
+//                        if (m_angularlock.X == 1)
+//                            avel2.X = 0;
+//                        if (m_angularlock.Y == 1)
+//                            avel2.Y = 0;
+//                        if (m_angularlock.Z == 1)
+//                            avel2.Z = 0;
+//                        d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z);
+//                         */
+//                    }
                     //float PID_P = 900.0f;
 
                     float m_mass = CalculateMass();
-- 
cgit v1.1


From d399bd3eb7de6bab531087a1956f30457c3285ff Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 21:18:52 +0100
Subject: minor: fix spelling mistake interupt -> interrupt in migrations

This is for  mantis 4783
---
 OpenSim/Data/Migration.cs | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs
index 4f113a2..c177097 100644
--- a/OpenSim/Data/Migration.cs
+++ b/OpenSim/Data/Migration.cs
@@ -67,7 +67,6 @@ namespace OpenSim.Data
     /// really want is the assembly of your database class.
     ///
     /// </summary>
-
     public class Migration
     {
         private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -173,8 +172,6 @@ namespace OpenSim.Data
             ExecuteScript(_conn, script);
         }
 
-
-
         public void Update()
         {
             InitMigrationsTable();
@@ -186,8 +183,8 @@ namespace OpenSim.Data
                 return;
 
             // to prevent people from killing long migrations.
-            m_log.InfoFormat("[MIGRATIONS] Upgrading {0} to latest revision {1}.", _type, migrations.Keys[migrations.Count - 1]);
-            m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!");
+            m_log.InfoFormat("[MIGRATIONS]: Upgrading {0} to latest revision {1}.", _type, migrations.Keys[migrations.Count - 1]);
+            m_log.Info("[MIGRATIONS]: NOTE - this may take a while, don't interrupt this process!");
 
             foreach (KeyValuePair<int, string[]> kvp in migrations)
             {
@@ -206,7 +203,7 @@ namespace OpenSim.Data
                 }
                 catch (Exception e)
                 {
-                    m_log.DebugFormat("[MIGRATIONS] Cmd was {0}", e.Message.Replace("\n", " "));
+                    m_log.DebugFormat("[MIGRATIONS]: Cmd was {0}", e.Message.Replace("\n", " "));
                     m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing.");
                     ExecuteScript("ROLLBACK;");
                 }
-- 
cgit v1.1


From a4a808818f32b937a4228e9311e3e3b413a1b1d7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Jun 2010 21:48:19 +0100
Subject: don't report the null uuid as a missing asset on saving oars/iars

---
 OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index a1451ce..4d360f6 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -134,7 +134,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
             
             foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
             {
-                m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
+                if (kvp.Key != UUID.Zero)
+                    m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
             }
 
             m_requestCallbackTimer.Enabled = true;
@@ -269,7 +270,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
             }
             catch (Exception e)
             {
-                m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e);
+                m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}{1}", e.Message, e.StackTrace);
             }
         }
 
@@ -285,7 +286,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
             catch (Exception e)
             {
                 m_log.ErrorFormat(
-                    "[ARCHIVER]: Terminating archive creation since asset requster callback failed with {0}", e);
+                    "[ARCHIVER]: Terminating archive creation since asset requester callback failed with {0}{1}", 
+                    e.Message, e.StackTrace);
             }
         }
     }
-- 
cgit v1.1


From 205d2496f6251244f69004c70b8c5db63b55bc98 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 27 Jun 2010 20:04:39 +0100
Subject: Fix permission propagation to prevent permanently locked objects from
 being created.

---
 OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 64bdc99..750b1f7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -385,7 +385,7 @@ namespace OpenSim.Region.Framework.Scenes
                 if (Permissions.PropagatePermissions() && recipient != senderId)
                 {
                     // First, make sore base is limited to the next perms
-                    itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
+                    itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
                     // By default, current equals base
                     itemCopy.CurrentPermissions = itemCopy.BasePermissions;
 
@@ -897,7 +897,7 @@ namespace OpenSim.Region.Framework.Scenes
 
             if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
             {
-                agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
+                agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
                 if (taskItem.InvType == (int)InventoryType.Object)
                     agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13);
                     agentItem.CurrentPermissions = agentItem.BasePermissions ;
@@ -1092,7 +1092,7 @@ namespace OpenSim.Region.Framework.Scenes
                     destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
                             srcTaskItem.NextPermissions;
                     destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
-                            srcTaskItem.NextPermissions;
+                            (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
                     destTaskItem.CurrentPermissions |= 8; // Slam!
                 }
             }
-- 
cgit v1.1


From 3612a5252bdfe0a1d231fee669aa73183ee7b493 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 27 Jun 2010 20:20:08 +0100
Subject: Fix more perms weirdness. Preserve "Locked" status across gives and
 rez/take. Preserve "Anyone can move" flag in most cases.

---
 OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 750b1f7..9278164 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -387,7 +387,7 @@ namespace OpenSim.Region.Framework.Scenes
                     // First, make sore base is limited to the next perms
                     itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
                     // By default, current equals base
-                    itemCopy.CurrentPermissions = itemCopy.BasePermissions;
+                    itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions;
 
                     // If this is an object, replace current perms
                     // with folded perms
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Framework.Scenes
                     }
 
                     // Ensure there is no escalation
-                    itemCopy.CurrentPermissions &= item.NextPermissions;
+                    itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move);
 
                     // Need slam bit on xfer
                     itemCopy.CurrentPermissions |= 8;
@@ -899,12 +899,13 @@ namespace OpenSim.Region.Framework.Scenes
             {
                 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
                 if (taskItem.InvType == (int)InventoryType.Object)
-                    agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13);
-                    agentItem.CurrentPermissions = agentItem.BasePermissions ;
+                    agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
+                else
+                    agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
 
                 agentItem.CurrentPermissions |= 8;
                 agentItem.NextPermissions = taskItem.NextPermissions;
-                agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
+                agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
                 agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
             }
             else
@@ -1086,11 +1087,11 @@ namespace OpenSim.Region.Framework.Scenes
                 if (Permissions.PropagatePermissions())
                 {
                     destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
-                            srcTaskItem.NextPermissions;
+                            (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
                     destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
-                            srcTaskItem.NextPermissions;
+                            (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
                     destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
-                            srcTaskItem.NextPermissions;
+                            (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
                     destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
                             (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
                     destTaskItem.CurrentPermissions |= 8; // Slam!
-- 
cgit v1.1


From b0129b35f8dbe24b8e857223b3ac8ba4cb7cc830 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 27 Jun 2010 12:37:16 -0700
Subject: Added checks to XInventory DB layer to truncate names and
 descriptions.

---
 OpenSim/Data/MySQL/MySQLXInventoryData.cs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
index 0fe801d..3c73095 100644
--- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
@@ -64,14 +64,22 @@ namespace OpenSim.Data.MySQL
 
         public bool StoreFolder(XInventoryFolder folder)
         {
+            if (folder.folderName.Length > 64)
+                folder.folderName = folder.folderName.Substring(0, 64);
+
             return m_Folders.Store(folder);
         }
 
         public bool StoreItem(XInventoryItem item)
         {
+            if (item.inventoryName.Length > 64)
+                item.inventoryName = item.inventoryName.Substring(0, 64);
+            if (item.inventoryDescription.Length > 128)
+                item.inventoryDescription = item.inventoryDescription.Substring(0, 128);
+
             return m_Items.Store(item);
         }
-
+        
         public bool DeleteFolders(string field, string val)
         {
             return m_Folders.Delete(field, val);
-- 
cgit v1.1


From 76d2f0f68e16f9b74ce4f81f9ecbf370f39f3ac6 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 27 Jun 2010 12:40:17 -0700
Subject: Same patch as before but for SQLite.

---
 OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index 6064538..ca651e1 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -66,11 +66,19 @@ namespace OpenSim.Data.SQLite
 
         public bool StoreFolder(XInventoryFolder folder)
         {
+            if (folder.folderName.Length > 64)
+                folder.folderName = folder.folderName.Substring(0, 64);
+
             return m_Folders.Store(folder);
         }
 
         public bool StoreItem(XInventoryItem item)
         {
+            if (item.inventoryName.Length > 64)
+                item.inventoryName = item.inventoryName.Substring(0, 64);
+            if (item.inventoryDescription.Length > 128)
+                item.inventoryDescription = item.inventoryDescription.Substring(0, 128);
+
             return m_Items.Store(item);
         }
 
-- 
cgit v1.1


From 7868f1f650a7d20ca7a6b5a236f89301c193444e Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 27 Jun 2010 13:06:39 -0700
Subject: Fixed Robust.32BitLaunch.exe

---
 OpenSim/Tools/Robust.32BitLaunch/Robust.32BitLaunch.csproj | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Tools/Robust.32BitLaunch/Robust.32BitLaunch.csproj b/OpenSim/Tools/Robust.32BitLaunch/Robust.32BitLaunch.csproj
index f19e082..481b3f8 100644
--- a/OpenSim/Tools/Robust.32BitLaunch/Robust.32BitLaunch.csproj
+++ b/OpenSim/Tools/Robust.32BitLaunch/Robust.32BitLaunch.csproj
@@ -36,9 +36,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\bin\log4net.dll</HintPath>
     </Reference>
-    <Reference Include="OpenSim.Server, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+    <Reference Include="Robust, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\bin\OpenSim.Server.exe</HintPath>
+      <HintPath>..\..\..\bin\Robust.exe</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core">
-- 
cgit v1.1


From 3dbc7360498582278a9dad9eb899431d14e4e9cf Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 27 Jun 2010 13:23:51 -0700
Subject: Addresses mantis #4789. Not really a fix, because the event is
 harmless anyway. Just shouldn't happen normally.

---
 OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 191acc9..bc31815 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -272,7 +272,7 @@ namespace OpenSim.Server.Handlers.Simulation
             //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead
         }
 
-        // subclasses cab override this
+        // subclasses can override this
         protected virtual bool UpdateAgent(GridRegion destination, AgentData agent)
         {
             return m_SimulationService.UpdateAgent(destination, agent);
@@ -280,6 +280,12 @@ namespace OpenSim.Server.Handlers.Simulation
 
         protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
         {
+            if (m_SimulationService == null)
+            {
+                m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless.");
+                return;
+            }
+
             GridRegion destination = new GridRegion();
             destination.RegionID = regionID;
 
-- 
cgit v1.1


From 6cf0b8f6fe0f8d35635e2a96953ce260a200d9c8 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Thu, 24 Jun 2010 09:11:27 -0700
Subject: Add command-script to the Robust console

---
 OpenSim/Server/Base/ServicesServerBase.cs | 41 +++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index a5bebb8..dee31bd 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -230,6 +230,12 @@ namespace OpenSim.Server.Base
                     "shutdown",
                     "Quit the application", HandleQuit);
 
+            // Register a command to read other commands from a file
+            MainConsole.Instance.Commands.AddCommand("base", false, "command-script",
+                                          "command-script <script>",
+                                          "Run a command script from file", HandleScript);
+
+
             // Allow derived classes to perform initialization that
             // needs to be done after the console has opened
             //
@@ -259,6 +265,41 @@ namespace OpenSim.Server.Base
             m_log.Info("[CONSOLE] Quitting");
         }
 
+        protected virtual void HandleScript(string module, string[] parms)
+        {
+            if (parms.Length != 2)
+            {
+                return;
+            }
+            RunCommandScript(parms[1]);
+        }
+
+        /// <summary>
+        /// Run an optional startup list of commands
+        /// </summary>
+        /// <param name="fileName"></param>
+        private void RunCommandScript(string fileName)
+        {
+            if (File.Exists(fileName))
+            {
+                m_log.Info("[COMMANDFILE]: Running " + fileName);
+
+                using (StreamReader readFile = File.OpenText(fileName))
+                {
+                    string currentCommand;
+                    while ((currentCommand = readFile.ReadLine()) != null)
+                    {
+                        if (currentCommand != String.Empty)
+                        {
+                            m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
+                            MainConsole.Instance.RunCommand(currentCommand);
+                        }
+                    }
+                }
+            }
+        }
+
+
         protected virtual void ReadConfig()
         {
         }
-- 
cgit v1.1


From 660a560d3ba0a4f4089fd173c30b3034f007d983 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sun, 27 Jun 2010 21:04:30 +0200
Subject: Make drag copy and copy-on-ray handle friends list perms properly

---
 OpenSim/Region/Framework/Scenes/SceneGraph.cs | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 240c688..ebb3005 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1750,6 +1750,28 @@ namespace OpenSim.Region.Framework.Scenes
                     SceneObjectGroup copy = original.Copy(AgentID, GroupID, true);
                     copy.AbsolutePosition = copy.AbsolutePosition + offset;
 
+                    if (copy.OwnerID != AgentID)
+                    {
+                        copy.SetOwnerId(AgentID);
+                        copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID);
+
+                        List<SceneObjectPart> partList =
+                            new List<SceneObjectPart>(copy.Children.Values);
+
+                        if (m_parentScene.Permissions.PropagatePermissions())
+                        {
+                            foreach (SceneObjectPart child in partList)
+                            {
+                                child.Inventory.ChangeInventoryOwner(AgentID);
+                                child.TriggerScriptChangedEvent(Changed.OWNER);
+                                child.ApplyNextOwnerPermissions();
+                            }
+                        }
+
+                        copy.RootPart.ObjectSaleType = 0;
+                        copy.RootPart.SalePrice = 10;
+                    }
+
                     Entities.Add(copy);
 
                     // Since we copy from a source group that is in selected
-- 
cgit v1.1


From 1499fd85c417fe5825b7080c07ab2d8e3e25ad09 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 27 Jun 2010 21:02:03 +0100
Subject: Fix a simian compiler warning

---
 OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 34bb8b3..7a420e4 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -371,7 +371,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
         /// <returns></returns>
         public bool Delete(string id)
         {
-            string errorMessage = String.Empty;
+            //string errorMessage = String.Empty;
             string url = m_serverUrl + id;
 
             if (m_cache != null)
-- 
cgit v1.1


From 4cdda2cae9f91ac793bfaf192e94cbe4607c3886 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 28 Jun 2010 01:29:30 +0200
Subject: Fix Copy on Ray, Drag Copy and other little things. Removed the wrong
 and nonworking ownership assignment in SOG, which messed things up before. No
 longer trust the client to send the ID of the person something is copied as,
 since it allows to run a script with someone else's permissions. Properly
 adjust inventory ownership and perms.

---
 OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs |  6 +++---
 OpenSim/Region/Framework/Scenes/SceneGraph.cs        |  2 +-
 OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs  | 18 ++----------------
 3 files changed, 6 insertions(+), 20 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index cdd22de..d2824bd 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -6303,8 +6303,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 if (handlerObjectDuplicate != null)
                 {
                     handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset,
-                                           dupe.SharedData.DuplicateFlags, AgentandGroupData.AgentID,
-                                           AgentandGroupData.GroupID);
+                                           dupe.SharedData.DuplicateFlags, AgentId,
+                                           m_activeGroupID);
                 }
             }
 
@@ -6894,7 +6894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 if (handlerObjectDuplicateOnRay != null)
                 {
                     handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags,
-                                                dupeOnRay.AgentData.AgentID, dupeOnRay.AgentData.GroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
+                                                AgentId, m_activeGroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
                                                 dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection,
                                                 dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates);
                 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index ebb3005..5fea332 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1750,7 +1750,7 @@ namespace OpenSim.Region.Framework.Scenes
                     SceneObjectGroup copy = original.Copy(AgentID, GroupID, true);
                     copy.AbsolutePosition = copy.AbsolutePosition + offset;
 
-                    if (copy.OwnerID != AgentID)
+                    if (original.OwnerID != AgentID)
                     {
                         copy.SetOwnerId(AgentID);
                         copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e23f39f..fad470f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1551,7 +1551,9 @@ namespace OpenSim.Region.Framework.Scenes
             dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
 
             if (!userExposed)
+            {
                 dupe.RootPart.IsAttachment = previousAttachmentStatus;
+            }
 
             dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
             dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
@@ -1576,16 +1578,6 @@ namespace OpenSim.Region.Framework.Scenes
                 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
             }
 
-            // Now we've made a copy that replaces this one, we need to
-            // switch the owner to the person who did the copying
-            // Second Life copies an object and duplicates the first one in it's place
-            // So, we have to make a copy of this one, set it in it's place then set the owner on this one
-            if (userExposed)
-            {
-                SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
-                m_rootPart.ScheduleFullUpdate();
-            }
-            
             List<SceneObjectPart> partList;
 
             lock (m_parts)
@@ -1606,12 +1598,6 @@ namespace OpenSim.Region.Framework.Scenes
                     SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
 
                     newPart.LinkNum = part.LinkNum;
-
-                    if (userExposed)
-                    {
-                        SetPartOwner(newPart, cAgentID, cGroupID);
-                        newPart.ScheduleFullUpdate();
-                    }
                 }
             }
 
-- 
cgit v1.1


From 85a9c305a202516b08b566b1120750010461022c Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 28 Jun 2010 01:48:24 +0200
Subject: Remove AgentID and GroupOD from the signature of SOG.Copy(). They
 were never used, but made for a very mispleading read of the code in the
 callers.

---
 OpenSim/Region/Framework/Scenes/SceneGraph.cs                       | 2 +-
 OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs                 | 6 +++---
 .../ContentManagementSystem/ContentManagementEntity.cs              | 2 +-
 .../Region/OptionalModules/ContentManagementSystem/MetaEntity.cs    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 5fea332..40332a6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1747,7 +1747,7 @@ namespace OpenSim.Region.Framework.Scenes
             {
                 if (m_parentScene.Permissions.CanDuplicateObject(original.Children.Count, original.UUID, AgentID, original.AbsolutePosition))
                 {
-                    SceneObjectGroup copy = original.Copy(AgentID, GroupID, true);
+                    SceneObjectGroup copy = original.Copy(true);
                     copy.AbsolutePosition = copy.AbsolutePosition + offset;
 
                     if (original.OwnerID != AgentID)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fad470f..1ca390a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.Framework.Scenes
                             "[SCENE]: Storing {0}, {1} in {2}",
                             Name, UUID, m_scene.RegionInfo.RegionName);
 
-                        SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false);
+                        SceneObjectGroup backup_group = Copy(false);
                         backup_group.RootPart.Velocity = RootPart.Velocity;
                         backup_group.RootPart.Acceleration = RootPart.Acceleration;
                         backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
@@ -1528,7 +1528,7 @@ namespace OpenSim.Region.Framework.Scenes
         /// Duplicates this object, including operations such as physics set up and attaching to the backup event.
         /// </summary>
         /// <returns></returns>
-        public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed)
+        public SceneObjectGroup Copy(bool userExposed)
         {
             SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
             dupe.m_isBackedUp = false;
@@ -3581,7 +3581,7 @@ namespace OpenSim.Region.Framework.Scenes
         
         public virtual ISceneObject CloneForNewScene()
         {
-            SceneObjectGroup sog = Copy(this.OwnerID, this.GroupID, false);
+            SceneObjectGroup sog = Copy(false);
             sog.m_isDeleted = false;
             return sog;
         }
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs
index c277034..ada6701 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
         public ContentManagementEntity(SceneObjectGroup Unchanged, bool physics)
             : base(Unchanged, false)
         {
-            m_UnchangedEntity = Unchanged.Copy(Unchanged.RootPart.OwnerID, Unchanged.RootPart.GroupID, false);
+            m_UnchangedEntity = Unchanged.Copy(false);
         }
 
         public ContentManagementEntity(string objectXML, Scene scene,  bool physics)
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs
index 1a72971..841ee00 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
         /// </summary>
         public MetaEntity(SceneObjectGroup orig, bool physics)
         {
-            m_Entity = orig.Copy(orig.RootPart.OwnerID, orig.RootPart.GroupID, false);
+            m_Entity = orig.Copy(false);
             Initialize(physics);
         }
 
-- 
cgit v1.1


From 0a82d10fc4827d4c537b5d23f0654d80ba89a2a3 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 28 Jun 2010 02:30:36 +0200
Subject: Change the way IRegionModule us referenced by IEmailModule to allow
 later conversion to new style

---
 OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | 2 +-
 OpenSim/Region/Framework/Interfaces/IEmailModule.cs              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
index 83f004d..c0975ea 100644
--- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs
@@ -40,7 +40,7 @@ using OpenSim.Region.Framework.Scenes;
 
 namespace OpenSim.Region.CoreModules.Scripting.EmailModules
 {
-    public class EmailModule : IEmailModule
+    public class EmailModule : IRegionModule, IEmailModule
     {
         //
         // Log
diff --git a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs
index 3a2c423..4f1b91a 100644
--- a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Interfaces
         public int numLeft;
     }
 
-    public interface IEmailModule : IRegionModule
+    public interface IEmailModule
     {
         void SendEmail(UUID objectID, string address, string subject, string body);
         Email GetNextEmail(UUID objectID, string sender, string subject);
-- 
cgit v1.1


From 20fc35399b8193e3620b0dadca861e90c4afe216 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 28 Jun 2010 14:10:22 -0700
Subject: Fixes mantis #4815 and #4812

---
 OpenSim/Services/GridService/HypergridLinker.cs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index af603b2..ae80a8c 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -255,7 +255,11 @@ namespace OpenSim.Services.GridService
                 {
                     m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName);
                 }
-                regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName;
+                string name = regInfo.RegionName;
+                regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort;
+                if (name != string.Empty)
+                    regInfo.RegionName += ":" + name;
+
                 // Try get the map image
                 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
                 // I need a texture that works for this... the one I tried doesn't seem to be working
-- 
cgit v1.1


From d1233501648d4c76abb259faf2a30095bc99b3f6 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 28 Jun 2010 16:04:12 -0700
Subject: One more bug fix in FriendsModule: GrantRights. One of the caches was
 not being updated.

---
 OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 5552be7..6f044cb 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -768,8 +768,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
                     bool canEditObjectsChanged = ((rights ^ userFlags) & (int)FriendRights.CanModifyObjects) != 0;
                     if (canEditObjectsChanged)
                         friendClient.SendChangeUserRights(userID, friendID, rights);
+
                 }
 
+                // update local cache
+                //m_Friends[friendID].Friends = m_FriendsService.GetFriends(friendID);
+                foreach (FriendInfo finfo in m_Friends[friendID].Friends)
+                    if (finfo.Friend == userID.ToString())
+                        finfo.TheirFlags = rights;
+
                 return true;
             }
 
-- 
cgit v1.1


From 621195e4f182d475b087049f4489e4c9187dd474 Mon Sep 17 00:00:00 2001
From: dahlia
Date: Mon, 28 Jun 2010 17:33:47 -0700
Subject: Thanks Micheil Merlin for Mantis #4784: [PATCH] llRotBetween does not
 return correct rotations for a 180 degree angle between vectors

Signed-off-by: dahlia <dahliaTrimble@gmail.removeme.com>
---
 .../Shared/Api/Implementation/LSL_Api.cs           | 89 +++++++++++++++++-----
 1 file changed, 71 insertions(+), 18 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 1feb153..dc34e1c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -703,24 +703,77 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
 
         public LSL_Rotation llRotBetween(LSL_Vector a, LSL_Vector b)
         {
-            //A and B should both be normalized
-            m_host.AddScriptLPS(1);
-            double dotProduct = LSL_Vector.Dot(a, b);
-            LSL_Vector crossProduct = LSL_Vector.Cross(a, b);
-            double magProduct = LSL_Vector.Mag(a) * LSL_Vector.Mag(b);
-            double angle = Math.Acos(dotProduct / magProduct);
-            LSL_Vector axis = LSL_Vector.Norm(crossProduct);
-            double s = Math.Sin(angle / 2);
-
-            double x = axis.x * s;
-            double y = axis.y * s;
-            double z = axis.z * s;
-            double w = Math.Cos(angle / 2);
-
-            if (Double.IsNaN(x) || Double.IsNaN(y) || Double.IsNaN(z) || Double.IsNaN(w))
-                return new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
-
-            return new LSL_Rotation((float)x, (float)y, (float)z, (float)w);
+            //A and B should both be normalized
+            m_host.AddScriptLPS(1);
+            LSL_Rotation rotBetween;
+            // Check for zero vectors. If either is zero, return zero rotation. Otherwise,
+            // continue calculation.
+            if (a == new LSL_Vector(0.0f, 0.0f, 0.0f) || b == new LSL_Vector(0.0f, 0.0f, 0.0f))
+            {
+                rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
+            }
+            else
+            {
+                a = LSL_Vector.Norm(a);
+                b = LSL_Vector.Norm(b);
+                double dotProduct = LSL_Vector.Dot(a, b);
+                // There are two degenerate cases possible. These are for vectors 180 or
+                // 0 degrees apart. These have to be detected and handled individually.
+                //
+                // Check for vectors 180 degrees apart.
+                // A dot product of -1 would mean the angle between vectors is 180 degrees.
+                if (dotProduct < -0.9999999f)
+                {
+                    // First assume X axis is orthogonal to the vectors.
+                    LSL_Vector orthoVector = new LSL_Vector(1.0f, 0.0f, 0.0f);
+                    orthoVector = orthoVector - a * (a.x / LSL_Vector.Dot(a, a));
+                    // Check for near zero vector. A very small non-zero number here will create
+                    // a rotation in an undesired direction.
+                    if (LSL_Vector.Mag(orthoVector) > 0.0001)
+                    {
+                        rotBetween = new LSL_Rotation(orthoVector.x, orthoVector.y, orthoVector.z, 0.0f);
+                    }
+                    // If the magnitude of the vector was near zero, then assume the X axis is not
+                    // orthogonal and use the Z axis instead.
+                    else
+                    {
+                        // Set 180 z rotation.
+                        rotBetween = new LSL_Rotation(0.0f, 0.0f, 1.0f, 0.0f);
+                    }
+                }
+                // Check for parallel vectors.
+                // A dot product of 1 would mean the angle between vectors is 0 degrees.
+                else if (dotProduct > 0.9999999f)
+                {
+                    // Set zero rotation.
+                    rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
+                }
+                else
+                {
+                    // All special checks have been performed so get the axis of rotation.
+                    LSL_Vector crossProduct = LSL_Vector.Cross(a, b);
+                    // Quarternion s value is the length of the unit vector + dot product.
+                    double qs = 1.0 + dotProduct;
+                    rotBetween = new LSL_Rotation(crossProduct.x, crossProduct.y, crossProduct.z, qs);
+                    // Normalize the rotation.
+                    double mag = LSL_Rotation.Mag(rotBetween);
+                    // We shouldn't have to worry about a divide by zero here. The qs value will be
+                    // non-zero because we already know if we're here, then the dotProduct is not -1 so
+                    // qs will not be zero. Also, we've already handled the input vectors being zero so the
+                    // crossProduct vector should also not be zero.
+                    rotBetween.x = rotBetween.x / mag;
+                    rotBetween.y = rotBetween.y / mag;
+                    rotBetween.z = rotBetween.z / mag;
+                    rotBetween.s = rotBetween.s / mag;
+                    // Check for undefined values and set zero rotation if any found. This code might not actually be required
+                    // any longer since zero vectors are checked for at the top.
+                    if (Double.IsNaN(rotBetween.x) || Double.IsNaN(rotBetween.y) || Double.IsNaN(rotBetween.z) || Double.IsNaN(rotBetween.s))
+                    {
+                        rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
+                    }
+                }
+            }
+            return rotBetween;
         }
 
         public void llWhisper(int channelID, string text)
-- 
cgit v1.1


From 9fde9085a0fcd2e78b01724e0b7e826156d23f53 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 29 Jun 2010 02:07:10 -0700
Subject: Bug fix in HG standalone: wrong handler in the in module. Fixed a few
 broken comments in InventoryAccessModule.

---
 .../Framework/InventoryAccess/InventoryAccessModule.cs      | 13 ++-----------
 .../Inventory/InventoryServiceInConnectorModule.cs          |  2 +-
 OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs  |  4 ++++
 3 files changed, 7 insertions(+), 12 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 3035d88..12b6aa0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -286,23 +286,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
                 {
                     // Deleting someone else's item
                     //
-
-
                     if (remoteClient == null ||
                         objectGroup.OwnerID != remoteClient.AgentId)
                     {
-                        // Folder skeleton may not be loaded and we
-                        // have to wait for the inventory to find
-                        // the destination folder
-                        //
+
                         folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
                     }
                     else
                     {
-                        // Assume inventory skeleton was loaded during login
-                        // and all folders can be found
-                        //
-                        folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
+                         folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
                     }
                 }
                 else if (action == DeRezAction.Return)
@@ -332,7 +324,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
 
                 if (folder == null) // None of the above
                 {
-                    //folder = userInfo.RootFolder.FindFolder(folderID);
                     folder = new InventoryFolderBase(folderID);
 
                     if (folder == null) // Nowhere to put it
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
index ae03cdf..209cf0d 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
@@ -96,7 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory
 
                 Object[] args = new Object[] { m_Config, MainServer.Instance, "HGInventoryService" };
 
-                ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:HGInventoryServiceInConnector", args);
+                ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:XInventoryInConnector", args);
             }
         }
 
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 6e580f1..ac6a3ab 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Server.Handlers.Asset
 {
     public class XInventoryInConnector : ServiceConnector
     {
+        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
         private IInventoryService m_InventoryService;
         private string m_ConfigName = "InventoryService";
 
@@ -53,6 +55,8 @@ namespace OpenSim.Server.Handlers.Asset
             if (configName != String.Empty)
                 m_ConfigName = configName;
 
+            m_log.DebugFormat("[XInventoryInConnector]: Starting with config name {0}", m_ConfigName);
+
             IConfig serverConfig = config.Configs[m_ConfigName];
             if (serverConfig == null)
                 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
-- 
cgit v1.1


From 08e338979062268aa6c82fbe83903de5bcd77f30 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 29 Jun 2010 04:38:15 -0700
Subject: Buglet fix in HG inventory. Make sure that GetRootFolder for non-HG
 xinventory is the folder "My Inventory". Also changed the Suitcase folder
 name to "My Suitcase".

---
 .../Framework/InventoryAccess/HGInventoryAccessModule.cs         | 2 +-
 OpenSim/Services/InventoryService/HGInventoryService.cs          | 4 ++--
 OpenSim/Services/InventoryService/XInventoryService.cs           | 9 ++++++++-
 3 files changed, 11 insertions(+), 4 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 2ab46aa..58c396c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
             return ret;
         }
 
-        public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
+        public override UUID DeleteToInventory(DeRezAction action, UUID folderID,
                 SceneObjectGroup objectGroup, IClientAPI remoteClient)
         {
             UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs
index 061effe..6e6b019 100644
--- a/OpenSim/Services/InventoryService/HGInventoryService.cs
+++ b/OpenSim/Services/InventoryService/HGInventoryService.cs
@@ -108,13 +108,13 @@ namespace OpenSim.Services.InventoryService
             // Warp! Root folder for travelers
             XInventoryFolder[] folders = m_Database.GetFolders(
                     new string[] { "agentID", "folderName"},
-                    new string[] { principalID.ToString(), "Suitcase" });
+                    new string[] { principalID.ToString(), "My Suitcase" });
 
             if (folders.Length > 0)
                 return ConvertToOpenSim(folders[0]);
             
             // make one
-            XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "Suitcase");
+            XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Suitcase");
             return ConvertToOpenSim(suitcase);
         }
 
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index af831fd..f48bf60 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -200,7 +200,14 @@ namespace OpenSim.Services.InventoryService
             if (folders.Length == 0)
                 return null;
 
-            return ConvertToOpenSim(folders[0]);
+            XInventoryFolder root = null;
+            foreach (XInventoryFolder folder in folders)
+                if (folder.folderName == "My Inventory")
+                    root = folder;
+            if (folders == null) // oops
+                root = folders[0];
+
+            return ConvertToOpenSim(root);
         }
 
         public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type)
-- 
cgit v1.1


From cf15558c9ec7dcee3e5d4ff7bab57171450c3eec Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 29 Jun 2010 06:25:12 -0700
Subject: This file wants to be committed.

---
 .../Shared/Api/Implementation/LSL_Api.cs           | 140 ++++++++++-----------
 1 file changed, 70 insertions(+), 70 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index dc34e1c..712bd7d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -703,76 +703,76 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
 
         public LSL_Rotation llRotBetween(LSL_Vector a, LSL_Vector b)
         {
-            //A and B should both be normalized
-            m_host.AddScriptLPS(1);
-            LSL_Rotation rotBetween;
-            // Check for zero vectors. If either is zero, return zero rotation. Otherwise,
-            // continue calculation.
-            if (a == new LSL_Vector(0.0f, 0.0f, 0.0f) || b == new LSL_Vector(0.0f, 0.0f, 0.0f))
-            {
-                rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
-            }
-            else
-            {
-                a = LSL_Vector.Norm(a);
-                b = LSL_Vector.Norm(b);
-                double dotProduct = LSL_Vector.Dot(a, b);
-                // There are two degenerate cases possible. These are for vectors 180 or
-                // 0 degrees apart. These have to be detected and handled individually.
-                //
-                // Check for vectors 180 degrees apart.
-                // A dot product of -1 would mean the angle between vectors is 180 degrees.
-                if (dotProduct < -0.9999999f)
-                {
-                    // First assume X axis is orthogonal to the vectors.
-                    LSL_Vector orthoVector = new LSL_Vector(1.0f, 0.0f, 0.0f);
-                    orthoVector = orthoVector - a * (a.x / LSL_Vector.Dot(a, a));
-                    // Check for near zero vector. A very small non-zero number here will create
-                    // a rotation in an undesired direction.
-                    if (LSL_Vector.Mag(orthoVector) > 0.0001)
-                    {
-                        rotBetween = new LSL_Rotation(orthoVector.x, orthoVector.y, orthoVector.z, 0.0f);
-                    }
-                    // If the magnitude of the vector was near zero, then assume the X axis is not
-                    // orthogonal and use the Z axis instead.
-                    else
-                    {
-                        // Set 180 z rotation.
-                        rotBetween = new LSL_Rotation(0.0f, 0.0f, 1.0f, 0.0f);
-                    }
-                }
-                // Check for parallel vectors.
-                // A dot product of 1 would mean the angle between vectors is 0 degrees.
-                else if (dotProduct > 0.9999999f)
-                {
-                    // Set zero rotation.
-                    rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
-                }
-                else
-                {
-                    // All special checks have been performed so get the axis of rotation.
-                    LSL_Vector crossProduct = LSL_Vector.Cross(a, b);
-                    // Quarternion s value is the length of the unit vector + dot product.
-                    double qs = 1.0 + dotProduct;
-                    rotBetween = new LSL_Rotation(crossProduct.x, crossProduct.y, crossProduct.z, qs);
-                    // Normalize the rotation.
-                    double mag = LSL_Rotation.Mag(rotBetween);
-                    // We shouldn't have to worry about a divide by zero here. The qs value will be
-                    // non-zero because we already know if we're here, then the dotProduct is not -1 so
-                    // qs will not be zero. Also, we've already handled the input vectors being zero so the
-                    // crossProduct vector should also not be zero.
-                    rotBetween.x = rotBetween.x / mag;
-                    rotBetween.y = rotBetween.y / mag;
-                    rotBetween.z = rotBetween.z / mag;
-                    rotBetween.s = rotBetween.s / mag;
-                    // Check for undefined values and set zero rotation if any found. This code might not actually be required
-                    // any longer since zero vectors are checked for at the top.
-                    if (Double.IsNaN(rotBetween.x) || Double.IsNaN(rotBetween.y) || Double.IsNaN(rotBetween.z) || Double.IsNaN(rotBetween.s))
-                    {
-                        rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
-                    }
-                }
-            }
+            //A and B should both be normalized
+            m_host.AddScriptLPS(1);
+            LSL_Rotation rotBetween;
+            // Check for zero vectors. If either is zero, return zero rotation. Otherwise,
+            // continue calculation.
+            if (a == new LSL_Vector(0.0f, 0.0f, 0.0f) || b == new LSL_Vector(0.0f, 0.0f, 0.0f))
+            {
+                rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
+            }
+            else
+            {
+                a = LSL_Vector.Norm(a);
+                b = LSL_Vector.Norm(b);
+                double dotProduct = LSL_Vector.Dot(a, b);
+                // There are two degenerate cases possible. These are for vectors 180 or
+                // 0 degrees apart. These have to be detected and handled individually.
+                //
+                // Check for vectors 180 degrees apart.
+                // A dot product of -1 would mean the angle between vectors is 180 degrees.
+                if (dotProduct < -0.9999999f)
+                {
+                    // First assume X axis is orthogonal to the vectors.
+                    LSL_Vector orthoVector = new LSL_Vector(1.0f, 0.0f, 0.0f);
+                    orthoVector = orthoVector - a * (a.x / LSL_Vector.Dot(a, a));
+                    // Check for near zero vector. A very small non-zero number here will create
+                    // a rotation in an undesired direction.
+                    if (LSL_Vector.Mag(orthoVector) > 0.0001)
+                    {
+                        rotBetween = new LSL_Rotation(orthoVector.x, orthoVector.y, orthoVector.z, 0.0f);
+                    }
+                    // If the magnitude of the vector was near zero, then assume the X axis is not
+                    // orthogonal and use the Z axis instead.
+                    else
+                    {
+                        // Set 180 z rotation.
+                        rotBetween = new LSL_Rotation(0.0f, 0.0f, 1.0f, 0.0f);
+                    }
+                }
+                // Check for parallel vectors.
+                // A dot product of 1 would mean the angle between vectors is 0 degrees.
+                else if (dotProduct > 0.9999999f)
+                {
+                    // Set zero rotation.
+                    rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
+                }
+                else
+                {
+                    // All special checks have been performed so get the axis of rotation.
+                    LSL_Vector crossProduct = LSL_Vector.Cross(a, b);
+                    // Quarternion s value is the length of the unit vector + dot product.
+                    double qs = 1.0 + dotProduct;
+                    rotBetween = new LSL_Rotation(crossProduct.x, crossProduct.y, crossProduct.z, qs);
+                    // Normalize the rotation.
+                    double mag = LSL_Rotation.Mag(rotBetween);
+                    // We shouldn't have to worry about a divide by zero here. The qs value will be
+                    // non-zero because we already know if we're here, then the dotProduct is not -1 so
+                    // qs will not be zero. Also, we've already handled the input vectors being zero so the
+                    // crossProduct vector should also not be zero.
+                    rotBetween.x = rotBetween.x / mag;
+                    rotBetween.y = rotBetween.y / mag;
+                    rotBetween.z = rotBetween.z / mag;
+                    rotBetween.s = rotBetween.s / mag;
+                    // Check for undefined values and set zero rotation if any found. This code might not actually be required
+                    // any longer since zero vectors are checked for at the top.
+                    if (Double.IsNaN(rotBetween.x) || Double.IsNaN(rotBetween.y) || Double.IsNaN(rotBetween.z) || Double.IsNaN(rotBetween.s))
+                    {
+                        rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
+                    }
+                }
+            }
             return rotBetween;
         }
 
-- 
cgit v1.1