aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorlbsa712007-09-21 05:23:17 +0000
committerlbsa712007-09-21 05:23:17 +0000
commit5fab795bf0fd3fe794e4635fc28b295963cfbb9e (patch)
treef2e344108680b593b53d00b5e183f1641e20c1ed /OpenSim/Region/Environment/Scenes/Scene.cs
parent* Removed unused RegenerateTerrain functions (diff)
downloadopensim-SC-5fab795bf0fd3fe794e4635fc28b295963cfbb9e.zip
opensim-SC-5fab795bf0fd3fe794e4635fc28b295963cfbb9e.tar.gz
opensim-SC-5fab795bf0fd3fe794e4635fc28b295963cfbb9e.tar.bz2
opensim-SC-5fab795bf0fd3fe794e4635fc28b295963cfbb9e.tar.xz
* Continued work on Region layer
* Added Close() to ScenePresence to remove and destroy PhysicsActor
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs40
1 files changed, 21 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 1e19c30..ab52ebf 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -307,7 +307,7 @@ namespace OpenSim.Region.Environment.Scenes
307 307
308 float[] terData = Terrain.GetHeights1D(); 308 float[] terData = Terrain.GetHeights1D();
309 309
310 Broadcast( delegate( IClientAPI client ) 310 Broadcast(delegate(IClientAPI client)
311 { 311 {
312 for (int x = 0; x < 16; x++) 312 for (int x = 0; x < 16; x++)
313 { 313 {
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Environment.Scenes
321 } 321 }
322 }); 322 });
323 323
324 324
325 325
326 Terrain.ResetTaint(); 326 Terrain.ResetTaint();
327 } 327 }
@@ -369,7 +369,7 @@ namespace OpenSim.Region.Environment.Scenes
369 369
370 internal void Broadcast(Action<IClientAPI> whatToDo) 370 internal void Broadcast(Action<IClientAPI> whatToDo)
371 { 371 {
372 m_region.Broadcast( whatToDo ); 372 m_region.Broadcast(whatToDo);
373 } 373 }
374 /// <summary> 374 /// <summary>
375 /// 375 ///
@@ -641,6 +641,7 @@ namespace OpenSim.Region.Environment.Scenes
641 public override void AddNewClient(IClientAPI client, bool child) 641 public override void AddNewClient(IClientAPI client, bool child)
642 { 642 {
643 SubscribeToClientEvents(client); 643 SubscribeToClientEvents(client);
644
644 m_estateManager.sendRegionHandshake(client); 645 m_estateManager.sendRegionHandshake(client);
645 646
646 CreateAndAddScenePresence(client, child); 647 CreateAndAddScenePresence(client, child);
@@ -769,33 +770,34 @@ namespace OpenSim.Region.Environment.Scenes
769 770
770 ScenePresence avatar = GetScenePresence(agentID); 771 ScenePresence avatar = GetScenePresence(agentID);
771 772
773 Broadcast(delegate(IClientAPI client)
774 {
775 client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
776 });
777
778
772 ForEachScenePresence( 779 ForEachScenePresence(
773 delegate(ScenePresence presence) 780 delegate(ScenePresence presence)
774 { 781 {
775 presence.CoarseLocationChange(avatar); 782 presence.CoarseLocationChange();
776 presence.ControllingClient.SendKillObject(avatar.RegionHandle, avatar.LocalId);
777 if (presence.PhysicsActor != null)
778 {
779 phyScene.RemoveAvatar(presence.PhysicsActor);
780 presence.PhysicsActor = null;
781 }
782 }); 783 });
783 784
784 lock (m_scenePresences) 785 lock (m_scenePresences)
785 { 786 {
786 if (m_scenePresences.ContainsKey(agentID)) 787 m_scenePresences.Remove(agentID);
787 { 788 }
788 m_scenePresences.Remove(agentID); 789
789 } 790 lock (m_region)
791 {
792 m_region.Remove(agentID);
790 } 793 }
794
791 lock (Entities) 795 lock (Entities)
792 { 796 {
793 if (Entities.ContainsKey(agentID)) 797 Entities.Remove(agentID);
794 {
795 Entities.Remove(agentID);
796 }
797 } 798 }
798 // TODO: Add the removal from physics ? 799
800 avatar.Close();
799 801
800 // Remove client agent from profile, so new logins will work 802 // Remove client agent from profile, so new logins will work
801 commsManager.UserServer.clearUserAgent(agentID); 803 commsManager.UserServer.clearUserAgent(agentID);