aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-08 18:50:46 +0000
committerJustin Clarke Casey2009-01-08 18:50:46 +0000
commit17f783457b8dbd182f8184ef77c72d57d7c8da8b (patch)
tree2ab67061f34d29f724ee13ebec4a9ca884cdd5da
parentUpdate svn properties, minor formatting cleanup. (diff)
downloadopensim-SC-17f783457b8dbd182f8184ef77c72d57d7c8da8b.zip
opensim-SC-17f783457b8dbd182f8184ef77c72d57d7c8da8b.tar.gz
opensim-SC-17f783457b8dbd182f8184ef77c72d57d7c8da8b.tar.bz2
opensim-SC-17f783457b8dbd182f8184ef77c72d57d7c8da8b.tar.xz
* refactor: move code for sending a message to all users in a region to the DialogModule
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs2
-rw-r--r--OpenSim/Region/Environment/Interfaces/IDialogModule.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs18
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs36
5 files changed, 42 insertions, 41 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6742948..7398c70 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -6056,9 +6056,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6056 (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter)), 6056 (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter)),
6057 Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[6].Parameter)), 6057 Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[6].Parameter)),
6058 convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter)); 6058 convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter));
6059
6060 } 6059 }
6061
6062 break; 6060 break;
6063// case "texturebase": 6061// case "texturebase":
6064// if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) 6062// if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false))
diff --git a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs
index a296c5a..4a648d6 100644
--- a/OpenSim/Region/Environment/Interfaces/IDialogModule.cs
+++ b/OpenSim/Region/Environment/Interfaces/IDialogModule.cs
@@ -34,7 +34,8 @@ namespace OpenSim.Region.Environment.Interfaces
34 public interface IDialogModule 34 public interface IDialogModule
35 { 35 {
36 /// <summary> 36 /// <summary>
37 /// Send a non-modal alert message to a particular user. 37 /// Send a non-modal alert message to a particular user. This can disappear from the user's view after a
38 /// small interval.
38 /// </summary> 39 /// </summary>
39 /// <param name="client"></param> 40 /// <param name="client"></param>
40 /// <param name="message"></param> 41 /// <param name="message"></param>
@@ -73,9 +74,22 @@ namespace OpenSim.Region.Environment.Interfaces
73 void SendAlertToUser(string firstName, string lastName, string message, bool modal); 74 void SendAlertToUser(string firstName, string lastName, string message, bool modal);
74 75
75 /// <summary> 76 /// <summary>
76 /// Send an alert messages to all avatars in the scene. 77 /// Send an alert message to all users in the scene.
77 /// </summary> 78 /// </summary>
78 /// <param name="message"></param> 79 /// <param name="message"></param>
79 void SendGeneralAlert(string message); 80 void SendGeneralAlert(string message);
81
82 /// <summary>
83 /// Send a notification to all users in the scene. This notification should remain around until the
84 /// user explicitly dismisses it.
85 /// </summary>
86 ///
87 /// On the Linden Labs Second Client (as of 1.21), this is a big blue box message on the upper right of the
88 /// screen.
89 ///
90 /// <param name="fromAvatarID">The user sending the message</param>
91 /// <param name="fromAvatarName">The name of the user doing the sending</param>
92 /// <param name="message">The message being sent to the user</param>
93 void SendNotificationToUsersInRegion(UUID fromAvatarID, string fromAvatarName, string message);
80 } 94 }
81} 95}
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs
index 430968d..b64ec71 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Dialog/DialogModule.cs
@@ -90,10 +90,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog
90 } 90 }
91 } 91 }
92 92
93 /// <summary>
94 /// Send an alert messages to all avatars in this scene.
95 /// </summary>
96 /// <param name="message"></param>
97 public void SendGeneralAlert(string message) 93 public void SendGeneralAlert(string message)
98 { 94 {
99 List<ScenePresence> presenceList = m_scene.GetScenePresences(); 95 List<ScenePresence> presenceList = m_scene.GetScenePresences();
@@ -103,6 +99,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog
103 if (!presence.IsChildAgent) 99 if (!presence.IsChildAgent)
104 presence.ControllingClient.SendAlertMessage(message); 100 presence.ControllingClient.SendAlertMessage(message);
105 } 101 }
106 } 102 }
103
104 public void SendNotificationToUsersInRegion(
105 UUID fromAvatarID, string fromAvatarName, string message)
106 {
107 List<ScenePresence> presenceList = m_scene.GetScenePresences();
108
109 foreach (ScenePresence presence in presenceList)
110 {
111 if (!presence.IsChildAgent)
112 presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
113 }
114 }
107 } 115 }
108} 116}
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
index 14450ae..33e354e 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
@@ -51,8 +51,6 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
51 51
52 private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) 52 private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
53 { 53 {
54 //SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant)
55
56 uint sun = 0; 54 uint sun = 0;
57 55
58 if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime) 56 if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime)
@@ -356,7 +354,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
356 354
357 private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) 355 private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
358 { 356 {
359 m_scene.SendRegionMessageFromEstateTools(senderID, sessionID, senderName, message); 357 IDialogModule dm = m_scene.RequestModuleInterface<IDialogModule>();
358
359 if (dm != null)
360 dm.SendNotificationToUsersInRegion(senderID, senderName, message);
360 } 361 }
361 362
362 private void SendEstateBlueBoxMessage(IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) 363 private void SendEstateBlueBoxMessage(IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index dea265e..134946b 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -559,11 +559,11 @@ namespace OpenSim.Region.Environment.Scenes
559 m_incrementsof15seconds = (int)seconds / 15; 559 m_incrementsof15seconds = (int)seconds / 15;
560 m_RestartTimerCounter = 0; 560 m_RestartTimerCounter = 0;
561 m_restartTimer.AutoReset = true; 561 m_restartTimer.AutoReset = true;
562 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); 562 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
563 m_log.Error("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); 563 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
564 m_restartTimer.Start(); 564 m_restartTimer.Start();
565 SendRegionMessageFromEstateTools(UUID.Random(), UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); 565 m_dialogModule.SendNotificationToUsersInRegion(
566 //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); 566 UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes");
567 } 567 }
568 } 568 }
569 569
@@ -577,11 +577,10 @@ namespace OpenSim.Region.Environment.Scenes
577 if (m_RestartTimerCounter <= m_incrementsof15seconds) 577 if (m_RestartTimerCounter <= m_incrementsof15seconds)
578 { 578 {
579 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) 579 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7)
580 SendRegionMessageFromEstateTools(UUID.Random(), UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + 580 m_dialogModule.SendNotificationToUsersInRegion(
581 ((8 - m_RestartTimerCounter) * 15) + " seconds"); 581 UUID.Random(),
582 582 String.Empty,
583 // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + 583 RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter) * 15) + " seconds");
584 //" seconds");
585 } 584 }
586 else 585 else
587 { 586 {
@@ -3477,25 +3476,6 @@ namespace OpenSim.Region.Environment.Scenes
3477 3476
3478 /// <summary> 3477 /// <summary>
3479 /// Sends a Big Blue Box message on the upper right of the screen to the client 3478 /// Sends a Big Blue Box message on the upper right of the screen to the client
3480 /// for all agents in the region
3481 /// </summary>
3482 /// <param name="FromAvatarID">The person sending the message</param>
3483 /// <param name="fromSessionID">The session of the person sending the message</param>
3484 /// <param name="FromAvatarName">The name of the person doing the sending</param>
3485 /// <param name="Message">The Message being sent to the user</param>
3486 public void SendRegionMessageFromEstateTools(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message)
3487 {
3488 List<ScenePresence> presenceList = GetScenePresences();
3489
3490 foreach (ScenePresence presence in presenceList)
3491 {
3492 if (!presence.IsChildAgent)
3493 presence.ControllingClient.SendBlueBoxMessage(FromAvatarID, FromAvatarName, Message);
3494 }
3495 }
3496
3497 /// <summary>
3498 /// Sends a Big Blue Box message on the upper right of the screen to the client
3499 /// for all agents in the estate 3479 /// for all agents in the estate
3500 /// </summary> 3480 /// </summary>
3501 /// <param name="FromAvatarID">The person sending the message</param> 3481 /// <param name="FromAvatarID">The person sending the message</param>