diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index b8e013c..c31266c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -87,31 +87,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
87 | 87 | ||
88 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) | 88 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) |
89 | { | 89 | { |
90 | ScenePresence[] presenceList = m_scene.GetScenePresences(); | 90 | ScenePresence presence = m_scene.GetScenePresence(firstName, lastName); |
91 | 91 | if(presence != null) | |
92 | for (int i = 0; i < presenceList.Length; i++) | 92 | presence.ControllingClient.SendAgentAlertMessage(message, modal); |
93 | { | ||
94 | ScenePresence presence = presenceList[i]; | ||
95 | |||
96 | if (presence.Firstname == firstName && presence.Lastname == lastName) | ||
97 | { | ||
98 | presence.ControllingClient.SendAgentAlertMessage(message, modal); | ||
99 | break; | ||
100 | } | ||
101 | } | ||
102 | } | 93 | } |
103 | 94 | ||
104 | public void SendGeneralAlert(string message) | 95 | public void SendGeneralAlert(string message) |
105 | { | 96 | { |
106 | ScenePresence[] presenceList = m_scene.GetScenePresences(); | 97 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) |
107 | |||
108 | for (int i = 0; i < presenceList.Length; i++) | ||
109 | { | 98 | { |
110 | ScenePresence presence = presenceList[i]; | ||
111 | |||
112 | if (!presence.IsChildAgent) | 99 | if (!presence.IsChildAgent) |
113 | presence.ControllingClient.SendAlertMessage(message); | 100 | presence.ControllingClient.SendAlertMessage(message); |
114 | } | 101 | }); |
115 | } | 102 | } |
116 | 103 | ||
117 | public void SendDialogToUser( | 104 | public void SendDialogToUser( |
@@ -179,14 +166,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
179 | public void SendNotificationToUsersInRegion( | 166 | public void SendNotificationToUsersInRegion( |
180 | UUID fromAvatarID, string fromAvatarName, string message) | 167 | UUID fromAvatarID, string fromAvatarName, string message) |
181 | { | 168 | { |
182 | ScenePresence[] presences = m_scene.GetScenePresences(); | 169 | m_scene.ForEachScenePresence(delegate(ScenePresence presence) |
183 | |||
184 | for (int i = 0; i < presences.Length; i++) | ||
185 | { | 170 | { |
186 | ScenePresence presence = presences[i]; | ||
187 | if (!presence.IsChildAgent) | 171 | if (!presence.IsChildAgent) |
188 | presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message); | 172 | presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message); |
189 | } | 173 | }); |
190 | } | 174 | } |
191 | 175 | ||
192 | /// <summary> | 176 | /// <summary> |