aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs158
1 files changed, 79 insertions, 79 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b6fc0a4..a5be251 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1952,7 +1952,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1952 1952
1953 return key.ToString(); 1953 return key.ToString();
1954 } 1954 }
1955 1955
1956 /// <summary> 1956 /// <summary>
1957 /// Return information regarding various simulator statistics (sim fps, physics fps, time 1957 /// Return information regarding various simulator statistics (sim fps, physics fps, time
1958 /// dilation, total number of prims, total number of active scripts, script lps, various 1958 /// dilation, total number of prims, total number of active scripts, script lps, various
@@ -1960,19 +1960,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1960 /// client's Statistics Bar (Ctrl-Shift-1) 1960 /// client's Statistics Bar (Ctrl-Shift-1)
1961 /// </summary> 1961 /// </summary>
1962 /// <returns>List of floats</returns> 1962 /// <returns>List of floats</returns>
1963 public LSL_List osGetRegionStats() 1963 public LSL_List osGetRegionStats()
1964 { 1964 {
1965 CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); 1965 CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats");
1966 m_host.AddScriptLPS(1); 1966 m_host.AddScriptLPS(1);
1967 LSL_List ret = new LSL_List(); 1967 LSL_List ret = new LSL_List();
1968 float[] stats = World.SimulatorStats; 1968 float[] stats = World.SimulatorStats;
1969 1969
1970 for (int i = 0; i < 21; i++) 1970 for (int i = 0; i < 21; i++)
1971 { 1971 {
1972 ret.Add(new LSL_Float( stats[i] )); 1972 ret.Add(new LSL_Float(stats[i]));
1973 } 1973 }
1974 return ret; 1974 return ret;
1975 } 1975 }
1976 1976
1977 public int osGetSimulatorMemory() 1977 public int osGetSimulatorMemory()
1978 { 1978 {
@@ -1988,81 +1988,81 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1988 return (int)pws; 1988 return (int)pws;
1989 } 1989 }
1990 public void osSetSpeed(string UUID, float SpeedModifier) 1990 public void osSetSpeed(string UUID, float SpeedModifier)
1991 { 1991 {
1992 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 1992 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
1993 m_host.AddScriptLPS(1); 1993 m_host.AddScriptLPS(1);
1994 ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); 1994 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
1995 avatar.SpeedModifier = SpeedModifier; 1995 avatar.SpeedModifier = SpeedModifier;
1996 } 1996 }
1997 public void osKickAvatar(string FirstName,string SurName,string alert) 1997 public void osKickAvatar(string FirstName,string SurName,string alert)
1998 { 1998 {
1999 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); 1999 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
2000 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) 2000 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
2001 { 2001 {
2002 foreach (ScenePresence presence in World.GetAvatars()) 2002 foreach (ScenePresence presence in World.GetAvatars())
2003 { 2003 {
2004 if ((presence.Firstname == FirstName) && 2004 if ((presence.Firstname == FirstName) &&
2005 presence.Lastname == SurName) 2005 presence.Lastname == SurName)
2006 { 2006 {
2007 // kick client... 2007 // kick client...
2008 if (alert != null) 2008 if (alert != null)
2009 presence.ControllingClient.Kick(alert); 2009 presence.ControllingClient.Kick(alert);
2010 2010
2011 // ...and close on our side 2011 // ...and close on our side
2012 presence.Scene.IncomingCloseAgent(presence.UUID); 2012 presence.Scene.IncomingCloseAgent(presence.UUID);
2013 } 2013 }
2014 } 2014 }
2015 } 2015 }
2016 } 2016 }
2017 public void osCauseDamage(string avatar, double damage) 2017 public void osCauseDamage(string avatar, double damage)
2018 { 2018 {
2019 CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); 2019 CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
2020 m_host.AddScriptLPS(1); 2020 m_host.AddScriptLPS(1);
2021 2021
2022 UUID avatarId = new UUID(avatar); 2022 UUID avatarId = new UUID(avatar);
2023 Vector3 pos = m_host.GetWorldPosition(); 2023 Vector3 pos = m_host.GetWorldPosition();
2024 2024
2025 ScenePresence presence = World.GetScenePresence(avatarId); 2025 ScenePresence presence = World.GetScenePresence(avatarId);
2026 if (presence != null) 2026 if (presence != null)
2027 { 2027 {
2028 LandData land = World.GetLandData((float)pos.X, (float)pos.Y); 2028 LandData land = World.GetLandData((float)pos.X, (float)pos.Y);
2029 if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) 2029 if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage)
2030 { 2030 {
2031 float health = presence.Health; 2031 float health = presence.Health;
2032 health -= (float)damage; 2032 health -= (float)damage;
2033 presence.setHealthWithUpdate(health); 2033 presence.setHealthWithUpdate(health);
2034 if (health <= 0) 2034 if (health <= 0)
2035 { 2035 {
2036 float healthliveagain = 100; 2036 float healthliveagain = 100;
2037 presence.ControllingClient.SendAgentAlertMessage("You died!", true); 2037 presence.ControllingClient.SendAgentAlertMessage("You died!", true);
2038 presence.setHealthWithUpdate(healthliveagain); 2038 presence.setHealthWithUpdate(healthliveagain);
2039 presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); 2039 presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient);
2040 } 2040 }
2041 } 2041 }
2042 } 2042 }
2043 } 2043 }
2044 public void osCauseHealing(string avatar, double healing) 2044 public void osCauseHealing(string avatar, double healing)
2045 { 2045 {
2046 CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); 2046 CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
2047 m_host.AddScriptLPS(1); 2047 m_host.AddScriptLPS(1);
2048 2048
2049 UUID avatarId = new UUID(avatar); 2049 UUID avatarId = new UUID(avatar);
2050 ScenePresence presence = World.GetScenePresence(avatarId); 2050 ScenePresence presence = World.GetScenePresence(avatarId);
2051 Vector3 pos = m_host.GetWorldPosition(); 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)); 2052 bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z));
2053 if (result) 2053 if (result)
2054 { 2054 {
2055 if (presence != null) 2055 if (presence != null)
2056 { 2056 {
2057 float health = presence.Health; 2057 float health = presence.Health;
2058 health += (float)healing; 2058 health += (float)healing;
2059 if (health >= 100) 2059 if (health >= 100)
2060 { 2060 {
2061 health = 100; 2061 health = 100;
2062 } 2062 }
2063 presence.setHealthWithUpdate(health); 2063 presence.setHealthWithUpdate(health);
2064 } 2064 }
2065 } 2065 }
2066 } 2066 }
2067 } 2067 }
2068} 2068}