aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs55
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObject.cs8
2 files changed, 31 insertions, 32 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 81bab9a..13a8c89 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -41,8 +41,8 @@ using OpenSim.Physics.Manager;
41using OpenSim.Region.Caches; 41using OpenSim.Region.Caches;
42using OpenSim.Region.Scripting; 42using OpenSim.Region.Scripting;
43using OpenSim.Region.Terrain; 43using OpenSim.Region.Terrain;
44using Caps=OpenSim.Region.Capabilities.Caps; 44using Caps = OpenSim.Region.Capabilities.Caps;
45using Timer=System.Timers.Timer; 45using Timer = System.Timers.Timer;
46 46
47namespace OpenSim.Region.Environment.Scenes 47namespace OpenSim.Region.Environment.Scenes
48{ 48{
@@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Scenes
223 //Perform parcel update of prim count 223 //Perform parcel update of prim count
224 performParcelPrimCountUpdate(); 224 performParcelPrimCountUpdate();
225 this.parcelPrimCheckCount = 0; 225 this.parcelPrimCheckCount = 0;
226 } 226 }
227 } 227 }
228 228
229 } 229 }
@@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Scenes
267 { 267 {
268 this.SendLayerData(client); 268 this.SendLayerData(client);
269 }); 269 });
270 270
271 foreach (LLUUID UUID in Entities.Keys) 271 foreach (LLUUID UUID in Entities.Keys)
272 { 272 {
273 Entities[UUID].LandRenegerated(); 273 Entities[UUID].LandRenegerated();
@@ -454,18 +454,13 @@ namespace OpenSim.Region.Environment.Scenes
454 /// <param name="ownerID"></param> 454 /// <param name="ownerID"></param>
455 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape) 455 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
456 { 456 {
457 try 457 SceneObject sceneOb = new SceneObject(this, ownerID, this.PrimIDAllocate(), pos, shape);
458 { 458 AddNewEntity(sceneOb);
459 SceneObject sceneOb = new SceneObject(m_regionHandle, this, this.m_eventManager,this.m_parcelManager, ownerID, this.PrimIDAllocate(), pos, shape); 459 }
460 this.Entities.Add(sceneOb.rootUUID, sceneOb);
461 460
462 // Trigger event for listeners 461 public void AddNewEntity(SceneObject sceneObject)
463 // eventManager.TriggerOnNewPrimitive(prim); 462 {
464 } 463 this.Entities.Add(sceneObject.rootUUID, sceneObject);
465 catch (Exception e)
466 {
467 MainLog.Instance.Warn("World.cs: AddNewPrim() - Failed with exception " + e.ToString());
468 }
469 } 464 }
470 465
471 #endregion 466 #endregion
@@ -484,7 +479,7 @@ namespace OpenSim.Region.Environment.Scenes
484 this.m_estateManager.sendRegionHandshake(client); 479 this.m_estateManager.sendRegionHandshake(client);
485 CreateAndAddScenePresence(client); 480 CreateAndAddScenePresence(client);
486 this.m_parcelManager.sendParcelOverlay(client); 481 this.m_parcelManager.sendParcelOverlay(client);
487 482
488 } 483 }
489 484
490 protected virtual void SubscribeToClientEvents(IClientAPI client) 485 protected virtual void SubscribeToClientEvents(IClientAPI client)
@@ -512,7 +507,7 @@ namespace OpenSim.Region.Environment.Scenes
512 client.OnObjectName += this.PrimName; 507 client.OnObjectName += this.PrimName;
513 client.OnLinkObjects += this.LinkObjects; 508 client.OnLinkObjects += this.LinkObjects;
514 client.OnObjectDuplicate += this.DuplicateObject; 509 client.OnObjectDuplicate += this.DuplicateObject;
515 510
516 client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_parcelManager.handleParcelPropertiesRequest); 511 client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_parcelManager.handleParcelPropertiesRequest);
517 client.OnParcelDivideRequest += new ParcelDivideRequest(m_parcelManager.handleParcelDivideRequest); 512 client.OnParcelDivideRequest += new ParcelDivideRequest(m_parcelManager.handleParcelDivideRequest);
518 client.OnParcelJoinRequest += new ParcelJoinRequest(m_parcelManager.handleParcelJoinRequest); 513 client.OnParcelJoinRequest += new ParcelJoinRequest(m_parcelManager.handleParcelJoinRequest);
@@ -571,26 +566,30 @@ namespace OpenSim.Region.Environment.Scenes
571 { 566 {
572 m_eventManager.TriggerOnRemovePresence(agentID); 567 m_eventManager.TriggerOnRemovePresence(agentID);
573 568
574 ScenePresence avatar = this.RequestAvatar(agentID); 569 ScenePresence avatar = this.RequestAvatar(agentID);
575 570
576 m_clientManager.ForEachClient( 571 m_clientManager.ForEachClient(
577 delegate(IClientAPI client) 572 delegate(IClientAPI client)
573 {
574 client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
575 });
576
577 lock (Avatars)
578 {
579 if (Avatars.ContainsKey(agentID))
578 { 580 {
579 client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
580 });
581
582 lock (Avatars) {
583 if (Avatars.ContainsKey(agentID)) {
584 Avatars.Remove(agentID); 581 Avatars.Remove(agentID);
585 } 582 }
586 } 583 }
587 lock (Entities) { 584 lock (Entities)
588 if (Entities.ContainsKey(agentID)) { 585 {
586 if (Entities.ContainsKey(agentID))
587 {
589 Entities.Remove(agentID); 588 Entities.Remove(agentID);
590 } 589 }
591 } 590 }
592 // TODO: Add the removal from physics ? 591 // TODO: Add the removal from physics ?
593 592
594 593
595 594
596 return; 595 return;
@@ -685,7 +684,7 @@ namespace OpenSim.Region.Environment.Scenes
685 /// </summary> 684 /// </summary>
686 public void RegisterRegionWithComms() 685 public void RegisterRegionWithComms()
687 { 686 {
688 687
689 this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo); 688 this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo);
690 if (this.regionCommsHost != null) 689 if (this.regionCommsHost != null)
691 { 690 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs
index f4c4083..7c49ddb 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObject.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs
@@ -79,12 +79,12 @@ namespace OpenSim.Region.Environment.Scenes
79 /// <summary> 79 /// <summary>
80 /// 80 ///
81 /// </summary> 81 /// </summary>
82 public SceneObject(ulong regionHandle, Scene world, EventManager eventManager, ParcelManager parcelManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) 82 public SceneObject(Scene world, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
83 { 83 {
84 m_regionHandle = regionHandle; 84 m_regionHandle = world.RegionInfo.RegionHandle;
85 m_world = world; 85 m_world = world;
86 m_eventManager = eventManager; 86 m_eventManager = world.EventManager;
87 m_parcelManager = parcelManager; 87 m_parcelManager = world.ParcelManager;
88 88
89 this.Pos = pos; 89 this.Pos = pos;
90 this.CreateRootFromShape(ownerID, localID, shape, pos); 90 this.CreateRootFromShape(ownerID, localID, shape, pos);