diff options
author | Diva Canto | 2012-03-08 18:29:08 -0800 |
---|---|---|
committer | Diva Canto | 2012-03-08 18:29:08 -0800 |
commit | c22446ede08c720b4c20b87cd144c77882e44ffe (patch) | |
tree | 139c4135772cba2bc958f500d19c281e5f3d5061 /OpenSim/Region | |
parent | HG inventory/asset transfers: serialize asset posts. I'm using the same patte... (diff) | |
parent | Remove a race condition from SP.Set_AbsolutePosition where we assume the Pare... (diff) | |
download | opensim-SC_OLD-c22446ede08c720b4c20b87cd144c77882e44ffe.zip opensim-SC_OLD-c22446ede08c720b4c20b87cd144c77882e44ffe.tar.gz opensim-SC_OLD-c22446ede08c720b4c20b87cd144c77882e44ffe.tar.bz2 opensim-SC_OLD-c22446ede08c720b4c20b87cd144c77882e44ffe.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
3 files changed, 56 insertions, 48 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index 2e6ec90..c78915f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -73,14 +73,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
73 | return; | 73 | return; |
74 | } | 74 | } |
75 | 75 | ||
76 | string serviceDll = assetConfig.GetString("LocalServiceModule", | 76 | string serviceDll = assetConfig.GetString("LocalServiceModule", String.Empty); |
77 | String.Empty); | ||
78 | 77 | ||
79 | if (serviceDll == String.Empty) | 78 | if (serviceDll == String.Empty) |
80 | { | 79 | { |
81 | m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: No LocalServiceModule named in section AssetService"); | 80 | m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: No LocalServiceModule named in section AssetService"); |
82 | return; | 81 | return; |
83 | } | 82 | } |
83 | else | ||
84 | { | ||
85 | m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Loading asset service at {0}", serviceDll); | ||
86 | } | ||
84 | 87 | ||
85 | Object[] args = new Object[] { source }; | 88 | Object[] args = new Object[] { source }; |
86 | m_AssetService = ServerUtils.LoadPlugin<IAssetService>(serviceDll, args); | 89 | m_AssetService = ServerUtils.LoadPlugin<IAssetService>(serviceDll, args); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9d5cdfa..be56fe1 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -455,12 +455,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
455 | // in the sim unless the avatar is on a sit target. While | 455 | // in the sim unless the avatar is on a sit target. While |
456 | // on a sit target, m_pos will contain the desired offset | 456 | // on a sit target, m_pos will contain the desired offset |
457 | // without the parent rotation applied. | 457 | // without the parent rotation applied. |
458 | if (ParentID != 0) | 458 | SceneObjectPart sitPart = ParentPart; |
459 | { | 459 | |
460 | SceneObjectPart part = ParentPart; | 460 | if (sitPart != null) |
461 | return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); | 461 | return sitPart.AbsolutePosition + (m_pos * sitPart.GetWorldRotation()); |
462 | } | ||
463 | } | 462 | } |
463 | |||
464 | return m_pos; | 464 | return m_pos; |
465 | } | 465 | } |
466 | set | 466 | set |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0003515..786ae6e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2771,64 +2771,69 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2771 | { | 2771 | { |
2772 | m_host.AddScriptLPS(1); | 2772 | m_host.AddScriptLPS(1); |
2773 | 2773 | ||
2774 | if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) | 2774 | Util.FireAndForget(delegate (object x) |
2775 | return; | 2775 | { |
2776 | float dist = (float)llVecDist(llGetPos(), pos); | 2776 | if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) |
2777 | return; | ||
2778 | float dist = (float)llVecDist(llGetPos(), pos); | ||
2777 | 2779 | ||
2778 | if (dist > m_ScriptDistanceFactor * 10.0f) | 2780 | if (dist > m_ScriptDistanceFactor * 10.0f) |
2779 | return; | 2781 | return; |
2780 | 2782 | ||
2781 | TaskInventoryDictionary partInventory = (TaskInventoryDictionary)m_host.TaskInventory.Clone(); | 2783 | //Clone is thread-safe |
2784 | TaskInventoryDictionary partInventory = (TaskInventoryDictionary)m_host.TaskInventory.Clone(); | ||
2782 | 2785 | ||
2783 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in partInventory) | 2786 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in partInventory) |
2784 | { | ||
2785 | if (inv.Value.Name == inventory) | ||
2786 | { | 2787 | { |
2787 | // make sure we're an object. | 2788 | if (inv.Value.Name == inventory) |
2788 | if (inv.Value.InvType != (int)InventoryType.Object) | ||
2789 | { | 2789 | { |
2790 | llSay(0, "Unable to create requested object. Object is missing from database."); | 2790 | // make sure we're an object. |
2791 | return; | 2791 | if (inv.Value.InvType != (int)InventoryType.Object) |
2792 | } | 2792 | { |
2793 | llSay(0, "Unable to create requested object. Object is missing from database."); | ||
2794 | return; | ||
2795 | } | ||
2793 | 2796 | ||
2794 | Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); | 2797 | Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); |
2795 | Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z); | 2798 | Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z); |
2796 | 2799 | ||
2797 | // need the magnitude later | 2800 | // need the magnitude later |
2798 | float velmag = (float)Util.GetMagnitude(llvel); | 2801 | // float velmag = (float)Util.GetMagnitude(llvel); |
2799 | 2802 | ||
2800 | SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param); | 2803 | SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param); |
2801 | 2804 | ||
2802 | // If either of these are null, then there was an unknown error. | 2805 | // If either of these are null, then there was an unknown error. |
2803 | if (new_group == null) | 2806 | if (new_group == null) |
2804 | continue; | 2807 | continue; |
2805 | 2808 | ||
2806 | // objects rezzed with this method are die_at_edge by default. | 2809 | // objects rezzed with this method are die_at_edge by default. |
2807 | new_group.RootPart.SetDieAtEdge(true); | 2810 | new_group.RootPart.SetDieAtEdge(true); |
2808 | 2811 | ||
2809 | new_group.ResumeScripts(); | 2812 | new_group.ResumeScripts(); |
2810 | 2813 | ||
2811 | m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( | 2814 | m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( |
2812 | "object_rez", new Object[] { | 2815 | "object_rez", new Object[] { |
2813 | new LSL_String( | 2816 | new LSL_String( |
2814 | new_group.RootPart.UUID.ToString()) }, | 2817 | new_group.RootPart.UUID.ToString()) }, |
2815 | new DetectParams[0])); | 2818 | new DetectParams[0])); |
2816 | 2819 | ||
2817 | float groupmass = new_group.GetMass(); | 2820 | float groupmass = new_group.GetMass(); |
2818 | 2821 | ||
2819 | if (new_group.RootPart.PhysActor != null && new_group.RootPart.PhysActor.IsPhysical && llvel != Vector3.Zero) | 2822 | if (new_group.RootPart.PhysActor != null && new_group.RootPart.PhysActor.IsPhysical && llvel != Vector3.Zero) |
2820 | { | 2823 | { |
2821 | //Recoil. | 2824 | //Recoil. |
2822 | llApplyImpulse(new LSL_Vector(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); | 2825 | llApplyImpulse(new LSL_Vector(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); |
2826 | } | ||
2827 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | ||
2828 | return; | ||
2823 | } | 2829 | } |
2824 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | ||
2825 | ScriptSleep((int)((groupmass * velmag) / 10)); | ||
2826 | ScriptSleep(100); | ||
2827 | return; | ||
2828 | } | 2830 | } |
2829 | } | ||
2830 | 2831 | ||
2831 | llSay(0, "Could not find object " + inventory); | 2832 | llSay(0, "Could not find object " + inventory); |
2833 | }); | ||
2834 | |||
2835 | //ScriptSleep((int)((groupmass * velmag) / 10)); | ||
2836 | ScriptSleep(100); | ||
2832 | } | 2837 | } |
2833 | 2838 | ||
2834 | public void llRezObject(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) | 2839 | public void llRezObject(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param) |