aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneBase.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-07 22:49:36 +0000
committerJustin Clarke Casey2008-11-07 22:49:36 +0000
commit4ace67a81d90ef6d6385c70f86cff2115522372b (patch)
treefc3fb61cf6ac54810c896351c02cd3c912a2e810 /OpenSim/Region/Environment/Scenes/SceneBase.cs
parent* refactor: cleanup AllocateLocalPrimId() a bit more (diff)
downloadopensim-SC-4ace67a81d90ef6d6385c70f86cff2115522372b.zip
opensim-SC-4ace67a81d90ef6d6385c70f86cff2115522372b.tar.gz
opensim-SC-4ace67a81d90ef6d6385c70f86cff2115522372b.tar.bz2
opensim-SC-4ace67a81d90ef6d6385c70f86cff2115522372b.tar.xz
* Fix bug in r7162 where avatars could not move
* Was caused by the lack of a local id. Local ids are now given from the same sequence as prims, rather than a separate one * I don't believe this will cause any problems, but please revert to a separate sequence if it does
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneBase.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index bf0e211..bba31f7 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Threading;
31using OpenMetaverse; 32using OpenMetaverse;
32using log4net; 33using log4net;
33using OpenSim.Framework; 34using OpenSim.Framework;
@@ -48,6 +49,14 @@ namespace OpenSim.Region.Environment.Scenes
48 49
49 #region Fields 50 #region Fields
50 51
52 /// <summary>
53 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is
54 /// dispensed.
55 /// </summary>
56 private uint m_lastAllocatedLocalId = 720000;
57
58 private readonly Mutex _primAllocateMutex = new Mutex(false);
59
51 private readonly ClientManager m_clientManager = new ClientManager(); 60 private readonly ClientManager m_clientManager = new ClientManager();
52 61
53 public ClientManager ClientManager 62 public ClientManager ClientManager
@@ -212,6 +221,21 @@ namespace OpenSim.Region.Environment.Scenes
212 221
213 return null; 222 return null;
214 } 223 }
224
225 /// <summary>
226 /// Returns a new unallocated local ID
227 /// </summary>
228 /// <returns>A brand new local ID</returns>
229 protected internal uint AllocateLocalId()
230 {
231 uint myID;
232
233 _primAllocateMutex.WaitOne();
234 myID = ++m_lastAllocatedLocalId;
235 _primAllocateMutex.ReleaseMutex();
236
237 return myID;
238 }
215 239
216 public virtual T RequestModuleInterface<T>() 240 public virtual T RequestModuleInterface<T>()
217 { 241 {