diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 59 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 64eb6d0..c87f8ba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -46,6 +46,7 @@ using OpenSim.Region.CoreModules.World.Land; | |||
46 | using OpenSim.Region.CoreModules.World.Terrain; | 46 | using OpenSim.Region.CoreModules.World.Terrain; |
47 | using OpenSim.Region.Framework.Interfaces; | 47 | using OpenSim.Region.Framework.Interfaces; |
48 | using OpenSim.Region.Framework.Scenes; | 48 | using OpenSim.Region.Framework.Scenes; |
49 | using OpenSim.Region.Framework.Scenes.Serialization; | ||
49 | using OpenSim.Region.Framework.Scenes.Animation; | 50 | using OpenSim.Region.Framework.Scenes.Animation; |
50 | using OpenSim.Region.Physics.Manager; | 51 | using OpenSim.Region.Physics.Manager; |
51 | using OpenSim.Region.ScriptEngine.Shared; | 52 | using OpenSim.Region.ScriptEngine.Shared; |
@@ -11010,11 +11011,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11010 | 11011 | ||
11011 | } | 11012 | } |
11012 | 11013 | ||
11013 | public virtual void llGetUsedMemory() | 11014 | public virtual LSL_Integer llGetUsedMemory() |
11014 | { | 11015 | { |
11015 | m_host.AddScriptLPS(1); | 11016 | m_host.AddScriptLPS(1); |
11016 | NotImplemented("llGetUsedMemory"); | 11017 | NotImplemented("llGetUsedMemory"); |
11017 | 11018 | return 0; | |
11018 | } | 11019 | } |
11019 | 11020 | ||
11020 | public void llRegionSayTo( LSL_Key target, LSL_Integer channel, LSL_String msg ) | 11021 | public void llRegionSayTo( LSL_Key target, LSL_Integer channel, LSL_String msg ) |
@@ -11045,7 +11046,56 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11045 | public void llGodLikeRezObject(string inventory, LSL_Vector pos) | 11046 | public void llGodLikeRezObject(string inventory, LSL_Vector pos) |
11046 | { | 11047 | { |
11047 | m_host.AddScriptLPS(1); | 11048 | m_host.AddScriptLPS(1); |
11048 | NotImplemented("llGodLikeRezObject"); | 11049 | |
11050 | if (!World.Permissions.IsGod(m_host.OwnerID)) | ||
11051 | NotImplemented("llGodLikeRezObject"); | ||
11052 | |||
11053 | AssetBase rezAsset = World.AssetService.Get(inventory); | ||
11054 | if (rezAsset == null) | ||
11055 | { | ||
11056 | llSay(0, "Asset not found"); | ||
11057 | return; | ||
11058 | } | ||
11059 | |||
11060 | SceneObjectGroup group = null; | ||
11061 | |||
11062 | try | ||
11063 | { | ||
11064 | string xmlData = Utils.BytesToString(rezAsset.Data); | ||
11065 | group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | ||
11066 | } | ||
11067 | catch | ||
11068 | { | ||
11069 | llSay(0, "Asset not found"); | ||
11070 | return; | ||
11071 | } | ||
11072 | |||
11073 | if (group == null) | ||
11074 | { | ||
11075 | llSay(0, "Asset not found"); | ||
11076 | return; | ||
11077 | } | ||
11078 | |||
11079 | group.RootPart.AttachPoint = group.RootPart.Shape.State; | ||
11080 | group.RootPart.AttachOffset = group.AbsolutePosition; | ||
11081 | |||
11082 | group.ResetIDs(); | ||
11083 | |||
11084 | Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); | ||
11085 | World.AddNewSceneObject(group, true, llpos, Quaternion.Identity, Vector3.Zero); | ||
11086 | group.CreateScriptInstances(0, true, World.DefaultScriptEngine, 3); | ||
11087 | group.ScheduleGroupForFullUpdate(); | ||
11088 | |||
11089 | // objects rezzed with this method are die_at_edge by default. | ||
11090 | group.RootPart.SetDieAtEdge(true); | ||
11091 | |||
11092 | group.ResumeScripts(); | ||
11093 | |||
11094 | m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( | ||
11095 | "object_rez", new Object[] { | ||
11096 | new LSL_String( | ||
11097 | group.RootPart.UUID.ToString()) }, | ||
11098 | new DetectParams[0])); | ||
11049 | } | 11099 | } |
11050 | 11100 | ||
11051 | #endregion | 11101 | #endregion |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 0ae2388..ce13d6b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -121,6 +121,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
121 | LSL_Float llGetEnergy(); | 121 | LSL_Float llGetEnergy(); |
122 | LSL_Vector llGetForce(); | 122 | LSL_Vector llGetForce(); |
123 | LSL_Integer llGetFreeMemory(); | 123 | LSL_Integer llGetFreeMemory(); |
124 | LSL_Integer llGetUsedMemory(); | ||
124 | LSL_Integer llGetFreeURLs(); | 125 | LSL_Integer llGetFreeURLs(); |
125 | LSL_Vector llGetGeometricCenter(); | 126 | LSL_Vector llGetGeometricCenter(); |
126 | LSL_Float llGetGMTclock(); | 127 | LSL_Float llGetGMTclock(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 63cac9a..7d7e54e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -461,6 +461,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
461 | return m_LSL_Functions.llGetFreeMemory(); | 461 | return m_LSL_Functions.llGetFreeMemory(); |
462 | } | 462 | } |
463 | 463 | ||
464 | public LSL_Integer llGetUsedMemory() | ||
465 | { | ||
466 | return m_LSL_Functions.llGetUsedMemory(); | ||
467 | } | ||
468 | |||
464 | public LSL_Integer llGetFreeURLs() | 469 | public LSL_Integer llGetFreeURLs() |
465 | { | 470 | { |
466 | return m_LSL_Functions.llGetFreeURLs(); | 471 | return m_LSL_Functions.llGetFreeURLs(); |