aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index fdf3cc8..1798cba 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -57,6 +57,7 @@ namespace OpenSim.Region.Environment.Scenes
57 private float timeStep = 0.1f; 57 private float timeStep = 0.1f;
58 private Random Rand = new Random(); 58 private Random Rand = new Random();
59 private uint _primCount = 702000; 59 private uint _primCount = 702000;
60 private System.Threading.Mutex _primAllocateMutex = new Mutex(false);
60 private int storageCount; 61 private int storageCount;
61 private Mutex updateLock; 62 private Mutex updateLock;
62 63
@@ -397,6 +398,22 @@ namespace OpenSim.Region.Environment.Scenes
397 } 398 }
398 399
399 /// <summary> 400 /// <summary>
401 /// Returns a new unallocated primitive ID
402 /// </summary>
403 /// <returns>A brand new primitive ID</returns>
404 public uint PrimIDAllocate()
405 {
406 uint myID;
407
408 _primAllocateMutex.WaitOne();
409 ++_primCount;
410 myID = _primCount;
411 _primAllocateMutex.ReleaseMutex();
412
413 return myID;
414 }
415
416 /// <summary>
400 /// 417 ///
401 /// </summary> 418 /// </summary>
402 /// <param name="addPacket"></param> 419 /// <param name="addPacket"></param>
@@ -415,9 +432,8 @@ namespace OpenSim.Region.Environment.Scenes
415 { 432 {
416 try 433 try
417 { 434 {
418 SceneObject sceneOb = new SceneObject(m_regionHandle, this, addPacket, ownerID, this._primCount); 435 SceneObject sceneOb = new SceneObject(m_regionHandle, this, addPacket, ownerID, this.PrimIDAllocate());
419 this.Entities.Add(sceneOb.rootUUID, sceneOb); 436 this.Entities.Add(sceneOb.rootUUID, sceneOb);
420 this._primCount++;
421 437
422 // Trigger event for listeners 438 // Trigger event for listeners
423 // eventManager.TriggerOnNewPrimitive(prim); 439 // eventManager.TriggerOnNewPrimitive(prim);
@@ -468,6 +484,7 @@ namespace OpenSim.Region.Environment.Scenes
468 client.OnObjectDescription += this.PrimDescription; 484 client.OnObjectDescription += this.PrimDescription;
469 client.OnObjectName += this.PrimName; 485 client.OnObjectName += this.PrimName;
470 client.OnLinkObjects += this.LinkObjects; 486 client.OnLinkObjects += this.LinkObjects;
487 client.OnObjectDuplicate += this.DuplicateObject;
471 488
472 /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); 489 /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest);
473 remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); 490 remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest);