aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2014-08-01 18:59:08 +0100
committerUbitUmarov2014-08-01 18:59:08 +0100
commitef1f37cf20b756e8549305f2d405ea8e9bbda9ff (patch)
treef838a8a62cca7d9023c23a15afacaf4fddf82dee /OpenSim/Region
parentremove unnecessary sendparceloverlay (diff)
downloadopensim-SC-ef1f37cf20b756e8549305f2d405ea8e9bbda9ff.zip
opensim-SC-ef1f37cf20b756e8549305f2d405ea8e9bbda9ff.tar.gz
opensim-SC-ef1f37cf20b756e8549305f2d405ea8e9bbda9ff.tar.bz2
opensim-SC-ef1f37cf20b756e8549305f2d405ea8e9bbda9ff.tar.xz
handle change of hide avatars flag. Parcel limits edition still need work
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs27
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs154
2 files changed, 114 insertions, 67 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 2de6402..3016bbe 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -194,7 +194,8 @@ namespace OpenSim.Region.CoreModules.World.Land
194 client.OnParcelEjectUser += ClientOnParcelEjectUser; 194 client.OnParcelEjectUser += ClientOnParcelEjectUser;
195 client.OnParcelFreezeUser += ClientOnParcelFreezeUser; 195 client.OnParcelFreezeUser += ClientOnParcelFreezeUser;
196 client.OnSetStartLocationRequest += ClientOnSetHome; 196 client.OnSetStartLocationRequest += ClientOnSetHome;
197/* avatar is still a child here position is unknow 197
198/* avatar is still a child here position is unknown
198 EntityBase presenceEntity; 199 EntityBase presenceEntity;
199 if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) 200 if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
200 { 201 {
@@ -334,12 +335,13 @@ namespace OpenSim.Region.CoreModules.World.Land
334 if (!position.HasValue) 335 if (!position.HasValue)
335 return; 336 return;
336 337
337 bool isFlying = avatar.PhysicsActor.Flying; 338// land should have no word on avatar physics
338 avatar.RemoveFromPhysicalScene(); 339// bool isFlying = avatar.PhysicsActor.Flying;
340// avatar.RemoveFromPhysicalScene();
339 341
340 avatar.AbsolutePosition = (Vector3)position; 342 avatar.AbsolutePosition = (Vector3)position;
341 343
342 avatar.AddToPhysicalScene(isFlying); 344// avatar.AddToPhysicalScene(isFlying);
343 } 345 }
344 346
345 public void SendYouAreRestrictedNotice(ScenePresence avatar) 347 public void SendYouAreRestrictedNotice(ScenePresence avatar)
@@ -388,13 +390,15 @@ namespace OpenSim.Region.CoreModules.World.Land
388 390
389 public void sendClientInitialLandInfo(IClientAPI remoteClient) 391 public void sendClientInitialLandInfo(IClientAPI remoteClient)
390 { 392 {
391 SendParcelOverlay(remoteClient);
392 ScenePresence avatar; 393 ScenePresence avatar;
394
393 if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out avatar)) 395 if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out avatar))
394 return; 396 return;
395 if (avatar.IsChildAgent) 397 if (avatar.IsChildAgent)
396 return; 398 return;
397 399
400 SendParcelOverlay(remoteClient);
401
398 ILandObject over = GetLandObject(avatar.AbsolutePosition.X,avatar.AbsolutePosition.Y); 402 ILandObject over = GetLandObject(avatar.AbsolutePosition.X,avatar.AbsolutePosition.Y);
399 if (over == null) 403 if (over == null)
400 return; 404 return;
@@ -416,8 +420,8 @@ namespace OpenSim.Region.CoreModules.World.Land
416 if (force || NotsameID) 420 if (force || NotsameID)
417 { 421 {
418 over.SendLandUpdateToClient(avatar.ControllingClient); 422 over.SendLandUpdateToClient(avatar.ControllingClient);
419 if (NotsameID) 423 SendParcelOverlay(avatar.ControllingClient);
420 avatar.currentParcelUUID = over.LandData.GlobalID; 424 avatar.currentParcelUUID = over.LandData.GlobalID;
421 m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, 425 m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID,
422 m_scene.RegionInfo.RegionID); 426 m_scene.RegionInfo.RegionID);
423 } 427 }
@@ -1190,15 +1194,16 @@ namespace OpenSim.Region.CoreModules.World.Land
1190 bool needOverlay = false; 1194 bool needOverlay = false;
1191 if (land.UpdateLandProperties(args, remote_client, out snap_selection, out needOverlay)) 1195 if (land.UpdateLandProperties(args, remote_client, out snap_selection, out needOverlay))
1192 { 1196 {
1193 //parcel 1197 //the proprieties to who changed it
1194 1198
1195 land.SendLandProperties(-10000, true, LandChannel.LAND_RESULT_SINGLE, remote_client); 1199 land.SendLandProperties(0, true, LandChannel.LAND_RESULT_SINGLE, remote_client);
1196 1200
1197 if (needOverlay) 1201 if (needOverlay)
1198 { 1202 {
1203 UUID parcelID = land.LandData.GlobalID;
1199 m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar) 1204 m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
1200 { 1205 {
1201 if (avatar.IsChildAgent) 1206 if (avatar.IsDeleted || avatar.IsChildAgent)
1202 return; 1207 return;
1203 1208
1204 IClientAPI client = avatar.ControllingClient; 1209 IClientAPI client = avatar.ControllingClient;
@@ -1209,6 +1214,8 @@ namespace OpenSim.Region.CoreModules.World.Land
1209 if (client != remote_client || land != aland) 1214 if (client != remote_client || land != aland)
1210 aland.SendLandProperties(0, false, LandChannel.LAND_RESULT_SINGLE, client); 1215 aland.SendLandProperties(0, false, LandChannel.LAND_RESULT_SINGLE, client);
1211 } 1216 }
1217 if (avatar.currentParcelUUID == parcelID)
1218 avatar.currentParcelUUID = parcelID; // force parcel flags review
1212 }); 1219 });
1213 } 1220 }
1214 } 1221 }
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