diff options
author | Justin Clarke Casey | 2009-01-07 20:29:09 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-01-07 20:29:09 +0000 |
commit | 1aa9e6342829201e29290638fbb23baae8702193 (patch) | |
tree | f3bfd2b5cc94da63349119c8c9dd90f4a8cf7640 /OpenSim | |
parent | * minor: Remove mono compiler warnings from WindModule (diff) | |
download | opensim-SC_OLD-1aa9e6342829201e29290638fbb23baae8702193.zip opensim-SC_OLD-1aa9e6342829201e29290638fbb23baae8702193.tar.gz opensim-SC_OLD-1aa9e6342829201e29290638fbb23baae8702193.tar.bz2 opensim-SC_OLD-1aa9e6342829201e29290638fbb23baae8702193.tar.xz |
* Move general alert code to DialogModule.
* Should be a clean build - last failure looked like a mantis hiccup
Diffstat (limited to '')
5 files changed, 34 insertions, 31 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs index 15f0471..1e5c791 100644 --- a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs | |||
@@ -54,6 +54,12 @@ namespace OpenSim.Region.Environment.Interfaces | |||
54 | /// <param name="lastName"></param> | 54 | /// <param name="lastName"></param> |
55 | /// <param name="message"></param> | 55 | /// <param name="message"></param> |
56 | /// <param name="modal"></param> | 56 | /// <param name="modal"></param> |
57 | void SendAlertToUser(string firstName, string lastName, string message, bool modal); | 57 | void SendAlertToUser(string firstName, string lastName, string message, bool modal); |
58 | |||
59 | /// <summary> | ||
60 | /// Send an alert messages to all avatars in the scene. | ||
61 | /// </summary> | ||
62 | /// <param name="message"></param> | ||
63 | void SendGeneralAlert(string message); | ||
58 | } | 64 | } |
59 | } | 65 | } |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs index e036c73..14a05ae 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs | |||
@@ -78,6 +78,21 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog | |||
78 | break; | 78 | break; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | ||
82 | |||
83 | /// <summary> | ||
84 | /// Send an alert messages to all avatars in this scene. | ||
85 | /// </summary> | ||
86 | /// <param name="message"></param> | ||
87 | public void SendGeneralAlert(string message) | ||
88 | { | ||
89 | List<ScenePresence> presenceList = m_scene.GetScenePresences(); | ||
90 | |||
91 | foreach (ScenePresence presence in presenceList) | ||
92 | { | ||
93 | if (!presence.IsChildAgent) | ||
94 | presence.ControllingClient.SendAlertMessage(message); | ||
95 | } | ||
81 | } | 96 | } |
82 | } | 97 | } |
83 | } | 98 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c3f2417..43354e6 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -148,6 +148,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
148 | protected IRegionSerialiserModule m_serialiser; | 148 | protected IRegionSerialiserModule m_serialiser; |
149 | protected IInterregionCommsOut m_interregionCommsOut; | 149 | protected IInterregionCommsOut m_interregionCommsOut; |
150 | protected IInterregionCommsIn m_interregionCommsIn; | 150 | protected IInterregionCommsIn m_interregionCommsIn; |
151 | protected IDialogModule m_dialogModule; | ||
151 | 152 | ||
152 | // Central Update Loop | 153 | // Central Update Loop |
153 | 154 | ||
@@ -549,7 +550,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
549 | if (seconds < 15) | 550 | if (seconds < 15) |
550 | { | 551 | { |
551 | m_restartTimer.Stop(); | 552 | m_restartTimer.Stop(); |
552 | SendGeneralAlert("Restart Aborted"); | 553 | m_dialogModule.SendGeneralAlert("Restart Aborted"); |
553 | } | 554 | } |
554 | else | 555 | else |
555 | { | 556 | { |
@@ -775,6 +776,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
775 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); | 776 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); |
776 | m_interregionCommsOut = RequestModuleInterface<IInterregionCommsOut>(); | 777 | m_interregionCommsOut = RequestModuleInterface<IInterregionCommsOut>(); |
777 | m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>(); | 778 | m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>(); |
779 | m_dialogModule = RequestModuleInterface<IDialogModule>(); | ||
778 | } | 780 | } |
779 | 781 | ||
780 | #endregion | 782 | #endregion |
@@ -3428,26 +3430,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
3428 | 3430 | ||
3429 | #endregion | 3431 | #endregion |
3430 | 3432 | ||
3431 | #region Console Commands | ||
3432 | |||
3433 | #region Alert Methods | 3433 | #region Alert Methods |
3434 | 3434 | ||
3435 | /// <summary> | 3435 | /// <summary> |
3436 | /// Send an alert messages to all avatars in this scene. | ||
3437 | /// </summary> | ||
3438 | /// <param name="message"></param> | ||
3439 | public void SendGeneralAlert(string message) | ||
3440 | { | ||
3441 | List<ScenePresence> presenceList = GetScenePresences(); | ||
3442 | |||
3443 | foreach (ScenePresence presence in presenceList) | ||
3444 | { | ||
3445 | if (!presence.IsChildAgent) | ||
3446 | presence.ControllingClient.SendAlertMessage(message); | ||
3447 | } | ||
3448 | } | ||
3449 | |||
3450 | /// <summary> | ||
3451 | /// Handle a request for admin rights | 3436 | /// Handle a request for admin rights |
3452 | /// </summary> | 3437 | /// </summary> |
3453 | /// <param name="agentID"></param> | 3438 | /// <param name="agentID"></param> |
@@ -3616,17 +3601,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
3616 | if (commandParams[0] == "general") | 3601 | if (commandParams[0] == "general") |
3617 | { | 3602 | { |
3618 | string message = CombineParams(commandParams, 1); | 3603 | string message = CombineParams(commandParams, 1); |
3619 | SendGeneralAlert(message); | 3604 | m_dialogModule.SendGeneralAlert(message); |
3620 | } | 3605 | } |
3621 | else | 3606 | else |
3622 | { | 3607 | { |
3623 | IDialogModule dm = RequestModuleInterface<IDialogModule>(); | 3608 | string message = CombineParams(commandParams, 2); |
3624 | 3609 | m_dialogModule.SendAlertToUser(commandParams[0], commandParams[1], message, false); | |
3625 | if (dm != null) | ||
3626 | { | ||
3627 | string message = CombineParams(commandParams, 2); | ||
3628 | dm.SendAlertToUser(commandParams[0], commandParams[1], message, false); | ||
3629 | } | ||
3630 | } | 3610 | } |
3631 | } | 3611 | } |
3632 | 3612 | ||
@@ -3727,8 +3707,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
3727 | } | 3707 | } |
3728 | } | 3708 | } |
3729 | 3709 | ||
3730 | #endregion | ||
3731 | |||
3732 | #region Script Handling Methods | 3710 | #region Script Handling Methods |
3733 | 3711 | ||
3734 | /// <summary> | 3712 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index d585b48..5541454 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs | |||
@@ -310,7 +310,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
310 | 310 | ||
311 | public void SendGeneralMessage(string msg) | 311 | public void SendGeneralMessage(string msg) |
312 | { | 312 | { |
313 | ForEachCurrentScene(delegate(Scene scene) { scene.SendGeneralAlert(msg); }); | 313 | ForEachCurrentScene(delegate(Scene scene) { scene.HandleAlertCommand(new string[] { "general", msg }); }); |
314 | } | 314 | } |
315 | 315 | ||
316 | public bool TrySetCurrentScene(string regionName) | 316 | public bool TrySetCurrentScene(string regionName) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 8a380ad..a9ee88a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -329,7 +329,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
329 | CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice"); | 329 | CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice"); |
330 | 330 | ||
331 | m_host.AddScriptLPS(1); | 331 | m_host.AddScriptLPS(1); |
332 | World.SendGeneralAlert(msg); | 332 | |
333 | IDialogModule dm = World.RequestModuleInterface<IDialogModule>(); | ||
334 | |||
335 | if (dm != null) | ||
336 | dm.SendGeneralAlert(msg); | ||
333 | } | 337 | } |
334 | 338 | ||
335 | public void osSetRot(UUID target, Quaternion rotation) | 339 | public void osSetRot(UUID target, Quaternion rotation) |