From 87959464c9db8948bed89909913400bc2eb7524d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Dec 2009 22:21:24 -0600 Subject: Adds osKickUser and osSetSpeed Signed-off-by: Melanie --- .../Shared/Api/Implementation/OSSL_Api.cs | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 9c7604b..5abe4b1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1983,5 +1983,82 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return (int)pws; } + public void osSetSpeed(string UUID, float SpeedModifier) + { + CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); + m_host.AddScriptLPS(1); + ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); + avatar.SpeedModifier = SpeedModifier; + } + public void osKickAvatar(string FirstName,string SurName,string alert) + { + CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); + if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) + { + foreach (ScenePresence presence in World.GetAvatars()) + { + if ((presence.Firstname == FirstName) && + presence.Lastname == SurName) + { + // kick client... + if (alert != null) + presence.ControllingClient.Kick(alert); + + // ...and close on our side + presence.Scene.IncomingCloseAgent(presence.UUID); + } + } + } + } + public void osCauseDamage(string avatar, double damage) + { + CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); + m_host.AddScriptLPS(1); + + UUID avatarId = new UUID(avatar); + Vector3 pos = m_host.GetWorldPosition(); + + ScenePresence presence = World.GetScenePresence(avatarId); + if (presence != null) + { + LandData land = World.GetLandData((float)pos.X, (float)pos.Y); + if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) + { + float health = presence.Health; + health -= (float)damage; + presence.setHealthWithUpdate(health); + if (health <= 0) + { + float healthliveagain = 100; + presence.ControllingClient.SendAgentAlertMessage("You died!", true); + presence.setHealthWithUpdate(healthliveagain); + presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); + } + } + } + } + public void osCauseHealing(string avatar, double healing) + { + CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); + m_host.AddScriptLPS(1); + + UUID avatarId = new UUID(avatar); + ScenePresence presence = World.GetScenePresence(avatarId); + Vector3 pos = m_host.GetWorldPosition(); + bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); + if (result) + { + if (presence != null) + { + float health = presence.Health; + health += (float)healing; + if (health >= 100) + { + health = 100; + } + presence.setHealthWithUpdate(health); + } + } + } } } -- cgit v1.1 From eab2b4c6a96cd5b2a0f079f27a9c2ac15273d3f0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 31 Dec 2009 04:48:59 +0000 Subject: [PATCH] Adds llCollisionFilter Thank you, Revolution. Applied with minor changes. --- .../Shared/Api/Implementation/LSL_Api.cs | 48 ++++++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6102504..43df4ab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2752,7 +2752,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionFilter(string name, string id, int accept) { m_host.AddScriptLPS(1); - NotImplemented("llCollisionFilter"); + m_host.CollisionFilter.Clear(); + if(id != null) + { + m_host.CollisionFilter.Add(accept,id); + } + else + { + m_host.CollisionFilter.Add(accept,name); + } } public void llTakeControls(int controls, int accept, int pass_on) @@ -8204,11 +8212,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return -1; } - + public void llSetInventoryPermMask(string item, int mask, int value) { - m_host.AddScriptLPS(1); - NotImplemented("llSetInventoryPermMask"); + m_host.AddScriptLPS(1); + if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) + { + if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) + { + lock (m_host.TaskInventory) + { + foreach (KeyValuePair inv in m_host.TaskInventory) + { + if (inv.Value.Name == item) + { + switch (mask) + { + case 0: + inv.Value.BasePermissions = (uint)value; + break; + case 1: + inv.Value.CurrentPermissions = (uint)value; + break; + case 2: + inv.Value.GroupPermissions = (uint)value; + break; + case 3: + inv.Value.EveryonePermissions = (uint)value; + break; + case 4: + inv.Value.NextPermissions = (uint)value; + break; + } + } + } + } + } + } } public LSL_String llGetInventoryCreator(string item) -- cgit v1.1