From b97a51d7d0dc0946e5bf5e42c69a40a68af4d01b Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 7 Jan 2009 20:46:28 +0000
Subject: * refactor: Make some direct IClientAPI calls go through the dialog
module instead
---
OpenSim/Region/Environment/Interfaces/IDialogModule.cs | 16 ++++++++++++++++
.../Environment/Modules/Avatar/Dialog/DialogModule.cs | 12 +++++++++++-
OpenSim/Region/Environment/Scenes/Scene.cs | 18 +++++++++---------
3 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs
index 1e5c791..a296c5a 100644
--- a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs
+++ b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs
@@ -27,6 +27,7 @@
using System;
using OpenMetaverse;
+using OpenSim.Framework;
namespace OpenSim.Region.Environment.Interfaces
{
@@ -35,6 +36,21 @@ namespace OpenSim.Region.Environment.Interfaces
///
/// Send a non-modal alert message to a particular user.
///
+ ///
+ ///
+ void SendAlertToUser(IClientAPI client, string message);
+
+ ///
+ /// Send an alert message to a particular user.
+ ///
+ ///
+ ///
+ ///
+ void SendAlertToUser(IClientAPI client, string message, bool modal);
+
+ ///
+ /// Send a non-modal alert message to a particular user.
+ ///
///
///
void SendAlertToUser(UUID agentID, string message);
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs
index 14a05ae..430968d 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs
@@ -53,6 +53,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog
public string Name { get { return "Dialog Module"; } }
public bool IsSharedModule { get { return false; } }
+ public void SendAlertToUser(IClientAPI client, string message)
+ {
+ SendAlertToUser(client, message, false);
+ }
+
+ public void SendAlertToUser(IClientAPI client, string message, bool modal)
+ {
+ client.SendAgentAlertMessage(message, modal);
+ }
+
public void SendAlertToUser(UUID agentID, string message)
{
SendAlertToUser(agentID, message, false);
@@ -64,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog
if (sp != null)
sp.ControllingClient.SendAgentAlertMessage(message, modal);
- }
+ }
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
{
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 43354e6..dea265e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2506,11 +2506,11 @@ namespace OpenSim.Region.Environment.Scenes
CommsManager.UserService.UpdateUserProfile(UserProfile);
// FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
- remoteClient.SendAgentAlertMessage("Home position set.",false);
+ m_dialogModule.SendAlertToUser(remoteClient, "Home position set.");
}
else
{
- remoteClient.SendAgentAlertMessage("Set Home request Failed",false);
+ m_dialogModule.SendAlertToUser(remoteClient, "Set Home request Failed.");
}
}
@@ -3469,7 +3469,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage("Request for god powers denied", false);
+ m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied");
}
}
}
@@ -3567,8 +3567,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- if (m_scenePresences.ContainsKey(godID))
- m_scenePresences[godID].ControllingClient.SendAgentAlertMessage("Kick request denied", false);
+ m_dialogModule.SendAlertToUser(godID, "Kick request denied");
}
}
}
@@ -4209,7 +4208,7 @@ namespace OpenSim.Region.Environment.Scenes
if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
{
- remoteClient.SendAgentAlertMessage("This item doesn't appear to be for sale", false);
+ m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
return false;
}
@@ -4250,7 +4249,7 @@ namespace OpenSim.Region.Environment.Scenes
if ((perms & (uint)PermissionMask.Transfer) == 0)
{
- remoteClient.SendAgentAlertMessage("This item doesn't appear to be for sale", false);
+ m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
return false;
}
@@ -4296,7 +4295,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- remoteClient.SendAgentAlertMessage("Cannot buy now. Your inventory is unavailable", false);
+ m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable");
return false;
}
break;
@@ -4319,7 +4318,8 @@ namespace OpenSim.Region.Environment.Scenes
if (!okToSell)
{
- remoteClient.SendAgentAlertMessage("This item's inventory doesn't appear to be for sale", false);
+ m_dialogModule.SendAlertToUser(
+ remoteClient, "This item's inventory doesn't appear to be for sale");
return false;
}
--
cgit v1.1