diff options
author | Justin Clarke Casey | 2008-05-26 00:38:04 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-26 00:38:04 +0000 |
commit | 73a28a56daf03e84f5a460317222b3e7e5d2e514 (patch) | |
tree | a589a505ce9ef6d182aeb73bb8933c35af7f77d4 /OpenSim | |
parent | Update svn properties. Formatting cleanup. (diff) | |
download | opensim-SC_OLD-73a28a56daf03e84f5a460317222b3e7e5d2e514.zip opensim-SC_OLD-73a28a56daf03e84f5a460317222b3e7e5d2e514.tar.gz opensim-SC_OLD-73a28a56daf03e84f5a460317222b3e7e5d2e514.tar.bz2 opensim-SC_OLD-73a28a56daf03e84f5a460317222b3e7e5d2e514.tar.xz |
* Refactor: Separate out RemoveScenePresence and add into InnerScene to match existing AddScenePresence
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 37 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 29 |
2 files changed, 40 insertions, 26 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 0405bdf..a2fdf66 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -520,6 +520,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
520 | Entities[client.AgentId] = newAvatar; | 520 | Entities[client.AgentId] = newAvatar; |
521 | } | 521 | } |
522 | } | 522 | } |
523 | |||
523 | lock (ScenePresences) | 524 | lock (ScenePresences) |
524 | { | 525 | { |
525 | if (ScenePresences.ContainsKey(client.AgentId)) | 526 | if (ScenePresences.ContainsKey(client.AgentId)) |
@@ -535,7 +536,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
535 | return newAvatar; | 536 | return newAvatar; |
536 | } | 537 | } |
537 | 538 | ||
538 | public void AddScenePresence(ScenePresence presence) | 539 | /// <summary> |
540 | /// Add a presence to the scene | ||
541 | /// </summary> | ||
542 | /// <param name="presence"></param> | ||
543 | internal void AddScenePresence(ScenePresence presence) | ||
539 | { | 544 | { |
540 | bool child = presence.IsChildAgent; | 545 | bool child = presence.IsChildAgent; |
541 | 546 | ||
@@ -563,6 +568,36 @@ namespace OpenSim.Region.Environment.Scenes | |||
563 | ScenePresences[presence.UUID] = presence; | 568 | ScenePresences[presence.UUID] = presence; |
564 | } | 569 | } |
565 | } | 570 | } |
571 | |||
572 | /// <summary> | ||
573 | /// Remove a presence from the scene | ||
574 | /// </summary> | ||
575 | internal void RemoveScenePresence(LLUUID agentID) | ||
576 | { | ||
577 | lock (Entities) | ||
578 | { | ||
579 | if (Entities.Remove(agentID)) | ||
580 | { | ||
581 | //m_log.InfoFormat("[SCENE] Removed scene presence {0} from entities list", agentID); | ||
582 | } | ||
583 | else | ||
584 | { | ||
585 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene Entities list", agentID); | ||
586 | } | ||
587 | } | ||
588 | |||
589 | lock (ScenePresences) | ||
590 | { | ||
591 | if (ScenePresences.Remove(agentID)) | ||
592 | { | ||
593 | //m_log.InfoFormat("[SCENE] Removed scene presence {0}", agentID); | ||
594 | } | ||
595 | else | ||
596 | { | ||
597 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); | ||
598 | } | ||
599 | } | ||
600 | } | ||
566 | 601 | ||
567 | public void SwapRootChildAgent(bool direction_RC_CR_T_F) | 602 | public void SwapRootChildAgent(bool direction_RC_CR_T_F) |
568 | { | 603 | { |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 27431ed..a44e88e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -558,18 +558,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
558 | m_scripts_enabled = !ScriptEngine; | 558 | m_scripts_enabled = !ScriptEngine; |
559 | m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); | 559 | m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); |
560 | } | 560 | } |
561 | |||
561 | if (m_physics_enabled != !PhysicsEngine) | 562 | if (m_physics_enabled != !PhysicsEngine) |
562 | { | 563 | { |
563 | m_physics_enabled = !PhysicsEngine; | 564 | m_physics_enabled = !PhysicsEngine; |
564 | |||
565 | } | 565 | } |
566 | |||
567 | } | 566 | } |
567 | |||
568 | public int GetInaccurateNeighborCount() | 568 | public int GetInaccurateNeighborCount() |
569 | { | 569 | { |
570 | lock (m_neighbours) | 570 | lock (m_neighbours) |
571 | return m_neighbours.Count; | 571 | return m_neighbours.Count; |
572 | } | 572 | } |
573 | |||
573 | // This is the method that shuts down the scene. | 574 | // This is the method that shuts down the scene. |
574 | public override void Close() | 575 | public override void Close() |
575 | { | 576 | { |
@@ -1910,29 +1911,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1910 | agentTransactions.RemoveAgentAssetTransactions(agentID); | 1911 | agentTransactions.RemoveAgentAssetTransactions(agentID); |
1911 | } | 1912 | } |
1912 | 1913 | ||
1913 | lock (m_scenePresences) | 1914 | m_innerScene.RemoveScenePresence(agentID); |
1914 | { | ||
1915 | if (m_scenePresences.Remove(agentID)) | ||
1916 | { | ||
1917 | //m_log.InfoFormat("[SCENE] Removed scene presence {0}", agentID); | ||
1918 | } | ||
1919 | else | ||
1920 | { | ||
1921 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); | ||
1922 | } | ||
1923 | } | ||
1924 | |||
1925 | lock (Entities) | ||
1926 | { | ||
1927 | if (Entities.Remove(agentID)) | ||
1928 | { | ||
1929 | //m_log.InfoFormat("[SCENE] Removed scene presence {0} from entities list", agentID); | ||
1930 | } | ||
1931 | else | ||
1932 | { | ||
1933 | m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene Entities list", agentID); | ||
1934 | } | ||
1935 | } | ||
1936 | 1915 | ||
1937 | try | 1916 | try |
1938 | { | 1917 | { |