From df24ce6dfd803c5fcf6b0958ce14c455331a87b4 Mon Sep 17 00:00:00 2001
From: mingchen
Date: Thu, 12 Jul 2007 20:33:10 +0000
Subject: *Parcel and estate support fully restored into Sugilite *Significant
movement (currently set to 2 meters of movement for performance reasons, even
though its speedy) and initial login now sends parcel updates
---
OpenSim/Region/ClientStack/ClientView.API.cs | 2 ++
.../ClientStack/ClientView.ProcessPackets.cs | 1 +
OpenSim/Region/Environment/ParcelManager.cs | 20 ++++++++++++++++----
OpenSim/Region/Environment/Scenes/Scene.cs | 3 ++-
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 22 +++++++++++++++++++++-
5 files changed, 42 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 5be82dd..1c359c2 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -86,6 +86,8 @@ namespace OpenSim.Region.ClientStack
public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
public event EstateOwnerMessageRequest OnEstateOwnerMessage;
+
+
///
///
///
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index e5249f9..df2bf34 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -564,6 +564,7 @@ namespace OpenSim.Region.ClientStack
if (OnParcelPropertiesUpdateRequest != null)
{
OnParcelPropertiesUpdateRequest(updatePacket, this);
+
}
break;
#endregion
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
//Sale Flag
tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_IS_FOR_SALE);
}
- /*else if (currentParcelBlock.parcelData.ownerID == LLUUID.Zero)
+ else if (currentParcelBlock.parcelData.ownerID == LLUUID.Zero)
{
//Public Flag
tempByte = Convert.ToByte(tempByte | PARCEL_TYPE_PUBLIC);
- }*/
+ }
else
{
//Other Flag
@@ -395,7 +395,6 @@ namespace OpenSim.Region.Environment
packet = new ParcelOverlayPacket();
packet.ParcelData.Data = byteArray;
packet.ParcelData.SequenceID = sequenceID;
- Console.WriteLine("SENT #" + sequenceID);
remote_client.OutPacket((Packet)packet);
sequenceID++;
byteArray = new byte[PARCEL_BLOCKS_PER_PACKET];
@@ -483,6 +482,20 @@ namespace OpenSim.Region.Environment
addParcel(fullSimParcel);
}
+
+
+ public void handleSignificantClientMovement(IClientAPI remote_client)
+ {
+ Avatar clientAvatar = m_world.RequestAvatar(remote_client.AgentId);
+ if (clientAvatar != null)
+ {
+ Parcel over = getParcel(Convert.ToInt32(clientAvatar.Pos.X), Convert.ToInt32(clientAvatar.Pos.Y));
+ if (over != null)
+ {
+ over.sendParcelProperties(0, false, 0, remote_client); //TODO: correctly send the sequence ID!!!
+ }
+ }
+ }
#endregion
}
#endregion
@@ -638,7 +651,6 @@ namespace OpenSim.Region.Environment
parcelData.userLookAt = packet.ParcelData.UserLookAt;
List avatars = m_world.RequestAvatarList();
-
for (int i = 0; i < avatars.Count; i++)
{
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
client.OnParcelJoinRequest += new ParcelJoinRequest(parcelManager.handleParcelJoinRequest);
client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest);
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage);
-
+
+
this.estateManager.sendRegionHandshake(client);
CreateAndAddScenePresence(client);
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
{
public partial class ScenePresence : Entity
{
+
+
+
public static bool PhysicsEngineFlying = false;
public static AvatarAnimations Animations;
public static byte[] DefaultTexture;
@@ -75,7 +78,10 @@ namespace OpenSim.Region.Environment.Scenes
DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
}
-
+ ///
+ /// Position at which a significant movement was made
+ ///
+ private LLVector3 posLastSignificantMove = new LLVector3();
#region Properties
///
///
@@ -359,7 +365,9 @@ namespace OpenSim.Region.Environment.Scenes
}
}
+ this.CheckForSignificantMovement();
this.CheckForBorderCrossing();
+
}
}
#endregion
@@ -465,6 +473,18 @@ namespace OpenSim.Region.Environment.Scenes
}
#endregion
+ #region Significant Movement Method
+
+ protected void CheckForSignificantMovement()
+ {
+ if (libsecondlife.Helpers.VecDist(this.Pos, this.posLastSignificantMove) > 2.0)
+ {
+ this.posLastSignificantMove = this.Pos;
+ this.m_world.parcelManager.handleSignificantClientMovement(this.ControllingClient);
+
+ }
+ }
+ #endregion
#region Border Crossing Methods
///
///
--
cgit v1.1