From af49acd6cca7fe3609f2febabb9fcde37af412bf Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 8 Jan 2009 19:28:10 +0000 Subject: * refactor: move url sending from scene to DialogModule --- .../Region/Environment/Interfaces/IDialogModule.cs | 15 +++++++++++++- .../Modules/Avatar/Dialog/DialogModule.cs | 9 +++++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 23 ---------------------- .../Shared/Api/Implementation/LSL_Api.cs | 9 ++++++--- 4 files changed, 29 insertions(+), 27 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs index 45c62bd..755aa27 100644 --- a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs @@ -92,7 +92,20 @@ namespace OpenSim.Region.Environment.Interfaces /// void SendDialogToUser( UUID avatarID, string objectName, UUID objectID, UUID ownerID, - string message, UUID textureID, int ch, string[] buttonlabels); + string message, UUID textureID, int ch, string[] buttonlabels); + + /// + /// Send a url to a particular user. + /// + /// + /// + /// + /// + /// + /// + /// + void SendUrlToUser( + UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url); /// /// Send a notification to all users in the scene. This notification should remain around until the diff --git a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs index 8fbe77f..4f8da9a 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs @@ -110,6 +110,15 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog if (sp != null) sp.ControllingClient.SendDialog(objectName, objectID, ownerID, message, textureID, ch, buttonlabels); } + + public void SendUrlToUser( + UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url) + { + ScenePresence sp = m_scene.GetScenePresence(avatarID); + + if (sp != null) + sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); + } public void SendNotificationToUsersInEstate( UUID fromAvatarID, string fromAvatarName, string message) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 655f15d..3b4b719 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -3354,29 +3354,6 @@ namespace OpenSim.Region.Environment.Scenes m_timePhase = phase; } - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public void SendUrlToUser(UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, - string message, string url) - { - lock (m_scenePresences) - { - if (m_scenePresences.ContainsKey(avatarID)) - { - m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, - message, url); - } - } - } - public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms) { m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f2a8474..34a3a26 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7799,9 +7799,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLoadURL(string avatar_id, string message, string url) { m_host.AddScriptLPS(1); - UUID avatarId = new UUID(avatar_id); - m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, - url); + + IDialogModule dm = World.RequestModuleInterface(); + if (null != dm) + dm.SendUrlToUser( + new UUID(avatar_id), m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, url); + // ScriptSleep(10000); } -- cgit v1.1