diff options
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/ParcelManager.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 22 |
3 files changed, 39 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/ParcelManager.cs b/OpenSim/Region/Environment/ParcelManager.cs index a1ed930..aca63a0 100644 --- a/OpenSim/Region/Environment/ParcelManager.cs +++ b/OpenSim/Region/Environment/ParcelManager.cs | |||
@@ -356,11 +356,11 @@ namespace OpenSim.Region.Environment | |||
356 | //Sale Flag | 356 | //Sale Flag |
357 | tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_IS_FOR_SALE); | 357 | tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_IS_FOR_SALE); |
358 | } | 358 | } |
359 | /*else if (currentParcelBlock.parcelData.ownerID == LLUUID.Zero) | 359 | else if (currentParcelBlock.parcelData.ownerID == LLUUID.Zero) |
360 | { | 360 | { |
361 | //Public Flag | 361 | //Public Flag |
362 | tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_PUBLIC); | 362 | tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_PUBLIC); |
363 | }*/ | 363 | } |
364 | else | 364 | else |
365 | { | 365 | { |
366 | //Other Flag | 366 | //Other Flag |
@@ -395,7 +395,6 @@ namespace OpenSim.Region.Environment | |||
395 | packet = new ParcelOverlayPacket(); | 395 | packet = new ParcelOverlayPacket(); |
396 | packet.ParcelData.Data = byteArray; | 396 | packet.ParcelData.Data = byteArray; |
397 | packet.ParcelData.SequenceID = sequenceID; | 397 | packet.ParcelData.SequenceID = sequenceID; |
398 | Console.WriteLine("SENT #" + sequenceID); | ||
399 | remote_client.OutPacket((Packet)packet); | 398 | remote_client.OutPacket((Packet)packet); |
400 | sequenceID++; | 399 | sequenceID++; |
401 | byteArray = new byte[PARCEL_BLOCKS_PER_PACKET]; | 400 | byteArray = new byte[PARCEL_BLOCKS_PER_PACKET]; |
@@ -483,6 +482,20 @@ namespace OpenSim.Region.Environment | |||
483 | addParcel(fullSimParcel); | 482 | addParcel(fullSimParcel); |
484 | 483 | ||
485 | } | 484 | } |
485 | |||
486 | |||
487 | public void handleSignificantClientMovement(IClientAPI remote_client) | ||
488 | { | ||
489 | Avatar clientAvatar = m_world.RequestAvatar(remote_client.AgentId); | ||
490 | if (clientAvatar != null) | ||
491 | { | ||
492 | Parcel over = getParcel(Convert.ToInt32(clientAvatar.Pos.X), Convert.ToInt32(clientAvatar.Pos.Y)); | ||
493 | if (over != null) | ||
494 | { | ||
495 | over.sendParcelProperties(0, false, 0, remote_client); //TODO: correctly send the sequence ID!!! | ||
496 | } | ||
497 | } | ||
498 | } | ||
486 | #endregion | 499 | #endregion |
487 | } | 500 | } |
488 | #endregion | 501 | #endregion |
@@ -638,7 +651,6 @@ namespace OpenSim.Region.Environment | |||
638 | parcelData.userLookAt = packet.ParcelData.UserLookAt; | 651 | parcelData.userLookAt = packet.ParcelData.UserLookAt; |
639 | 652 | ||
640 | List<Avatar> avatars = m_world.RequestAvatarList(); | 653 | List<Avatar> avatars = m_world.RequestAvatarList(); |
641 | |||
642 | for (int i = 0; i < avatars.Count; i++) | 654 | for (int i = 0; i < avatars.Count; i++) |
643 | { | 655 | { |
644 | Parcel over = m_world.parcelManager.getParcel((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); | 656 | Parcel over = m_world.parcelManager.getParcel((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d526b3c..4a4b7a0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -492,7 +492,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
492 | client.OnParcelJoinRequest += new ParcelJoinRequest(parcelManager.handleParcelJoinRequest); | 492 | client.OnParcelJoinRequest += new ParcelJoinRequest(parcelManager.handleParcelJoinRequest); |
493 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); | 493 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); |
494 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); | 494 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); |
495 | 495 | ||
496 | |||
496 | this.estateManager.sendRegionHandshake(client); | 497 | this.estateManager.sendRegionHandshake(client); |
497 | CreateAndAddScenePresence(client); | 498 | CreateAndAddScenePresence(client); |
498 | 499 | ||
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 8134276..037b19d 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -40,6 +40,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
40 | { | 40 | { |
41 | public partial class ScenePresence : Entity | 41 | public partial class ScenePresence : Entity |
42 | { | 42 | { |
43 | |||
44 | |||
45 | |||
43 | public static bool PhysicsEngineFlying = false; | 46 | public static bool PhysicsEngineFlying = false; |
44 | public static AvatarAnimations Animations; | 47 | public static AvatarAnimations Animations; |
45 | public static byte[] DefaultTexture; | 48 | public static byte[] DefaultTexture; |
@@ -75,7 +78,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
75 | DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS, | 78 | DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS, |
76 | DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG | 79 | DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG |
77 | } | 80 | } |
78 | 81 | /// <summary> | |
82 | /// Position at which a significant movement was made | ||
83 | /// </summary> | ||
84 | private LLVector3 posLastSignificantMove = new LLVector3(); | ||
79 | #region Properties | 85 | #region Properties |
80 | /// <summary> | 86 | /// <summary> |
81 | /// | 87 | /// |
@@ -359,7 +365,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
359 | } | 365 | } |
360 | } | 366 | } |
361 | 367 | ||
368 | this.CheckForSignificantMovement(); | ||
362 | this.CheckForBorderCrossing(); | 369 | this.CheckForBorderCrossing(); |
370 | |||
363 | } | 371 | } |
364 | } | 372 | } |
365 | #endregion | 373 | #endregion |
@@ -465,6 +473,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
465 | } | 473 | } |
466 | #endregion | 474 | #endregion |
467 | 475 | ||
476 | #region Significant Movement Method | ||
477 | |||
478 | protected void CheckForSignificantMovement() | ||
479 | { | ||
480 | if (libsecondlife.Helpers.VecDist(this.Pos, this.posLastSignificantMove) > 2.0) | ||
481 | { | ||
482 | this.posLastSignificantMove = this.Pos; | ||
483 | this.m_world.parcelManager.handleSignificantClientMovement(this.ControllingClient); | ||
484 | |||
485 | } | ||
486 | } | ||
487 | #endregion | ||
468 | #region Border Crossing Methods | 488 | #region Border Crossing Methods |
469 | /// <summary> | 489 | /// <summary> |
470 | /// | 490 | /// |