aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorMelanie2010-01-03 21:43:39 +0000
committerMelanie2010-01-03 21:43:39 +0000
commit61ce884336f0cd20b7ecf85e9a6c8a54ad1f8d11 (patch)
tree7780b88dc26de91fe0b95a0a234a7f995adf5d22 /OpenSim/Region/ScriptEngine/Shared/Api
parentAdd virtual method StateChange to ScriptBaseClass (diff)
parentCause llSetText to send prim updates. (diff)
downloadopensim-SC_OLD-61ce884336f0cd20b7ecf85e9a6c8a54ad1f8d11.zip
opensim-SC_OLD-61ce884336f0cd20b7ecf85e9a6c8a54ad1f8d11.tar.gz
opensim-SC_OLD-61ce884336f0cd20b7ecf85e9a6c8a54ad1f8d11.tar.bz2
opensim-SC_OLD-61ce884336f0cd20b7ecf85e9a6c8a54ad1f8d11.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs158
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs46
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs12
5 files changed, 113 insertions, 112 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index df8de19..76c79da 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2813,7 +2813,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2813 { 2813 {
2814 m_host.AddScriptLPS(1); 2814 m_host.AddScriptLPS(1);
2815 m_host.CollisionFilter.Clear(); 2815 m_host.CollisionFilter.Clear();
2816 if(id != null) 2816 if (id != null)
2817 { 2817 {
2818 m_host.CollisionFilter.Add(accept,id); 2818 m_host.CollisionFilter.Add(accept,id);
2819 } 2819 }
@@ -3918,6 +3918,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3918 Util.Clip((float)color.z, 0.0f, 1.0f)); 3918 Util.Clip((float)color.z, 0.0f, 1.0f));
3919 m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); 3919 m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f));
3920 m_host.ParentGroup.HasGroupChanged = true; 3920 m_host.ParentGroup.HasGroupChanged = true;
3921 m_host.ParentGroup.ScheduleGroupForFullUpdate();
3921 } 3922 }
3922 3923
3923 public LSL_Float llWater(LSL_Vector offset) 3924 public LSL_Float llWater(LSL_Vector offset)
@@ -4341,7 +4342,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4341 public void llPassCollisions(int pass) 4342 public void llPassCollisions(int pass)
4342 { 4343 {
4343 m_host.AddScriptLPS(1); 4344 m_host.AddScriptLPS(1);
4344 if(pass == 0) 4345 if (pass == 0)
4345 { 4346 {
4346 m_host.ParentGroup.PassCollision = false; 4347 m_host.ParentGroup.PassCollision = false;
4347 } 4348 }
@@ -7556,7 +7557,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7556 // makes it more difficult to determine a child prim's actual inworld position). 7557 // makes it more difficult to determine a child prim's actual inworld position).
7557 if (part.ParentID != 0) 7558 if (part.ParentID != 0)
7558 v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition(); 7559 v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition();
7559 res.Add( v ); 7560 res.Add(v);
7560 break; 7561 break;
7561 7562
7562 case (int)ScriptBaseClass.PRIM_SIZE: 7563 case (int)ScriptBaseClass.PRIM_SIZE:
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}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 5e20f7d..f5921e1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
162 162
163 key osGetMapTexture(); 163 key osGetMapTexture();
164 key osGetRegionMapTexture(string regionName); 164 key osGetRegionMapTexture(string regionName);
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); 168 void osKickAvatar(string FirstName,string SurName,string alert);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index acff8fb..13b855f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -515,29 +515,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
515 public const string TEXTURE_PLYWOOD = "89556747-24cb-43ed-920b-47caed15465f"; 515 public const string TEXTURE_PLYWOOD = "89556747-24cb-43ed-920b-47caed15465f";
516 public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"; 516 public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903";
517 public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"; 517 public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361";
518 518
519 // Constants for osGetRegionStats 519 // Constants for osGetRegionStats
520 public const int STATS_TIME_DILATION = 0; 520 public const int STATS_TIME_DILATION = 0;
521 public const int STATS_SIM_FPS = 1; 521 public const int STATS_SIM_FPS = 1;
522 public const int STATS_PHYSICS_FPS = 2; 522 public const int STATS_PHYSICS_FPS = 2;
523 public const int STATS_AGENT_UPDATES = 3; 523 public const int STATS_AGENT_UPDATES = 3;
524 public const int STATS_ROOT_AGENTS = 4; 524 public const int STATS_ROOT_AGENTS = 4;
525 public const int STATS_CHILD_AGENTS = 5; 525 public const int STATS_CHILD_AGENTS = 5;
526 public const int STATS_TOTAL_PRIMS = 6; 526 public const int STATS_TOTAL_PRIMS = 6;
527 public const int STATS_ACTIVE_PRIMS = 7; 527 public const int STATS_ACTIVE_PRIMS = 7;
528 public const int STATS_FRAME_MS = 8; 528 public const int STATS_FRAME_MS = 8;
529 public const int STATS_NET_MS = 9; 529 public const int STATS_NET_MS = 9;
530 public const int STATS_PHYSICS_MS = 10; 530 public const int STATS_PHYSICS_MS = 10;
531 public const int STATS_IMAGE_MS = 11; 531 public const int STATS_IMAGE_MS = 11;
532 public const int STATS_OTHER_MS = 12; 532 public const int STATS_OTHER_MS = 12;
533 public const int STATS_IN_PACKETS_PER_SECOND = 13; 533 public const int STATS_IN_PACKETS_PER_SECOND = 13;
534 public const int STATS_OUT_PACKETS_PER_SECOND = 14; 534 public const int STATS_OUT_PACKETS_PER_SECOND = 14;
535 public const int STATS_UNACKED_BYTES = 15; 535 public const int STATS_UNACKED_BYTES = 15;
536 public const int STATS_AGENT_MS = 16; 536 public const int STATS_AGENT_MS = 16;
537 public const int STATS_PENDING_DOWNLOADS = 17; 537 public const int STATS_PENDING_DOWNLOADS = 17;
538 public const int STATS_PENDING_UPLOADS = 18; 538 public const int STATS_PENDING_UPLOADS = 18;
539 public const int STATS_ACTIVE_SCRIPTS = 19; 539 public const int STATS_ACTIVE_SCRIPTS = 19;
540 public const int STATS_SCRIPT_LPS = 20; 540 public const int STATS_SCRIPT_LPS = 20;
541 541
542 } 542 }
543} 543}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 2ec6226..3870af3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -632,11 +632,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
632 { 632 {
633 return m_OSSL_Functions.osGetRegionMapTexture(regionName); 633 return m_OSSL_Functions.osGetRegionMapTexture(regionName);
634 } 634 }
635 635
636 public LSL_List osGetRegionStats() 636 public LSL_List osGetRegionStats()
637 { 637 {
638 return m_OSSL_Functions.osGetRegionStats(); 638 return m_OSSL_Functions.osGetRegionStats();
639 } 639 }
640 640
641 /// <summary> 641 /// <summary>
642 /// Returns the amount of memory in use by the Simulator Daemon. 642 /// Returns the amount of memory in use by the Simulator Daemon.
@@ -649,7 +649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
649 } 649 }
650 public void osKickAvatar(string FirstName,string SurName,string alert) 650 public void osKickAvatar(string FirstName,string SurName,string alert)
651 { 651 {
652 m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert); 652 m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
653 } 653 }
654 public void osSetSpeed(string UUID, float SpeedModifier) 654 public void osSetSpeed(string UUID, float SpeedModifier)
655 { 655 {