diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandObject.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 109 |
1 files changed, 26 insertions, 83 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 46c15ed..c2f104e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
51 | 51 | ||
52 | private int m_lastSeqId = 0; | 52 | private int m_lastSeqId = 0; |
53 | 53 | ||
54 | protected LandData m_landData = new LandData(); | 54 | protected LandData m_landData = new LandData(); |
55 | protected Scene m_scene; | 55 | protected Scene m_scene; |
56 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); | 56 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); |
57 | protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>(); | 57 | protected Dictionary<uint, UUID> m_listTransactions = new Dictionary<uint, UUID>(); |
@@ -64,8 +64,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
64 | 64 | ||
65 | #endregion | 65 | #endregion |
66 | 66 | ||
67 | #region ILandObject Members | ||
68 | |||
69 | public int GetPrimsFree() | 67 | public int GetPrimsFree() |
70 | { | 68 | { |
71 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); | 69 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); |
@@ -79,6 +77,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
79 | 77 | ||
80 | set { m_landData = value; } | 78 | set { m_landData = value; } |
81 | } | 79 | } |
80 | |||
81 | public IPrimCounts PrimCounts { get; set; } | ||
82 | 82 | ||
83 | public UUID RegionUUID | 83 | public UUID RegionUUID |
84 | { | 84 | { |
@@ -211,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
211 | return simMax; | 211 | return simMax; |
212 | } | 212 | } |
213 | } | 213 | } |
214 | |||
214 | #endregion | 215 | #endregion |
215 | 216 | ||
216 | #region Packet Request Handling | 217 | #region Packet Request Handling |
@@ -241,7 +242,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
241 | } | 242 | } |
242 | 243 | ||
243 | remote_client.SendLandProperties(seq_id, | 244 | remote_client.SendLandProperties(seq_id, |
244 | snap_selection, request_result, LandData, | 245 | snap_selection, request_result, this, |
245 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 246 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
246 | GetParcelMaxPrimCount(this), | 247 | GetParcelMaxPrimCount(this), |
247 | GetSimulatorMaxPrimCount(this), regionFlags); | 248 | GetSimulatorMaxPrimCount(this), regionFlags); |
@@ -700,23 +701,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
700 | return LandBitmap; | 701 | return LandBitmap; |
701 | } | 702 | } |
702 | 703 | ||
703 | /// <summary> | ||
704 | /// Full sim land object creation | ||
705 | /// </summary> | ||
706 | /// <returns></returns> | ||
707 | public bool[,] BasicFullRegionLandBitmap() | 704 | public bool[,] BasicFullRegionLandBitmap() |
708 | { | 705 | { |
709 | return GetSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize); | 706 | return GetSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize); |
710 | } | 707 | } |
711 | 708 | ||
712 | /// <summary> | ||
713 | /// Used to modify the bitmap between the x and y points. Points use 64 scale | ||
714 | /// </summary> | ||
715 | /// <param name="start_x"></param> | ||
716 | /// <param name="start_y"></param> | ||
717 | /// <param name="end_x"></param> | ||
718 | /// <param name="end_y"></param> | ||
719 | /// <returns></returns> | ||
720 | public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) | 709 | public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y) |
721 | { | 710 | { |
722 | bool[,] tempBitmap = new bool[64,64]; | 711 | bool[,] tempBitmap = new bool[64,64]; |
@@ -907,9 +896,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
907 | 896 | ||
908 | lock (primsOverMe) | 897 | lock (primsOverMe) |
909 | { | 898 | { |
899 | // m_log.DebugFormat( | ||
900 | // "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", | ||
901 | // remote_client.Name, primsOverMe.Count); | ||
902 | |||
910 | try | 903 | try |
911 | { | 904 | { |
912 | |||
913 | foreach (SceneObjectGroup obj in primsOverMe) | 905 | foreach (SceneObjectGroup obj in primsOverMe) |
914 | { | 906 | { |
915 | try | 907 | try |
@@ -921,7 +913,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
921 | } | 913 | } |
922 | catch (NullReferenceException) | 914 | catch (NullReferenceException) |
923 | { | 915 | { |
924 | m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); | 916 | m_log.Error("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); |
925 | } | 917 | } |
926 | try | 918 | try |
927 | { | 919 | { |
@@ -948,6 +940,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
948 | public Dictionary<UUID, int> GetLandObjectOwners() | 940 | public Dictionary<UUID, int> GetLandObjectOwners() |
949 | { | 941 | { |
950 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); | 942 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); |
943 | |||
951 | lock (primsOverMe) | 944 | lock (primsOverMe) |
952 | { | 945 | { |
953 | try | 946 | try |
@@ -984,8 +977,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
984 | 977 | ||
985 | public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) | 978 | public void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client) |
986 | { | 979 | { |
987 | Dictionary<UUID,List<SceneObjectGroup>> returns = | 980 | // m_log.DebugFormat( |
988 | new Dictionary<UUID,List<SceneObjectGroup>>(); | 981 | // "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name); |
982 | |||
983 | Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>(); | ||
989 | 984 | ||
990 | lock (primsOverMe) | 985 | lock (primsOverMe) |
991 | { | 986 | { |
@@ -1058,83 +1053,29 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1058 | 1053 | ||
1059 | #region Object Adding/Removing from Parcel | 1054 | #region Object Adding/Removing from Parcel |
1060 | 1055 | ||
1061 | public void ResetLandPrimCounts() | 1056 | public void ResetOverMeRecord() |
1062 | { | 1057 | { |
1063 | LandData.GroupPrims = 0; | ||
1064 | LandData.OwnerPrims = 0; | ||
1065 | LandData.OtherPrims = 0; | ||
1066 | LandData.SelectedPrims = 0; | ||
1067 | |||
1068 | |||
1069 | lock (primsOverMe) | 1058 | lock (primsOverMe) |
1070 | primsOverMe.Clear(); | 1059 | primsOverMe.Clear(); |
1071 | } | 1060 | } |
1072 | 1061 | ||
1073 | public void AddPrimToCount(SceneObjectGroup obj) | 1062 | public void AddPrimOverMe(SceneObjectGroup obj) |
1074 | { | 1063 | { |
1075 | 1064 | // m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name); | |
1076 | UUID prim_owner = obj.OwnerID; | 1065 | |
1077 | int prim_count = obj.PrimCount; | ||
1078 | |||
1079 | if (obj.IsSelected) | ||
1080 | { | ||
1081 | LandData.SelectedPrims += prim_count; | ||
1082 | } | ||
1083 | else | ||
1084 | { | ||
1085 | if (prim_owner == LandData.OwnerID) | ||
1086 | { | ||
1087 | LandData.OwnerPrims += prim_count; | ||
1088 | } | ||
1089 | else if ((obj.GroupID == LandData.GroupID || | ||
1090 | prim_owner == LandData.GroupID) && | ||
1091 | LandData.GroupID != UUID.Zero) | ||
1092 | { | ||
1093 | LandData.GroupPrims += prim_count; | ||
1094 | } | ||
1095 | else | ||
1096 | { | ||
1097 | LandData.OtherPrims += prim_count; | ||
1098 | } | ||
1099 | } | ||
1100 | |||
1101 | lock (primsOverMe) | 1066 | lock (primsOverMe) |
1102 | primsOverMe.Add(obj); | 1067 | primsOverMe.Add(obj); |
1103 | } | 1068 | } |
1104 | 1069 | ||
1105 | public void RemovePrimFromCount(SceneObjectGroup obj) | 1070 | public void RemovePrimFromOverMe(SceneObjectGroup obj) |
1106 | { | 1071 | { |
1072 | // m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name); | ||
1073 | |||
1107 | lock (primsOverMe) | 1074 | lock (primsOverMe) |
1108 | { | 1075 | primsOverMe.Remove(obj); |
1109 | if (primsOverMe.Contains(obj)) | ||
1110 | { | ||
1111 | UUID prim_owner = obj.OwnerID; | ||
1112 | int prim_count = obj.PrimCount; | ||
1113 | |||
1114 | if (prim_owner == LandData.OwnerID) | ||
1115 | { | ||
1116 | LandData.OwnerPrims -= prim_count; | ||
1117 | } | ||
1118 | else if (obj.GroupID == LandData.GroupID || | ||
1119 | prim_owner == LandData.GroupID) | ||
1120 | { | ||
1121 | LandData.GroupPrims -= prim_count; | ||
1122 | } | ||
1123 | else | ||
1124 | { | ||
1125 | LandData.OtherPrims -= prim_count; | ||
1126 | } | ||
1127 | |||
1128 | primsOverMe.Remove(obj); | ||
1129 | } | ||
1130 | } | ||
1131 | } | 1076 | } |
1132 | 1077 | ||
1133 | #endregion | 1078 | #endregion |
1134 | |||
1135 | #endregion | ||
1136 | |||
1137 | #endregion | ||
1138 | 1079 | ||
1139 | /// <summary> | 1080 | /// <summary> |
1140 | /// Set the media url for this land parcel | 1081 | /// Set the media url for this land parcel |
@@ -1155,5 +1096,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1155 | LandData.MusicURL = url; | 1096 | LandData.MusicURL = url; |
1156 | SendLandUpdateToAvatarsOverMe(); | 1097 | SendLandUpdateToAvatarsOverMe(); |
1157 | } | 1098 | } |
1099 | |||
1100 | #endregion | ||
1158 | } | 1101 | } |
1159 | } | 1102 | } |