diff options
author | Justin Clarke Casey | 2008-02-08 19:53:18 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-02-08 19:53:18 +0000 |
commit | 9d95f9bcf4decd7f9cfcbc8c51a2a9cae567b8bb (patch) | |
tree | c7a8b0668d3d08ee23a0cc3c1d23ec953f10dc8d | |
parent | * Dun-dun-dun. JavaScript scripting now actually works. :) (diff) | |
download | opensim-SC_OLD-9d95f9bcf4decd7f9cfcbc8c51a2a9cae567b8bb.zip opensim-SC_OLD-9d95f9bcf4decd7f9cfcbc8c51a2a9cae567b8bb.tar.gz opensim-SC_OLD-9d95f9bcf4decd7f9cfcbc8c51a2a9cae567b8bb.tar.bz2 opensim-SC_OLD-9d95f9bcf4decd7f9cfcbc8c51a2a9cae567b8bb.tar.xz |
Minor ScenePresence related refactoring
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneManager.cs | 26 |
2 files changed, 30 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index bd7f59d..3480530 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1407,12 +1407,28 @@ namespace OpenSim.Region.Environment.Scenes | |||
1407 | 1407 | ||
1408 | lock (m_scenePresences) | 1408 | lock (m_scenePresences) |
1409 | { | 1409 | { |
1410 | m_scenePresences.Remove(agentID); | 1410 | if (m_scenePresences.Remove(agentID)) |
1411 | { | ||
1412 | //m_log.Info(String.Format("[SCENE] Removed scene presence {0}", agentID)); | ||
1413 | } | ||
1414 | else | ||
1415 | { | ||
1416 | m_log.Warn( | ||
1417 | String.Format("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene ScenePresences list", agentID)); | ||
1418 | } | ||
1411 | } | 1419 | } |
1412 | 1420 | ||
1413 | lock (Entities) | 1421 | lock (Entities) |
1414 | { | 1422 | { |
1415 | Entities.Remove(agentID); | 1423 | if (Entities.Remove(agentID)) |
1424 | { | ||
1425 | //m_log.Info(String.Format("[SCENE] Removed scene presence {0} from entities list", agentID)); | ||
1426 | } | ||
1427 | else | ||
1428 | { | ||
1429 | m_log.Warn( | ||
1430 | String.Format("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene Entities list", agentID)); | ||
1431 | } | ||
1416 | } | 1432 | } |
1417 | 1433 | ||
1418 | try | 1434 | try |
@@ -1425,7 +1441,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1425 | } | 1441 | } |
1426 | catch (Exception e) | 1442 | catch (Exception e) |
1427 | { | 1443 | { |
1428 | m_log.Error("Scene.cs:RemoveClient exception: " + e.ToString()); | 1444 | m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); |
1429 | } | 1445 | } |
1430 | 1446 | ||
1431 | // Remove client agent from profile, so new logins will work | 1447 | // Remove client agent from profile, so new logins will work |
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 7156428..9f066d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs | |||
@@ -316,21 +316,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
316 | List<ScenePresence> avatars = new List<ScenePresence>(); | 316 | List<ScenePresence> avatars = new List<ScenePresence>(); |
317 | 317 | ||
318 | ForEachCurrentScene(delegate(Scene scene) | 318 | ForEachCurrentScene(delegate(Scene scene) |
319 | { | 319 | { |
320 | List<EntityBase> EntitieList = scene.GetEntities(); | 320 | List<ScenePresence> scenePrescences = scene.GetScenePresences(); |
321 | 321 | ||
322 | foreach (EntityBase entity in EntitieList) | 322 | foreach (ScenePresence scenePrescence in scenePrescences) |
323 | { | 323 | { |
324 | if (entity is ScenePresence) | 324 | if (!scenePrescence.IsChildAgent) |
325 | { | 325 | { |
326 | ScenePresence scenePrescence = entity as ScenePresence; | 326 | avatars.Add(scenePrescence); |
327 | if (!scenePrescence.IsChildAgent) | 327 | } |
328 | { | 328 | } |
329 | avatars.Add(scenePrescence); | 329 | }); |
330 | } | ||
331 | } | ||
332 | } | ||
333 | }); | ||
334 | 330 | ||
335 | return avatars; | 331 | return avatars; |
336 | } | 332 | } |
@@ -423,4 +419,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
423 | m_localScenes.ForEach(action); | 419 | m_localScenes.ForEach(action); |
424 | } | 420 | } |
425 | } | 421 | } |
426 | } \ No newline at end of file | 422 | } |