aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs41
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs15
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs19
3 files changed, 53 insertions, 22 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 9d5f670..e114a53 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3629,7 +3629,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3629 { 3629 {
3630 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); 3630 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
3631 3631
3632 World.ForEachRootScenePresence(delegate(ScenePresence sp) 3632 World.ForEachRootScenePresence(delegate (ScenePresence sp)
3633 { 3633 {
3634 if (sp.Firstname == FirstName && sp.Lastname == SurName) 3634 if (sp.Firstname == FirstName && sp.Lastname == SurName)
3635 { 3635 {
@@ -3643,18 +3643,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3643 }); 3643 });
3644 } 3644 }
3645 3645
3646 public LSL_Float osGetHealth(string avatar) 3646 public void osKickAvatar(LSL_Key agentKey, string alert)
3647 {
3648 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
3649
3650 UUID id;
3651 if (!UUID.TryParse(agentKey, out id) || id == UUID.Zero)
3652 return;
3653
3654 ScenePresence sp = World.GetScenePresence(id);
3655 if(sp == null)
3656 return;
3657
3658 // kick client...
3659 if (alert != null)
3660 sp.ControllingClient.Kick(alert);
3661
3662 // ...and close on our side
3663 sp.Scene.CloseAgent(id, false);
3664 }
3665
3666 public LSL_Float osGetHealth(LSL_Key agentKey)
3647 { 3667 {
3648 CheckThreatLevel(ThreatLevel.None, "osGetHealth"); 3668 CheckThreatLevel(ThreatLevel.None, "osGetHealth");
3649 3669
3650 LSL_Float health = new LSL_Float(-1); 3670 LSL_Float health = new LSL_Float(-1);
3651 ScenePresence presence = World.GetScenePresence(new UUID(avatar)); 3671
3672 UUID id;
3673 if (!UUID.TryParse(agentKey, out id) || id == UUID.Zero)
3674 return health;
3675
3676 ScenePresence presence = World.GetScenePresence(id);
3652 if (presence != null) 3677 if (presence != null)
3653 health = presence.Health; 3678 health = presence.Health;
3654 return health; 3679 return health;
3655 } 3680 }
3656 3681
3657 public void osCauseDamage(string avatar, double damage) 3682 public void osCauseDamage(LSL_Key avatar, LSL_Float damage)
3658 { 3683 {
3659 CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); 3684 CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
3660 3685
@@ -3683,7 +3708,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3683 } 3708 }
3684 } 3709 }
3685 3710
3686 public void osCauseHealing(string avatar, double healing) 3711 public void osCauseHealing(LSL_Key avatar, LSL_Float healing)
3687 { 3712 {
3688 CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); 3713 CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
3689 3714
@@ -3704,7 +3729,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3704 presence.setHealthWithUpdate(health); 3729 presence.setHealthWithUpdate(health);
3705 } 3730 }
3706 3731
3707 public void osSetHealth(string avatar, double health) 3732 public void osSetHealth(LSL_Key avatar, LSL_Float health)
3708 { 3733 {
3709 CheckThreatLevel(ThreatLevel.High, "osSetHealth"); 3734 CheckThreatLevel(ThreatLevel.High, "osSetHealth");
3710 3735
@@ -3722,7 +3747,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3722 } 3747 }
3723 } 3748 }
3724 3749
3725 public void osSetHealRate(string avatar, double healrate) 3750 public void osSetHealRate(LSL_Key avatar, LSL_Float healrate)
3726 { 3751 {
3727 CheckThreatLevel(ThreatLevel.High, "osSetHealRate"); 3752 CheckThreatLevel(ThreatLevel.High, "osSetHealRate");
3728 3753
@@ -3737,7 +3762,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3737 presence.HealRate = (float)healrate; 3762 presence.HealRate = (float)healrate;
3738 } 3763 }
3739 3764
3740 public LSL_Float osGetHealRate(string avatar) 3765 public LSL_Float osGetHealRate(LSL_Key avatar)
3741 { 3766 {
3742 CheckThreatLevel(ThreatLevel.None, "osGetHealRate"); 3767 CheckThreatLevel(ThreatLevel.None, "osGetHealRate");
3743 3768
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 12e8103..67c0261 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -379,15 +379,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
379 379
380 int osGetSimulatorMemory(); 380 int osGetSimulatorMemory();
381 int osGetSimulatorMemoryKB(); 381 int osGetSimulatorMemoryKB();
382 void osKickAvatar(string FirstName,string SurName,string alert); 382 void osKickAvatar(string FirstName, string SurName, string alert);
383 void osKickAvatar(LSL_Key agentId, string alert);
383 void osSetSpeed(string UUID, LSL_Float SpeedModifier); 384 void osSetSpeed(string UUID, LSL_Float SpeedModifier);
384 void osSetOwnerSpeed(LSL_Float SpeedModifier); 385 void osSetOwnerSpeed(LSL_Float SpeedModifier);
385 LSL_Float osGetHealth(string avatar); 386 LSL_Float osGetHealth(key agentId);
386 void osCauseHealing(string avatar, double healing); 387 void osCauseHealing(key agentId, LSL_Float healing);
387 void osSetHealth(string avatar, double health); 388 void osSetHealth(key agentId, LSL_Float health);
388 void osSetHealRate(string avatar, double health); 389 void osSetHealRate(key agentId, LSL_Float health);
389 LSL_Float osGetHealRate(string avatar); 390 LSL_Float osGetHealRate(key agentId);
390 void osCauseDamage(string avatar, double damage); 391 void osCauseDamage(key avatar, LSL_Float damage);
391 void osForceOtherSit(string avatar); 392 void osForceOtherSit(string avatar);
392 void osForceOtherSit(string avatar, string target); 393 void osForceOtherSit(string avatar, string target);
393 LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); 394 LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 94df1ea..76d334b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -965,11 +965,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
965 return m_OSSL_Functions.osGetSimulatorMemoryKB(); 965 return m_OSSL_Functions.osGetSimulatorMemoryKB();
966 } 966 }
967 967
968 public void osKickAvatar(string FirstName,string SurName,string alert) 968 public void osKickAvatar(string FirstName, string SurName, string alert)
969 { 969 {
970 m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert); 970 m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
971 } 971 }
972 972
973 public void osKickAvatar(LSL_Key agentId, string alert)
974 {
975 m_OSSL_Functions.osKickAvatar(agentId, alert);
976 }
977
973 public void osSetSpeed(string UUID, LSL_Float SpeedModifier) 978 public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
974 { 979 {
975 m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); 980 m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
@@ -980,32 +985,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
980 m_OSSL_Functions.osSetOwnerSpeed(SpeedModifier); 985 m_OSSL_Functions.osSetOwnerSpeed(SpeedModifier);
981 } 986 }
982 987
983 public LSL_Float osGetHealth(string avatar) 988 public LSL_Float osGetHealth(key avatar)
984 { 989 {
985 return m_OSSL_Functions.osGetHealth(avatar); 990 return m_OSSL_Functions.osGetHealth(avatar);
986 } 991 }
987 992
988 public void osCauseDamage(string avatar, double damage) 993 public void osCauseDamage(key avatar, LSL_Float damage)
989 { 994 {
990 m_OSSL_Functions.osCauseDamage(avatar, damage); 995 m_OSSL_Functions.osCauseDamage(avatar, damage);
991 } 996 }
992 997
993 public void osCauseHealing(string avatar, double healing) 998 public void osCauseHealing(key avatar, LSL_Float healing)
994 { 999 {
995 m_OSSL_Functions.osCauseHealing(avatar, healing); 1000 m_OSSL_Functions.osCauseHealing(avatar, healing);
996 } 1001 }
997 1002
998 public void osSetHealth(string avatar, double health) 1003 public void osSetHealth(key avatar, LSL_Float health)
999 { 1004 {
1000 m_OSSL_Functions.osSetHealth(avatar, health); 1005 m_OSSL_Functions.osSetHealth(avatar, health);
1001 } 1006 }
1002 1007
1003 public void osSetHealRate(string avatar, double health) 1008 public void osSetHealRate(key avatar, LSL_Float health)
1004 { 1009 {
1005 m_OSSL_Functions.osSetHealRate(avatar, health); 1010 m_OSSL_Functions.osSetHealRate(avatar, health);
1006 } 1011 }
1007 1012
1008 public LSL_Float osGetHealRate(string avatar) 1013 public LSL_Float osGetHealRate(key avatar)
1009 { 1014 {
1010 return m_OSSL_Functions.osGetHealRate(avatar); 1015 return m_OSSL_Functions.osGetHealRate(avatar);
1011 } 1016 }