aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-29 13:17:21 +0000
committerMelanie Thielker2008-11-29 13:17:21 +0000
commit1b3a3ffc7781a468f40841ee291d3f1e0fe22957 (patch)
tree3539571d9da669ed83ce0b1e7c0cc70b2dd12bd9 /OpenSim/Region/Environment
parentAdd the lifetime management back into the LSL_Api, since that will also (diff)
downloadopensim-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.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs2
4 files changed, 13 insertions, 12 deletions
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)