diff options
author | MW | 2007-06-09 11:13:02 +0000 |
---|---|---|
committer | MW | 2007-06-09 11:13:02 +0000 |
commit | 3658015de8f614b99f116b2971957307f0960c55 (patch) | |
tree | 491156d6c9a5319bdf032c94abd70784c157854e /OpenSim/OpenSim.World/ParcelManager.cs | |
parent | Protip: Check for obvious errors before submitting (diff) | |
download | opensim-SC-3658015de8f614b99f116b2971957307f0960c55.zip opensim-SC-3658015de8f614b99f116b2971957307f0960c55.tar.gz opensim-SC-3658015de8f614b99f116b2971957307f0960c55.tar.bz2 opensim-SC-3658015de8f614b99f116b2971957307f0960c55.tar.xz |
Number of small changes.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/OpenSim.World/ParcelManager.cs | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/OpenSim/OpenSim.World/ParcelManager.cs b/OpenSim/OpenSim.World/ParcelManager.cs index 4a9bfb1..db6909d 100644 --- a/OpenSim/OpenSim.World/ParcelManager.cs +++ b/OpenSim/OpenSim.World/ParcelManager.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Framework.Types; | |||
35 | 35 | ||
36 | namespace OpenSim.world | 36 | namespace OpenSim.world |
37 | { | 37 | { |
38 | 38 | ||
39 | 39 | ||
40 | #region ParcelManager Class | 40 | #region ParcelManager Class |
41 | /// <summary> | 41 | /// <summary> |
@@ -62,7 +62,7 @@ namespace OpenSim.world | |||
62 | public const byte PARCEL_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000 | 62 | public const byte PARCEL_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000 |
63 | 63 | ||
64 | //RequestResults (I think these are right, they seem to work): | 64 | //RequestResults (I think these are right, they seem to work): |
65 | public const int PARCEL_RESULT_ONE_PARCEL = 0; // The request they made contained only one parcel | 65 | public const int PARCEL_RESULT_ONE_PARCEL = 0; // The request they made contained only one parcel |
66 | public const int PARCEL_RESULT_MULTIPLE_PARCELS = 1; // The request they made contained more than one parcel | 66 | public const int PARCEL_RESULT_MULTIPLE_PARCELS = 1; // The request they made contained more than one parcel |
67 | 67 | ||
68 | //These are other constants. Yay! | 68 | //These are other constants. Yay! |
@@ -143,7 +143,7 @@ namespace OpenSim.world | |||
143 | } | 143 | } |
144 | parcelList[lastParcelLocalID].forceUpdateParcelInfo(); | 144 | parcelList[lastParcelLocalID].forceUpdateParcelInfo(); |
145 | 145 | ||
146 | 146 | ||
147 | } | 147 | } |
148 | /// <summary> | 148 | /// <summary> |
149 | /// Removes a parcel from the list. Will not remove if local_id is still owning an area in parcelIDList | 149 | /// Removes a parcel from the list. Will not remove if local_id is still owning an area in parcelIDList |
@@ -258,12 +258,12 @@ namespace OpenSim.world | |||
258 | int startParcelIndex = startParcel.parcelData.localID; | 258 | int startParcelIndex = startParcel.parcelData.localID; |
259 | parcelList[startParcelIndex].setParcelBitmap(Parcel.modifyParcelBitmapSquare(startParcel.getParcelBitmap(), start_x, start_y, end_x, end_y, false)); | 259 | parcelList[startParcelIndex].setParcelBitmap(Parcel.modifyParcelBitmapSquare(startParcel.getParcelBitmap(), start_x, start_y, end_x, end_y, false)); |
260 | parcelList[startParcelIndex].forceUpdateParcelInfo(); | 260 | parcelList[startParcelIndex].forceUpdateParcelInfo(); |
261 | 261 | ||
262 | 262 | ||
263 | //Now add the new parcel | 263 | //Now add the new parcel |
264 | addParcel(newParcel); | 264 | addParcel(newParcel); |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | 268 | ||
269 | 269 | ||
@@ -282,7 +282,7 @@ namespace OpenSim.world | |||
282 | { | 282 | { |
283 | end_x -= 4; | 283 | end_x -= 4; |
284 | end_y -= 4; | 284 | end_y -= 4; |
285 | 285 | ||
286 | //NOTE: The following only connects the parcels in each corner and not all the parcels that are within the selection box! | 286 | //NOTE: The following only connects the parcels in each corner and not all the parcels that are within the selection box! |
287 | //This should be fixed later -- somewhat "incomplete code" --Ming | 287 | //This should be fixed later -- somewhat "incomplete code" --Ming |
288 | Parcel startParcel, endParcel; | 288 | Parcel startParcel, endParcel; |
@@ -456,7 +456,7 @@ namespace OpenSim.world | |||
456 | public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client) | 456 | public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client) |
457 | { | 457 | { |
458 | join(west, south, east, north, remote_client.AgentId); | 458 | join(west, south, east, north, remote_client.AgentId); |
459 | 459 | ||
460 | } | 460 | } |
461 | #endregion | 461 | #endregion |
462 | 462 | ||
@@ -543,7 +543,7 @@ namespace OpenSim.world | |||
543 | //Place all new variables here! | 543 | //Place all new variables here! |
544 | newParcel.parcelBitmap = (bool[,])(this.parcelBitmap.Clone()); | 544 | newParcel.parcelBitmap = (bool[,])(this.parcelBitmap.Clone()); |
545 | newParcel.parcelData = parcelData.Copy(); | 545 | newParcel.parcelData = parcelData.Copy(); |
546 | 546 | ||
547 | return newParcel; | 547 | return newParcel; |
548 | } | 548 | } |
549 | 549 | ||
@@ -565,7 +565,7 @@ namespace OpenSim.world | |||
565 | updatePacket.ParcelData.AABBMin = parcelData.AABBMin; | 565 | updatePacket.ParcelData.AABBMin = parcelData.AABBMin; |
566 | updatePacket.ParcelData.Area = parcelData.area; | 566 | updatePacket.ParcelData.Area = parcelData.area; |
567 | updatePacket.ParcelData.AuctionID = parcelData.auctionID; | 567 | updatePacket.ParcelData.AuctionID = parcelData.auctionID; |
568 | updatePacket.ParcelData.AuthBuyerID =parcelData.authBuyerID; //unemplemented | 568 | updatePacket.ParcelData.AuthBuyerID = parcelData.authBuyerID; //unemplemented |
569 | 569 | ||
570 | updatePacket.ParcelData.Bitmap = parcelData.parcelBitmapByteArray; | 570 | updatePacket.ParcelData.Bitmap = parcelData.parcelBitmapByteArray; |
571 | 571 | ||
@@ -606,7 +606,7 @@ namespace OpenSim.world | |||
606 | updatePacket.ParcelData.SequenceID = sequence_id; | 606 | updatePacket.ParcelData.SequenceID = sequence_id; |
607 | updatePacket.ParcelData.SimWideMaxPrims = 15000; //unemplemented | 607 | updatePacket.ParcelData.SimWideMaxPrims = 15000; //unemplemented |
608 | updatePacket.ParcelData.SimWideTotalPrims = 0; //unemplemented | 608 | updatePacket.ParcelData.SimWideTotalPrims = 0; //unemplemented |
609 | updatePacket.ParcelData.SnapSelection = snap_selection; | 609 | updatePacket.ParcelData.SnapSelection = snap_selection; |
610 | updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; | 610 | updatePacket.ParcelData.SnapshotID = parcelData.snapshotID; |
611 | updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; | 611 | updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus; |
612 | updatePacket.ParcelData.TotalPrims = 0; //unemplemented | 612 | updatePacket.ParcelData.TotalPrims = 0; //unemplemented |
@@ -638,14 +638,17 @@ namespace OpenSim.world | |||
638 | parcelData.userLocation = packet.ParcelData.UserLocation; | 638 | parcelData.userLocation = packet.ParcelData.UserLocation; |
639 | parcelData.userLookAt = packet.ParcelData.UserLookAt; | 639 | parcelData.userLookAt = packet.ParcelData.UserLookAt; |
640 | 640 | ||
641 | foreach (Avatar av in m_world.Avatars.Values) | 641 | List<Avatar> avatars = m_world.RequestAvatarList(); |
642 | |||
643 | for (int i = 0; i < avatars.Count; i++) | ||
642 | { | 644 | { |
643 | Parcel over = m_world.parcelManager.getParcel((int)Math.Round(av.Pos.X), (int)Math.Round(av.Pos.Y)); | 645 | Parcel over = m_world.parcelManager.getParcel((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); |
644 | if (over == this) | 646 | if (over == this) |
645 | { | 647 | { |
646 | sendParcelProperties(0, false, 0, av.ControllingClient); | 648 | sendParcelProperties(0, false, 0, avatars[i].ControllingClient); |
647 | } | 649 | } |
648 | } | 650 | } |
651 | |||
649 | } | 652 | } |
650 | } | 653 | } |
651 | #endregion | 654 | #endregion |
@@ -720,7 +723,7 @@ namespace OpenSim.world | |||
720 | //Valid: Lets set it | 723 | //Valid: Lets set it |
721 | parcelBitmap = bitmap; | 724 | parcelBitmap = bitmap; |
722 | forceUpdateParcelInfo(); | 725 | forceUpdateParcelInfo(); |
723 | 726 | ||
724 | } | 727 | } |
725 | } | 728 | } |
726 | /// <summary> | 729 | /// <summary> |
@@ -761,23 +764,23 @@ namespace OpenSim.world | |||
761 | private bool[,] convertBytesToParcelBitmap() | 764 | private bool[,] convertBytesToParcelBitmap() |
762 | { | 765 | { |
763 | bool[,] tempConvertMap = new bool[64, 64]; | 766 | bool[,] tempConvertMap = new bool[64, 64]; |
764 | tempConvertMap.Initialize(); | 767 | tempConvertMap.Initialize(); |
765 | byte tempByte = 0; | 768 | byte tempByte = 0; |
766 | int x = 0, y = 0, i = 0, bitNum = 0; | 769 | int x = 0, y = 0, i = 0, bitNum = 0; |
767 | for(i = 0; i < 512; i++) | 770 | for (i = 0; i < 512; i++) |
768 | { | 771 | { |
769 | tempByte = parcelData.parcelBitmapByteArray[i]; | 772 | tempByte = parcelData.parcelBitmapByteArray[i]; |
770 | for(bitNum = 0; bitNum < 8; bitNum++) | 773 | for (bitNum = 0; bitNum < 8; bitNum++) |
771 | { | 774 | { |
772 | bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1); | 775 | bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1); |
773 | tempConvertMap[x, y] = bit; | 776 | tempConvertMap[x, y] = bit; |
774 | x++; | 777 | x++; |
775 | if(x > 63) | 778 | if (x > 63) |
776 | { | 779 | { |
777 | x = 0; | 780 | x = 0; |
778 | y++; | 781 | y++; |
779 | } | 782 | } |
780 | 783 | ||
781 | } | 784 | } |
782 | 785 | ||
783 | } | 786 | } |
@@ -859,7 +862,7 @@ namespace OpenSim.world | |||
859 | { | 862 | { |
860 | //Throw an exception - The bitmap is not 64x64 | 863 | //Throw an exception - The bitmap is not 64x64 |
861 | throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeParcelBitmaps"); | 864 | throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeParcelBitmaps"); |
862 | 865 | ||
863 | } | 866 | } |
864 | 867 | ||
865 | int x, y; | 868 | int x, y; |
@@ -879,9 +882,9 @@ namespace OpenSim.world | |||
879 | 882 | ||
880 | #endregion | 883 | #endregion |
881 | 884 | ||
882 | 885 | ||
883 | } | 886 | } |
884 | #endregion | 887 | #endregion |
885 | 888 | ||
886 | 889 | ||
887 | } | 890 | } |