aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authormingchen2007-07-13 21:13:38 +0000
committermingchen2007-07-13 21:13:38 +0000
commit862dc9fe975bdaa71116c8449ac27289f860441e (patch)
treefd90837f60f7bebcca522b4770601795a3c065dc /OpenSim/Region/Environment
parentChat/Shout/etc should be working again (diff)
downloadopensim-SC_OLD-862dc9fe975bdaa71116c8449ac27289f860441e.zip
opensim-SC_OLD-862dc9fe975bdaa71116c8449ac27289f860441e.tar.gz
opensim-SC_OLD-862dc9fe975bdaa71116c8449ac27289f860441e.tar.bz2
opensim-SC_OLD-862dc9fe975bdaa71116c8449ac27289f860441e.tar.xz
*Reworked parcel joining to work the same way as LL's method.
**Parcels within selection now join and not the two parcels selected at each corner *Created OnSignificantClientMovement event that is triggered when an avatar moves more than 2 meters.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/ParcelManager.cs54
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs3
3 files changed, 34 insertions, 25 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
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