*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
afrisby
mingchen 2007-07-12 20:33:10 +00:00
parent b27924d0a5
commit df24ce6dfd
6 changed files with 43 additions and 7 deletions

View File

@ -75,6 +75,7 @@ namespace OpenSim.Framework.Interfaces
public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client);
public interface IClientAPI
{
event ImprovedInstantMessage OnInstantMessage;
@ -124,7 +125,6 @@ namespace OpenSim.Framework.Interfaces
event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
event EstateOwnerMessageRequest OnEstateOwnerMessage;
LLVector3 StartPos
{
get;

View File

@ -86,6 +86,8 @@ namespace OpenSim.Region.ClientStack
public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
public event EstateOwnerMessageRequest OnEstateOwnerMessage;
/// <summary>
///
/// </summary>

View File

@ -564,6 +564,7 @@ namespace OpenSim.Region.ClientStack
if (OnParcelPropertiesUpdateRequest != null)
{
OnParcelPropertiesUpdateRequest(updatePacket, this);
}
break;
#endregion

View File

@ -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<Avatar> 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));

View File

@ -493,6 +493,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest);
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage);
this.estateManager.sendRegionHandshake(client);
CreateAndAddScenePresence(client);

View File

@ -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
}
/// <summary>
/// Position at which a significant movement was made
/// </summary>
private LLVector3 posLastSignificantMove = new LLVector3();
#region Properties
/// <summary>
///
@ -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
/// <summary>
///