From 4822e79759307ac7293df98a19fd9c17def9f371 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Mon, 8 Sep 2008 02:24:30 +0000 Subject: Implement llEjectFromLand. --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 13 ++++++++++++- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index b2334be..ebf2a15 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -4507,7 +4507,18 @@ namespace OpenSim.Region.ScriptEngine.Common public void llEjectFromLand(string pest) { m_host.AddScriptLPS(1); - NotImplemented("llEjectFromLand"); + UUID agentId = new UUID(); + if (UUID.TryParse(pest, out agentId)) + { + ScenePresence presence = World.GetScenePresence(agentId); + if (presence != null) + { + // agent must be over the owners land + if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + World.TeleportClientHome(agentId, presence.ControllingClient); + } + } + // ScriptSleep(5000); } public LSL_Types.list llParseString2List(string str, LSL_Types.list separators, LSL_Types.list spacers) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1cde8d2..20dc46e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4408,7 +4408,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llEjectFromLand(string pest) { m_host.AddScriptLPS(1); - NotImplemented("llEjectFromLand"); + UUID agentId = new UUID(); + if (UUID.TryParse(pest, out agentId)) + { + ScenePresence presence = World.GetScenePresence(agentId); + if (presence != null) + { + // agent must be over the owners land + if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + World.TeleportClientHome(agentId, presence.ControllingClient); + } + } + // ScriptSleep(5000); } public LSL_Types.list llParseString2List(string str, LSL_Types.list separators, LSL_Types.list spacers) -- cgit v1.1