aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
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
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 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs40
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs26
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs4
3 files changed, 40 insertions, 30 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);
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs
index e8f29c8..168a60e 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs
@@ -45,20 +45,19 @@ namespace OpenSim.Region.Environment.Scenes
45 public void LoadAnims() 45 public void LoadAnims()
46 { 46 {
47 //OpenSim.Framework.Console.MainLog.Instance.Verbose("Avatar.cs:LoadAnims() - Loading avatar animations"); 47 //OpenSim.Framework.Console.MainLog.Instance.Verbose("Avatar.cs:LoadAnims() - Loading avatar animations");
48 XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"); 48 using( XmlTextReader reader = new XmlTextReader("data/avataranimations.xml") )
49
50 XmlDocument doc = new XmlDocument();
51 doc.Load(reader);
52 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
53 { 49 {
54 if (nod.Attributes["name"] != null) 50 XmlDocument doc = new XmlDocument();
51 doc.Load(reader);
52 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
55 { 53 {
56 AnimsLLUUID.Add(nod.Attributes["name"].Value, nod.InnerText); 54 if (nod.Attributes["name"] != null)
55 {
56 AnimsLLUUID.Add(nod.Attributes["name"].Value, nod.InnerText);
57 }
57 } 58 }
58 } 59 }
59 60
60 reader.Close();
61
62 // OpenSim.Framework.Console.MainLog.Instance.Verbose("Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)"); 61 // OpenSim.Framework.Console.MainLog.Instance.Verbose("Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");
63 62
64 foreach (KeyValuePair<string, LLUUID> kp in Animations.AnimsLLUUID) 63 foreach (KeyValuePair<string, LLUUID> kp in Animations.AnimsLLUUID)
@@ -67,5 +66,14 @@ namespace OpenSim.Region.Environment.Scenes
67 } 66 }
68 } 67 }
69 } 68 }
69
70 internal void Close()
71 {
72 if (m_physicsActor != null)
73 {
74 m_scene.PhysScene.RemoveAvatar( PhysicsActor );
75 m_physicsActor = null;
76 }
77 }
70 } 78 }
71} \ No newline at end of file 79} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 9b5aa99..cee93b2 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -627,7 +627,7 @@ namespace OpenSim.Region.Environment.Scenes
627 m_controllingClient.SendCoarseLocationUpdate(CoarseLocations); 627 m_controllingClient.SendCoarseLocationUpdate(CoarseLocations);
628 } 628 }
629 629
630 public void CoarseLocationChange(ScenePresence avatar) 630 public void CoarseLocationChange()
631 { 631 {
632 newCoarseLocations = true; 632 newCoarseLocations = true;
633 } 633 }
@@ -638,7 +638,7 @@ namespace OpenSim.Region.Environment.Scenes
638 { 638 {
639 if (presence != this) 639 if (presence != this)
640 { 640 {
641 presence.CoarseLocationChange(this); 641 presence.CoarseLocationChange();
642 } 642 }
643 }); 643 });
644 } 644 }