diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 154 |
1 files changed, 97 insertions, 57 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b8ad78e..ae14af2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -153,15 +153,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
153 | { | 153 | { |
154 | lock (parcelLock) | 154 | lock (parcelLock) |
155 | { | 155 | { |
156 | m_previusParcelHide = m_currentParcelHide; | 156 | bool oldhide = m_currentParcelHide; |
157 | m_previusParcelUUID = m_currentParcelUUID; | 157 | bool check = true; |
158 | if (value != m_currentParcelUUID) | ||
159 | { | ||
160 | m_previusParcelHide = m_currentParcelHide; | ||
161 | m_previusParcelUUID = m_currentParcelUUID; | ||
162 | check = false; | ||
163 | } | ||
158 | m_currentParcelUUID = value; | 164 | m_currentParcelUUID = value; |
159 | m_currentParcelHide = false; | 165 | m_currentParcelHide = false; |
160 | ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y); | 166 | ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y); |
161 | if (land != null && !land.LandData.SeeAVs) | 167 | if (land != null && !land.LandData.SeeAVs) |
162 | m_currentParcelHide = true; | 168 | m_currentParcelHide = true; |
163 | if (m_previusParcelUUID != UUID.Zero) | 169 | if (m_previusParcelUUID != UUID.Zero) |
164 | ParcelCrossCheck(); | 170 | ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,check); |
165 | } | 171 | } |
166 | } | 172 | } |
167 | } | 173 | } |
@@ -195,17 +201,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
195 | { | 201 | { |
196 | get | 202 | get |
197 | { | 203 | { |
198 | try | 204 | return m_currentParcelHide; |
199 | { | ||
200 | lock (parcelLock) | ||
201 | { | ||
202 | return m_currentParcelHide; | ||
203 | } | ||
204 | } | ||
205 | catch | ||
206 | { | ||
207 | return false; | ||
208 | } | ||
209 | } | 205 | } |
210 | } | 206 | } |
211 | 207 | ||
@@ -5312,7 +5308,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
5312 | 5308 | ||
5313 | } | 5309 | } |
5314 | 5310 | ||
5315 | private void ParcelCrossCheck() | 5311 | private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID, |
5312 | bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) | ||
5316 | { | 5313 | { |
5317 | List<ScenePresence> killsToSendto = new List<ScenePresence>(); | 5314 | List<ScenePresence> killsToSendto = new List<ScenePresence>(); |
5318 | List<ScenePresence> killsToSendme = new List<ScenePresence>(); | 5315 | List<ScenePresence> killsToSendme = new List<ScenePresence>(); |
@@ -5320,82 +5317,125 @@ namespace OpenSim.Region.Framework.Scenes | |||
5320 | List<ScenePresence> viewsToSendme = new List<ScenePresence>(); | 5317 | List<ScenePresence> viewsToSendme = new List<ScenePresence>(); |
5321 | List<ScenePresence> allpresences = null; | 5318 | List<ScenePresence> allpresences = null; |
5322 | 5319 | ||
5323 | if (m_currentParcelHide) | 5320 | if (check) |
5324 | { | 5321 | { |
5325 | // now on a private parcel | 5322 | if (currentParcelUUID == null || oldhide == currentParcelHide) |
5323 | return; | ||
5324 | |||
5326 | allpresences = m_scene.GetScenePresences(); | 5325 | allpresences = m_scene.GetScenePresences(); |
5327 | 5326 | ||
5328 | if (m_previusParcelHide && m_previusParcelUUID != UUID.Zero) | 5327 | if (oldhide) |
5329 | { | 5328 | { // where private |
5330 | foreach (ScenePresence p in allpresences) | 5329 | foreach (ScenePresence p in allpresences) |
5331 | { | 5330 | { |
5332 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) | 5331 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) |
5333 | continue; | 5332 | continue; |
5334 | 5333 | ||
5335 | // only those on previus parcel need receive kills | 5334 | // those on not on parcel see me |
5336 | if (m_previusParcelUUID == p.currentParcelUUID) | 5335 | if (currentParcelUUID != p.currentParcelUUID) |
5337 | { | ||
5338 | killsToSendto.Add(p); // they dont see me | ||
5339 | killsToSendme.Add(p); // i dont see them | ||
5340 | } | ||
5341 | // only those on new parcel need see | ||
5342 | if (m_currentParcelUUID == p.currentParcelUUID) | ||
5343 | { | 5336 | { |
5344 | viewsToSendto.Add(p); // they see me | 5337 | viewsToSendto.Add(p); // they see me |
5345 | viewsToSendme.Add(p); // i see them | ||
5346 | } | 5338 | } |
5347 | } | 5339 | } |
5348 | } | 5340 | } // where private end |
5349 | else | ||
5350 | { | ||
5351 | //was on a public area | ||
5352 | allpresences = m_scene.GetScenePresences(); | ||
5353 | 5341 | ||
5342 | else | ||
5343 | { // where public | ||
5354 | foreach (ScenePresence p in allpresences) | 5344 | foreach (ScenePresence p in allpresences) |
5355 | { | 5345 | { |
5356 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) | 5346 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) |
5357 | continue; | 5347 | continue; |
5358 | 5348 | ||
5359 | // those not on new parcel dont see me | 5349 | // those not on parcel dont see me |
5360 | if (m_currentParcelUUID != p.currentParcelUUID) | 5350 | if (currentParcelUUID != p.currentParcelUUID) |
5361 | { | 5351 | { |
5362 | killsToSendto.Add(p); // they dont see me | 5352 | killsToSendto.Add(p); // they dont see me |
5363 | } | 5353 | } |
5364 | else | ||
5365 | { | ||
5366 | viewsToSendme.Add(p); // i see those on it | ||
5367 | } | ||
5368 | } | 5354 | } |
5369 | } | 5355 | } // where public end |
5370 | allpresences.Clear(); | ||
5371 | } // now on a private parcel end | ||
5372 | 5356 | ||
5357 | |||
5358 | allpresences.Clear(); | ||
5359 | } | ||
5373 | else | 5360 | else |
5374 | { | 5361 | { |
5375 | // now on public parcel | 5362 | if (currentParcelHide) |
5376 | if (m_previusParcelHide && m_previusParcelUUID != UUID.Zero) | ||
5377 | { | 5363 | { |
5378 | // was on private area | 5364 | // now on a private parcel |
5379 | allpresences = m_scene.GetScenePresences(); | 5365 | allpresences = m_scene.GetScenePresences(); |
5380 | 5366 | ||
5381 | foreach (ScenePresence p in allpresences) | 5367 | if (previusParcelHide && previusParcelUUID != UUID.Zero) |
5382 | { | 5368 | { |
5383 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) | 5369 | foreach (ScenePresence p in allpresences) |
5384 | continue; | ||
5385 | // only those old parcel need receive kills | ||
5386 | if (m_previusParcelUUID == p.currentParcelUUID) | ||
5387 | { | 5370 | { |
5388 | killsToSendme.Add(p); // i dont see them | 5371 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) |
5372 | continue; | ||
5373 | |||
5374 | // only those on previus parcel need receive kills | ||
5375 | if (previusParcelUUID == p.currentParcelUUID) | ||
5376 | { | ||
5377 | killsToSendto.Add(p); // they dont see me | ||
5378 | killsToSendme.Add(p); // i dont see them | ||
5379 | } | ||
5380 | // only those on new parcel need see | ||
5381 | if (currentParcelUUID == p.currentParcelUUID) | ||
5382 | { | ||
5383 | viewsToSendto.Add(p); // they see me | ||
5384 | viewsToSendme.Add(p); // i see them | ||
5385 | } | ||
5389 | } | 5386 | } |
5390 | else | 5387 | } |
5388 | else | ||
5389 | { | ||
5390 | //was on a public area | ||
5391 | allpresences = m_scene.GetScenePresences(); | ||
5392 | |||
5393 | foreach (ScenePresence p in allpresences) | ||
5391 | { | 5394 | { |
5392 | viewsToSendto.Add(p); // they see me | 5395 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) |
5396 | continue; | ||
5397 | |||
5398 | // those not on new parcel dont see me | ||
5399 | if (currentParcelUUID != p.currentParcelUUID) | ||
5400 | { | ||
5401 | killsToSendto.Add(p); // they dont see me | ||
5402 | } | ||
5403 | else | ||
5404 | { | ||
5405 | viewsToSendme.Add(p); // i see those on it | ||
5406 | } | ||
5393 | } | 5407 | } |
5394 | } | 5408 | } |
5395 | } | 5409 | allpresences.Clear(); |
5410 | } // now on a private parcel end | ||
5411 | |||
5396 | else | 5412 | else |
5397 | return; // was on a public area also | 5413 | { |
5398 | } // now on public parcel end | 5414 | // now on public parcel |
5415 | if (previusParcelHide && previusParcelUUID != UUID.Zero) | ||
5416 | { | ||
5417 | // was on private area | ||
5418 | allpresences = m_scene.GetScenePresences(); | ||
5419 | |||
5420 | foreach (ScenePresence p in allpresences) | ||
5421 | { | ||
5422 | if (p.IsChildAgent || p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) | ||
5423 | continue; | ||
5424 | // only those old parcel need receive kills | ||
5425 | if (previusParcelUUID == p.currentParcelUUID) | ||
5426 | { | ||
5427 | killsToSendme.Add(p); // i dont see them | ||
5428 | } | ||
5429 | else | ||
5430 | { | ||
5431 | viewsToSendto.Add(p); // they see me | ||
5432 | } | ||
5433 | } | ||
5434 | } | ||
5435 | else | ||
5436 | return; // was on a public area also | ||
5437 | } // now on public parcel end | ||
5438 | } | ||
5399 | 5439 | ||
5400 | // send the things | 5440 | // send the things |
5401 | // kill main avatar object | 5441 | // kill main avatar object |