diff options
author | Melanie | 2009-12-31 04:53:05 +0000 |
---|---|---|
committer | Melanie | 2009-12-31 04:53:05 +0000 |
commit | 643cc7a0ee19dd6670d674eca5ed039c652f14bf (patch) | |
tree | 4ae205fa5e0aad244c7a41b47cf7e3cf147bdb8a /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | Merge branch 'master' of ssh://3dhosting.de/var/git/careminster (diff) | |
parent | [PATCH] Adds llCollisionFilter (diff) | |
download | opensim-SC-643cc7a0ee19dd6670d674eca5ed039c652f14bf.zip opensim-SC-643cc7a0ee19dd6670d674eca5ed039c652f14bf.tar.gz opensim-SC-643cc7a0ee19dd6670d674eca5ed039c652f14bf.tar.bz2 opensim-SC-643cc7a0ee19dd6670d674eca5ed039c652f14bf.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 48 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 77 |
2 files changed, 121 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3a229c2..f0d73d3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2812,7 +2812,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2812 | public void llCollisionFilter(string name, string id, int accept) | 2812 | public void llCollisionFilter(string name, string id, int accept) |
2813 | { | 2813 | { |
2814 | m_host.AddScriptLPS(1); | 2814 | m_host.AddScriptLPS(1); |
2815 | NotImplemented("llCollisionFilter"); | 2815 | m_host.CollisionFilter.Clear(); |
2816 | if(id != null) | ||
2817 | { | ||
2818 | m_host.CollisionFilter.Add(accept,id); | ||
2819 | } | ||
2820 | else | ||
2821 | { | ||
2822 | m_host.CollisionFilter.Add(accept,name); | ||
2823 | } | ||
2816 | } | 2824 | } |
2817 | 2825 | ||
2818 | public void llTakeControls(int controls, int accept, int pass_on) | 2826 | public void llTakeControls(int controls, int accept, int pass_on) |
@@ -8323,11 +8331,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8323 | 8331 | ||
8324 | return -1; | 8332 | return -1; |
8325 | } | 8333 | } |
8326 | 8334 | ||
8327 | public void llSetInventoryPermMask(string item, int mask, int value) | 8335 | public void llSetInventoryPermMask(string item, int mask, int value) |
8328 | { | 8336 | { |
8329 | m_host.AddScriptLPS(1); | 8337 | m_host.AddScriptLPS(1); |
8330 | NotImplemented("llSetInventoryPermMask"); | 8338 | if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) |
8339 | { | ||
8340 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | ||
8341 | { | ||
8342 | lock (m_host.TaskInventory) | ||
8343 | { | ||
8344 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
8345 | { | ||
8346 | if (inv.Value.Name == item) | ||
8347 | { | ||
8348 | switch (mask) | ||
8349 | { | ||
8350 | case 0: | ||
8351 | inv.Value.BasePermissions = (uint)value; | ||
8352 | break; | ||
8353 | case 1: | ||
8354 | inv.Value.CurrentPermissions = (uint)value; | ||
8355 | break; | ||
8356 | case 2: | ||
8357 | inv.Value.GroupPermissions = (uint)value; | ||
8358 | break; | ||
8359 | case 3: | ||
8360 | inv.Value.EveryonePermissions = (uint)value; | ||
8361 | break; | ||
8362 | case 4: | ||
8363 | inv.Value.NextPermissions = (uint)value; | ||
8364 | break; | ||
8365 | } | ||
8366 | } | ||
8367 | } | ||
8368 | } | ||
8369 | } | ||
8370 | } | ||
8331 | } | 8371 | } |
8332 | 8372 | ||
8333 | public LSL_String llGetInventoryCreator(string item) | 8373 | public LSL_String llGetInventoryCreator(string item) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index bd09534..b6fc0a4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1987,5 +1987,82 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1987 | 1987 | ||
1988 | return (int)pws; | 1988 | return (int)pws; |
1989 | } | 1989 | } |
1990 | public void osSetSpeed(string UUID, float SpeedModifier) | ||
1991 | { | ||
1992 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); | ||
1993 | m_host.AddScriptLPS(1); | ||
1994 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); | ||
1995 | avatar.SpeedModifier = SpeedModifier; | ||
1996 | } | ||
1997 | public void osKickAvatar(string FirstName,string SurName,string alert) | ||
1998 | { | ||
1999 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | ||
2000 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | ||
2001 | { | ||
2002 | foreach (ScenePresence presence in World.GetAvatars()) | ||
2003 | { | ||
2004 | if ((presence.Firstname == FirstName) && | ||
2005 | presence.Lastname == SurName) | ||
2006 | { | ||
2007 | // kick client... | ||
2008 | if (alert != null) | ||
2009 | presence.ControllingClient.Kick(alert); | ||
2010 | |||
2011 | // ...and close on our side | ||
2012 | presence.Scene.IncomingCloseAgent(presence.UUID); | ||
2013 | } | ||
2014 | } | ||
2015 | } | ||
2016 | } | ||
2017 | public void osCauseDamage(string avatar, double damage) | ||
2018 | { | ||
2019 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); | ||
2020 | m_host.AddScriptLPS(1); | ||
2021 | |||
2022 | UUID avatarId = new UUID(avatar); | ||
2023 | Vector3 pos = m_host.GetWorldPosition(); | ||
2024 | |||
2025 | ScenePresence presence = World.GetScenePresence(avatarId); | ||
2026 | if (presence != null) | ||
2027 | { | ||
2028 | LandData land = World.GetLandData((float)pos.X, (float)pos.Y); | ||
2029 | if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) | ||
2030 | { | ||
2031 | float health = presence.Health; | ||
2032 | health -= (float)damage; | ||
2033 | presence.setHealthWithUpdate(health); | ||
2034 | if (health <= 0) | ||
2035 | { | ||
2036 | float healthliveagain = 100; | ||
2037 | presence.ControllingClient.SendAgentAlertMessage("You died!", true); | ||
2038 | presence.setHealthWithUpdate(healthliveagain); | ||
2039 | presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); | ||
2040 | } | ||
2041 | } | ||
2042 | } | ||
2043 | } | ||
2044 | public void osCauseHealing(string avatar, double healing) | ||
2045 | { | ||
2046 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); | ||
2047 | m_host.AddScriptLPS(1); | ||
2048 | |||
2049 | UUID avatarId = new UUID(avatar); | ||
2050 | ScenePresence presence = World.GetScenePresence(avatarId); | ||
2051 | Vector3 pos = m_host.GetWorldPosition(); | ||
2052 | bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); | ||
2053 | if (result) | ||
2054 | { | ||
2055 | if (presence != null) | ||
2056 | { | ||
2057 | float health = presence.Health; | ||
2058 | health += (float)healing; | ||
2059 | if (health >= 100) | ||
2060 | { | ||
2061 | health = 100; | ||
2062 | } | ||
2063 | presence.setHealthWithUpdate(health); | ||
2064 | } | ||
2065 | } | ||
2066 | } | ||
1990 | } | 2067 | } |
1991 | } | 2068 | } |