add osKickAvatar(LSL_Key agentKey, string alert)

0.9.1.0-post-fixes
UbitUmarov 2019-02-20 02:06:25 +00:00
parent 98b6ba24b4
commit fdf5274c25
3 changed files with 53 additions and 22 deletions

View File

@ -3629,7 +3629,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
World.ForEachRootScenePresence(delegate(ScenePresence sp)
World.ForEachRootScenePresence(delegate (ScenePresence sp)
{
if (sp.Firstname == FirstName && sp.Lastname == SurName)
{
@ -3643,18 +3643,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
});
}
public LSL_Float osGetHealth(string avatar)
public void osKickAvatar(LSL_Key agentKey, string alert)
{
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
UUID id;
if (!UUID.TryParse(agentKey, out id) || id == UUID.Zero)
return;
ScenePresence sp = World.GetScenePresence(id);
if(sp == null)
return;
// kick client...
if (alert != null)
sp.ControllingClient.Kick(alert);
// ...and close on our side
sp.Scene.CloseAgent(id, false);
}
public LSL_Float osGetHealth(LSL_Key agentKey)
{
CheckThreatLevel(ThreatLevel.None, "osGetHealth");
LSL_Float health = new LSL_Float(-1);
ScenePresence presence = World.GetScenePresence(new UUID(avatar));
UUID id;
if (!UUID.TryParse(agentKey, out id) || id == UUID.Zero)
return health;
ScenePresence presence = World.GetScenePresence(id);
if (presence != null)
health = presence.Health;
return health;
}
public void osCauseDamage(string avatar, double damage)
public void osCauseDamage(LSL_Key avatar, LSL_Float damage)
{
CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
@ -3683,7 +3708,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void osCauseHealing(string avatar, double healing)
public void osCauseHealing(LSL_Key avatar, LSL_Float healing)
{
CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
@ -3704,7 +3729,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
presence.setHealthWithUpdate(health);
}
public void osSetHealth(string avatar, double health)
public void osSetHealth(LSL_Key avatar, LSL_Float health)
{
CheckThreatLevel(ThreatLevel.High, "osSetHealth");
@ -3722,7 +3747,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void osSetHealRate(string avatar, double healrate)
public void osSetHealRate(LSL_Key avatar, LSL_Float healrate)
{
CheckThreatLevel(ThreatLevel.High, "osSetHealRate");
@ -3737,7 +3762,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
presence.HealRate = (float)healrate;
}
public LSL_Float osGetHealRate(string avatar)
public LSL_Float osGetHealRate(LSL_Key avatar)
{
CheckThreatLevel(ThreatLevel.None, "osGetHealRate");

View File

@ -379,15 +379,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
int osGetSimulatorMemory();
int osGetSimulatorMemoryKB();
void osKickAvatar(string FirstName,string SurName,string alert);
void osKickAvatar(string FirstName, string SurName, string alert);
void osKickAvatar(LSL_Key agentId, string alert);
void osSetSpeed(string UUID, LSL_Float SpeedModifier);
void osSetOwnerSpeed(LSL_Float SpeedModifier);
LSL_Float osGetHealth(string avatar);
void osCauseHealing(string avatar, double healing);
void osSetHealth(string avatar, double health);
void osSetHealRate(string avatar, double health);
LSL_Float osGetHealRate(string avatar);
void osCauseDamage(string avatar, double damage);
LSL_Float osGetHealth(key agentId);
void osCauseHealing(key agentId, LSL_Float healing);
void osSetHealth(key agentId, LSL_Float health);
void osSetHealRate(key agentId, LSL_Float health);
LSL_Float osGetHealRate(key agentId);
void osCauseDamage(key avatar, LSL_Float damage);
void osForceOtherSit(string avatar);
void osForceOtherSit(string avatar, string target);
LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);

View File

@ -965,11 +965,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetSimulatorMemoryKB();
}
public void osKickAvatar(string FirstName,string SurName,string alert)
public void osKickAvatar(string FirstName, string SurName, string alert)
{
m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
}
public void osKickAvatar(LSL_Key agentId, string alert)
{
m_OSSL_Functions.osKickAvatar(agentId, alert);
}
public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
{
m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
@ -980,32 +985,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osSetOwnerSpeed(SpeedModifier);
}
public LSL_Float osGetHealth(string avatar)
public LSL_Float osGetHealth(key avatar)
{
return m_OSSL_Functions.osGetHealth(avatar);
}
public void osCauseDamage(string avatar, double damage)
public void osCauseDamage(key avatar, LSL_Float damage)
{
m_OSSL_Functions.osCauseDamage(avatar, damage);
}
public void osCauseHealing(string avatar, double healing)
public void osCauseHealing(key avatar, LSL_Float healing)
{
m_OSSL_Functions.osCauseHealing(avatar, healing);
}
public void osSetHealth(string avatar, double health)
public void osSetHealth(key avatar, LSL_Float health)
{
m_OSSL_Functions.osSetHealth(avatar, health);
}
public void osSetHealRate(string avatar, double health)
public void osSetHealRate(key avatar, LSL_Float health)
{
m_OSSL_Functions.osSetHealRate(avatar, health);
}
public LSL_Float osGetHealRate(string avatar)
public LSL_Float osGetHealRate(key avatar)
{
return m_OSSL_Functions.osGetHealRate(avatar);
}