From 3d70dbd01df8c02dc75c66b470602e93665e91f6 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 5 Mar 2009 20:53:23 +0000 Subject: [PATCH] * refactor: move media and music url setting from scene into LandObject --- .../CoreModules/World/Land/LandObject.cs | 21 ++++++++++++++++++- .../Framework/Interfaces/ILandObject.cs | 13 +++++++++++- OpenSim/Region/Framework/Scenes/Scene.cs | 14 ------------- .../Shared/Api/Implementation/LSL_Api.cs | 8 ++++--- .../Shared/Api/Implementation/OSSL_Api.cs | 2 +- 5 files changed, 38 insertions(+), 20 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 67cb845cd1..e3e49ba6c4 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -116,7 +116,6 @@ namespace OpenSim.Region.CoreModules.World.Land return newLand; } - static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; @@ -926,5 +925,25 @@ namespace OpenSim.Region.CoreModules.World.Land #endregion #endregion + + /// + /// Set the media url for this land parcel + /// + /// + public void SetMediaUrl(string url) + { + landData.MediaURL = url; + sendLandUpdateToAvatarsOverMe(); + } + + /// + /// Set the music url for this land parcel + /// + /// + public void SetMusicUrl(string url) + { + landData.MusicURL = url; + sendLandUpdateToAvatarsOverMe(); + } } } diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs index 52cc6cf4d4..db3c9bff10 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs @@ -63,7 +63,6 @@ namespace OpenSim.Region.Framework.Interfaces void forceUpdateLandInfo(); void setLandBitmap(bool[,] bitmap); - bool[,] basicFullRegionLandBitmap(); bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); @@ -79,5 +78,17 @@ namespace OpenSim.Region.Framework.Interfaces void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); + + /// + /// Set the media url for this land parcel + /// + /// + void SetMediaUrl(string url); + + /// + /// Set the music url for this land parcel + /// + /// + void SetMusicUrl(string url); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index faa3bd7a18..7776215d41 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3048,20 +3048,6 @@ namespace OpenSim.Region.Framework.Scenes return LandChannel.GetLandObject((int)x, (int)y).landData; } - public void SetLandMusicURL(float x, float y, string url) - { - ILandObject land = LandChannel.GetLandObject(x, y); - land.landData.MusicURL = url; - land.sendLandUpdateToAvatarsOverMe(); - } - - public void SetLandMediaURL(float x, float y, string url) - { - ILandObject land = LandChannel.GetLandObject(x, y); - land.landData.MediaURL = url; - land.sendLandUpdateToAvatarsOverMe(); - } - public RegionInfo RequestClosestRegion(string name) { return m_sceneGridService.RequestClosestRegion(name); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 32ebc37620..5be967e8b6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6824,7 +6824,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { return; } - World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); + + World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).SetMusicUrl(url); + // ScriptSleep(2000); } @@ -8204,11 +8206,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence == null) { // we send to all - landData.MediaID = new UUID(texture); landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; + // do that one last, it will cause a ParcelPropertiesUpdate - World.SetLandMediaURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); + landObject.SetMediaUrl(url); // now send to all (non-child) agents List agents = World.GetAvatars(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 642b1f9796..17732e6fc2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -789,7 +789,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - World.SetLandMediaURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); + World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).SetMediaUrl(url); } public string osGetScriptEngineName()