aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs57
1 files changed, 11 insertions, 46 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 9a07f6b..c3f2417 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -414,7 +414,10 @@ namespace OpenSim.Region.Environment.Scenes
414 414
415 protected virtual void RegisterDefaultSceneEvents() 415 protected virtual void RegisterDefaultSceneEvents()
416 { 416 {
417 m_eventManager.OnPermissionError += SendPermissionAlert; 417 IDialogModule dm = RequestModuleInterface<IDialogModule>();
418
419 if (dm != null)
420 m_eventManager.OnPermissionError += dm.SendAlertToUser;
418 } 421 }
419 422
420 public override string GetSimulatorVersion() 423 public override string GetSimulatorVersion()
@@ -3429,11 +3432,6 @@ namespace OpenSim.Region.Environment.Scenes
3429 3432
3430 #region Alert Methods 3433 #region Alert Methods
3431 3434
3432 private void SendPermissionAlert(UUID user, string reason)
3433 {
3434 SendAlertToUser(user, reason, false);
3435 }
3436
3437 /// <summary> 3435 /// <summary>
3438 /// Send an alert messages to all avatars in this scene. 3436 /// Send an alert messages to all avatars in this scene.
3439 /// </summary> 3437 /// </summary>
@@ -3450,23 +3448,6 @@ namespace OpenSim.Region.Environment.Scenes
3450 } 3448 }
3451 3449
3452 /// <summary> 3450 /// <summary>
3453 /// Send an alert message to a particular agent.
3454 /// </summary>
3455 /// <param name="agentID"></param>
3456 /// <param name="message"></param>
3457 /// <param name="modal"></param>
3458 public void SendAlertToUser(UUID agentID, string message, bool modal)
3459 {
3460 lock (m_scenePresences)
3461 {
3462 if (m_scenePresences.ContainsKey(agentID))
3463 {
3464 m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage(message, modal);
3465 }
3466 }
3467 }
3468
3469 /// <summary>
3470 /// Handle a request for admin rights 3451 /// Handle a request for admin rights
3471 /// </summary> 3452 /// </summary>
3472 /// <param name="agentID"></param> 3453 /// <param name="agentID"></param>
@@ -3626,27 +3607,6 @@ namespace OpenSim.Region.Environment.Scenes
3626 } 3607 }
3627 3608
3628 /// <summary> 3609 /// <summary>
3629 ///
3630 /// </summary>
3631 /// <param name="firstName"></param>
3632 /// <param name="lastName"></param>
3633 /// <param name="message"></param>
3634 /// <param name="modal"></param>
3635 public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
3636 {
3637 List<ScenePresence> presenceList = GetScenePresences();
3638
3639 foreach (ScenePresence presence in presenceList)
3640 {
3641 if (presence.Firstname == firstName && presence.Lastname == lastName)
3642 {
3643 presence.ControllingClient.SendAgentAlertMessage(message, modal);
3644 break;
3645 }
3646 }
3647 }
3648
3649 /// <summary>
3650 /// Handle an alert command from the console. 3610 /// Handle an alert command from the console.
3651 /// FIXME: Command parsing code really shouldn't be in this core Scene class. 3611 /// FIXME: Command parsing code really shouldn't be in this core Scene class.
3652 /// </summary> 3612 /// </summary>
@@ -3660,8 +3620,13 @@ namespace OpenSim.Region.Environment.Scenes
3660 } 3620 }
3661 else 3621 else
3662 { 3622 {
3663 string message = CombineParams(commandParams, 2); 3623 IDialogModule dm = RequestModuleInterface<IDialogModule>();
3664 SendAlertToUser(commandParams[0], commandParams[1], message, false); 3624
3625 if (dm != null)
3626 {
3627 string message = CombineParams(commandParams, 2);
3628 dm.SendAlertToUser(commandParams[0], commandParams[1], message, false);
3629 }
3665 } 3630 }
3666 } 3631 }
3667 3632