diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Environment/ParcelManager.cs | 54 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 3 |
4 files changed, 43 insertions, 25 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index cc4fdbe..df5a853 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -87,6 +87,7 @@ namespace OpenSim.Region.ClientStack | |||
87 | 87 | ||
88 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; | 88 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; |
89 | 89 | ||
90 | public event SignificantClientMovement OnSignificantClientMovement; | ||
90 | 91 | ||
91 | /// <summary> | 92 | /// <summary> |
92 | /// | 93 | /// |
@@ -1177,5 +1178,13 @@ namespace OpenSim.Region.ClientStack | |||
1177 | 1178 | ||
1178 | OutPacket( packet ); | 1179 | OutPacket( packet ); |
1179 | } | 1180 | } |
1181 | |||
1182 | public void TriggerSignificantClientMovement(IClientAPI remote_client) | ||
1183 | { | ||
1184 | if (OnSignificantClientMovement != null) | ||
1185 | { | ||
1186 | OnSignificantClientMovement(remote_client); | ||
1187 | } | ||
1188 | } | ||
1180 | } | 1189 | } |
1181 | } | 1190 | } |
diff --git a/OpenSim/Region/Environment/ParcelManager.cs b/OpenSim/Region/Environment/ParcelManager.cs index ef6603d..125ba19 100644 --- a/OpenSim/Region/Environment/ParcelManager.cs +++ b/OpenSim/Region/Environment/ParcelManager.cs | |||
@@ -183,7 +183,6 @@ namespace OpenSim.Region.Environment | |||
183 | } | 183 | } |
184 | } | 184 | } |
185 | removeParcel(slave.parcelData.localID); | 185 | removeParcel(slave.parcelData.localID); |
186 | master.sendParcelUpdateToAvatarsOverMe(); | ||
187 | } | 186 | } |
188 | /// <summary> | 187 | /// <summary> |
189 | /// Get the parcel at the specified point | 188 | /// Get the parcel at the specified point |
@@ -217,6 +216,7 @@ namespace OpenSim.Region.Environment | |||
217 | /// <returns>Returns true if successful</returns> | 216 | /// <returns>Returns true if successful</returns> |
218 | private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) | 217 | private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) |
219 | { | 218 | { |
219 | |||
220 | //First, lets loop through the points and make sure they are all in the same parcel | 220 | //First, lets loop through the points and make sure they are all in the same parcel |
221 | //Get the parcel at start | 221 | //Get the parcel at start |
222 | Parcel startParcel = getParcel(start_x, start_y); | 222 | Parcel startParcel = getParcel(start_x, start_y); |
@@ -286,39 +286,47 @@ namespace OpenSim.Region.Environment | |||
286 | end_x -= 4; | 286 | end_x -= 4; |
287 | end_y -= 4; | 287 | end_y -= 4; |
288 | 288 | ||
289 | //NOTE: The following only connects the parcels in each corner and not all the parcels that are within the selection box! | 289 | List<Parcel> selectedParcels = new List<Parcel>(); |
290 | //This should be fixed later -- somewhat "incomplete code" --Ming | 290 | int stepXSelected = 0; |
291 | Parcel startParcel, endParcel; | 291 | int stepYSelected = 0; |
292 | 292 | for (stepYSelected = start_y; stepYSelected <= end_y; stepYSelected += 4) | |
293 | try | ||
294 | { | 293 | { |
295 | startParcel = getParcel(start_x, start_y); | 294 | for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4) |
296 | endParcel = getParcel(end_x, end_y); | 295 | { |
296 | Parcel p = getParcel(stepXSelected,stepYSelected); | ||
297 | if (!selectedParcels.Contains(p)) | ||
298 | { | ||
299 | selectedParcels.Add(p); | ||
300 | } | ||
301 | } | ||
297 | } | 302 | } |
298 | catch (Exception) | 303 | Parcel masterParcel = selectedParcels[0]; |
304 | selectedParcels.RemoveAt(0); | ||
305 | |||
306 | |||
307 | if (selectedParcels.Count < 1) | ||
299 | { | 308 | { |
300 | return false; //Error occured when trying to get the start and end parcels | 309 | return false; //Only one parcel selected |
301 | } | 310 | } |
302 | if (startParcel == endParcel) | 311 | if (masterParcel.parcelData.ownerID != attempting_user_id) |
303 | { | 312 | { |
304 | return false; //Subdivision of the same parcel is not allowed | 313 | return false; //Not the same owner |
305 | } | 314 | } |
306 | 315 | foreach (Parcel p in selectedParcels) | |
307 | //Check the parcel owners: | ||
308 | if (startParcel.parcelData.ownerID != endParcel.parcelData.ownerID) | ||
309 | { | 316 | { |
310 | return false; | 317 | if (p.parcelData.ownerID != masterParcel.parcelData.ownerID) |
318 | { | ||
319 | return false; //Over multiple users. TODO: make this just ignore this parcel? | ||
320 | } | ||
311 | } | 321 | } |
312 | if (startParcel.parcelData.ownerID != attempting_user_id) | 322 | foreach (Parcel slaveParcel in selectedParcels) |
313 | { | 323 | { |
314 | //TODO: Group editing stuff. Avatar owner support for now | 324 | parcelList[masterParcel.parcelData.localID].setParcelBitmap(Parcel.mergeParcelBitmaps(masterParcel.getParcelBitmap(), slaveParcel.getParcelBitmap())); |
315 | return false; | 325 | performFinalParcelJoin(masterParcel, slaveParcel); |
316 | } | 326 | } |
317 | 327 | ||
318 | //Same owners! Lets join them | 328 | |
319 | //Merge them to startParcel | 329 | masterParcel.sendParcelUpdateToAvatarsOverMe(); |
320 | parcelList[startParcel.parcelData.localID].setParcelBitmap(Parcel.mergeParcelBitmaps(startParcel.getParcelBitmap(), endParcel.getParcelBitmap())); | ||
321 | performFinalParcelJoin(startParcel, endParcel); | ||
322 | 330 | ||
323 | return true; | 331 | return true; |
324 | 332 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a1b060f..7098c38 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -484,6 +484,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
484 | client.OnParcelJoinRequest += new ParcelJoinRequest(parcelManager.handleParcelJoinRequest); | 484 | client.OnParcelJoinRequest += new ParcelJoinRequest(parcelManager.handleParcelJoinRequest); |
485 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); | 485 | client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); |
486 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); | 486 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); |
487 | |||
488 | client.OnSignificantClientMovement += new SignificantClientMovement(parcelManager.handleSignificantClientMovement); | ||
487 | } | 489 | } |
488 | 490 | ||
489 | protected void CreateAndAddScenePresence(IClientAPI client) | 491 | protected void CreateAndAddScenePresence(IClientAPI client) |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index a813aed..613ad52 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -479,8 +479,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
479 | if (libsecondlife.Helpers.VecDist(this.Pos, this.posLastSignificantMove) > 2.0) | 479 | if (libsecondlife.Helpers.VecDist(this.Pos, this.posLastSignificantMove) > 2.0) |
480 | { | 480 | { |
481 | this.posLastSignificantMove = this.Pos; | 481 | this.posLastSignificantMove = this.Pos; |
482 | this.m_world.parcelManager.handleSignificantClientMovement(this.ControllingClient); | 482 | this.ControllingClient.TriggerSignificantClientMovement(this.ControllingClient); |
483 | |||
484 | } | 483 | } |
485 | } | 484 | } |
486 | #endregion | 485 | #endregion |