diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index aa0218bac2..5cb9724939 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3019,19 +3019,6 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerOnPluginConsole(args); } - public UUID GetLandOwner(float x, float y) - { - ILandObject land = LandChannel.GetLandObject(x, y); - if (land == null) - { - return UUID.Zero; - } - else - { - return land.landData.OwnerID; - } - } - public LandData GetLandData(float x, float y) { return LandChannel.GetLandObject(x, y).landData; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fad456f11b..517453e211 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3706,8 +3706,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api 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)) + // agent must be over the owners land + if (m_host.OwnerID + == World.LandChannel.GetLandObject( + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) { presence.ControllingClient.SendTeleportLocationStart(); World.TeleportClientHome(agentId, presence.ControllingClient); @@ -5182,7 +5184,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence != null) { // agent must be over the owners land - if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + if (m_host.OwnerID + == World.LandChannel.GetLandObject( + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) World.TeleportClientHome(agentId, presence.ControllingClient); } } @@ -5265,29 +5269,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key = new UUID(); - if (UUID.TryParse(id,out key)) + if (UUID.TryParse(id, out key)) { - ScenePresence presence = World.GetScenePresence(key); + ScenePresence presence = World.GetScenePresence(key); if (presence != null) // object is an avatar { - if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + if (m_host.OwnerID + == World.LandChannel.GetLandObject( + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) return 1; } else // object is not an avatar { SceneObjectPart obj = World.GetSceneObjectPart(key); if (obj != null) - if (m_host.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y)) + if (m_host.OwnerID + == World.LandChannel.GetLandObject( + obj.AbsolutePosition.X, obj.AbsolutePosition.Y).landData.OwnerID) return 1; } } + return 0; } public LSL_String llGetLandOwnerAt(LSL_Vector pos) { m_host.AddScriptLPS(1); - return World.GetLandOwner((float)pos.x, (float)pos.y).ToString(); + return World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).landData.OwnerID.ToString(); } /// @@ -6812,17 +6821,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetParcelMusicURL(string url) { m_host.AddScriptLPS(1); - UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (landowner == UUID.Zero) - { - return; - } - if (landowner != m_host.ObjectOwner) - { - return; - } - World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).SetMusicUrl(url); + ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + + if (land.landData.OwnerID != m_host.ObjectOwner) + return; + + land.SetMusicUrl(url); // ScriptSleep(2000); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 17732e6fc2..e96dd2643a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -503,12 +503,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence != null) { // agent must be over owners land to avoid abuse - if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + if (m_host.OwnerID + == World.LandChannel.GetLandObject( + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) { presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionName, new Vector3((float)position.x, (float)position.y, (float)position.z), new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); + ScriptSleep(5000); } } @@ -532,7 +535,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence != null) { // agent must be over owners land to avoid abuse - if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + if (m_host.OwnerID + == World.LandChannel.GetLandObject( + presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) { presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionHandle, @@ -777,19 +782,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL"); m_host.AddScriptLPS(1); - UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + + ILandObject land + = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (landowner == UUID.Zero) - { + if (land.landData.OwnerID != m_host.ObjectOwner) return; - } - if (landowner != m_host.ObjectOwner) - { - return; - } - - World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).SetMediaUrl(url); + land.SetMediaUrl(url); } public string osGetScriptEngineName()