From 16cf3967b4b2929e20f13a5d9ae91dc0e7ac03ef Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 20 Aug 2014 17:54:23 +0100 Subject: [PATCH] Reserve a extra localID for a presence ( it will be localID + 1 ) --- OpenSim/Region/Framework/Scenes/SceneBase.cs | 12 ++++++++++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index dd0c828067..f5be7a7c64 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -295,6 +295,18 @@ namespace OpenSim.Region.Framework.Scenes return myID; } + + public uint AllocatePresenceLocalId() + { + uint myID; + + _primAllocateMutex.WaitOne(); + myID = ++m_lastAllocatedLocalId; + ++m_lastAllocatedLocalId; + _primAllocateMutex.ReleaseMutex(); + + return myID; + } #region Module Methods diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 864f54dc62..5ebf3dbb10 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -969,7 +969,7 @@ namespace OpenSim.Region.Framework.Scenes m_name = String.Format("{0} {1}", Firstname, Lastname); m_scene = world; m_uuid = client.AgentId; - LocalId = m_scene.AllocateLocalId(); + LocalId = m_scene.AllocatePresenceLocalId(); UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); if (account != null)