diff options
author | Melanie Thielker | 2008-11-29 13:17:21 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-29 13:17:21 +0000 |
commit | 1b3a3ffc7781a468f40841ee291d3f1e0fe22957 (patch) | |
tree | 3539571d9da669ed83ce0b1e7c0cc70b2dd12bd9 | |
parent | Add the lifetime management back into the LSL_Api, since that will also (diff) | |
download | opensim-SC-1b3a3ffc7781a468f40841ee291d3f1e0fe22957.zip opensim-SC-1b3a3ffc7781a468f40841ee291d3f1e0fe22957.tar.gz opensim-SC-1b3a3ffc7781a468f40841ee291d3f1e0fe22957.tar.bz2 opensim-SC-1b3a3ffc7781a468f40841ee291d3f1e0fe22957.tar.xz |
Finally make attachments stay put. Randomize local ID generation to
prevent adjacent sims from using identical Local IDs for the attachment
Thanks to Mana Janus (Hippo Viewer) for providing the crucial bit of
information, namely that, due to a bug in the viewer, adjacent sims can't
use the same local ids.
-rw-r--r-- | OpenSim/Framework/IScene.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneBase.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index 000a800..bd4acd1 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs | |||
@@ -57,7 +57,6 @@ namespace OpenSim.Framework | |||
57 | public interface IScene | 57 | public interface IScene |
58 | { | 58 | { |
59 | RegionInfo RegionInfo { get; } | 59 | RegionInfo RegionInfo { get; } |
60 | uint NextAvatarLocalId { get; } | ||
61 | RegionStatus Region_Status { get; set; } | 60 | RegionStatus Region_Status { get; set; } |
62 | 61 | ||
63 | ClientManager ClientManager { get; } | 62 | ClientManager ClientManager { get; } |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 68aee86..0c4e6db 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -556,7 +556,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
556 | } | 556 | } |
557 | lock (m_landList) | 557 | lock (m_landList) |
558 | { | 558 | { |
559 | return m_landList[m_landIDList[x, y]]; | 559 | // Corner case. If an autoreturn happens during sim startup |
560 | // we will come here with the list uninitialized | ||
561 | // | ||
562 | if (m_landList.ContainsKey(m_landIDList[x, y])) | ||
563 | return m_landList[m_landIDList[x, y]]; | ||
564 | return null; | ||
560 | } | 565 | } |
561 | } | 566 | } |
562 | 567 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c8285a3..03d79f1 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -269,6 +269,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
269 | { | 269 | { |
270 | m_config = config; | 270 | m_config = config; |
271 | 271 | ||
272 | Random random = new Random(); | ||
273 | m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue/2))+(uint)(uint.MaxValue/4); | ||
272 | m_moduleLoader = moduleLoader; | 274 | m_moduleLoader = moduleLoader; |
273 | m_authenticateHandler = authen; | 275 | m_authenticateHandler = authen; |
274 | CommsManager = commsMan; | 276 | CommsManager = commsMan; |
@@ -2182,12 +2184,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
2182 | // | 2184 | // |
2183 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | 2185 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); |
2184 | 2186 | ||
2185 | RootPrim.SetParentLocalId(parentLocalID); | ||
2186 | |||
2187 | if (RootPrim != null) | 2187 | if (RootPrim != null) |
2188 | { | 2188 | { |
2189 | SceneObjectGroup grp = RootPrim.ParentGroup; | 2189 | SceneObjectGroup grp = RootPrim.ParentGroup; |
2190 | 2190 | ||
2191 | RootPrim.SetParentLocalId(parentLocalID); | ||
2192 | |||
2191 | if (grp != null) | 2193 | if (grp != null) |
2192 | { | 2194 | { |
2193 | m_log.DebugFormat("[ATTACHMENT]: Received "+ | 2195 | m_log.DebugFormat("[ATTACHMENT]: Received "+ |
@@ -2205,6 +2207,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2205 | grp.LocalId, (uint)0, | 2207 | grp.LocalId, (uint)0, |
2206 | grp.GroupRotation, | 2208 | grp.GroupRotation, |
2207 | grp.AbsolutePosition, false); | 2209 | grp.AbsolutePosition, false); |
2210 | grp.SendGroupFullUpdate(); | ||
2208 | } | 2211 | } |
2209 | else | 2212 | else |
2210 | { | 2213 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 6d1e808..805ca5d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
53 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is | 53 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is |
54 | /// dispensed. | 54 | /// dispensed. |
55 | /// </summary> | 55 | /// </summary> |
56 | private uint m_lastAllocatedLocalId = 720000; | 56 | protected uint m_lastAllocatedLocalId = 720000; |
57 | 57 | ||
58 | private readonly Mutex _primAllocateMutex = new Mutex(false); | 58 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
59 | 59 | ||
@@ -92,8 +92,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
92 | 92 | ||
93 | protected string m_datastore; | 93 | protected string m_datastore; |
94 | 94 | ||
95 | private uint m_nextAvatarLocalId = 8880000; | ||
96 | |||
97 | private AssetCache m_assetCache; | 95 | private AssetCache m_assetCache; |
98 | 96 | ||
99 | public AssetCache AssetCache | 97 | public AssetCache AssetCache |
@@ -167,11 +165,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
167 | get { return m_regInfo; } | 165 | get { return m_regInfo; } |
168 | } | 166 | } |
169 | 167 | ||
170 | public uint NextAvatarLocalId | ||
171 | { | ||
172 | get { return m_nextAvatarLocalId++; } | ||
173 | } | ||
174 | |||
175 | #region admin stuff | 168 | #region admin stuff |
176 | 169 | ||
177 | /// <summary> | 170 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 8b4eb72..b85fd93 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -508,7 +508,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
508 | m_scene = world; | 508 | m_scene = world; |
509 | m_uuid = client.AgentId; | 509 | m_uuid = client.AgentId; |
510 | m_regionInfo = reginfo; | 510 | m_regionInfo = reginfo; |
511 | m_localId = m_scene.NextAvatarLocalId; | 511 | m_localId = m_scene.AllocateLocalId(); |
512 | 512 | ||
513 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 513 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
514 | if (gm != null) | 514 | if (gm != null) |