aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-07-09 15:29:39 +0000
committerAdam Frisby2007-07-09 15:29:39 +0000
commite8acf1cca92592fea38208dbfe4137555431434d (patch)
tree4d8b6353f1baab805b17caec835d93ee0ef6817e /OpenSim/Region/Environment/Scenes/Scene.cs
parent* reverted rev 1200 waiting for info re animations.xml (diff)
downloadopensim-SC_OLD-e8acf1cca92592fea38208dbfe4137555431434d.zip
opensim-SC_OLD-e8acf1cca92592fea38208dbfe4137555431434d.tar.gz
opensim-SC_OLD-e8acf1cca92592fea38208dbfe4137555431434d.tar.bz2
opensim-SC_OLD-e8acf1cca92592fea38208dbfe4137555431434d.tar.xz
* Begun work on Primitive Duplication. Not hooked up yet, but theoretically could be done so. In practice, more work needs to be done.
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);