diff options
12 files changed, 215 insertions, 259 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index a25f3c0..f704dd2 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -532,7 +532,7 @@ namespace OpenSim | |||
532 | scene.StartScripts(); | 532 | scene.StartScripts(); |
533 | 533 | ||
534 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 534 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
535 | scene.LandChannel.performParcelPrimCountUpdate(); | 535 | scene.LandChannel.PerformParcelPrimCountUpdate(); |
536 | 536 | ||
537 | m_sceneManager.Add(scene); | 537 | m_sceneManager.Add(scene); |
538 | 538 | ||
diff --git a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs index ce79a8f..a814e39 100644 --- a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs | |||
@@ -34,42 +34,31 @@ namespace OpenSim.Region.Environment.Interfaces | |||
34 | { | 34 | { |
35 | public interface ILandChannel | 35 | public interface ILandChannel |
36 | { | 36 | { |
37 | bool allowedForcefulBans { get; set; } | 37 | bool AllowedForcefulBans { get; set; } |
38 | void IncomingLandObjectsFromStorage(List<LandData> data); | 38 | void IncomingLandObjectsFromStorage(List<LandData> data); |
39 | void IncomingLandObjectFromStorage(LandData data); | 39 | void IncomingLandObjectFromStorage(LandData data); |
40 | 40 | ||
41 | void NoLandDataFromStorage(); | 41 | void NoLandDataFromStorage(); |
42 | ILandObject getLandObject(int x, int y); | 42 | ILandObject GetLandObject(int x, int y); |
43 | ILandObject getLandObject(float x, float y); | 43 | ILandObject GetLandObject(float x, float y); |
44 | void setPrimsTainted(); | 44 | void SetPrimsTainted(); |
45 | bool isLandPrimCountTainted(); | 45 | bool IsLandPrimCountTainted(); |
46 | void sendLandUpdate(ScenePresence avatar, bool force); | 46 | void SendLandUpdate(ScenePresence avatar, bool force); |
47 | void sendLandUpdate(ScenePresence avatar); | 47 | void SendLandUpdate(ScenePresence avatar); |
48 | void resetAllLandPrimCounts(); | 48 | void ResetAllLandPrimCounts(); |
49 | void addPrimToLandPrimCounts(SceneObjectGroup obj); | 49 | void AddPrimToLandPrimCounts(SceneObjectGroup obj); |
50 | void removePrimFromLandPrimCounts(SceneObjectGroup obj); | 50 | void RemovePrimFromLandPrimCounts(SceneObjectGroup obj); |
51 | void finalizeLandPrimCountUpdate(); | 51 | void FinalizeLandPrimCountUpdate(); |
52 | void updateLandPrimCounts(); | 52 | void UpdateLandPrimCounts(); |
53 | void performParcelPrimCountUpdate(); | 53 | void PerformParcelPrimCountUpdate(); |
54 | void updateLandObject(int local_id, LandData newData); | 54 | void UpdateLandObject(int local_id, LandData newData); |
55 | 55 | ||
56 | void sendParcelOverlay(IClientAPI remote_client); | 56 | void SendParcelOverlay(IClientAPI remote_client); |
57 | void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); | ||
58 | void handleParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client); | ||
59 | void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
60 | void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); | ||
61 | void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client); | ||
62 | void handleParcelObjectOwnersRequest(int local_id, IClientAPI remote_client); | ||
63 | 57 | ||
64 | void resetSimLandObjects(); | 58 | void ResetSimLandObjects(); |
65 | List<ILandObject> parcelsNearPoint(LLVector3 position); | 59 | List<ILandObject> ParcelsNearPoint(LLVector3 position); |
66 | void sendYouAreBannedNotice(ScenePresence avatar); | 60 | void SendYouAreBannedNotice(ScenePresence avatar); |
67 | void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, LLUUID regionID); | 61 | void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, LLUUID regionID); |
68 | void sendOutNearestBanLine(IClientAPI avatar); | 62 | void SendOutNearestBanLine(IClientAPI avatar); |
69 | void handleSignificantClientMovement(IClientAPI remote_client); | ||
70 | void handleAnyClientMovement(ScenePresence avatar); | ||
71 | void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client); | ||
72 | void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID, uint flags, int landLocalID, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); | ||
73 | |||
74 | } | 63 | } |
75 | } | 64 | } |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs index aa7e690..c63fc93 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs | |||
@@ -1426,7 +1426,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1426 | } | 1426 | } |
1427 | else | 1427 | else |
1428 | { | 1428 | { |
1429 | ILandObject obj = avatar.Scene.LandChannel.getLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 1429 | ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
1430 | if ((obj.landData.landFlags & (uint)Parcel.ParcelFlags.AllowDamage) != 0) | 1430 | if ((obj.landData.landFlags & (uint)Parcel.ParcelFlags.AllowDamage) != 0) |
1431 | { | 1431 | { |
1432 | avatar.Invulnerable = false; | 1432 | avatar.Invulnerable = false; |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs index 4454c38..02558a9 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs | |||
@@ -44,8 +44,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
44 | //Land types set with flags in ParcelOverlay. | 44 | //Land types set with flags in ParcelOverlay. |
45 | //Only one of these can be used. | 45 | //Only one of these can be used. |
46 | public const float BAN_LINE_SAFETY_HIEGHT = 100; | 46 | public const float BAN_LINE_SAFETY_HIEGHT = 100; |
47 | public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = (byte) 128; //Equals 10000000 | 47 | public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000 |
48 | public const byte LAND_FLAG_PROPERTY_BORDER_WEST = (byte) 64; //Equals 01000000 | 48 | public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000 |
49 | 49 | ||
50 | //RequestResults (I think these are right, they seem to work): | 50 | //RequestResults (I think these are right, they seem to work): |
51 | public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land | 51 | public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land |
@@ -55,31 +55,41 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
55 | public const int LAND_SELECT_OBJECTS_GROUP = 4; | 55 | public const int LAND_SELECT_OBJECTS_GROUP = 4; |
56 | public const int LAND_SELECT_OBJECTS_OTHER = 8; | 56 | public const int LAND_SELECT_OBJECTS_OTHER = 8; |
57 | public const int LAND_SELECT_OBJECTS_OWNER = 2; | 57 | public const int LAND_SELECT_OBJECTS_OWNER = 2; |
58 | public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte) 5; //Equals 00000101 | 58 | public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101 |
59 | public const byte LAND_TYPE_IS_FOR_SALE = (byte) 4; //Equals 00000100 | 59 | public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100 |
60 | public const byte LAND_TYPE_OWNED_BY_GROUP = (byte) 2; //Equals 00000010 | 60 | public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010 |
61 | public const byte LAND_TYPE_OWNED_BY_OTHER = (byte) 1; //Equals 00000001 | 61 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 |
62 | public const byte LAND_TYPE_OWNED_BY_REQUESTER = (byte) 3; //Equals 00000011 | 62 | public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011 |
63 | public const byte LAND_TYPE_PUBLIC = (byte) 0; //Equals 00000000 | 63 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 |
64 | 64 | ||
65 | //These are other constants. Yay! | 65 | //These are other constants. Yay! |
66 | public const int START_LAND_LOCAL_ID = 1; | 66 | public const int START_LAND_LOCAL_ID = 1; |
67 | 67 | ||
68 | #endregion | 68 | #endregion |
69 | 69 | ||
70 | private int[,] landIDList = new int[64,64]; | 70 | private readonly int[,] landIDList = new int[64,64]; |
71 | private Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); | 71 | private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); |
72 | 72 | ||
73 | private bool landPrimCountTainted = false; | 73 | private bool landPrimCountTainted; |
74 | private int lastLandLocalID = START_LAND_LOCAL_ID - 1; | 74 | private int lastLandLocalID = START_LAND_LOCAL_ID - 1; |
75 | 75 | ||
76 | private bool m_allowedForcefulBans = true; | 76 | private bool m_allowedForcefulBans = true; |
77 | private Scene m_scene; | 77 | private readonly Scene m_scene; |
78 | 78 | ||
79 | public LandChannel(Scene scene) | 79 | public LandChannel(Scene scene) |
80 | { | 80 | { |
81 | m_scene = scene; | 81 | m_scene = scene; |
82 | landIDList.Initialize(); | 82 | landIDList.Initialize(); |
83 | |||
84 | m_scene.EventManager.OnNewPresence += handleNewPresence; | ||
85 | } | ||
86 | |||
87 | private void handleNewPresence(ScenePresence avatar) | ||
88 | { | ||
89 | if (avatar.IsChildAgent) | ||
90 | { | ||
91 | avatar.OnSignificantClientMovement += handleSignificantClientMovement; | ||
92 | } | ||
83 | } | 93 | } |
84 | 94 | ||
85 | #region Land Object From Storage Functions | 95 | #region Land Object From Storage Functions |
@@ -109,19 +119,19 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
109 | ILandObject new_land = new LandObject(data.ownerID, data.isGroupOwned, m_scene); | 119 | ILandObject new_land = new LandObject(data.ownerID, data.isGroupOwned, m_scene); |
110 | new_land.landData = data.Copy(); | 120 | new_land.landData = data.Copy(); |
111 | new_land.setLandBitmapFromByteArray(); | 121 | new_land.setLandBitmapFromByteArray(); |
112 | addLandObject(new_land); | 122 | AddLandObject(new_land); |
113 | } | 123 | } |
114 | 124 | ||
115 | public void NoLandDataFromStorage() | 125 | public void NoLandDataFromStorage() |
116 | { | 126 | { |
117 | resetSimLandObjects(); | 127 | ResetSimLandObjects(); |
118 | } | 128 | } |
119 | 129 | ||
120 | #endregion | 130 | #endregion |
121 | 131 | ||
122 | #region Parcel Add/Remove/Get/Create | 132 | #region Parcel Add/Remove/Get/Create |
123 | 133 | ||
124 | public void updateLandObject(int local_id, LandData newData) | 134 | public void UpdateLandObject(int local_id, LandData newData) |
125 | { | 135 | { |
126 | if (landList.ContainsKey(local_id)) | 136 | if (landList.ContainsKey(local_id)) |
127 | { | 137 | { |
@@ -133,10 +143,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
133 | /// <summary> | 143 | /// <summary> |
134 | /// Get the land object at the specified point | 144 | /// Get the land object at the specified point |
135 | /// </summary> | 145 | /// </summary> |
136 | /// <param name="x">Value between 0 - 256 on the x axis of the point</param> | 146 | /// <param name="x_float">Value between 0 - 256 on the x axis of the point</param> |
137 | /// <param name="y">Value between 0 - 256 on the y axis of the point</param> | 147 | /// <param name="y_float">Value between 0 - 256 on the y axis of the point</param> |
138 | /// <returns>Land object at the point supplied</returns> | 148 | /// <returns>Land object at the point supplied</returns> |
139 | public ILandObject getLandObject(float x_float, float y_float) | 149 | public ILandObject GetLandObject(float x_float, float y_float) |
140 | { | 150 | { |
141 | int x; | 151 | int x; |
142 | int y; | 152 | int y; |
@@ -155,13 +165,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
155 | { | 165 | { |
156 | return null; | 166 | return null; |
157 | } | 167 | } |
158 | else | 168 | return landList[landIDList[x, y]]; |
159 | { | ||
160 | return landList[landIDList[x, y]]; | ||
161 | } | ||
162 | } | 169 | } |
163 | 170 | ||
164 | public ILandObject getLandObject(int x, int y) | 171 | public ILandObject GetLandObject(int x, int y) |
165 | { | 172 | { |
166 | if (x >= Convert.ToInt32(Constants.RegionSize) || y >= Convert.ToInt32(Constants.RegionSize) || x < 0 || y < 0) | 173 | if (x >= Convert.ToInt32(Constants.RegionSize) || y >= Convert.ToInt32(Constants.RegionSize) || x < 0 || y < 0) |
167 | { | 174 | { |
@@ -169,17 +176,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
169 | // they happen every time at border crossings | 176 | // they happen every time at border crossings |
170 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); | 177 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); |
171 | } | 178 | } |
172 | else | 179 | return landList[landIDList[x / 4, y / 4]]; |
173 | { | ||
174 | return landList[landIDList[x / 4, y / 4]]; | ||
175 | } | ||
176 | } | 180 | } |
177 | 181 | ||
178 | /// <summary> | 182 | /// <summary> |
179 | /// Creates a basic Parcel object without an owner (a zeroed key) | 183 | /// Creates a basic Parcel object without an owner (a zeroed key) |
180 | /// </summary> | 184 | /// </summary> |
181 | /// <returns></returns> | 185 | /// <returns></returns> |
182 | public ILandObject createBaseLand() | 186 | public ILandObject CreateBaseLand() |
183 | { | 187 | { |
184 | return new LandObject(LLUUID.Zero, false, m_scene); | 188 | return new LandObject(LLUUID.Zero, false, m_scene); |
185 | } | 189 | } |
@@ -188,17 +192,18 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
188 | /// Adds a land object to the stored list and adds them to the landIDList to what they own | 192 | /// Adds a land object to the stored list and adds them to the landIDList to what they own |
189 | /// </summary> | 193 | /// </summary> |
190 | /// <param name="new_land">The land object being added</param> | 194 | /// <param name="new_land">The land object being added</param> |
191 | public ILandObject addLandObject(ILandObject new_land) | 195 | public ILandObject AddLandObject(ILandObject new_land) |
192 | { | 196 | { |
193 | lastLandLocalID++; | 197 | lastLandLocalID++; |
194 | new_land.landData.localID = lastLandLocalID; | 198 | new_land.landData.localID = lastLandLocalID; |
195 | landList.Add(lastLandLocalID, (LandObject) new_land.Copy()); | 199 | landList.Add(lastLandLocalID, new_land.Copy()); |
196 | 200 | ||
197 | 201 | ||
198 | bool[,] landBitmap = new_land.getLandBitmap(); | 202 | bool[,] landBitmap = new_land.getLandBitmap(); |
199 | int x, y; | 203 | int x; |
200 | for (x = 0; x < 64; x++) | 204 | for (x = 0; x < 64; x++) |
201 | { | 205 | { |
206 | int y; | ||
202 | for (y = 0; y < 64; y++) | 207 | for (y = 0; y < 64; y++) |
203 | { | 208 | { |
204 | if (landBitmap[x, y]) | 209 | if (landBitmap[x, y]) |
@@ -218,9 +223,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
218 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> | 223 | /// <param name="local_id">Land.localID of the peice of land to remove.</param> |
219 | public void removeLandObject(int local_id) | 224 | public void removeLandObject(int local_id) |
220 | { | 225 | { |
221 | int x, y; | 226 | int x; |
222 | for (x = 0; x < 64; x++) | 227 | for (x = 0; x < 64; x++) |
223 | { | 228 | { |
229 | int y; | ||
224 | for (y = 0; y < 64; y++) | 230 | for (y = 0; y < 64; y++) |
225 | { | 231 | { |
226 | if (landIDList[x, y] == local_id) | 232 | if (landIDList[x, y] == local_id) |
@@ -237,10 +243,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
237 | 243 | ||
238 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 244 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
239 | { | 245 | { |
240 | int x, y; | 246 | int x; |
241 | bool[,] landBitmapSlave = slave.getLandBitmap(); | 247 | bool[,] landBitmapSlave = slave.getLandBitmap(); |
242 | for (x = 0; x < 64; x++) | 248 | for (x = 0; x < 64; x++) |
243 | { | 249 | { |
250 | int y; | ||
244 | for (y = 0; y < 64; y++) | 251 | for (y = 0; y < 64; y++) |
245 | { | 252 | { |
246 | if (landBitmapSlave[x, y]) | 253 | if (landBitmapSlave[x, y]) |
@@ -251,10 +258,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
251 | } | 258 | } |
252 | 259 | ||
253 | removeLandObject(slave.landData.localID); | 260 | removeLandObject(slave.landData.localID); |
254 | updateLandObject(master.landData.localID, master.landData); | 261 | UpdateLandObject(master.landData.localID, master.landData); |
255 | } | 262 | } |
256 | 263 | ||
257 | public ILandObject getLandObject(int parcelLocalID) | 264 | public ILandObject GetLandObject(int parcelLocalID) |
258 | { | 265 | { |
259 | lock (landList) | 266 | lock (landList) |
260 | { | 267 | { |
@@ -270,7 +277,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
270 | 277 | ||
271 | #region Parcel Modification | 278 | #region Parcel Modification |
272 | 279 | ||
273 | public void resetAllLandPrimCounts() | 280 | public void ResetAllLandPrimCounts() |
274 | { | 281 | { |
275 | foreach (LandObject p in landList.Values) | 282 | foreach (LandObject p in landList.Values) |
276 | { | 283 | { |
@@ -278,27 +285,27 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
278 | } | 285 | } |
279 | } | 286 | } |
280 | 287 | ||
281 | public void setPrimsTainted() | 288 | public void SetPrimsTainted() |
282 | { | 289 | { |
283 | landPrimCountTainted = true; | 290 | landPrimCountTainted = true; |
284 | } | 291 | } |
285 | 292 | ||
286 | public bool isLandPrimCountTainted() | 293 | public bool IsLandPrimCountTainted() |
287 | { | 294 | { |
288 | return landPrimCountTainted; | 295 | return landPrimCountTainted; |
289 | } | 296 | } |
290 | 297 | ||
291 | public void addPrimToLandPrimCounts(SceneObjectGroup obj) | 298 | public void AddPrimToLandPrimCounts(SceneObjectGroup obj) |
292 | { | 299 | { |
293 | LLVector3 position = obj.AbsolutePosition; | 300 | LLVector3 position = obj.AbsolutePosition; |
294 | ILandObject landUnderPrim = getLandObject(position.X, position.Y); | 301 | ILandObject landUnderPrim = GetLandObject(position.X, position.Y); |
295 | if (landUnderPrim != null) | 302 | if (landUnderPrim != null) |
296 | { | 303 | { |
297 | landUnderPrim.addPrimToCount(obj); | 304 | landUnderPrim.addPrimToCount(obj); |
298 | } | 305 | } |
299 | } | 306 | } |
300 | 307 | ||
301 | public void removePrimFromLandPrimCounts(SceneObjectGroup obj) | 308 | public void RemovePrimFromLandPrimCounts(SceneObjectGroup obj) |
302 | { | 309 | { |
303 | foreach (LandObject p in landList.Values) | 310 | foreach (LandObject p in landList.Values) |
304 | { | 311 | { |
@@ -306,7 +313,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
306 | } | 313 | } |
307 | } | 314 | } |
308 | 315 | ||
309 | public void finalizeLandPrimCountUpdate() | 316 | public void FinalizeLandPrimCountUpdate() |
310 | { | 317 | { |
311 | //Get Simwide prim count for owner | 318 | //Get Simwide prim count for owner |
312 | Dictionary<LLUUID, List<LandObject>> landOwnersAndParcels = new Dictionary<LLUUID, List<LandObject>>(); | 319 | Dictionary<LLUUID, List<LandObject>> landOwnersAndParcels = new Dictionary<LLUUID, List<LandObject>>(); |
@@ -343,7 +350,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
343 | } | 350 | } |
344 | } | 351 | } |
345 | 352 | ||
346 | public void updateLandPrimCounts() | 353 | public void UpdateLandPrimCounts() |
347 | { | 354 | { |
348 | foreach (EntityBase obj in m_scene.Entities.Values) | 355 | foreach (EntityBase obj in m_scene.Entities.Values) |
349 | { | 356 | { |
@@ -354,11 +361,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
354 | } | 361 | } |
355 | } | 362 | } |
356 | 363 | ||
357 | public void performParcelPrimCountUpdate() | 364 | public void PerformParcelPrimCountUpdate() |
358 | { | 365 | { |
359 | resetAllLandPrimCounts(); | 366 | ResetAllLandPrimCounts(); |
360 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); | 367 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); |
361 | finalizeLandPrimCountUpdate(); | 368 | FinalizeLandPrimCountUpdate(); |
362 | landPrimCountTainted = false; | 369 | landPrimCountTainted = false; |
363 | } | 370 | } |
364 | 371 | ||
@@ -371,47 +378,42 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
371 | /// <param name="end_y">North Point</param> | 378 | /// <param name="end_y">North Point</param> |
372 | /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param> | 379 | /// <param name="attempting_user_id">LLUUID of user who is trying to subdivide</param> |
373 | /// <returns>Returns true if successful</returns> | 380 | /// <returns>Returns true if successful</returns> |
374 | private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) | 381 | private void subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) |
375 | { | 382 | { |
376 | //First, lets loop through the points and make sure they are all in the same peice of land | 383 | //First, lets loop through the points and make sure they are all in the same peice of land |
377 | //Get the land object at start | 384 | //Get the land object at start |
378 | ILandObject startLandObject = null; | 385 | |
379 | try | 386 | ILandObject startLandObject = GetLandObject(start_x, start_y); |
380 | { | 387 | |
381 | startLandObject = getLandObject(start_x, start_y); | 388 | if (startLandObject == null) return; |
382 | } | ||
383 | catch (Exception) | ||
384 | { | ||
385 | //m_log.Error("[LAND]: " + "Unable to get land object for subdivision at x: " + start_x + " y:" + start_y); | ||
386 | } | ||
387 | if (startLandObject == null) return false; //No such land object at the beginning | ||
388 | 389 | ||
389 | //Loop through the points | 390 | //Loop through the points |
390 | try | 391 | try |
391 | { | 392 | { |
392 | int totalX = end_x - start_x; | 393 | int totalX = end_x - start_x; |
393 | int totalY = end_y - start_y; | 394 | int totalY = end_y - start_y; |
394 | int x, y; | 395 | int y; |
395 | for (y = 0; y < totalY; y++) | 396 | for (y = 0; y < totalY; y++) |
396 | { | 397 | { |
398 | int x; | ||
397 | for (x = 0; x < totalX; x++) | 399 | for (x = 0; x < totalX; x++) |
398 | { | 400 | { |
399 | ILandObject tempLandObject = getLandObject(start_x + x, start_y + y); | 401 | ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); |
400 | if (tempLandObject == null) return false; //No such land object at that point | 402 | if (tempLandObject == null) return; |
401 | if (tempLandObject != startLandObject) return false; //Subdividing over 2 land objects; no-no | 403 | if (tempLandObject != startLandObject) return; |
402 | } | 404 | } |
403 | } | 405 | } |
404 | } | 406 | } |
405 | catch (Exception) | 407 | catch (Exception) |
406 | { | 408 | { |
407 | return false; //Exception. For now, lets skip subdivision | 409 | return; |
408 | } | 410 | } |
409 | 411 | ||
410 | //If we are still here, then they are subdividing within one piece of land | 412 | //If we are still here, then they are subdividing within one piece of land |
411 | //Check owner | 413 | //Check owner |
412 | if (startLandObject.landData.ownerID != attempting_user_id) | 414 | if (startLandObject.landData.ownerID != attempting_user_id) |
413 | { | 415 | { |
414 | return false; //They cant do this! | 416 | return; |
415 | } | 417 | } |
416 | 418 | ||
417 | //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) | 419 | //Lets create a new land object with bitmap activated at that point (keeping the old land objects info) |
@@ -427,15 +429,15 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
427 | newLand.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false)); | 429 | newLand.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false)); |
428 | landList[startLandObjectIndex].forceUpdateLandInfo(); | 430 | landList[startLandObjectIndex].forceUpdateLandInfo(); |
429 | 431 | ||
430 | setPrimsTainted(); | 432 | SetPrimsTainted(); |
431 | 433 | ||
432 | //Now add the new land object | 434 | //Now add the new land object |
433 | ILandObject result = addLandObject(newLand); | 435 | ILandObject result = AddLandObject(newLand); |
434 | updateLandObject(startLandObject.landData.localID, startLandObject.landData); | 436 | UpdateLandObject(startLandObject.landData.localID, startLandObject.landData); |
435 | result.sendLandUpdateToAvatarsOverMe(); | 437 | result.sendLandUpdateToAvatarsOverMe(); |
436 | 438 | ||
437 | 439 | ||
438 | return true; | 440 | return; |
439 | } | 441 | } |
440 | 442 | ||
441 | /// <summary> | 443 | /// <summary> |
@@ -447,27 +449,20 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
447 | /// <param name="end_y">y value in second peice of land</param> | 449 | /// <param name="end_y">y value in second peice of land</param> |
448 | /// <param name="attempting_user_id">LLUUID of the avatar trying to join the land objects</param> | 450 | /// <param name="attempting_user_id">LLUUID of the avatar trying to join the land objects</param> |
449 | /// <returns>Returns true if successful</returns> | 451 | /// <returns>Returns true if successful</returns> |
450 | private bool join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) | 452 | private void join(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id) |
451 | { | 453 | { |
452 | end_x -= 4; | 454 | end_x -= 4; |
453 | end_y -= 4; | 455 | end_y -= 4; |
454 | 456 | ||
455 | List<ILandObject> selectedLandObjects = new List<ILandObject>(); | 457 | List<ILandObject> selectedLandObjects = new List<ILandObject>(); |
456 | int stepXSelected = 0; | 458 | int stepYSelected; |
457 | int stepYSelected = 0; | ||
458 | for (stepYSelected = start_y; stepYSelected <= end_y; stepYSelected += 4) | 459 | for (stepYSelected = start_y; stepYSelected <= end_y; stepYSelected += 4) |
459 | { | 460 | { |
461 | int stepXSelected; | ||
460 | for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4) | 462 | for (stepXSelected = start_x; stepXSelected <= end_x; stepXSelected += 4) |
461 | { | 463 | { |
462 | ILandObject p = null; | 464 | ILandObject p = GetLandObject(stepXSelected, stepYSelected); |
463 | try | 465 | |
464 | { | ||
465 | p = getLandObject(stepXSelected, stepYSelected); | ||
466 | } | ||
467 | catch (Exception) | ||
468 | { | ||
469 | //m_log.Error("[LAND]: " + "Unable to get land object for subdivision at x: " + stepXSelected + " y:" + stepYSelected); | ||
470 | } | ||
471 | if (p != null) | 466 | if (p != null) |
472 | { | 467 | { |
473 | if (!selectedLandObjects.Contains(p)) | 468 | if (!selectedLandObjects.Contains(p)) |
@@ -483,17 +478,17 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
483 | 478 | ||
484 | if (selectedLandObjects.Count < 1) | 479 | if (selectedLandObjects.Count < 1) |
485 | { | 480 | { |
486 | return false; //Only one piece of land selected | 481 | return; |
487 | } | 482 | } |
488 | if (masterLandObject.landData.ownerID != attempting_user_id) | 483 | if (masterLandObject.landData.ownerID != attempting_user_id) |
489 | { | 484 | { |
490 | return false; //Not the same owner | 485 | return; |
491 | } | 486 | } |
492 | foreach (ILandObject p in selectedLandObjects) | 487 | foreach (ILandObject p in selectedLandObjects) |
493 | { | 488 | { |
494 | if (p.landData.ownerID != masterLandObject.landData.ownerID) | 489 | if (p.landData.ownerID != masterLandObject.landData.ownerID) |
495 | { | 490 | { |
496 | return false; //Over multiple users. TODO: make this just ignore this piece of land? | 491 | return; |
497 | } | 492 | } |
498 | } | 493 | } |
499 | foreach (ILandObject slaveLandObject in selectedLandObjects) | 494 | foreach (ILandObject slaveLandObject in selectedLandObjects) |
@@ -504,11 +499,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
504 | } | 499 | } |
505 | 500 | ||
506 | 501 | ||
507 | setPrimsTainted(); | 502 | SetPrimsTainted(); |
508 | 503 | ||
509 | masterLandObject.sendLandUpdateToAvatarsOverMe(); | 504 | masterLandObject.sendLandUpdateToAvatarsOverMe(); |
510 | 505 | ||
511 | return true; | 506 | return; |
512 | } | 507 | } |
513 | 508 | ||
514 | #endregion | 509 | #endregion |
@@ -519,30 +514,24 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
519 | /// Where we send the ParcelOverlay packet to the client | 514 | /// Where we send the ParcelOverlay packet to the client |
520 | /// </summary> | 515 | /// </summary> |
521 | /// <param name="remote_client">The object representing the client</param> | 516 | /// <param name="remote_client">The object representing the client</param> |
522 | public void sendParcelOverlay(IClientAPI remote_client) | 517 | public void SendParcelOverlay(IClientAPI remote_client) |
523 | { | 518 | { |
524 | const int LAND_BLOCKS_PER_PACKET = 1024; | 519 | const int LAND_BLOCKS_PER_PACKET = 1024; |
525 | int x, y = 0; | 520 | |
526 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | 521 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; |
527 | int byteArrayCount = 0; | 522 | int byteArrayCount = 0; |
528 | int sequenceID = 0; | 523 | int sequenceID = 0; |
529 | ParcelOverlayPacket packet; | 524 | ParcelOverlayPacket packet; |
530 | 525 | ||
526 | int y; | ||
531 | for (y = 0; y < 64; y++) | 527 | for (y = 0; y < 64; y++) |
532 | { | 528 | { |
529 | int x; | ||
533 | for (x = 0; x < 64; x++) | 530 | for (x = 0; x < 64; x++) |
534 | { | 531 | { |
535 | byte tempByte = (byte) 0; //This represents the byte for the current 4x4 | 532 | byte tempByte = 0; //This represents the byte for the current 4x4 |
536 | ILandObject currentParcelBlock = null; | ||
537 | 533 | ||
538 | try | 534 | ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); |
539 | { | ||
540 | currentParcelBlock = getLandObject(x * 4, y * 4); | ||
541 | } | ||
542 | catch (Exception) | ||
543 | { | ||
544 | //m_log.Warn("[LAND]: " + "unable to get land at x: " + (x * 4) + " y: " + (y * 4)); | ||
545 | } | ||
546 | 535 | ||
547 | 536 | ||
548 | if (currentParcelBlock != null) | 537 | if (currentParcelBlock != null) |
@@ -572,53 +561,47 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
572 | 561 | ||
573 | 562 | ||
574 | //Now for border control | 563 | //Now for border control |
575 | try | 564 | |
565 | ILandObject westParcel = null; | ||
566 | ILandObject southParcel = null; | ||
567 | if (x > 0) | ||
568 | { | ||
569 | westParcel = GetLandObject((x - 1) * 4, y * 4); | ||
570 | } | ||
571 | if (y > 0) | ||
572 | { | ||
573 | southParcel = GetLandObject(x * 4, (y - 1) * 4); | ||
574 | } | ||
575 | |||
576 | if (x == 0) | ||
577 | { | ||
578 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); | ||
579 | } | ||
580 | else if (westParcel != null && westParcel != currentParcelBlock) | ||
581 | { | ||
582 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); | ||
583 | } | ||
584 | |||
585 | if (y == 0) | ||
576 | { | 586 | { |
577 | ILandObject westParcel = null; | 587 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH); |
578 | ILandObject southParcel = null; | ||
579 | if (x > 0) | ||
580 | { | ||
581 | westParcel = getLandObject((x - 1) * 4, y * 4); | ||
582 | } | ||
583 | if (y > 0) | ||
584 | { | ||
585 | southParcel = getLandObject(x * 4, (y - 1) * 4); | ||
586 | } | ||
587 | |||
588 | if (x == 0) | ||
589 | { | ||
590 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); | ||
591 | } | ||
592 | else if (westParcel != null && westParcel != currentParcelBlock) | ||
593 | { | ||
594 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_WEST); | ||
595 | } | ||
596 | |||
597 | if (y == 0) | ||
598 | { | ||
599 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH); | ||
600 | } | ||
601 | else if (southParcel != null && southParcel != currentParcelBlock) | ||
602 | { | ||
603 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH); | ||
604 | } | ||
605 | |||
606 | byteArray[byteArrayCount] = tempByte; | ||
607 | byteArrayCount++; | ||
608 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) | ||
609 | { | ||
610 | byteArrayCount = 0; | ||
611 | packet = (ParcelOverlayPacket) PacketPool.Instance.GetPacket(PacketType.ParcelOverlay); | ||
612 | packet.ParcelData.Data = byteArray; | ||
613 | packet.ParcelData.SequenceID = sequenceID; | ||
614 | remote_client.OutPacket((Packet) packet, ThrottleOutPacketType.Task); | ||
615 | sequenceID++; | ||
616 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | ||
617 | } | ||
618 | } | 588 | } |
619 | catch (Exception) | 589 | else if (southParcel != null && southParcel != currentParcelBlock) |
620 | { | 590 | { |
621 | //m_log.Debug("[LAND]: Skipped Land checks because avatar is out of bounds: " + e.Message); | 591 | tempByte = Convert.ToByte(tempByte | LAND_FLAG_PROPERTY_BORDER_SOUTH); |
592 | } | ||
593 | |||
594 | byteArray[byteArrayCount] = tempByte; | ||
595 | byteArrayCount++; | ||
596 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) | ||
597 | { | ||
598 | byteArrayCount = 0; | ||
599 | packet = (ParcelOverlayPacket) PacketPool.Instance.GetPacket(PacketType.ParcelOverlay); | ||
600 | packet.ParcelData.Data = byteArray; | ||
601 | packet.ParcelData.SequenceID = sequenceID; | ||
602 | remote_client.OutPacket(packet, ThrottleOutPacketType.Task); | ||
603 | sequenceID++; | ||
604 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | ||
622 | } | 605 | } |
623 | } | 606 | } |
624 | } | 607 | } |
@@ -630,22 +613,17 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
630 | { | 613 | { |
631 | //Get the land objects within the bounds | 614 | //Get the land objects within the bounds |
632 | List<ILandObject> temp = new List<ILandObject>(); | 615 | List<ILandObject> temp = new List<ILandObject>(); |
633 | int x, y, i; | 616 | int x; |
617 | int i; | ||
634 | int inc_x = end_x - start_x; | 618 | int inc_x = end_x - start_x; |
635 | int inc_y = end_y - start_y; | 619 | int inc_y = end_y - start_y; |
636 | for (x = 0; x < inc_x; x++) | 620 | for (x = 0; x < inc_x; x++) |
637 | { | 621 | { |
622 | int y; | ||
638 | for (y = 0; y < inc_y; y++) | 623 | for (y = 0; y < inc_y; y++) |
639 | { | 624 | { |
640 | ILandObject currentParcel = null; | 625 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); |
641 | try | 626 | |
642 | { | ||
643 | currentParcel = getLandObject(start_x + x, start_y + y); | ||
644 | } | ||
645 | catch (Exception) | ||
646 | { | ||
647 | //m_log.Warn("[LAND]: " + "unable to get land at x: " + (start_x + x) + " y: " + (start_y + y)); | ||
648 | } | ||
649 | if (currentParcel != null) | 627 | if (currentParcel != null) |
650 | { | 628 | { |
651 | if (!temp.Contains(currentParcel)) | 629 | if (!temp.Contains(currentParcel)) |
@@ -669,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
669 | } | 647 | } |
670 | 648 | ||
671 | 649 | ||
672 | sendParcelOverlay(remote_client); | 650 | SendParcelOverlay(remote_client); |
673 | } | 651 | } |
674 | 652 | ||
675 | public void handleParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client) | 653 | public void handleParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client) |
@@ -704,7 +682,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
704 | 682 | ||
705 | #region ILandChannel Members | 683 | #region ILandChannel Members |
706 | 684 | ||
707 | public bool allowedForcefulBans | 685 | public bool AllowedForcefulBans |
708 | { | 686 | { |
709 | get { return m_allowedForcefulBans; } | 687 | get { return m_allowedForcefulBans; } |
710 | set { m_allowedForcefulBans = value; } | 688 | set { m_allowedForcefulBans = value; } |
@@ -713,7 +691,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
713 | /// <summary> | 691 | /// <summary> |
714 | /// Resets the sim to the default land object (full sim piece of land owned by the default user) | 692 | /// Resets the sim to the default land object (full sim piece of land owned by the default user) |
715 | /// </summary> | 693 | /// </summary> |
716 | public void resetSimLandObjects() | 694 | public void ResetSimLandObjects() |
717 | { | 695 | { |
718 | //Remove all the land objects in the sim and add a blank, full sim land object set to public | 696 | //Remove all the land objects in the sim and add a blank, full sim land object set to public |
719 | landList.Clear(); | 697 | landList.Clear(); |
@@ -725,18 +703,19 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
725 | fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize)); | 703 | fullSimParcel.setLandBitmap(fullSimParcel.getSquareLandBitmap(0, 0, (int) Constants.RegionSize, (int) Constants.RegionSize)); |
726 | fullSimParcel.landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 704 | fullSimParcel.landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
727 | 705 | ||
728 | addLandObject(fullSimParcel); | 706 | AddLandObject(fullSimParcel); |
729 | } | 707 | } |
730 | 708 | ||
731 | public List<ILandObject> parcelsNearPoint(LLVector3 position) | 709 | public List<ILandObject> ParcelsNearPoint(LLVector3 position) |
732 | { | 710 | { |
733 | List<ILandObject> parcelsNear = new List<ILandObject>(); | 711 | List<ILandObject> parcelsNear = new List<ILandObject>(); |
734 | int x, y; | 712 | int x; |
735 | for (x = -4; x <= 4; x += 4) | 713 | for (x = -4; x <= 4; x += 4) |
736 | { | 714 | { |
715 | int y; | ||
737 | for (y = -4; y <= 4; y += 4) | 716 | for (y = -4; y <= 4; y += 4) |
738 | { | 717 | { |
739 | ILandObject check = getLandObject(position.X + x, position.Y + y); | 718 | ILandObject check = GetLandObject(position.X + x, position.Y + y); |
740 | if (check != null) | 719 | if (check != null) |
741 | { | 720 | { |
742 | if (!parcelsNear.Contains(check)) | 721 | if (!parcelsNear.Contains(check)) |
@@ -750,9 +729,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
750 | return parcelsNear; | 729 | return parcelsNear; |
751 | } | 730 | } |
752 | 731 | ||
753 | public void sendYouAreBannedNotice(ScenePresence avatar) | 732 | public void SendYouAreBannedNotice(ScenePresence avatar) |
754 | { | 733 | { |
755 | if (allowedForcefulBans) | 734 | if (AllowedForcefulBans) |
756 | { | 735 | { |
757 | avatar.ControllingClient.SendAlertMessage( | 736 | avatar.ControllingClient.SendAlertMessage( |
758 | "You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); | 737 | "You are not allowed on this parcel because you are banned. Please go away. <3 OpenSim Developers"); |
@@ -780,7 +759,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
780 | { | 759 | { |
781 | if (parcelAvatarIsEntering.isBannedFromLand(avatar.UUID)) | 760 | if (parcelAvatarIsEntering.isBannedFromLand(avatar.UUID)) |
782 | { | 761 | { |
783 | sendYouAreBannedNotice(avatar); | 762 | SendYouAreBannedNotice(avatar); |
784 | } | 763 | } |
785 | else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) | 764 | else if (parcelAvatarIsEntering.isRestrictedFromLand(avatar.UUID)) |
786 | { | 765 | { |
@@ -800,14 +779,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
800 | } | 779 | } |
801 | } | 780 | } |
802 | 781 | ||
803 | public void sendOutNearestBanLine(IClientAPI avatar) | 782 | public void SendOutNearestBanLine(IClientAPI avatar) |
804 | { | 783 | { |
805 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 784 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
806 | foreach (ScenePresence presence in avatars) | 785 | foreach (ScenePresence presence in avatars) |
807 | { | 786 | { |
808 | if (presence.UUID == avatar.AgentId) | 787 | if (presence.UUID == avatar.AgentId) |
809 | { | 788 | { |
810 | List<ILandObject> checkLandParcels = parcelsNearPoint(presence.AbsolutePosition); | 789 | List<ILandObject> checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition); |
811 | foreach (ILandObject checkBan in checkLandParcels) | 790 | foreach (ILandObject checkBan in checkLandParcels) |
812 | { | 791 | { |
813 | if (checkBan.isBannedFromLand(avatar.AgentId)) | 792 | if (checkBan.isBannedFromLand(avatar.AgentId)) |
@@ -815,7 +794,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
815 | checkBan.sendLandProperties(-30000, false, (int) ParcelManager.ParcelResult.Single, avatar); | 794 | checkBan.sendLandProperties(-30000, false, (int) ParcelManager.ParcelResult.Single, avatar); |
816 | return; //Only send one | 795 | return; //Only send one |
817 | } | 796 | } |
818 | else if (checkBan.isRestrictedFromLand(avatar.AgentId)) | 797 | if (checkBan.isRestrictedFromLand(avatar.AgentId)) |
819 | { | 798 | { |
820 | checkBan.sendLandProperties(-40000, false, (int) ParcelManager.ParcelResult.Single, avatar); | 799 | checkBan.sendLandProperties(-40000, false, (int) ParcelManager.ParcelResult.Single, avatar); |
821 | return; //Only send one | 800 | return; //Only send one |
@@ -826,18 +805,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
826 | } | 805 | } |
827 | } | 806 | } |
828 | 807 | ||
829 | public void sendLandUpdate(ScenePresence avatar, bool force) | 808 | public void SendLandUpdate(ScenePresence avatar, bool force) |
830 | { | 809 | { |
831 | ILandObject over = null; | 810 | ILandObject over = GetLandObject((int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
832 | try | 811 | (int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
833 | { | 812 | |
834 | over = getLandObject((int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | ||
835 | (int) Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | ||
836 | } | ||
837 | catch (Exception) | ||
838 | { | ||
839 | //m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatar.AbsolutePosition.X) + " y: " + Math.Round(avatar.AbsolutePosition.Y)); | ||
840 | } | ||
841 | 813 | ||
842 | if (over != null) | 814 | if (over != null) |
843 | { | 815 | { |
@@ -864,9 +836,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
864 | } | 836 | } |
865 | } | 837 | } |
866 | 838 | ||
867 | public void sendLandUpdate(ScenePresence avatar) | 839 | public void SendLandUpdate(ScenePresence avatar) |
868 | { | 840 | { |
869 | sendLandUpdate(avatar, false); | 841 | SendLandUpdate(avatar, false); |
870 | } | 842 | } |
871 | 843 | ||
872 | public void handleSignificantClientMovement(IClientAPI remote_client) | 844 | public void handleSignificantClientMovement(IClientAPI remote_client) |
@@ -875,9 +847,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
875 | 847 | ||
876 | if (clientAvatar != null) | 848 | if (clientAvatar != null) |
877 | { | 849 | { |
878 | sendLandUpdate(clientAvatar); | 850 | SendLandUpdate(clientAvatar); |
879 | sendOutNearestBanLine(remote_client); | 851 | SendOutNearestBanLine(remote_client); |
880 | ILandObject parcel = getLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); | 852 | ILandObject parcel = GetLandObject(clientAvatar.AbsolutePosition.X, clientAvatar.AbsolutePosition.Y); |
881 | if (parcel != null) | 853 | if (parcel != null) |
882 | { | 854 | { |
883 | if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && | 855 | if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && |
@@ -893,7 +865,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
893 | else if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && | 865 | else if (clientAvatar.AbsolutePosition.Z < BAN_LINE_SAFETY_HIEGHT && |
894 | parcel.isBannedFromLand(clientAvatar.UUID)) | 866 | parcel.isBannedFromLand(clientAvatar.UUID)) |
895 | { | 867 | { |
896 | sendYouAreBannedNotice(clientAvatar); | 868 | SendYouAreBannedNotice(clientAvatar); |
897 | } | 869 | } |
898 | } | 870 | } |
899 | } | 871 | } |
@@ -902,7 +874,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
902 | public void handleAnyClientMovement(ScenePresence avatar) | 874 | public void handleAnyClientMovement(ScenePresence avatar) |
903 | //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. | 875 | //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. |
904 | { | 876 | { |
905 | ILandObject over = getLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 877 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
906 | if (over != null) | 878 | if (over != null) |
907 | { | 879 | { |
908 | if (!over.isBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= BAN_LINE_SAFETY_HIEGHT) | 880 | if (!over.isBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= BAN_LINE_SAFETY_HIEGHT) |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index f891332..5e65608 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -44,8 +44,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
44 | m_scene = scene; | 44 | m_scene = scene; |
45 | landChannel = new LandChannel(scene); | 45 | landChannel = new LandChannel(scene); |
46 | 46 | ||
47 | m_scene.EventManager.OnParcelPrimCountAdd += landChannel.addPrimToLandPrimCounts; | 47 | m_scene.EventManager.OnParcelPrimCountAdd += landChannel.AddPrimToLandPrimCounts; |
48 | m_scene.EventManager.OnParcelPrimCountUpdate += landChannel.updateLandPrimCounts; | 48 | m_scene.EventManager.OnParcelPrimCountUpdate += landChannel.UpdateLandPrimCounts; |
49 | m_scene.EventManager.OnAvatarEnteringNewParcel += new EventManager.AvatarEnteringNewParcel(landChannel.handleAvatarChangingParcel); | 49 | m_scene.EventManager.OnAvatarEnteringNewParcel += new EventManager.AvatarEnteringNewParcel(landChannel.handleAvatarChangingParcel); |
50 | m_scene.EventManager.OnClientMovement += new EventManager.ClientMovement(landChannel.handleAnyClientMovement); | 50 | m_scene.EventManager.OnClientMovement += new EventManager.ClientMovement(landChannel.handleAnyClientMovement); |
51 | m_scene.EventManager.OnValidateLandBuy += landChannel.handleLandValidationRequest; | 51 | m_scene.EventManager.OnValidateLandBuy += landChannel.handleLandValidationRequest; |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 891e1db..88bc4e6 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |||
@@ -150,7 +150,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
150 | newData.userLocation = args.UserLocation; | 150 | newData.userLocation = args.UserLocation; |
151 | newData.userLookAt = args.UserLookAt; | 151 | newData.userLookAt = args.UserLookAt; |
152 | 152 | ||
153 | m_scene.LandChannel.updateLandObject(landData.localID, newData); | 153 | m_scene.LandChannel.UpdateLandObject(landData.localID, newData); |
154 | 154 | ||
155 | sendLandUpdateToAvatarsOverMe(); | 155 | sendLandUpdateToAvatarsOverMe(); |
156 | } | 156 | } |
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
168 | newData.salePrice = 0; | 168 | newData.salePrice = 0; |
169 | newData.authBuyerID = LLUUID.Zero; | 169 | newData.authBuyerID = LLUUID.Zero; |
170 | newData.landFlags &= ~(uint) (Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects); | 170 | newData.landFlags &= ~(uint) (Parcel.ParcelFlags.ForSale | Parcel.ParcelFlags.ForSaleObjects | Parcel.ParcelFlags.SellParcelObjects); |
171 | m_scene.LandChannel.updateLandObject(landData.localID, newData); | 171 | m_scene.LandChannel.UpdateLandObject(landData.localID, newData); |
172 | 172 | ||
173 | sendLandUpdateToAvatarsOverMe(); | 173 | sendLandUpdateToAvatarsOverMe(); |
174 | } | 174 | } |
@@ -234,7 +234,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
234 | try | 234 | try |
235 | { | 235 | { |
236 | over = | 236 | over = |
237 | m_scene.LandChannel.getLandObject((int) Math.Max(255, Math.Min(0, Math.Round(avatars[i].AbsolutePosition.X))), | 237 | m_scene.LandChannel.GetLandObject((int) Math.Max(255, Math.Min(0, Math.Round(avatars[i].AbsolutePosition.X))), |
238 | (int) Math.Max(255, Math.Min(0, Math.Round(avatars[i].AbsolutePosition.Y)))); | 238 | (int) Math.Max(255, Math.Min(0, Math.Round(avatars[i].AbsolutePosition.Y)))); |
239 | } | 239 | } |
240 | catch (Exception) | 240 | catch (Exception) |
@@ -332,7 +332,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | m_scene.LandChannel.updateLandObject(landData.localID, newData); | 335 | m_scene.LandChannel.UpdateLandObject(landData.localID, newData); |
336 | } | 336 | } |
337 | 337 | ||
338 | #endregion | 338 | #endregion |
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index de02702..b613bd0 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
146 | 146 | ||
147 | string reason = "Insufficient permission"; | 147 | string reason = "Insufficient permission"; |
148 | 148 | ||
149 | ILandObject land = m_scene.LandChannel.getLandObject(position.X, position.Y); | 149 | ILandObject land = m_scene.LandChannel.GetLandObject(position.X, position.Y); |
150 | if (land == null) return false; | 150 | if (land == null) return false; |
151 | 151 | ||
152 | if ((land.landData.landFlags & ((int)Parcel.ParcelFlags.CreateObjects)) == | 152 | if ((land.landData.landFlags & ((int)Parcel.ParcelFlags.CreateObjects)) == |
@@ -187,8 +187,8 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
187 | return true; | 187 | return true; |
188 | } | 188 | } |
189 | 189 | ||
190 | ILandObject land1 = m_scene.LandChannel.getLandObject(oldPos.X, oldPos.Y); | 190 | ILandObject land1 = m_scene.LandChannel.GetLandObject(oldPos.X, oldPos.Y); |
191 | ILandObject land2 = m_scene.LandChannel.getLandObject(newPos.X, newPos.Y); | 191 | ILandObject land2 = m_scene.LandChannel.GetLandObject(newPos.X, newPos.Y); |
192 | 192 | ||
193 | if (land1 == null || land2 == null) | 193 | if (land1 == null || land2 == null) |
194 | { | 194 | { |
@@ -285,7 +285,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
285 | } | 285 | } |
286 | 286 | ||
287 | // Users should be able to edit what is over their land. | 287 | // Users should be able to edit what is over their land. |
288 | ILandObject parcel = m_scene.LandChannel.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); | 288 | ILandObject parcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); |
289 | if (parcel != null && parcel.landData.ownerID == user) | 289 | if (parcel != null && parcel.landData.ownerID == user) |
290 | return objectOwnerMask; | 290 | return objectOwnerMask; |
291 | 291 | ||
@@ -377,7 +377,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
377 | } | 377 | } |
378 | 378 | ||
379 | // Users should be able to edit what is over their land. | 379 | // Users should be able to edit what is over their land. |
380 | ILandObject parcel = m_scene.LandChannel.getLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); | 380 | ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); |
381 | if ((parcel != null) && (parcel.landData.ownerID == currentUser)) | 381 | if ((parcel != null) && (parcel.landData.ownerID == currentUser)) |
382 | { | 382 | { |
383 | permission = true; | 383 | permission = true; |
@@ -599,7 +599,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
599 | Y = 0; | 599 | Y = 0; |
600 | 600 | ||
601 | // Land owner can terraform too | 601 | // Land owner can terraform too |
602 | ILandObject parcel = m_scene.LandChannel.getLandObject(X, Y); | 602 | ILandObject parcel = m_scene.LandChannel.GetLandObject(X, Y); |
603 | if (parcel != null && GenericParcelPermission(user, parcel)) | 603 | if (parcel != null && GenericParcelPermission(user, parcel)) |
604 | permission = true; | 604 | permission = true; |
605 | 605 | ||
@@ -673,7 +673,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
673 | 673 | ||
674 | protected virtual bool GenericParcelPermission(LLUUID user, LLVector3 pos) | 674 | protected virtual bool GenericParcelPermission(LLUUID user, LLVector3 pos) |
675 | { | 675 | { |
676 | ILandObject parcel = m_scene.LandChannel.getLandObject(pos.X, pos.Y); | 676 | ILandObject parcel = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); |
677 | if (parcel == null) return false; | 677 | if (parcel == null) return false; |
678 | return GenericParcelPermission(user, parcel); | 678 | return GenericParcelPermission(user, parcel); |
679 | } | 679 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 350990e..ae37790 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
89 | { | 89 | { |
90 | ((SceneObjectGroup) ent).GetProperties(remoteClient); | 90 | ((SceneObjectGroup) ent).GetProperties(remoteClient); |
91 | ((SceneObjectGroup) ent).IsSelected = true; | 91 | ((SceneObjectGroup) ent).IsSelected = true; |
92 | LandChannel.setPrimsTainted(); | 92 | LandChannel.SetPrimsTainted(); |
93 | } | 93 | } |
94 | break; | 94 | break; |
95 | } | 95 | } |
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
115 | if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) | 115 | if (Permissions.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || Permissions.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID)) |
116 | { | 116 | { |
117 | ((SceneObjectGroup) ent).IsSelected = false; | 117 | ((SceneObjectGroup) ent).IsSelected = false; |
118 | LandChannel.setPrimsTainted(); | 118 | LandChannel.SetPrimsTainted(); |
119 | break; | 119 | break; |
120 | } | 120 | } |
121 | } | 121 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a703622..a875051 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -799,9 +799,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
799 | { | 799 | { |
800 | if (LandChannel != null) | 800 | if (LandChannel != null) |
801 | { | 801 | { |
802 | if (LandChannel.isLandPrimCountTainted()) | 802 | if (LandChannel.IsLandPrimCountTainted()) |
803 | { | 803 | { |
804 | LandChannel.performParcelPrimCountUpdate(); | 804 | LandChannel.PerformParcelPrimCountUpdate(); |
805 | } | 805 | } |
806 | } | 806 | } |
807 | } | 807 | } |
@@ -937,12 +937,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
937 | if (dGridSettings["allow_forceful_banlines"] != "TRUE") | 937 | if (dGridSettings["allow_forceful_banlines"] != "TRUE") |
938 | { | 938 | { |
939 | m_log.Info("[GRID]: Grid is disabling forceful parcel banlists"); | 939 | m_log.Info("[GRID]: Grid is disabling forceful parcel banlists"); |
940 | LandChannel.allowedForcefulBans = false; | 940 | LandChannel.AllowedForcefulBans = false; |
941 | } | 941 | } |
942 | else | 942 | else |
943 | { | 943 | { |
944 | m_log.Info("[GRID]: Grid is allowing forceful parcel banlists"); | 944 | m_log.Info("[GRID]: Grid is allowing forceful parcel banlists"); |
945 | LandChannel.allowedForcefulBans = true; | 945 | LandChannel.AllowedForcefulBans = true; |
946 | } | 946 | } |
947 | } | 947 | } |
948 | } | 948 | } |
@@ -1305,9 +1305,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1305 | { | 1305 | { |
1306 | if (Entities.ContainsKey(sceneObject.UUID)) | 1306 | if (Entities.ContainsKey(sceneObject.UUID)) |
1307 | { | 1307 | { |
1308 | LandChannel.removePrimFromLandPrimCounts(sceneObject); | 1308 | LandChannel.RemovePrimFromLandPrimCounts(sceneObject); |
1309 | Entities.Remove(sceneObject.UUID); | 1309 | Entities.Remove(sceneObject.UUID); |
1310 | LandChannel.setPrimsTainted(); | 1310 | LandChannel.SetPrimsTainted(); |
1311 | m_innerScene.RemoveAPrimCount(); | 1311 | m_innerScene.RemoveAPrimCount(); |
1312 | } | 1312 | } |
1313 | } | 1313 | } |
@@ -1318,7 +1318,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1318 | /// <param name="prim"></param> | 1318 | /// <param name="prim"></param> |
1319 | public void AcknowledgeNewPrim(SceneObjectGroup prim) | 1319 | public void AcknowledgeNewPrim(SceneObjectGroup prim) |
1320 | { | 1320 | { |
1321 | prim.OnPrimCountTainted += LandChannel.setPrimsTainted; | 1321 | prim.OnPrimCountTainted += LandChannel.SetPrimsTainted; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) | 1324 | public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) |
@@ -1525,7 +1525,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1525 | 1525 | ||
1526 | CreateAndAddScenePresence(client, child); | 1526 | CreateAndAddScenePresence(client, child); |
1527 | 1527 | ||
1528 | LandChannel.sendParcelOverlay(client); | 1528 | LandChannel.SendParcelOverlay(client); |
1529 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 1529 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
1530 | } | 1530 | } |
1531 | } | 1531 | } |
@@ -1741,11 +1741,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
1741 | 1741 | ||
1742 | ScenePresence avatar = m_innerScene.CreateAndAddScenePresence(client, child, appearance); | 1742 | ScenePresence avatar = m_innerScene.CreateAndAddScenePresence(client, child, appearance); |
1743 | 1743 | ||
1744 | if (avatar.IsChildAgent) | ||
1745 | { | ||
1746 | avatar.OnSignificantClientMovement += LandChannel.handleSignificantClientMovement; | ||
1747 | } | ||
1748 | |||
1749 | return avatar; | 1744 | return avatar; |
1750 | } | 1745 | } |
1751 | 1746 | ||
@@ -1984,7 +1979,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1984 | AddCapsHandler(agent.AgentID); | 1979 | AddCapsHandler(agent.AgentID); |
1985 | 1980 | ||
1986 | // Honor parcel landing type and position. | 1981 | // Honor parcel landing type and position. |
1987 | ILandObject land = LandChannel.getLandObject(agent.startpos.X, agent.startpos.Y); | 1982 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); |
1988 | if (land != null) | 1983 | if (land != null) |
1989 | { | 1984 | { |
1990 | if (land.landData.landingType == (byte)1 && land.landData.userLocation != LLVector3.Zero) | 1985 | if (land.landData.landingType == (byte)1 && land.landData.userLocation != LLVector3.Zero) |
@@ -2803,7 +2798,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2803 | 2798 | ||
2804 | public LLUUID GetLandOwner(float x, float y) | 2799 | public LLUUID GetLandOwner(float x, float y) |
2805 | { | 2800 | { |
2806 | ILandObject land = LandChannel.getLandObject(x, y); | 2801 | ILandObject land = LandChannel.GetLandObject(x, y); |
2807 | if (land == null) | 2802 | if (land == null) |
2808 | { | 2803 | { |
2809 | return LLUUID.Zero; | 2804 | return LLUUID.Zero; |
@@ -2816,12 +2811,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
2816 | 2811 | ||
2817 | public LandData GetLandData(float x, float y) | 2812 | public LandData GetLandData(float x, float y) |
2818 | { | 2813 | { |
2819 | return LandChannel.getLandObject(x, y).landData; | 2814 | return LandChannel.GetLandObject(x, y).landData; |
2820 | } | 2815 | } |
2821 | 2816 | ||
2822 | public void SetLandMusicURL(float x, float y, string url) | 2817 | public void SetLandMusicURL(float x, float y, string url) |
2823 | { | 2818 | { |
2824 | ILandObject land = LandChannel.getLandObject(x, y); | 2819 | ILandObject land = LandChannel.GetLandObject(x, y); |
2825 | if (land == null) | 2820 | if (land == null) |
2826 | { | 2821 | { |
2827 | return; | 2822 | return; |
@@ -2835,7 +2830,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2835 | 2830 | ||
2836 | public void SetLandMediaURL(float x, float y, string url) | 2831 | public void SetLandMediaURL(float x, float y, string url) |
2837 | { | 2832 | { |
2838 | ILandObject land = LandChannel.getLandObject(x, y); | 2833 | ILandObject land = LandChannel.GetLandObject(x, y); |
2839 | 2834 | ||
2840 | if (land == null) | 2835 | if (land == null) |
2841 | { | 2836 | { |
@@ -2885,7 +2880,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2885 | 2880 | ||
2886 | private bool scriptDanger(SceneObjectPart part,LLVector3 pos) | 2881 | private bool scriptDanger(SceneObjectPart part,LLVector3 pos) |
2887 | { | 2882 | { |
2888 | ILandObject parcel = LandChannel.getLandObject(pos.X, pos.Y); | 2883 | ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); |
2889 | if (part != null) | 2884 | if (part != null) |
2890 | { | 2885 | { |
2891 | if (parcel != null) | 2886 | if (parcel != null) |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 2e6fe3d..66363b7 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -414,7 +414,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
414 | RegisterToEvents(); | 414 | RegisterToEvents(); |
415 | SetDirectionVectors(); | 415 | SetDirectionVectors(); |
416 | 416 | ||
417 | m_scene.LandChannel.sendLandUpdate(this, true); | 417 | m_scene.LandChannel.SendLandUpdate(this, true); |
418 | } | 418 | } |
419 | 419 | ||
420 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, | 420 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, |
@@ -597,7 +597,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
597 | //if (!m_gotAllObjectsInScene) | 597 | //if (!m_gotAllObjectsInScene) |
598 | //{ | 598 | //{ |
599 | m_scene.SendAllSceneObjectsToClient(this); | 599 | m_scene.SendAllSceneObjectsToClient(this); |
600 | m_scene.LandChannel.sendLandUpdate(this, true); | 600 | m_scene.LandChannel.SendLandUpdate(this, true); |
601 | 601 | ||
602 | //m_gotAllObjectsInScene = true; | 602 | //m_gotAllObjectsInScene = true; |
603 | //} | 603 | //} |
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs index a11fb0f..8520d23 100644 --- a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs +++ b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs | |||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.ExtensionsScriptModule | |||
106 | public void osAddToLandPassList(Key avatar, float hours) | 106 | public void osAddToLandPassList(Key avatar, float hours) |
107 | { | 107 | { |
108 | Vector myPosition = Task.AbsolutePosition; | 108 | Vector myPosition = Task.AbsolutePosition; |
109 | ILandObject myParcel = Scene.LandChannel.getLandObject(myPosition.X, myPosition.Y); | 109 | ILandObject myParcel = Scene.LandChannel.GetLandObject(myPosition.X, myPosition.Y); |
110 | if (myParcel == null) | 110 | if (myParcel == null) |
111 | { | 111 | { |
112 | //Dont do anything! | 112 | //Dont do anything! |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 59afe32..c8b7d5c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -3875,7 +3875,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3875 | // or | 3875 | // or |
3876 | // if the object is owned by a person with estate access. | 3876 | // if the object is owned by a person with estate access. |
3877 | 3877 | ||
3878 | ILandObject parcel = World.LandChannel.getLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y); | 3878 | ILandObject parcel = World.LandChannel.GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y); |
3879 | if (parcel != null) | 3879 | if (parcel != null) |
3880 | { | 3880 | { |
3881 | if (m_host.ObjectOwner == parcel.landData.ownerID || | 3881 | if (m_host.ObjectOwner == parcel.landData.ownerID || |
@@ -4214,7 +4214,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4214 | { | 4214 | { |
4215 | m_host.AddScriptLPS(1); | 4215 | m_host.AddScriptLPS(1); |
4216 | LLUUID key; | 4216 | LLUUID key; |
4217 | LandData land = World.LandChannel.getLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; | 4217 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; |
4218 | if (land.ownerID == m_host.OwnerID) | 4218 | if (land.ownerID == m_host.OwnerID) |
4219 | { | 4219 | { |
4220 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 4220 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
@@ -5599,7 +5599,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5599 | { | 5599 | { |
5600 | m_host.AddScriptLPS(1); | 5600 | m_host.AddScriptLPS(1); |
5601 | LLUUID key; | 5601 | LLUUID key; |
5602 | LandData land = World.LandChannel.getLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; | 5602 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; |
5603 | if (land.ownerID == m_host.OwnerID) | 5603 | if (land.ownerID == m_host.OwnerID) |
5604 | { | 5604 | { |
5605 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 5605 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
@@ -5617,7 +5617,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5617 | { | 5617 | { |
5618 | m_host.AddScriptLPS(1); | 5618 | m_host.AddScriptLPS(1); |
5619 | LLUUID key; | 5619 | LLUUID key; |
5620 | LandData land = World.LandChannel.getLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; | 5620 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; |
5621 | if (land.ownerID == m_host.OwnerID) | 5621 | if (land.ownerID == m_host.OwnerID) |
5622 | { | 5622 | { |
5623 | if (LLUUID.TryParse(avatar, out key)) | 5623 | if (LLUUID.TryParse(avatar, out key)) |
@@ -5638,7 +5638,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5638 | { | 5638 | { |
5639 | m_host.AddScriptLPS(1); | 5639 | m_host.AddScriptLPS(1); |
5640 | LLUUID key; | 5640 | LLUUID key; |
5641 | LandData land = World.LandChannel.getLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; | 5641 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; |
5642 | if (land.ownerID == m_host.OwnerID) | 5642 | if (land.ownerID == m_host.OwnerID) |
5643 | { | 5643 | { |
5644 | if (LLUUID.TryParse(avatar, out key)) | 5644 | if (LLUUID.TryParse(avatar, out key)) |
@@ -5709,7 +5709,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5709 | public int llGetParcelFlags(LSL_Types.Vector3 pos) | 5709 | public int llGetParcelFlags(LSL_Types.Vector3 pos) |
5710 | { | 5710 | { |
5711 | m_host.AddScriptLPS(1); | 5711 | m_host.AddScriptLPS(1); |
5712 | return (int)World.LandChannel.getLandObject((float)pos.x, (float)pos.y).landData.landFlags; | 5712 | return (int)World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).landData.landFlags; |
5713 | } | 5713 | } |
5714 | 5714 | ||
5715 | public int llGetRegionFlags() | 5715 | public int llGetRegionFlags() |
@@ -5763,7 +5763,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5763 | public void llResetLandBanList() | 5763 | public void llResetLandBanList() |
5764 | { | 5764 | { |
5765 | m_host.AddScriptLPS(1); | 5765 | m_host.AddScriptLPS(1); |
5766 | LandData land = World.LandChannel.getLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; | 5766 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; |
5767 | if (land.ownerID == m_host.OwnerID) | 5767 | if (land.ownerID == m_host.OwnerID) |
5768 | { | 5768 | { |
5769 | foreach (ParcelManager.ParcelAccessEntry entry in land.parcelAccessList) | 5769 | foreach (ParcelManager.ParcelAccessEntry entry in land.parcelAccessList) |
@@ -5779,7 +5779,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5779 | public void llResetLandPassList() | 5779 | public void llResetLandPassList() |
5780 | { | 5780 | { |
5781 | m_host.AddScriptLPS(1); | 5781 | m_host.AddScriptLPS(1); |
5782 | LandData land = World.LandChannel.getLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; | 5782 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).landData; |
5783 | if (land.ownerID == m_host.OwnerID) | 5783 | if (land.ownerID == m_host.OwnerID) |
5784 | { | 5784 | { |
5785 | foreach (ParcelManager.ParcelAccessEntry entry in land.parcelAccessList) | 5785 | foreach (ParcelManager.ParcelAccessEntry entry in land.parcelAccessList) |
@@ -5858,7 +5858,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5858 | public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos) | 5858 | public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos) |
5859 | { | 5859 | { |
5860 | m_host.AddScriptLPS(1); | 5860 | m_host.AddScriptLPS(1); |
5861 | LandObject land = (LandObject)World.LandChannel.getLandObject((float)pos.x, (float)pos.y); | 5861 | LandObject land = (LandObject)World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); |
5862 | LSL_Types.list ret = new LSL_Types.list(); | 5862 | LSL_Types.list ret = new LSL_Types.list(); |
5863 | if (land != null) | 5863 | if (land != null) |
5864 | { | 5864 | { |