aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs86
1 files changed, 42 insertions, 44 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index a315d02..75e2a41 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -28,9 +28,9 @@
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using OpenSim.Framework.Console;
32using OpenSim.Framework;
33using libsecondlife; 31using libsecondlife;
32using OpenSim.Framework;
33using OpenSim.Framework.Console;
34 34
35namespace OpenSim.Region.Environment.Scenes 35namespace OpenSim.Region.Environment.Scenes
36{ 36{
@@ -152,10 +152,7 @@ namespace OpenSim.Region.Environment.Scenes
152 152
153 public void SendGeneralMessage(string msg) 153 public void SendGeneralMessage(string msg)
154 { 154 {
155 ForEachCurrentScene(delegate(Scene scene) 155 ForEachCurrentScene(delegate(Scene scene) { scene.SendGeneralAlert(msg); });
156 {
157 scene.SendGeneralAlert(msg);
158 });
159 } 156 }
160 157
161 public bool TrySetCurrentScene(string regionName) 158 public bool TrySetCurrentScene(string regionName)
@@ -185,23 +182,24 @@ namespace OpenSim.Region.Environment.Scenes
185 public void SetDebugPacketOnCurrentScene(LogBase log, int newDebug) 182 public void SetDebugPacketOnCurrentScene(LogBase log, int newDebug)
186 { 183 {
187 ForEachCurrentScene(delegate(Scene scene) 184 ForEachCurrentScene(delegate(Scene scene)
188 {
189 foreach (EntityBase entity in scene.Entities.Values)
190 {
191 if (entity is ScenePresence)
192 {
193 ScenePresence scenePrescence = entity as ScenePresence;
194 if (!scenePrescence.IsChildAgent)
195 { 185 {
196 log.Error(String.Format("Packet debug for {0} {1} set to {2}", 186 foreach (EntityBase entity in scene.Entities.Values)
197 scenePrescence.Firstname, scenePrescence.Lastname, 187 {
198 newDebug)); 188 if (entity is ScenePresence)
199 189 {
200 scenePrescence.ControllingClient.SetDebug(newDebug); 190 ScenePresence scenePrescence = entity as ScenePresence;
201 } 191 if (!scenePrescence.IsChildAgent)
202 } 192 {
203 } 193 log.Error(String.Format("Packet debug for {0} {1} set to {2}",
204 }); 194 scenePrescence.Firstname,
195 scenePrescence.Lastname,
196 newDebug));
197
198 scenePrescence.ControllingClient.SetDebug(newDebug);
199 }
200 }
201 }
202 });
205 } 203 }
206 204
207 public List<ScenePresence> GetCurrentSceneAvatars() 205 public List<ScenePresence> GetCurrentSceneAvatars()
@@ -209,19 +207,19 @@ namespace OpenSim.Region.Environment.Scenes
209 List<ScenePresence> avatars = new List<ScenePresence>(); 207 List<ScenePresence> avatars = new List<ScenePresence>();
210 208
211 ForEachCurrentScene(delegate(Scene scene) 209 ForEachCurrentScene(delegate(Scene scene)
212 {
213 foreach (EntityBase entity in scene.Entities.Values)
214 {
215 if (entity is ScenePresence)
216 {
217 ScenePresence scenePrescence = entity as ScenePresence;
218 if (!scenePrescence.IsChildAgent)
219 { 210 {
220 avatars.Add(scenePrescence); 211 foreach (EntityBase entity in scene.Entities.Values)
221 } 212 {
222 } 213 if (entity is ScenePresence)
223 } 214 {
224 }); 215 ScenePresence scenePrescence = entity as ScenePresence;
216 if (!scenePrescence.IsChildAgent)
217 {
218 avatars.Add(scenePrescence);
219 }
220 }
221 }
222 });
225 223
226 return avatars; 224 return avatars;
227 } 225 }
@@ -242,11 +240,11 @@ namespace OpenSim.Region.Environment.Scenes
242 public void SetCurrentSceneTimePhase(int timePhase) 240 public void SetCurrentSceneTimePhase(int timePhase)
243 { 241 {
244 ForEachCurrentScene(delegate(Scene scene) 242 ForEachCurrentScene(delegate(Scene scene)
245 { 243 {
246 scene.SetTimePhase( 244 scene.SetTimePhase(
247 timePhase) 245 timePhase)
248 ; 246 ;
249 }); 247 });
250 } 248 }
251 249
252 250
@@ -260,11 +258,11 @@ namespace OpenSim.Region.Environment.Scenes
260 ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); 258 ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
261 } 259 }
262 260
263 public bool TryGetAvatar( LLUUID avatarId, out ScenePresence avatar ) 261 public bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar)
264 { 262 {
265 foreach (Scene scene in m_localScenes) 263 foreach (Scene scene in m_localScenes)
266 { 264 {
267 if( scene.TryGetAvatar( avatarId, out avatar )) 265 if (scene.TryGetAvatar(avatarId, out avatar))
268 { 266 {
269 return true; 267 return true;
270 } 268 }
@@ -311,9 +309,9 @@ namespace OpenSim.Region.Environment.Scenes
311 return false; 309 return false;
312 } 310 }
313 311
314 public void ForEachScene(Action<Scene> action ) 312 public void ForEachScene(Action<Scene> action)
315 { 313 {
316 m_localScenes.ForEach( action ); 314 m_localScenes.ForEach(action);
317 } 315 }
318 } 316 }
319} 317} \ No newline at end of file