diff options
Diffstat (limited to '')
5 files changed, 78 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index af04951..849d02d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1803,6 +1803,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1803 | return 0; | 1803 | return 0; |
1804 | } | 1804 | } |
1805 | 1805 | ||
1806 | public LSL_Integer llScaleByFactor(double scaling_factor) | ||
1807 | { | ||
1808 | m_host.AddScriptLPS(1); | ||
1809 | SceneObjectGroup group = m_host.ParentGroup; | ||
1810 | |||
1811 | if(scaling_factor < 1e-6) | ||
1812 | return ScriptBaseClass.FALSE; | ||
1813 | if(scaling_factor > 1e6) | ||
1814 | return ScriptBaseClass.FALSE; | ||
1815 | |||
1816 | if (group == null || group.IsDeleted || group.inTransit) | ||
1817 | return ScriptBaseClass.FALSE; | ||
1818 | |||
1819 | if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical) | ||
1820 | return ScriptBaseClass.FALSE; | ||
1821 | |||
1822 | if (group.RootPart.KeyframeMotion != null) | ||
1823 | return ScriptBaseClass.FALSE; | ||
1824 | |||
1825 | if(group.GroupResize(scaling_factor)) | ||
1826 | return ScriptBaseClass.TRUE; | ||
1827 | else | ||
1828 | return ScriptBaseClass.FALSE; | ||
1829 | } | ||
1830 | |||
1831 | public LSL_Float llGetMaxScaleFactor() | ||
1832 | { | ||
1833 | m_host.AddScriptLPS(1); | ||
1834 | SceneObjectGroup group = m_host.ParentGroup; | ||
1835 | |||
1836 | if (group == null || group.IsDeleted || group.inTransit) | ||
1837 | return 1.0f; | ||
1838 | |||
1839 | return (LSL_Float)group.GetMaxGroupResizeScale(); | ||
1840 | } | ||
1841 | |||
1842 | public LSL_Float llGetMinScaleFactor() | ||
1843 | { | ||
1844 | m_host.AddScriptLPS(1); | ||
1845 | SceneObjectGroup group = m_host.ParentGroup; | ||
1846 | |||
1847 | if (group == null || group.IsDeleted || group.inTransit) | ||
1848 | return 1.0f; | ||
1849 | |||
1850 | return (LSL_Float)group.GetMinGroupResizeScale(); | ||
1851 | } | ||
1852 | |||
1806 | public void llSetScale(LSL_Vector scale) | 1853 | public void llSetScale(LSL_Vector scale) |
1807 | { | 1854 | { |
1808 | m_host.AddScriptLPS(1); | 1855 | m_host.AddScriptLPS(1); |
@@ -3049,7 +3096,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3049 | { | 3096 | { |
3050 | m_host.AddScriptLPS(1); | 3097 | m_host.AddScriptLPS(1); |
3051 | double ScriptTime = Util.GetTimeStampMS() - m_timer; | 3098 | double ScriptTime = Util.GetTimeStampMS() - m_timer; |
3052 | return (ScriptTime / 1000.0); | 3099 | return (float)Math.Round((ScriptTime / 1000.0), 3); |
3053 | } | 3100 | } |
3054 | 3101 | ||
3055 | public void llResetTime() | 3102 | public void llResetTime() |
@@ -3064,7 +3111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3064 | double now = Util.GetTimeStampMS(); | 3111 | double now = Util.GetTimeStampMS(); |
3065 | double ScriptTime = now - m_timer; | 3112 | double ScriptTime = now - m_timer; |
3066 | m_timer = now; | 3113 | m_timer = now; |
3067 | return (ScriptTime / 1000.0); | 3114 | return (float)Math.Round((ScriptTime / 1000.0), 3); |
3068 | } | 3115 | } |
3069 | 3116 | ||
3070 | public void llSound(string sound, double volume, int queue, int loop) | 3117 | public void llSound(string sound, double volume, int queue, int loop) |
@@ -3482,13 +3529,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3482 | 3529 | ||
3483 | if (item == null) | 3530 | if (item == null) |
3484 | { | 3531 | { |
3485 | Error("llRezAtRoot", "Can't find object '" + inventory + "'"); | 3532 | Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'"); |
3486 | return; | 3533 | return; |
3487 | } | 3534 | } |
3488 | 3535 | ||
3489 | if (item.InvType != (int)InventoryType.Object) | 3536 | if (item.InvType != (int)InventoryType.Object) |
3490 | { | 3537 | { |
3491 | Error("llRezAtRoot", "Can't create requested object; object is missing from database"); | 3538 | Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database"); |
3492 | return; | 3539 | return; |
3493 | } | 3540 | } |
3494 | 3541 | ||
@@ -3532,7 +3579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3532 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | 3579 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) |
3533 | } | 3580 | } |
3534 | 3581 | ||
3535 | }, null, "LSL_Api.llRezAtRoot"); | 3582 | }, null, "LSL_Api.doObjectRez"); |
3536 | 3583 | ||
3537 | //ScriptSleep((int)((groupmass * velmag) / 10)); | 3584 | //ScriptSleep((int)((groupmass * velmag) / 10)); |
3538 | ScriptSleep(m_sleepMsOnRezAtRoot); | 3585 | ScriptSleep(m_sleepMsOnRezAtRoot); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 57bff6e..a21a0ca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1938,8 +1938,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1938 | taskItem.ResetIDs(m_host.UUID); | 1938 | taskItem.ResetIDs(m_host.UUID); |
1939 | taskItem.ParentID = m_host.UUID; | 1939 | taskItem.ParentID = m_host.UUID; |
1940 | taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); | 1940 | taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); |
1941 | taskItem.Name = asset.Name; | 1941 | taskItem.Name = name; |
1942 | taskItem.Description = asset.Description; | 1942 | taskItem.Description = description; |
1943 | taskItem.Type = (int)AssetType.Notecard; | 1943 | taskItem.Type = (int)AssetType.Notecard; |
1944 | taskItem.InvType = (int)InventoryType.Notecard; | 1944 | taskItem.InvType = (int)InventoryType.Notecard; |
1945 | taskItem.OwnerID = m_host.OwnerID; | 1945 | taskItem.OwnerID = m_host.OwnerID; |
@@ -3354,8 +3354,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3354 | m_host.AddScriptLPS(1); | 3354 | m_host.AddScriptLPS(1); |
3355 | 3355 | ||
3356 | Scene scene = m_ScriptEngine.World; | 3356 | Scene scene = m_ScriptEngine.World; |
3357 | GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID); | 3357 | RegionInfo reg = World.RegionInfo; |
3358 | return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight); | 3358 | // GridRegion region = scene.GridService.GetRegionByUUID(UUID.Zero, World.RegionInfo.RegionID); |
3359 | // return new LSL_Vector((float)region.RegionSizeX, (float)region.RegionSizeY, (float)Constants.RegionHeight); | ||
3360 | return new LSL_Vector((float)reg.RegionSizeX, (float)reg.RegionSizeY, 0.0f); | ||
3359 | } | 3361 | } |
3360 | 3362 | ||
3361 | public int osGetSimulatorMemory() | 3363 | public int osGetSimulatorMemory() |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 3d1482d..cc52403 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -326,6 +326,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
326 | LSL_Integer llRound(double f); | 326 | LSL_Integer llRound(double f); |
327 | LSL_Integer llSameGroup(string agent); | 327 | LSL_Integer llSameGroup(string agent); |
328 | void llSay(int channelID, string text); | 328 | void llSay(int channelID, string text); |
329 | LSL_Integer llScaleByFactor(double scaling_factor); | ||
330 | LSL_Float llGetMaxScaleFactor(); | ||
331 | LSL_Float llGetMinScaleFactor(); | ||
329 | void llScaleTexture(double u, double v, int face); | 332 | void llScaleTexture(double u, double v, int face); |
330 | LSL_Integer llScriptDanger(LSL_Vector pos); | 333 | LSL_Integer llScriptDanger(LSL_Vector pos); |
331 | void llScriptProfiler(LSL_Integer flag); | 334 | void llScriptProfiler(LSL_Integer flag); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 2769712..9d36341 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -1465,6 +1465,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1465 | m_LSL_Functions.llSay(channelID, text); | 1465 | m_LSL_Functions.llSay(channelID, text); |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | public LSL_Integer llScaleByFactor(double scaling_factor) | ||
1469 | { | ||
1470 | return m_LSL_Functions.llScaleByFactor(scaling_factor); | ||
1471 | } | ||
1472 | |||
1473 | public LSL_Float llGetMaxScaleFactor() | ||
1474 | { | ||
1475 | return m_LSL_Functions.llGetMaxScaleFactor(); | ||
1476 | } | ||
1477 | |||
1478 | public LSL_Float llGetMinScaleFactor() | ||
1479 | { | ||
1480 | return m_LSL_Functions.llGetMinScaleFactor(); | ||
1481 | } | ||
1482 | |||
1468 | public void llScaleTexture(double u, double v, int face) | 1483 | public void llScaleTexture(double u, double v, int face) |
1469 | { | 1484 | { |
1470 | m_LSL_Functions.llScaleTexture(u, v, face); | 1485 | m_LSL_Functions.llScaleTexture(u, v, face); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index d725907..7129c8a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -880,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
880 | try | 880 | try |
881 | { | 881 | { |
882 | m_CurrentEvent = data.EventName; | 882 | m_CurrentEvent = data.EventName; |
883 | m_EventStart = DateTime.Now; | 883 | m_EventStart = DateTime.UtcNow; |
884 | m_InEvent = true; | 884 | m_InEvent = true; |
885 | 885 | ||
886 | try | 886 | try |
@@ -1033,7 +1033,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1033 | if (!m_InEvent) | 1033 | if (!m_InEvent) |
1034 | return 0; | 1034 | return 0; |
1035 | 1035 | ||
1036 | return (DateTime.Now - m_EventStart).Seconds; | 1036 | return (DateTime.UtcNow - m_EventStart).Seconds; |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | public void ResetScript(int timeout) | 1039 | public void ResetScript(int timeout) |