aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/ParcelManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/ParcelManager.cs')
-rw-r--r--OpenSim/Region/Environment/ParcelManager.cs54
1 files changed, 31 insertions, 23 deletions
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