diff options
author | Justin Clarke Casey | 2008-11-07 22:49:36 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-07 22:49:36 +0000 |
commit | 4ace67a81d90ef6d6385c70f86cff2115522372b (patch) | |
tree | fc3fb61cf6ac54810c896351c02cd3c912a2e810 /OpenSim/Region/Environment/Scenes/SceneBase.cs | |
parent | * refactor: cleanup AllocateLocalPrimId() a bit more (diff) | |
download | opensim-SC_OLD-4ace67a81d90ef6d6385c70f86cff2115522372b.zip opensim-SC_OLD-4ace67a81d90ef6d6385c70f86cff2115522372b.tar.gz opensim-SC_OLD-4ace67a81d90ef6d6385c70f86cff2115522372b.tar.bz2 opensim-SC_OLD-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.cs | 24 |
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 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Threading; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using log4net; | 33 | using log4net; |
33 | using OpenSim.Framework; | 34 | using 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 | { |