diff options
author | Diva Canto | 2009-12-31 17:19:22 -0800 |
---|---|---|
committer | Diva Canto | 2009-12-31 17:19:22 -0800 |
commit | 1427572294ca1318647a68447fb2cc8ac17dd261 (patch) | |
tree | 7751d7428ef184af8c781a6436ba5693c6ff2a33 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | A lot more beef on the login service. The LLLoginResponse is a MONSTER! Almos... (diff) | |
parent | Merge branch 'master' into presence-refactor (diff) | |
download | opensim-SC_OLD-1427572294ca1318647a68447fb2cc8ac17dd261.zip opensim-SC_OLD-1427572294ca1318647a68447fb2cc8ac17dd261.tar.gz opensim-SC_OLD-1427572294ca1318647a68447fb2cc8ac17dd261.tar.bz2 opensim-SC_OLD-1427572294ca1318647a68447fb2cc8ac17dd261.tar.xz |
Merge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/opensim into presence-refactor
Diffstat (limited to '')
4 files changed, 114 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6102504..d242506 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 | |||
2752 | public void llCollisionFilter(string name, string id, int accept) | 2752 | public void llCollisionFilter(string name, string id, int accept) |
2753 | { | 2753 | { |
2754 | m_host.AddScriptLPS(1); | 2754 | m_host.AddScriptLPS(1); |
2755 | NotImplemented("llCollisionFilter"); | 2755 | m_host.CollisionFilter.Clear(); |
2756 | if(id != null) | ||
2757 | { | ||
2758 | m_host.CollisionFilter.Add(accept,id); | ||
2759 | } | ||
2760 | else | ||
2761 | { | ||
2762 | m_host.CollisionFilter.Add(accept,name); | ||
2763 | } | ||
2756 | } | 2764 | } |
2757 | 2765 | ||
2758 | public void llTakeControls(int controls, int accept, int pass_on) | 2766 | public void llTakeControls(int controls, int accept, int pass_on) |
@@ -4232,7 +4240,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4232 | public void llPassCollisions(int pass) | 4240 | public void llPassCollisions(int pass) |
4233 | { | 4241 | { |
4234 | m_host.AddScriptLPS(1); | 4242 | m_host.AddScriptLPS(1); |
4235 | NotImplemented("llPassCollisions"); | 4243 | if(pass == 0) |
4244 | { | ||
4245 | m_host.ParentGroup.PassCollision = false; | ||
4246 | } | ||
4247 | else | ||
4248 | { | ||
4249 | m_host.ParentGroup.PassCollision = true; | ||
4250 | } | ||
4236 | } | 4251 | } |
4237 | 4252 | ||
4238 | public LSL_String llGetScriptName() | 4253 | public LSL_String llGetScriptName() |
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 | |||
1983 | 1983 | ||
1984 | return (int)pws; | 1984 | return (int)pws; |
1985 | } | 1985 | } |
1986 | public void osSetSpeed(string UUID, float SpeedModifier) | ||
1987 | { | ||
1988 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); | ||
1989 | m_host.AddScriptLPS(1); | ||
1990 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); | ||
1991 | avatar.SpeedModifier = SpeedModifier; | ||
1992 | } | ||
1993 | public void osKickAvatar(string FirstName,string SurName,string alert) | ||
1994 | { | ||
1995 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | ||
1996 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | ||
1997 | { | ||
1998 | foreach (ScenePresence presence in World.GetAvatars()) | ||
1999 | { | ||
2000 | if ((presence.Firstname == FirstName) && | ||
2001 | presence.Lastname == SurName) | ||
2002 | { | ||
2003 | // kick client... | ||
2004 | if (alert != null) | ||
2005 | presence.ControllingClient.Kick(alert); | ||
2006 | |||
2007 | // ...and close on our side | ||
2008 | presence.Scene.IncomingCloseAgent(presence.UUID); | ||
2009 | } | ||
2010 | } | ||
2011 | } | ||
2012 | } | ||
2013 | public void osCauseDamage(string avatar, double damage) | ||
2014 | { | ||
2015 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); | ||
2016 | m_host.AddScriptLPS(1); | ||
2017 | |||
2018 | UUID avatarId = new UUID(avatar); | ||
2019 | Vector3 pos = m_host.GetWorldPosition(); | ||
2020 | |||
2021 | ScenePresence presence = World.GetScenePresence(avatarId); | ||
2022 | if (presence != null) | ||
2023 | { | ||
2024 | LandData land = World.GetLandData((float)pos.X, (float)pos.Y); | ||
2025 | if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) | ||
2026 | { | ||
2027 | float health = presence.Health; | ||
2028 | health -= (float)damage; | ||
2029 | presence.setHealthWithUpdate(health); | ||
2030 | if (health <= 0) | ||
2031 | { | ||
2032 | float healthliveagain = 100; | ||
2033 | presence.ControllingClient.SendAgentAlertMessage("You died!", true); | ||
2034 | presence.setHealthWithUpdate(healthliveagain); | ||
2035 | presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); | ||
2036 | } | ||
2037 | } | ||
2038 | } | ||
2039 | } | ||
2040 | public void osCauseHealing(string avatar, double healing) | ||
2041 | { | ||
2042 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); | ||
2043 | m_host.AddScriptLPS(1); | ||
2044 | |||
2045 | UUID avatarId = new UUID(avatar); | ||
2046 | ScenePresence presence = World.GetScenePresence(avatarId); | ||
2047 | Vector3 pos = m_host.GetWorldPosition(); | ||
2048 | bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); | ||
2049 | if (result) | ||
2050 | { | ||
2051 | if (presence != null) | ||
2052 | { | ||
2053 | float health = presence.Health; | ||
2054 | health += (float)healing; | ||
2055 | if (health >= 100) | ||
2056 | { | ||
2057 | health = 100; | ||
2058 | } | ||
2059 | presence.setHealthWithUpdate(health); | ||
2060 | } | ||
2061 | } | ||
2062 | } | ||
1986 | } | 2063 | } |
1987 | } | 2064 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 580c354..ac9405e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -165,5 +165,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
165 | LSL_List osGetRegionStats(); | 165 | LSL_List osGetRegionStats(); |
166 | 166 | ||
167 | int osGetSimulatorMemory(); | 167 | int osGetSimulatorMemory(); |
168 | void osKickAvatar(string FirstName,string SurName,string alert); | ||
169 | void osSetSpeed(string UUID, float SpeedModifier); | ||
170 | void osCauseHealing(string avatar, double healing); | ||
171 | void osCauseDamage(string avatar, double damage); | ||
168 | } | 172 | } |
169 | } | 173 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 2876ad6..2ec6226 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -647,5 +647,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
647 | { | 647 | { |
648 | return m_OSSL_Functions.osGetSimulatorMemory(); | 648 | return m_OSSL_Functions.osGetSimulatorMemory(); |
649 | } | 649 | } |
650 | public void osKickAvatar(string FirstName,string SurName,string alert) | ||
651 | { | ||
652 | m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert); | ||
653 | } | ||
654 | public void osSetSpeed(string UUID, float SpeedModifier) | ||
655 | { | ||
656 | m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); | ||
657 | } | ||
658 | public void osCauseDamage(string avatar, double damage) | ||
659 | { | ||
660 | m_OSSL_Functions.osCauseDamage(avatar, damage); | ||
661 | } | ||
662 | public void osCauseHealing(string avatar, double healing) | ||
663 | { | ||
664 | m_OSSL_Functions.osCauseHealing(avatar, healing); | ||
665 | } | ||
650 | } | 666 | } |
651 | } | 667 | } |