diff options
author | mingchen | 2007-06-08 21:30:51 +0000 |
---|---|---|
committer | mingchen | 2007-06-08 21:30:51 +0000 |
commit | 2c04171990df9e01cd4c5aa600a6eaa1487f9605 (patch) | |
tree | c5664038ce624fb0f6edb63db6c62587e45518a3 /OpenSim/OpenSim.World | |
parent | *Moved SendRegionHandshake back to IClientAPI and modded sendRegionHandshakeT... (diff) | |
download | opensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.zip opensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.tar.gz opensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.tar.bz2 opensim-SC_OLD-2c04171990df9e01cd4c5aa600a6eaa1487f9605.tar.xz |
*Added delegates and events for parcel and estate management
*Only thing left is to get the master user setup in both sandbox and grid mode
Diffstat (limited to 'OpenSim/OpenSim.World')
-rw-r--r-- | OpenSim/OpenSim.World/Avatar.cs | 7 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/ParcelManager.cs | 58 | ||||
-rw-r--r-- | OpenSim/OpenSim.World/World.cs | 10 |
3 files changed, 72 insertions, 3 deletions
diff --git a/OpenSim/OpenSim.World/Avatar.cs b/OpenSim/OpenSim.World/Avatar.cs index d597ca7..6a4c0f8 100644 --- a/OpenSim/OpenSim.World/Avatar.cs +++ b/OpenSim/OpenSim.World/Avatar.cs | |||
@@ -83,6 +83,13 @@ namespace OpenSim.world | |||
83 | ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); | 83 | ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
84 | ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); | 84 | ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
85 | * */ | 85 | * */ |
86 | |||
87 | ControllingClient.OnParcelPropertiesRequest +=new ParcelPropertiesRequest(this.m_world.parcelManager.handleParcelPropertiesRequest); | ||
88 | ControllingClient.OnParcelDivideRequest += new ParcelDivideRequest(this.m_world.parcelManager.handleParcelDivideRequest); | ||
89 | ControllingClient.OnParcelJoinRequest += new ParcelJoinRequest(this.m_world.parcelManager.handleParcelJoinRequest); | ||
90 | ControllingClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(this.m_world.parcelManager.handleParcelPropertiesUpdateRequest); | ||
91 | |||
92 | ControllingClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(this.m_world.estateManager.handleEstateOwnerMessage); | ||
86 | } | 93 | } |
87 | 94 | ||
88 | /// <summary> | 95 | /// <summary> |
diff --git a/OpenSim/OpenSim.World/ParcelManager.cs b/OpenSim/OpenSim.World/ParcelManager.cs index 9fbacd6..4a9bfb1 100644 --- a/OpenSim/OpenSim.World/ParcelManager.cs +++ b/OpenSim/OpenSim.World/ParcelManager.cs | |||
@@ -166,7 +166,7 @@ namespace OpenSim.world | |||
166 | parcelList.Remove(local_id); | 166 | parcelList.Remove(local_id); |
167 | } | 167 | } |
168 | 168 | ||
169 | public void performFinalParcelJoin(Parcel master, Parcel slave) | 169 | private void performFinalParcelJoin(Parcel master, Parcel slave) |
170 | { | 170 | { |
171 | int x, y; | 171 | int x, y; |
172 | bool[,] parcelBitmapSlave = slave.getParcelBitmap(); | 172 | bool[,] parcelBitmapSlave = slave.getParcelBitmap(); |
@@ -212,7 +212,7 @@ namespace OpenSim.world | |||
212 | /// <param name="end_y">North Point</param> | 212 | /// <param name="end_y">North Point</param> |
213 | /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param> | 213 | /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param> |
214 | /// <returns>Returns true if successful</returns> | 214 | /// <returns>Returns true if successful</returns> |
215 | public bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) | 215 | private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) |
216 | { | 216 | { |
217 | //First, lets loop through the points and make sure they are all in the same parcel | 217 | //First, lets loop through the points and make sure they are all in the same parcel |
218 | //Get the parcel at start | 218 | //Get the parcel at start |
@@ -278,7 +278,7 @@ namespace OpenSim.world | |||
278 | /// <param name="end_y">y value in second parcel</param> | 278 | /// <param name="end_y">y value in second parcel</param> |
279 | /// <param name="attempting_user_id">LLUUID of the avatar trying to join the parcels</param> | 279 | /// <param name="attempting_user_id">LLUUID of the avatar trying to join the parcels</param> |
280 | /// <returns>Returns true if successful</returns> | 280 | /// <returns>Returns true if successful</returns> |
281 | public bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) | 281 | private bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) |
282 | { | 282 | { |
283 | end_x -= 4; | 283 | end_x -= 4; |
284 | end_y -= 4; | 284 | end_y -= 4; |
@@ -406,6 +406,58 @@ namespace OpenSim.world | |||
406 | packet.ParcelData.SequenceID = sequenceID; //Eh? | 406 | packet.ParcelData.SequenceID = sequenceID; //Eh? |
407 | remote_client.OutPacket((Packet)packet); | 407 | remote_client.OutPacket((Packet)packet); |
408 | } | 408 | } |
409 | |||
410 | public void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client) | ||
411 | { | ||
412 | //Get the parcels within the bounds | ||
413 | List<Parcel> temp = new List<Parcel>(); | ||
414 | int x, y, i; | ||
415 | int inc_x = end_x - start_x; | ||
416 | int inc_y = end_y - start_y; | ||
417 | for (x = 0; x < inc_x; x++) | ||
418 | { | ||
419 | for (y = 0; y < inc_y; y++) | ||
420 | { | ||
421 | OpenSim.world.Parcel currentParcel = getParcel(start_x + x, start_y + y); | ||
422 | if (!temp.Contains(currentParcel)) | ||
423 | { | ||
424 | currentParcel.forceUpdateParcelInfo(); | ||
425 | temp.Add(currentParcel); | ||
426 | } | ||
427 | } | ||
428 | } | ||
429 | |||
430 | int requestResult = ParcelManager.PARCEL_RESULT_ONE_PARCEL; | ||
431 | if (temp.Count > 1) | ||
432 | { | ||
433 | requestResult = ParcelManager.PARCEL_RESULT_MULTIPLE_PARCELS; | ||
434 | } | ||
435 | |||
436 | for (i = 0; i < temp.Count; i++) | ||
437 | { | ||
438 | temp[i].sendParcelProperties(sequence_id, snap_selection, requestResult, remote_client); | ||
439 | } | ||
440 | |||
441 | |||
442 | sendParcelOverlay(remote_client); | ||
443 | } | ||
444 | |||
445 | public void handleParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client) | ||
446 | { | ||
447 | if (parcelList.ContainsKey(packet.ParcelData.LocalID)) | ||
448 | { | ||
449 | parcelList[packet.ParcelData.LocalID].updateParcelProperties(packet, remote_client); | ||
450 | } | ||
451 | } | ||
452 | public void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) | ||
453 | { | ||
454 | subdivide(west, south, east, north, remote_client.AgentId); | ||
455 | } | ||
456 | public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client) | ||
457 | { | ||
458 | join(west, south, east, north, remote_client.AgentId); | ||
459 | |||
460 | } | ||
409 | #endregion | 461 | #endregion |
410 | 462 | ||
411 | /// <summary> | 463 | /// <summary> |
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs index e51c983..dc9602e 100644 --- a/OpenSim/OpenSim.World/World.cs +++ b/OpenSim/OpenSim.World/World.cs | |||
@@ -217,6 +217,16 @@ namespace OpenSim.world | |||
217 | Entities[UUID].BackUp(); | 217 | Entities[UUID].BackUp(); |
218 | } | 218 | } |
219 | 219 | ||
220 | //Parcel backup routines | ||
221 | ParcelData[] parcels = new ParcelData[parcelManager.parcelList.Count]; | ||
222 | int i = 0; | ||
223 | foreach (OpenSim.world.Parcel parcel in parcelManager.parcelList.Values) | ||
224 | { | ||
225 | parcels[i] = parcel.parcelData; | ||
226 | i++; | ||
227 | } | ||
228 | localStorage.SaveParcels(parcels); | ||
229 | |||
220 | // Backup successful | 230 | // Backup successful |
221 | return true; | 231 | return true; |
222 | } | 232 | } |