From 486632986c33234924ba548609f623e590c46e2e Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 12 Jul 2007 23:57:26 +0000 Subject: *Parcel updates are now sent to users over newly subdivided areas and users over parcels being joined to correctly update the viewers *NOTE: Parcel updates are packets sent to the viewer when they enter a new parcel containing information such as parcel name, media URLS, etc --- OpenSim/Region/Environment/ParcelManager.cs | 31 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Environment/ParcelManager.cs') diff --git a/OpenSim/Region/Environment/ParcelManager.cs b/OpenSim/Region/Environment/ParcelManager.cs index aca63a0..5e7ee18 100644 --- a/OpenSim/Region/Environment/ParcelManager.cs +++ b/OpenSim/Region/Environment/ParcelManager.cs @@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment /// Adds a parcel to the stored list and adds them to the parcelIDList to what they own /// /// The parcel being added - public void addParcel(Parcel new_parcel) + public Parcel addParcel(Parcel new_parcel) { lastParcelLocalID++; new_parcel.parcelData.localID = lastParcelLocalID; @@ -144,6 +144,7 @@ namespace OpenSim.Region.Environment } parcelList[lastParcelLocalID].forceUpdateParcelInfo(); + return new_parcel; } /// @@ -182,6 +183,7 @@ namespace OpenSim.Region.Environment } } removeParcel(slave.parcelData.localID); + master.sendParcelUpdateToAvatarsOverMe(); } /// /// Get the parcel at the specified point @@ -260,10 +262,10 @@ namespace OpenSim.Region.Environment parcelList[startParcelIndex].setParcelBitmap(Parcel.modifyParcelBitmapSquare(startParcel.getParcelBitmap(), start_x, start_y, end_x, end_y, false)); parcelList[startParcelIndex].forceUpdateParcelInfo(); - //Now add the new parcel - addParcel(newParcel); + Parcel result = addParcel(newParcel); + result.sendParcelUpdateToAvatarsOverMe(); @@ -492,7 +494,7 @@ namespace OpenSim.Region.Environment 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!!! + over.sendParcelProperties(0, false, 0, remote_client); } } } @@ -649,17 +651,22 @@ namespace OpenSim.Region.Environment parcelData.snapshotID = packet.ParcelData.SnapshotID; parcelData.userLocation = packet.ParcelData.UserLocation; parcelData.userLookAt = packet.ParcelData.UserLookAt; + sendParcelUpdateToAvatarsOverMe(); + - List avatars = m_world.RequestAvatarList(); - for (int i = 0; i < avatars.Count; i++) + } + } + + public void sendParcelUpdateToAvatarsOverMe() + { + 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)); + if (over.parcelData.localID == this.parcelData.localID) { - Parcel over = m_world.parcelManager.getParcel((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); - if (over == this) - { - sendParcelProperties(0, false, 0, avatars[i].ControllingClient); - } + sendParcelProperties(0, false, 0, avatars[i].ControllingClient); } - } } #endregion -- cgit v1.1