diff options
author | UbitUmarov | 2015-09-01 14:54:35 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-01 14:54:35 +0100 |
commit | 371c9dd2af01a2e7422ec901ee1f80757284a78c (patch) | |
tree | 058d2a513cacb12efcce0c0df0ae14ad135dbfe2 /OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |
parent | remove lixo (diff) | |
parent | dont change camera on crossings (diff) | |
download | opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.zip opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.gz opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.bz2 opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.xz |
bad merge?
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 687 |
1 files changed, 562 insertions, 125 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 25e1454..8bd46f6 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -69,7 +69,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Minimum land unit size in region co-ordinates. | 70 | /// Minimum land unit size in region co-ordinates. |
71 | /// </summary> | 71 | /// </summary> |
72 | <<<<<<< HEAD | ||
72 | public const int LandUnit = 4; | 73 | public const int LandUnit = 4; |
74 | ======= | ||
75 | public const int landUnit = 4; | ||
76 | >>>>>>> avn/ubitvar | ||
73 | 77 | ||
74 | private static readonly string remoteParcelRequestPath = "0009/"; | 78 | private static readonly string remoteParcelRequestPath = "0009/"; |
75 | 79 | ||
@@ -89,20 +93,30 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
89 | /// <value> | 93 | /// <value> |
90 | /// Land objects keyed by local id | 94 | /// Land objects keyed by local id |
91 | /// </value> | 95 | /// </value> |
92 | private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); | 96 | // private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); |
97 | |||
98 | //ubit: removed the readonly so i can move it around | ||
99 | private Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); | ||
93 | 100 | ||
94 | private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; | 101 | private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; |
95 | 102 | ||
96 | private bool m_allowedForcefulBans = true; | 103 | private bool m_allowedForcefulBans = true; |
104 | private UUID DefaultGodParcelGroup; | ||
105 | private string DefaultGodParcelName; | ||
97 | 106 | ||
98 | // caches ExtendedLandData | 107 | // caches ExtendedLandData |
99 | private Cache parcelInfoCache; | 108 | private Cache parcelInfoCache; |
109 | <<<<<<< HEAD | ||
100 | 110 | ||
101 | 111 | ||
102 | /// <summary> | 112 | /// <summary> |
103 | /// Record positions that avatar's are currently being forced to move to due to parcel entry restrictions. | 113 | /// Record positions that avatar's are currently being forced to move to due to parcel entry restrictions. |
104 | /// </summary> | 114 | /// </summary> |
105 | private Dictionary<UUID, Vector3> forcedPosition = new Dictionary<UUID, Vector3>(); | 115 | private Dictionary<UUID, Vector3> forcedPosition = new Dictionary<UUID, Vector3>(); |
116 | ======= | ||
117 | private Dictionary<UUID, Vector3> forcedPosition = | ||
118 | new Dictionary<UUID, Vector3>(); | ||
119 | >>>>>>> avn/ubitvar | ||
106 | 120 | ||
107 | // Enables limiting parcel layer info transmission when doing simple updates | 121 | // Enables limiting parcel layer info transmission when doing simple updates |
108 | private bool shouldLimitParcelLayerInfoToViewDistance { get; set; } | 122 | private bool shouldLimitParcelLayerInfoToViewDistance { get; set; } |
@@ -118,6 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
118 | 132 | ||
119 | public void Initialise(IConfigSource source) | 133 | public void Initialise(IConfigSource source) |
120 | { | 134 | { |
135 | <<<<<<< HEAD | ||
121 | shouldLimitParcelLayerInfoToViewDistance = true; | 136 | shouldLimitParcelLayerInfoToViewDistance = true; |
122 | parcelLayerViewDistance = 128; | 137 | parcelLayerViewDistance = 128; |
123 | IConfig landManagementConfig = source.Configs["LandManagement"]; | 138 | IConfig landManagementConfig = source.Configs["LandManagement"]; |
@@ -125,13 +140,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
125 | { | 140 | { |
126 | shouldLimitParcelLayerInfoToViewDistance = landManagementConfig.GetBoolean("LimitParcelLayerUpdateDistance", shouldLimitParcelLayerInfoToViewDistance); | 141 | shouldLimitParcelLayerInfoToViewDistance = landManagementConfig.GetBoolean("LimitParcelLayerUpdateDistance", shouldLimitParcelLayerInfoToViewDistance); |
127 | parcelLayerViewDistance = landManagementConfig.GetInt("ParcelLayerViewDistance", parcelLayerViewDistance); | 142 | parcelLayerViewDistance = landManagementConfig.GetInt("ParcelLayerViewDistance", parcelLayerViewDistance); |
143 | ======= | ||
144 | IConfig cnf = source.Configs["LandManagement"]; | ||
145 | if (cnf != null) | ||
146 | { | ||
147 | DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString())); | ||
148 | DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel"); | ||
149 | >>>>>>> avn/ubitvar | ||
128 | } | 150 | } |
129 | } | 151 | } |
130 | 152 | ||
131 | public void AddRegion(Scene scene) | 153 | public void AddRegion(Scene scene) |
132 | { | 154 | { |
133 | m_scene = scene; | 155 | m_scene = scene; |
156 | <<<<<<< HEAD | ||
134 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; | 157 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; |
158 | ======= | ||
159 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; | ||
160 | >>>>>>> avn/ubitvar | ||
135 | landChannel = new LandChannel(scene, this); | 161 | landChannel = new LandChannel(scene, this); |
136 | 162 | ||
137 | parcelInfoCache = new Cache(); | 163 | parcelInfoCache = new Cache(); |
@@ -154,7 +180,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
154 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; | 180 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; |
155 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; | 181 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; |
156 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; | 182 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; |
157 | 183 | ||
158 | lock (m_scene) | 184 | lock (m_scene) |
159 | { | 185 | { |
160 | m_scene.LandChannel = (ILandChannel)landChannel; | 186 | m_scene.LandChannel = (ILandChannel)landChannel; |
@@ -204,13 +230,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
204 | client.OnParcelFreezeUser += ClientOnParcelFreezeUser; | 230 | client.OnParcelFreezeUser += ClientOnParcelFreezeUser; |
205 | client.OnSetStartLocationRequest += ClientOnSetHome; | 231 | client.OnSetStartLocationRequest += ClientOnSetHome; |
206 | 232 | ||
207 | 233 | /* avatar is still a child here position is unknown | |
208 | EntityBase presenceEntity; | 234 | EntityBase presenceEntity; |
209 | if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) | 235 | if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) |
210 | { | 236 | { |
211 | SendLandUpdate((ScenePresence)presenceEntity, true); | 237 | SendLandUpdate((ScenePresence)presenceEntity, true); |
212 | SendParcelOverlay(client); | 238 | SendParcelOverlay(client); |
213 | } | 239 | } |
240 | */ | ||
214 | } | 241 | } |
215 | 242 | ||
216 | public void EventMakeChildAgent(ScenePresence avatar) | 243 | public void EventMakeChildAgent(ScenePresence avatar) |
@@ -220,48 +247,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
220 | 247 | ||
221 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 248 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
222 | { | 249 | { |
223 | //If we are forcing a position for them to go | ||
224 | if (forcedPosition.ContainsKey(remoteClient.AgentId)) | ||
225 | { | ||
226 | ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); | ||
227 | |||
228 | //Putting the user into flying, both keeps the avatar in fligth when it bumps into something and stopped from going another direction AND | ||
229 | //When the avatar walks into a ban line on the ground, it prevents getting stuck | ||
230 | agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | ||
231 | |||
232 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines | ||
233 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) | ||
234 | { | ||
235 | // m_log.DebugFormat( | ||
236 | // "[LAND MANAGEMENT MODULE]: Stopping force position of {0} because {1} is close enough to {2}", | ||
237 | // clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]); | ||
238 | |||
239 | forcedPosition.Remove(remoteClient.AgentId); | ||
240 | } | ||
241 | //if we are far away, teleport | ||
242 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) | ||
243 | { | ||
244 | Vector3 forcePosition = forcedPosition[remoteClient.AgentId]; | ||
245 | // m_log.DebugFormat( | ||
246 | // "[LAND MANAGEMENT MODULE]: Teleporting out {0} because {1} is too far from avatar position {2}", | ||
247 | // clientAvatar.Name, clientAvatar.AbsolutePosition, forcePosition); | ||
248 | |||
249 | m_scene.RequestTeleportLocation(remoteClient, m_scene.RegionInfo.RegionHandle, | ||
250 | forcePosition, clientAvatar.Lookat, (uint)Constants.TeleportFlags.ForceRedirect); | ||
251 | |||
252 | forcedPosition.Remove(remoteClient.AgentId); | ||
253 | } | ||
254 | else | ||
255 | { | ||
256 | // m_log.DebugFormat( | ||
257 | // "[LAND MANAGEMENT MODULE]: Forcing {0} from {1} to {2}", | ||
258 | // clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]); | ||
259 | |||
260 | //Forces them toward the forced position we want if they aren't there yet | ||
261 | agentData.UseClientAgentPosition = true; | ||
262 | agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; | ||
263 | } | ||
264 | } | ||
265 | } | 250 | } |
266 | 251 | ||
267 | public void Close() | 252 | public void Close() |
@@ -314,7 +299,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
314 | { | 299 | { |
315 | m_landList.Clear(); | 300 | m_landList.Clear(); |
316 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; | 301 | m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; |
302 | <<<<<<< HEAD | ||
317 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; | 303 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; |
304 | ======= | ||
305 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; | ||
306 | >>>>>>> avn/ubitvar | ||
318 | } | 307 | } |
319 | } | 308 | } |
320 | 309 | ||
@@ -324,16 +313,22 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
324 | /// <returns>The parcel created.</returns> | 313 | /// <returns>The parcel created.</returns> |
325 | protected ILandObject CreateDefaultParcel() | 314 | protected ILandObject CreateDefaultParcel() |
326 | { | 315 | { |
316 | <<<<<<< HEAD | ||
327 | m_log.DebugFormat( | 317 | m_log.DebugFormat( |
328 | "[LAND MANAGEMENT MODULE]: Creating default parcel for region {0}", m_scene.RegionInfo.RegionName); | 318 | "[LAND MANAGEMENT MODULE]: Creating default parcel for region {0}", m_scene.RegionInfo.RegionName); |
329 | 319 | ||
330 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | 320 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); |
321 | ======= | ||
322 | m_log.DebugFormat("{0} Creating default parcel for region {1}", LogHeader, m_scene.RegionInfo.RegionName); | ||
323 | |||
324 | ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene); | ||
325 | >>>>>>> avn/ubitvar | ||
331 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, | 326 | fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, |
332 | (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY)); | 327 | (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY)); |
333 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 328 | fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
334 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 329 | fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
335 | 330 | ||
336 | return AddLandObject(fullSimParcel); | 331 | return AddLandObject(fullSimParcel); |
337 | } | 332 | } |
338 | 333 | ||
339 | public List<ILandObject> AllParcels() | 334 | public List<ILandObject> AllParcels() |
@@ -382,10 +377,17 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
382 | private void ForceAvatarToPosition(ScenePresence avatar, Vector3? position) | 377 | private void ForceAvatarToPosition(ScenePresence avatar, Vector3? position) |
383 | { | 378 | { |
384 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; | 379 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; |
385 | if (position.HasValue) | 380 | |
386 | { | 381 | if (!position.HasValue) |
387 | forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position; | 382 | return; |
388 | } | 383 | |
384 | // land should have no word on avatar physics | ||
385 | // bool isFlying = avatar.PhysicsActor.Flying; | ||
386 | // avatar.RemoveFromPhysicalScene(); | ||
387 | |||
388 | avatar.AbsolutePosition = (Vector3)position; | ||
389 | |||
390 | // avatar.AddToPhysicalScene(isFlying); | ||
389 | } | 391 | } |
390 | 392 | ||
391 | public void SendYouAreRestrictedNotice(ScenePresence avatar) | 393 | public void SendYouAreRestrictedNotice(ScenePresence avatar) |
@@ -405,36 +407,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
405 | } | 407 | } |
406 | 408 | ||
407 | if (parcelAvatarIsEntering != null) | 409 | if (parcelAvatarIsEntering != null) |
408 | { | 410 | EnforceBans(parcelAvatarIsEntering, avatar); |
409 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) | ||
410 | { | ||
411 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) | ||
412 | { | ||
413 | SendYouAreBannedNotice(avatar); | ||
414 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); | ||
415 | } | ||
416 | else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID)) | ||
417 | { | ||
418 | SendYouAreRestrictedNotice(avatar); | ||
419 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); | ||
420 | } | ||
421 | else | ||
422 | { | ||
423 | avatar.sentMessageAboutRestrictedParcelFlyingDown = true; | ||
424 | } | ||
425 | } | ||
426 | else | ||
427 | { | ||
428 | avatar.sentMessageAboutRestrictedParcelFlyingDown = true; | ||
429 | } | ||
430 | } | ||
431 | } | 411 | } |
432 | } | 412 | } |
433 | 413 | ||
434 | public void SendOutNearestBanLine(IClientAPI client) | 414 | public void SendOutNearestBanLine(IClientAPI client) |
435 | { | 415 | { |
436 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 416 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
437 | if (sp == null || sp.IsChildAgent) | 417 | if (sp == null) |
438 | return; | 418 | return; |
439 | 419 | ||
440 | List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition); | 420 | List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition); |
@@ -454,32 +434,49 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
454 | return; | 434 | return; |
455 | } | 435 | } |
456 | 436 | ||
437 | public void sendClientInitialLandInfo(IClientAPI remoteClient) | ||
438 | { | ||
439 | ScenePresence avatar; | ||
440 | |||
441 | if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out avatar)) | ||
442 | return; | ||
443 | |||
444 | |||
445 | if (!avatar.IsChildAgent) | ||
446 | { | ||
447 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | ||
448 | if (over == null) | ||
449 | return; | ||
450 | |||
451 | avatar.currentParcelUUID = over.LandData.GlobalID; | ||
452 | over.SendLandUpdateToClient(avatar.ControllingClient); | ||
453 | } | ||
454 | SendParcelOverlay(remoteClient); | ||
455 | } | ||
456 | |||
457 | public void SendLandUpdate(ScenePresence avatar, bool force) | 457 | public void SendLandUpdate(ScenePresence avatar, bool force) |
458 | { | 458 | { |
459 | <<<<<<< HEAD | ||
459 | ILandObject over = GetLandObject((int)Math.Min(((int)m_scene.RegionInfo.RegionSizeX - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | 460 | ILandObject over = GetLandObject((int)Math.Min(((int)m_scene.RegionInfo.RegionSizeX - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
460 | (int)Math.Min(((int)m_scene.RegionInfo.RegionSizeY - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | 461 | (int)Math.Min(((int)m_scene.RegionInfo.RegionSizeY - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
462 | ======= | ||
463 | if (avatar.IsChildAgent) | ||
464 | return; | ||
465 | |||
466 | ILandObject over = GetLandObjectClipedXY(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | ||
467 | >>>>>>> avn/ubitvar | ||
461 | 468 | ||
462 | if (over != null) | 469 | if (over != null) |
463 | { | 470 | { |
464 | if (force) | 471 | bool NotsameID = (avatar.currentParcelUUID != over.LandData.GlobalID); |
472 | if (force || NotsameID) | ||
465 | { | 473 | { |
466 | if (!avatar.IsChildAgent) | 474 | over.SendLandUpdateToClient(avatar.ControllingClient); |
467 | { | 475 | // sl doesnt seem to send this now, as it used 2 |
468 | over.SendLandUpdateToClient(avatar.ControllingClient); | 476 | // SendParcelOverlay(avatar.ControllingClient); |
469 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, | 477 | avatar.currentParcelUUID = over.LandData.GlobalID; |
470 | m_scene.RegionInfo.RegionID); | 478 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, |
471 | } | 479 | m_scene.RegionInfo.RegionID); |
472 | } | ||
473 | |||
474 | if (avatar.currentParcelUUID != over.LandData.GlobalID) | ||
475 | { | ||
476 | if (!avatar.IsChildAgent) | ||
477 | { | ||
478 | over.SendLandUpdateToClient(avatar.ControllingClient); | ||
479 | avatar.currentParcelUUID = over.LandData.GlobalID; | ||
480 | m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID, | ||
481 | m_scene.RegionInfo.RegionID); | ||
482 | } | ||
483 | } | 480 | } |
484 | } | 481 | } |
485 | } | 482 | } |
@@ -531,6 +528,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
531 | //when we are finally in a safe place, lets release the forced position lock | 528 | //when we are finally in a safe place, lets release the forced position lock |
532 | forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); | 529 | forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); |
533 | } | 530 | } |
531 | EnforceBans(parcel, clientAvatar); | ||
534 | } | 532 | } |
535 | } | 533 | } |
536 | 534 | ||
@@ -589,7 +587,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
589 | requiredPowers = GroupPowers.LandManageBanned; | 587 | requiredPowers = GroupPowers.LandManageBanned; |
590 | 588 | ||
591 | if (m_scene.Permissions.CanEditParcelProperties(agentID, | 589 | if (m_scene.Permissions.CanEditParcelProperties(agentID, |
592 | land, requiredPowers)) | 590 | land, requiredPowers, false)) |
593 | { | 591 | { |
594 | land.UpdateAccessList(flags, transactionID, sequenceID, | 592 | land.UpdateAccessList(flags, transactionID, sequenceID, |
595 | sections, entries, remote_client); | 593 | sections, entries, remote_client); |
@@ -623,20 +621,28 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
623 | new_land.LandData.LocalID = newLandLocalID; | 621 | new_land.LandData.LocalID = newLandLocalID; |
624 | 622 | ||
625 | bool[,] landBitmap = new_land.GetLandBitmap(); | 623 | bool[,] landBitmap = new_land.GetLandBitmap(); |
624 | <<<<<<< HEAD | ||
626 | // m_log.DebugFormat("{0} AddLandObject. new_land.bitmapSize=({1},{2}). newLocalID={3}", | 625 | // m_log.DebugFormat("{0} AddLandObject. new_land.bitmapSize=({1},{2}). newLocalID={3}", |
627 | // LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), newLandLocalID); | 626 | // LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), newLandLocalID); |
628 | 627 | ||
628 | ======= | ||
629 | >>>>>>> avn/ubitvar | ||
629 | if (landBitmap.GetLength(0) != m_landIDList.GetLength(0) || landBitmap.GetLength(1) != m_landIDList.GetLength(1)) | 630 | if (landBitmap.GetLength(0) != m_landIDList.GetLength(0) || landBitmap.GetLength(1) != m_landIDList.GetLength(1)) |
630 | { | 631 | { |
631 | // Going to variable sized regions can cause mismatches | 632 | // Going to variable sized regions can cause mismatches |
632 | m_log.ErrorFormat("{0} AddLandObject. Added land bitmap different size than region ID map. bitmapSize=({1},{2}), landIDSize=({3},{4})", | 633 | m_log.ErrorFormat("{0} AddLandObject. Added land bitmap different size than region ID map. bitmapSize=({1},{2}), landIDSize=({3},{4})", |
634 | <<<<<<< HEAD | ||
633 | LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), m_landIDList.GetLength(0), m_landIDList.GetLength(1) ); | 635 | LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), m_landIDList.GetLength(0), m_landIDList.GetLength(1) ); |
636 | ======= | ||
637 | LogHeader, landBitmap.GetLength(0), landBitmap.GetLength(1), m_landIDList.GetLength(0), m_landIDList.GetLength(1)); | ||
638 | >>>>>>> avn/ubitvar | ||
634 | } | 639 | } |
635 | else | 640 | else |
636 | { | 641 | { |
637 | // If other land objects still believe that they occupy any parts of the same space, | 642 | // If other land objects still believe that they occupy any parts of the same space, |
638 | // then do not allow the add to proceed. | 643 | // then do not allow the add to proceed. |
639 | for (int x = 0; x < landBitmap.GetLength(0); x++) | 644 | for (int x = 0; x < landBitmap.GetLength(0); x++) |
645 | <<<<<<< HEAD | ||
640 | { | 646 | { |
641 | for (int y = 0; y < landBitmap.GetLength(1); y++) | 647 | for (int y = 0; y < landBitmap.GetLength(1); y++) |
642 | { | 648 | { |
@@ -663,15 +669,50 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
663 | } | 669 | } |
664 | 670 | ||
665 | for (int x = 0; x < landBitmap.GetLength(0); x++) | 671 | for (int x = 0; x < landBitmap.GetLength(0); x++) |
672 | ======= | ||
673 | >>>>>>> avn/ubitvar | ||
666 | { | 674 | { |
667 | for (int y = 0; y < landBitmap.GetLength(1); y++) | 675 | for (int y = 0; y < landBitmap.GetLength(1); y++) |
668 | { | 676 | { |
669 | if (landBitmap[x, y]) | 677 | if (landBitmap[x, y]) |
670 | { | 678 | { |
679 | <<<<<<< HEAD | ||
671 | // m_log.DebugFormat( | 680 | // m_log.DebugFormat( |
672 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", | 681 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", |
673 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); | 682 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); |
674 | 683 | ||
684 | ======= | ||
685 | int lastRecordedLandId = m_landIDList[x, y]; | ||
686 | |||
687 | if (lastRecordedLandId > 0) | ||
688 | { | ||
689 | ILandObject lastRecordedLo = m_landList[lastRecordedLandId]; | ||
690 | |||
691 | if (lastRecordedLo.LandBitmap[x, y]) | ||
692 | { | ||
693 | m_log.ErrorFormat( | ||
694 | "{0}: Cannot add parcel \"{1}\", local ID {2} at tile {3},{4} because this is still occupied by parcel \"{5}\", local ID {6} in {7}", | ||
695 | LogHeader, new_land.LandData.Name, new_land.LandData.LocalID, x, y, | ||
696 | lastRecordedLo.LandData.Name, lastRecordedLo.LandData.LocalID, m_scene.Name); | ||
697 | |||
698 | return null; | ||
699 | } | ||
700 | } | ||
701 | } | ||
702 | } | ||
703 | } | ||
704 | |||
705 | for (int x = 0; x < landBitmap.GetLength(0); x++) | ||
706 | { | ||
707 | for (int y = 0; y < landBitmap.GetLength(1); y++) | ||
708 | { | ||
709 | if (landBitmap[x, y]) | ||
710 | { | ||
711 | // m_log.DebugFormat( | ||
712 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", | ||
713 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); | ||
714 | |||
715 | >>>>>>> avn/ubitvar | ||
675 | m_landIDList[x, y] = newLandLocalID; | 716 | m_landIDList[x, y] = newLandLocalID; |
676 | } | 717 | } |
677 | } | 718 | } |
@@ -723,27 +764,28 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
723 | /// </summary> | 764 | /// </summary> |
724 | public void Clear(bool setupDefaultParcel) | 765 | public void Clear(bool setupDefaultParcel) |
725 | { | 766 | { |
726 | List<ILandObject> parcels; | 767 | Dictionary<int, ILandObject> landworkList; |
768 | // move to work pointer since we are deleting it all | ||
727 | lock (m_landList) | 769 | lock (m_landList) |
728 | { | 770 | { |
729 | parcels = new List<ILandObject>(m_landList.Values); | 771 | landworkList = m_landList; |
772 | m_landList = new Dictionary<int, ILandObject>(); | ||
730 | } | 773 | } |
731 | 774 | ||
732 | foreach (ILandObject lo in parcels) | 775 | // this 2 methods have locks (now) |
776 | ResetSimLandObjects(); | ||
777 | |||
778 | if (setupDefaultParcel) | ||
779 | CreateDefaultParcel(); | ||
780 | |||
781 | // fire outside events unlocked | ||
782 | foreach (ILandObject lo in landworkList.Values) | ||
733 | { | 783 | { |
734 | //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); | 784 | //m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID); |
735 | m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); | 785 | m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID); |
736 | } | 786 | } |
787 | landworkList.Clear(); | ||
737 | 788 | ||
738 | lock (m_landList) | ||
739 | { | ||
740 | m_landList.Clear(); | ||
741 | |||
742 | ResetSimLandObjects(); | ||
743 | } | ||
744 | |||
745 | if (setupDefaultParcel) | ||
746 | CreateDefaultParcel(); | ||
747 | } | 789 | } |
748 | 790 | ||
749 | private void performFinalLandJoin(ILandObject master, ILandObject slave) | 791 | private void performFinalLandJoin(ILandObject master, ILandObject slave) |
@@ -787,6 +829,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
787 | /// <returns>Land object at the point supplied</returns> | 829 | /// <returns>Land object at the point supplied</returns> |
788 | public ILandObject GetLandObject(float x_float, float y_float) | 830 | public ILandObject GetLandObject(float x_float, float y_float) |
789 | { | 831 | { |
832 | <<<<<<< HEAD | ||
790 | return GetLandObject((int)x_float, (int)y_float, true /* returnNullIfLandObjectNotFound */); | 833 | return GetLandObject((int)x_float, (int)y_float, true /* returnNullIfLandObjectNotFound */); |
791 | /* | 834 | /* |
792 | int x; | 835 | int x; |
@@ -812,9 +855,31 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
812 | { | 855 | { |
813 | return null; | 856 | return null; |
814 | } | 857 | } |
858 | ======= | ||
859 | return GetLandObject((int)x_float, (int)y_float, true); | ||
860 | } | ||
815 | 861 | ||
816 | lock (m_landList) | 862 | // if x,y is off region this will return the parcel at cliped x,y |
863 | // as did code it replaces | ||
864 | public ILandObject GetLandObjectClipedXY(float x, float y) | ||
865 | { | ||
866 | //do clip inline | ||
867 | int avx = (int)x; | ||
868 | if (avx < 0) | ||
869 | avx = 0; | ||
870 | else if (avx >= m_scene.RegionInfo.RegionSizeX) | ||
871 | avx = (int)Constants.RegionSize - 1; | ||
872 | |||
873 | int avy = (int)y; | ||
874 | if (avy < 0) | ||
875 | avy = 0; | ||
876 | else if (avy >= m_scene.RegionInfo.RegionSizeY) | ||
877 | avy = (int)Constants.RegionSize - 1; | ||
878 | >>>>>>> avn/ubitvar | ||
879 | |||
880 | lock (m_landIDList) | ||
817 | { | 881 | { |
882 | <<<<<<< HEAD | ||
818 | // Corner case. If an autoreturn happens during sim startup | 883 | // Corner case. If an autoreturn happens during sim startup |
819 | // we will come here with the list uninitialized | 884 | // we will come here with the list uninitialized |
820 | // | 885 | // |
@@ -837,6 +902,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
837 | } | 902 | } |
838 | 903 | ||
839 | return null; | 904 | return null; |
905 | ======= | ||
906 | try | ||
907 | { | ||
908 | return m_landList[m_landIDList[avx / landUnit, avy / landUnit]]; | ||
909 | } | ||
910 | catch (IndexOutOfRangeException) | ||
911 | { | ||
912 | return null; | ||
913 | } | ||
914 | >>>>>>> avn/ubitvar | ||
840 | } | 915 | } |
841 | */ | 916 | */ |
842 | } | 917 | } |
@@ -848,6 +923,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
848 | return GetLandObject(x, y, false /* returnNullIfLandObjectNotFound */); | 923 | return GetLandObject(x, y, false /* returnNullIfLandObjectNotFound */); |
849 | } | 924 | } |
850 | 925 | ||
926 | <<<<<<< HEAD | ||
851 | /// <summary> | 927 | /// <summary> |
852 | /// Given a region position, return the parcel land object for that location | 928 | /// Given a region position, return the parcel land object for that location |
853 | /// </summary> | 929 | /// </summary> |
@@ -862,16 +938,37 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
862 | private ILandObject GetLandObject(int x, int y, bool returnNullIfLandObjectOutsideBounds) | 938 | private ILandObject GetLandObject(int x, int y, bool returnNullIfLandObjectOutsideBounds) |
863 | { | 939 | { |
864 | if (x >= m_scene.RegionInfo.RegionSizeX || y >= m_scene.RegionInfo.RegionSizeY || x < 0 || y < 0) | 940 | if (x >= m_scene.RegionInfo.RegionSizeX || y >= m_scene.RegionInfo.RegionSizeY || x < 0 || y < 0) |
941 | ======= | ||
942 | public ILandObject GetLandObject(int x, int y, bool returnNullIfLandObjectOutsideBounds) | ||
943 | { | ||
944 | if (x >= m_scene.RegionInfo.RegionSizeX || y >= m_scene.RegionInfo.RegionSizeY || x < 0 || y < 0) | ||
945 | >>>>>>> avn/ubitvar | ||
865 | { | 946 | { |
866 | // These exceptions here will cause a lot of complaints from the users specifically because | 947 | // These exceptions here will cause a lot of complaints from the users specifically because |
867 | // they happen every time at border crossings | 948 | // they happen every time at border crossings |
868 | if (returnNullIfLandObjectOutsideBounds) | 949 | if (returnNullIfLandObjectOutsideBounds) |
869 | return null; | 950 | return null; |
870 | else | 951 | else |
952 | <<<<<<< HEAD | ||
871 | throw new Exception( | 953 | throw new Exception( |
872 | String.Format("{0} GetLandObject for non-existent position. Region={1}, pos=<{2},{3}", | 954 | String.Format("{0} GetLandObject for non-existent position. Region={1}, pos=<{2},{3}", |
873 | LogHeader, m_scene.RegionInfo.RegionName, x, y) | 955 | LogHeader, m_scene.RegionInfo.RegionName, x, y) |
874 | ); | 956 | ); |
957 | ======= | ||
958 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); | ||
959 | } | ||
960 | |||
961 | lock (m_landIDList) | ||
962 | { | ||
963 | try | ||
964 | { | ||
965 | return m_landList[m_landIDList[x / 4, y / 4]]; | ||
966 | } | ||
967 | catch (IndexOutOfRangeException) | ||
968 | { | ||
969 | return null; | ||
970 | } | ||
971 | >>>>>>> avn/ubitvar | ||
875 | } | 972 | } |
876 | 973 | ||
877 | return m_landList[m_landIDList[x / 4, y / 4]]; | 974 | return m_landList[m_landIDList[x / 4, y / 4]]; |
@@ -890,6 +987,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
890 | return ret; | 987 | return ret; |
891 | } | 988 | } |
892 | 989 | ||
990 | // Create a 'parcel is here' bitmap for the parcel identified by the passed landID | ||
991 | private bool[,] CreateBitmapForID(int landID) | ||
992 | { | ||
993 | bool[,] ret = new bool[m_landIDList.GetLength(0), m_landIDList.GetLength(1)]; | ||
994 | |||
995 | for (int xx = 0; xx < m_landIDList.GetLength(0); xx++) | ||
996 | for (int yy = 0; yy < m_landIDList.GetLength(0); yy++) | ||
997 | if (m_landIDList[xx, yy] == landID) | ||
998 | ret[xx, yy] = true; | ||
999 | |||
1000 | return ret; | ||
1001 | } | ||
1002 | |||
893 | #endregion | 1003 | #endregion |
894 | 1004 | ||
895 | #region Parcel Modification | 1005 | #region Parcel Modification |
@@ -1033,7 +1143,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1033 | 1143 | ||
1034 | //If we are still here, then they are subdividing within one piece of land | 1144 | //If we are still here, then they are subdividing within one piece of land |
1035 | //Check owner | 1145 | //Check owner |
1036 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin)) | 1146 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin, true)) |
1037 | { | 1147 | { |
1038 | return; | 1148 | return; |
1039 | } | 1149 | } |
@@ -1043,6 +1153,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1043 | newLand.LandData.Name = newLand.LandData.Name; | 1153 | newLand.LandData.Name = newLand.LandData.Name; |
1044 | newLand.LandData.GlobalID = UUID.Random(); | 1154 | newLand.LandData.GlobalID = UUID.Random(); |
1045 | newLand.LandData.Dwell = 0; | 1155 | newLand.LandData.Dwell = 0; |
1156 | // Clear "Show in search" on the cut out parcel to prevent double-charging | ||
1157 | newLand.LandData.Flags &= ~(uint)ParcelFlags.ShowDirectory; | ||
1046 | 1158 | ||
1047 | newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y)); | 1159 | newLand.SetLandBitmap(newLand.GetSquareLandBitmap(start_x, start_y, end_x, end_y)); |
1048 | 1160 | ||
@@ -1057,12 +1169,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1057 | 1169 | ||
1058 | //Now add the new land object | 1170 | //Now add the new land object |
1059 | ILandObject result = AddLandObject(newLand); | 1171 | ILandObject result = AddLandObject(newLand); |
1172 | <<<<<<< HEAD | ||
1060 | 1173 | ||
1061 | if (result != null) | 1174 | if (result != null) |
1062 | { | 1175 | { |
1063 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); | 1176 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); |
1064 | result.SendLandUpdateToAvatarsOverMe(); | 1177 | result.SendLandUpdateToAvatarsOverMe(); |
1065 | } | 1178 | } |
1179 | ======= | ||
1180 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); | ||
1181 | result.SendLandUpdateToAvatarsOverMe(); | ||
1182 | startLandObject.SendLandUpdateToAvatarsOverMe(); | ||
1183 | m_scene.ForEachClient(SendParcelOverlay); | ||
1184 | >>>>>>> avn/ubitvar | ||
1066 | } | 1185 | } |
1067 | 1186 | ||
1068 | /// <summary> | 1187 | /// <summary> |
@@ -1104,7 +1223,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1104 | { | 1223 | { |
1105 | return; | 1224 | return; |
1106 | } | 1225 | } |
1107 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin)) | 1226 | if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin, true)) |
1108 | { | 1227 | { |
1109 | return; | 1228 | return; |
1110 | } | 1229 | } |
@@ -1127,6 +1246,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1127 | } | 1246 | } |
1128 | 1247 | ||
1129 | masterLandObject.SendLandUpdateToAvatarsOverMe(); | 1248 | masterLandObject.SendLandUpdateToAvatarsOverMe(); |
1249 | m_scene.ForEachClient(SendParcelOverlay); | ||
1130 | } | 1250 | } |
1131 | 1251 | ||
1132 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | 1252 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) |
@@ -1143,11 +1263,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1143 | 1263 | ||
1144 | #region Parcel Updating | 1264 | #region Parcel Updating |
1145 | 1265 | ||
1266 | <<<<<<< HEAD | ||
1146 | // Send parcel layer info for the whole region | 1267 | // Send parcel layer info for the whole region |
1147 | public void SendParcelOverlay(IClientAPI remote_client) | 1268 | public void SendParcelOverlay(IClientAPI remote_client) |
1148 | { | 1269 | { |
1149 | SendParcelOverlay(remote_client, 0, 0, (int)Constants.MaximumRegionSize); | 1270 | SendParcelOverlay(remote_client, 0, 0, (int)Constants.MaximumRegionSize); |
1150 | } | 1271 | } |
1272 | ======= | ||
1273 | >>>>>>> avn/ubitvar | ||
1151 | 1274 | ||
1152 | /// <summary> | 1275 | /// <summary> |
1153 | /// Send the parcel overlay blocks to the client. We send the overlay packets | 1276 | /// Send the parcel overlay blocks to the client. We send the overlay packets |
@@ -1164,11 +1287,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1164 | /// <param name="layerViewDistance">Distance from x,y position to send parcel layer info</param> | 1287 | /// <param name="layerViewDistance">Distance from x,y position to send parcel layer info</param> |
1165 | private void SendParcelOverlay(IClientAPI remote_client, int xPlace, int yPlace, int layerViewDistance) | 1288 | private void SendParcelOverlay(IClientAPI remote_client, int xPlace, int yPlace, int layerViewDistance) |
1166 | { | 1289 | { |
1290 | if (remote_client.SceneAgent.PresenceType == PresenceType.Npc) | ||
1291 | return; | ||
1292 | |||
1167 | const int LAND_BLOCKS_PER_PACKET = 1024; | 1293 | const int LAND_BLOCKS_PER_PACKET = 1024; |
1168 | 1294 | ||
1169 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | 1295 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; |
1170 | int byteArrayCount = 0; | 1296 | int byteArrayCount = 0; |
1171 | int sequenceID = 0; | 1297 | int sequenceID = 0; |
1298 | <<<<<<< HEAD | ||
1172 | 1299 | ||
1173 | int xLow = 0; | 1300 | int xLow = 0; |
1174 | int xHigh = (int)m_scene.RegionInfo.RegionSizeX; | 1301 | int xHigh = (int)m_scene.RegionInfo.RegionSizeX; |
@@ -1182,6 +1309,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1182 | int txHigh = xPlace + layerViewDistance; | 1309 | int txHigh = xPlace + layerViewDistance; |
1183 | // If the distance is outside the region area, move the view distance to ba all in the region | 1310 | // If the distance is outside the region area, move the view distance to ba all in the region |
1184 | if (txLow < xLow) | 1311 | if (txLow < xLow) |
1312 | ======= | ||
1313 | |||
1314 | // Layer data is in landUnit (4m) chunks | ||
1315 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY; y += landUnit) | ||
1316 | { | ||
1317 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX; x += landUnit) | ||
1318 | >>>>>>> avn/ubitvar | ||
1185 | { | 1319 | { |
1186 | txLow = xLow; | 1320 | txLow = xLow; |
1187 | txHigh = Math.Min(yLow + (layerViewDistance * 2), xHigh); | 1321 | txHigh = Math.Min(yLow + (layerViewDistance * 2), xHigh); |
@@ -1194,6 +1328,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1194 | xLow = txLow; | 1328 | xLow = txLow; |
1195 | xHigh = txHigh; | 1329 | xHigh = txHigh; |
1196 | 1330 | ||
1331 | <<<<<<< HEAD | ||
1197 | int tyLow = yPlace - layerViewDistance; | 1332 | int tyLow = yPlace - layerViewDistance; |
1198 | int tyHigh = yPlace + layerViewDistance; | 1333 | int tyHigh = yPlace + layerViewDistance; |
1199 | if (tyLow < yLow) | 1334 | if (tyLow < yLow) |
@@ -1211,6 +1346,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1211 | } | 1346 | } |
1212 | // m_log.DebugFormat("{0} SendParcelOverlay: place=<{1},{2}>, vDist={3}, xLH=<{4},{5}, yLH=<{6},{7}>", | 1347 | // m_log.DebugFormat("{0} SendParcelOverlay: place=<{1},{2}>, vDist={3}, xLH=<{4},{5}, yLH=<{6},{7}>", |
1213 | // LogHeader, xPlace, yPlace, layerViewDistance, xLow, xHigh, yLow, yHigh); | 1348 | // LogHeader, xPlace, yPlace, layerViewDistance, xLow, xHigh, yLow, yHigh); |
1349 | ======= | ||
1350 | ILandObject currentParcelBlock = GetLandObject(x, y); | ||
1351 | >>>>>>> avn/ubitvar | ||
1214 | 1352 | ||
1215 | // Layer data is in landUnit (4m) chunks | 1353 | // Layer data is in landUnit (4m) chunks |
1216 | for (int y = yLow; y < yHigh / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); y++) | 1354 | for (int y = yLow; y < yHigh / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); y++) |
@@ -1221,6 +1359,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1221 | byteArrayCount++; | 1359 | byteArrayCount++; |
1222 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) | 1360 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) |
1223 | { | 1361 | { |
1362 | <<<<<<< HEAD | ||
1224 | // m_log.DebugFormat("{0} SendParcelOverlay, sending packet, bytes={1}", LogHeader, byteArray.Length); | 1363 | // m_log.DebugFormat("{0} SendParcelOverlay, sending packet, bytes={1}", LogHeader, byteArray.Length); |
1225 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); | 1364 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); |
1226 | byteArrayCount = 0; | 1365 | byteArrayCount = 0; |
@@ -1298,6 +1437,95 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1298 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); | 1437 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH); |
1299 | } | 1438 | } |
1300 | 1439 | ||
1440 | ======= | ||
1441 | // types | ||
1442 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) | ||
1443 | { | ||
1444 | //Owner Flag | ||
1445 | tempByte = (byte)LandChannel.LAND_TYPE_OWNED_BY_REQUESTER; | ||
1446 | } | ||
1447 | else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) | ||
1448 | { | ||
1449 | tempByte = (byte)LandChannel.LAND_TYPE_OWNED_BY_GROUP; | ||
1450 | } | ||
1451 | else if (currentParcelBlock.LandData.SalePrice > 0 && | ||
1452 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || | ||
1453 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) | ||
1454 | { | ||
1455 | //Sale type | ||
1456 | tempByte = (byte)LandChannel.LAND_TYPE_IS_FOR_SALE; | ||
1457 | } | ||
1458 | else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) | ||
1459 | { | ||
1460 | //Public type | ||
1461 | tempByte = (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero | ||
1462 | } | ||
1463 | // LAND_TYPE_IS_BEING_AUCTIONED still unsuported | ||
1464 | else | ||
1465 | { | ||
1466 | //Other Flag | ||
1467 | tempByte = (byte)LandChannel.LAND_TYPE_OWNED_BY_OTHER; | ||
1468 | } | ||
1469 | |||
1470 | // now flags | ||
1471 | // border control | ||
1472 | |||
1473 | ILandObject westParcel = null; | ||
1474 | ILandObject southParcel = null; | ||
1475 | if (x > 0) | ||
1476 | { | ||
1477 | westParcel = GetLandObject((x - 1), y); | ||
1478 | } | ||
1479 | if (y > 0) | ||
1480 | { | ||
1481 | southParcel = GetLandObject(x, (y - 1)); | ||
1482 | } | ||
1483 | |||
1484 | if (x == 0) | ||
1485 | { | ||
1486 | tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST; | ||
1487 | } | ||
1488 | else if (westParcel != null && westParcel != currentParcelBlock) | ||
1489 | { | ||
1490 | tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_WEST; | ||
1491 | } | ||
1492 | |||
1493 | if (y == 0) | ||
1494 | { | ||
1495 | tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH; | ||
1496 | } | ||
1497 | else if (southParcel != null && southParcel != currentParcelBlock) | ||
1498 | { | ||
1499 | tempByte |= (byte)LandChannel.LAND_FLAG_PROPERTY_BORDER_SOUTH; | ||
1500 | } | ||
1501 | |||
1502 | // local sound | ||
1503 | if ((currentParcelBlock.LandData.Flags & (uint)ParcelFlags.SoundLocal) != 0) | ||
1504 | tempByte |= (byte)LandChannel.LAND_FLAG_LOCALSOUND; | ||
1505 | |||
1506 | // hide avatars | ||
1507 | if (!currentParcelBlock.LandData.SeeAVs) | ||
1508 | tempByte |= (byte)LandChannel.LAND_FLAG_HIDEAVATARS; | ||
1509 | |||
1510 | |||
1511 | byteArray[byteArrayCount] = tempByte; | ||
1512 | byteArrayCount++; | ||
1513 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) | ||
1514 | { | ||
1515 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); | ||
1516 | byteArrayCount = 0; | ||
1517 | sequenceID++; | ||
1518 | byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | ||
1519 | } | ||
1520 | } | ||
1521 | } | ||
1522 | |||
1523 | } | ||
1524 | |||
1525 | if (byteArrayCount > 0) | ||
1526 | { | ||
1527 | remote_client.SendLandParcelOverlay(byteArray, sequenceID); | ||
1528 | >>>>>>> avn/ubitvar | ||
1301 | } | 1529 | } |
1302 | 1530 | ||
1303 | return tempByte; | 1531 | return tempByte; |
@@ -1320,8 +1548,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1320 | { | 1548 | { |
1321 | if (!temp.Contains(currentParcel)) | 1549 | if (!temp.Contains(currentParcel)) |
1322 | { | 1550 | { |
1323 | currentParcel.ForceUpdateLandInfo(); | 1551 | if (!currentParcel.IsEitherBannedOrRestricted(remote_client.AgentId)) |
1324 | temp.Add(currentParcel); | 1552 | { |
1553 | currentParcel.ForceUpdateLandInfo(); | ||
1554 | temp.Add(currentParcel); | ||
1555 | } | ||
1325 | } | 1556 | } |
1326 | } | 1557 | } |
1327 | } | 1558 | } |
@@ -1338,8 +1569,50 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1338 | temp[i].SendLandProperties(sequence_id, snap_selection, requestResult, remote_client); | 1569 | temp[i].SendLandProperties(sequence_id, snap_selection, requestResult, remote_client); |
1339 | } | 1570 | } |
1340 | 1571 | ||
1572 | <<<<<<< HEAD | ||
1341 | // Also send the layer data around the point of interest | 1573 | // Also send the layer data around the point of interest |
1342 | SendParcelOverlay(remote_client, (start_x + end_x) / 2, (start_y + end_y) / 2, parcelLayerViewDistance); | 1574 | SendParcelOverlay(remote_client, (start_x + end_x) / 2, (start_y + end_y) / 2, parcelLayerViewDistance); |
1575 | ======= | ||
1576 | // SendParcelOverlay(remote_client); | ||
1577 | } | ||
1578 | |||
1579 | public void UpdateLandProperties(ILandObject land, LandUpdateArgs args, IClientAPI remote_client) | ||
1580 | { | ||
1581 | bool snap_selection = false; | ||
1582 | bool needOverlay = false; | ||
1583 | if (land.UpdateLandProperties(args, remote_client, out snap_selection, out needOverlay)) | ||
1584 | { | ||
1585 | //the proprieties to who changed them | ||
1586 | ScenePresence av = m_scene.GetScenePresence(remote_client.AgentId); | ||
1587 | if(av.IsChildAgent || land != GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y)) | ||
1588 | land.SendLandProperties(-10000, false, LandChannel.LAND_RESULT_SINGLE, remote_client); | ||
1589 | else | ||
1590 | land.SendLandProperties(0, false, LandChannel.LAND_RESULT_SINGLE, remote_client); | ||
1591 | |||
1592 | UUID parcelID = land.LandData.GlobalID; | ||
1593 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) | ||
1594 | { | ||
1595 | if (avatar.IsDeleted || avatar.isNPC) | ||
1596 | return; | ||
1597 | |||
1598 | IClientAPI client = avatar.ControllingClient; | ||
1599 | if (needOverlay) | ||
1600 | SendParcelOverlay(client); | ||
1601 | |||
1602 | if (avatar.IsChildAgent) | ||
1603 | return; | ||
1604 | |||
1605 | ILandObject aland = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | ||
1606 | if (aland != null) | ||
1607 | { | ||
1608 | if (client != remote_client && land == aland) | ||
1609 | aland.SendLandProperties(0, false, LandChannel.LAND_RESULT_SINGLE, client); | ||
1610 | } | ||
1611 | if (avatar.currentParcelUUID == parcelID) | ||
1612 | avatar.currentParcelUUID = parcelID; // force parcel flags review | ||
1613 | }); | ||
1614 | } | ||
1615 | >>>>>>> avn/ubitvar | ||
1343 | } | 1616 | } |
1344 | 1617 | ||
1345 | public void ClientOnParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client) | 1618 | public void ClientOnParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client) |
@@ -1352,7 +1625,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1352 | 1625 | ||
1353 | if (land != null) | 1626 | if (land != null) |
1354 | { | 1627 | { |
1355 | land.UpdateLandProperties(args, remote_client); | 1628 | UpdateLandProperties(land, args, remote_client); |
1356 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(args, localID, remote_client); | 1629 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(args, localID, remote_client); |
1357 | } | 1630 | } |
1358 | } | 1631 | } |
@@ -1408,7 +1681,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1408 | land.LandData.GroupID = UUID.Zero; | 1681 | land.LandData.GroupID = UUID.Zero; |
1409 | land.LandData.IsGroupOwned = false; | 1682 | land.LandData.IsGroupOwned = false; |
1410 | land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); | 1683 | land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); |
1411 | |||
1412 | m_scene.ForEachClient(SendParcelOverlay); | 1684 | m_scene.ForEachClient(SendParcelOverlay); |
1413 | land.SendLandUpdateToClient(true, remote_client); | 1685 | land.SendLandUpdateToClient(true, remote_client); |
1414 | UpdateLandObject(land.LandData.LocalID, land.LandData); | 1686 | UpdateLandObject(land.LandData.LocalID, land.LandData); |
@@ -1459,7 +1731,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1459 | land.LandData.SalePrice = 0; | 1731 | land.LandData.SalePrice = 0; |
1460 | land.LandData.AuthBuyerID = UUID.Zero; | 1732 | land.LandData.AuthBuyerID = UUID.Zero; |
1461 | land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); | 1733 | land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); |
1462 | |||
1463 | m_scene.ForEachClient(SendParcelOverlay); | 1734 | m_scene.ForEachClient(SendParcelOverlay); |
1464 | land.SendLandUpdateToClient(true, remote_client); | 1735 | land.SendLandUpdateToClient(true, remote_client); |
1465 | UpdateLandObject(land.LandData.LocalID, land.LandData); | 1736 | UpdateLandObject(land.LandData.LocalID, land.LandData); |
@@ -1545,9 +1816,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1545 | 1816 | ||
1546 | private void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) | 1817 | private void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) |
1547 | { | 1818 | { |
1548 | // m_log.DebugFormat( | 1819 | lock (m_landList) |
1549 | // "[LAND MANAGMENT MODULE]: Processing {0} incoming parcels on {1}", data.Count, m_scene.Name); | 1820 | { |
1821 | for (int i = 0; i < data.Count; i++) | ||
1822 | IncomingLandObjectFromStorage(data[i]); | ||
1550 | 1823 | ||
1824 | <<<<<<< HEAD | ||
1551 | // Prevent race conditions from any auto-creation of new parcels for varregions whilst we are still loading | 1825 | // Prevent race conditions from any auto-creation of new parcels for varregions whilst we are still loading |
1552 | // the existing parcels. | 1826 | // the existing parcels. |
1553 | lock (m_landList) | 1827 | lock (m_landList) |
@@ -1559,13 +1833,23 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1559 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); y++) | 1833 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); y++) |
1560 | { | 1834 | { |
1561 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); x++) | 1835 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / LandUnit); x++) |
1836 | ======= | ||
1837 | // Layer data is in landUnit (4m) chunks | ||
1838 | for (int y = 0; y < m_scene.RegionInfo.RegionSizeY / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / landUnit); y++) | ||
1839 | { | ||
1840 | for (int x = 0; x < m_scene.RegionInfo.RegionSizeX / Constants.TerrainPatchSize * (Constants.TerrainPatchSize / landUnit); x++) | ||
1841 | >>>>>>> avn/ubitvar | ||
1562 | { | 1842 | { |
1563 | if (m_landIDList[x, y] == 0) | 1843 | if (m_landIDList[x, y] == 0) |
1564 | { | 1844 | { |
1565 | if (m_landList.Count == 1) | 1845 | if (m_landList.Count == 1) |
1566 | { | 1846 | { |
1567 | m_log.DebugFormat( | 1847 | m_log.DebugFormat( |
1848 | <<<<<<< HEAD | ||
1568 | "[{0}]: Auto-extending land parcel as landID at {1},{2} is 0 and only one land parcel is present in {3}", | 1849 | "[{0}]: Auto-extending land parcel as landID at {1},{2} is 0 and only one land parcel is present in {3}", |
1850 | ======= | ||
1851 | "[{0}]: Auto-extending land parcel as landID at {1},{2} is 0 and only one land parcel is present in {3}", | ||
1852 | >>>>>>> avn/ubitvar | ||
1569 | LogHeader, x, y, m_scene.Name); | 1853 | LogHeader, x, y, m_scene.Name); |
1570 | 1854 | ||
1571 | int onlyParcelID = 0; | 1855 | int onlyParcelID = 0; |
@@ -1588,11 +1872,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1588 | else if (m_landList.Count > 1) | 1872 | else if (m_landList.Count > 1) |
1589 | { | 1873 | { |
1590 | m_log.DebugFormat( | 1874 | m_log.DebugFormat( |
1875 | <<<<<<< HEAD | ||
1591 | "{0}: Auto-creating land parcel as landID at {1},{2} is 0 and more than one land parcel is present in {3}", | 1876 | "{0}: Auto-creating land parcel as landID at {1},{2} is 0 and more than one land parcel is present in {3}", |
1592 | LogHeader, x, y, m_scene.Name); | 1877 | LogHeader, x, y, m_scene.Name); |
1593 | 1878 | ||
1594 | // There are several other parcels so we must create a new one for the unassigned space | 1879 | // There are several other parcels so we must create a new one for the unassigned space |
1595 | ILandObject newLand = new LandObject(UUID.Zero, false, m_scene); | 1880 | ILandObject newLand = new LandObject(UUID.Zero, false, m_scene); |
1881 | ======= | ||
1882 | "{0}: Auto-creating land parcel as landID at {1},{2} is 0 and more than one land parcel is present in {3}", | ||
1883 | LogHeader, x, y, m_scene.Name); | ||
1884 | |||
1885 | // There are several other parcels so we must create a new one for the unassigned space | ||
1886 | ILandObject newLand = new LandObject(UUID.Zero, false, m_scene); | ||
1887 | >>>>>>> avn/ubitvar | ||
1596 | // Claim all the unclaimed "0" ids | 1888 | // Claim all the unclaimed "0" ids |
1597 | newLand.SetLandBitmap(CreateBitmapForID(0)); | 1889 | newLand.SetLandBitmap(CreateBitmapForID(0)); |
1598 | newLand.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 1890 | newLand.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
@@ -1603,7 +1895,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1603 | { | 1895 | { |
1604 | // We should never reach this point as the separate code path when no land data exists should have fired instead. | 1896 | // We should never reach this point as the separate code path when no land data exists should have fired instead. |
1605 | m_log.WarnFormat( | 1897 | m_log.WarnFormat( |
1898 | <<<<<<< HEAD | ||
1606 | "{0}: Ignoring request to auto-create parcel in {1} as there are no other parcels present", | 1899 | "{0}: Ignoring request to auto-create parcel in {1} as there are no other parcels present", |
1900 | ======= | ||
1901 | "{0}: Ignoring request to auto-create parcel in {1} as there are no other parcels present", | ||
1902 | >>>>>>> avn/ubitvar | ||
1607 | LogHeader, m_scene.Name); | 1903 | LogHeader, m_scene.Name); |
1608 | } | 1904 | } |
1609 | } | 1905 | } |
@@ -1614,9 +1910,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1614 | 1910 | ||
1615 | private void IncomingLandObjectFromStorage(LandData data) | 1911 | private void IncomingLandObjectFromStorage(LandData data) |
1616 | { | 1912 | { |
1913 | <<<<<<< HEAD | ||
1617 | ILandObject new_land = new LandObject(data, m_scene); | 1914 | ILandObject new_land = new LandObject(data, m_scene); |
1915 | ======= | ||
1916 | |||
1917 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); | ||
1918 | new_land.LandData = data.Copy(); | ||
1919 | >>>>>>> avn/ubitvar | ||
1618 | new_land.SetLandBitmapFromByteArray(); | 1920 | new_land.SetLandBitmapFromByteArray(); |
1619 | AddLandObject(new_land); | 1921 | AddLandObject(new_land); |
1922 | // new_land.SendLandUpdateToAvatarsOverMe(); | ||
1620 | } | 1923 | } |
1621 | 1924 | ||
1622 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | 1925 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
@@ -1773,6 +2076,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1773 | land_update.ObscureMusic = properties.ObscureMusic; | 2076 | land_update.ObscureMusic = properties.ObscureMusic; |
1774 | land_update.ObscureMedia = properties.ObscureMedia; | 2077 | land_update.ObscureMedia = properties.ObscureMedia; |
1775 | 2078 | ||
2079 | if (args.ContainsKey("see_avs")) | ||
2080 | { | ||
2081 | land_update.SeeAVs = args["see_avs"].AsBoolean(); | ||
2082 | land_update.AnyAVSounds = args["any_av_sounds"].AsBoolean(); | ||
2083 | land_update.GroupAVSounds = args["group_av_sounds"].AsBoolean(); | ||
2084 | } | ||
2085 | else | ||
2086 | { | ||
2087 | land_update.SeeAVs = true; | ||
2088 | land_update.AnyAVSounds = true; | ||
2089 | land_update.GroupAVSounds = true; | ||
2090 | } | ||
2091 | |||
1776 | ILandObject land; | 2092 | ILandObject land; |
1777 | lock (m_landList) | 2093 | lock (m_landList) |
1778 | { | 2094 | { |
@@ -1781,13 +2097,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1781 | 2097 | ||
1782 | if (land != null) | 2098 | if (land != null) |
1783 | { | 2099 | { |
1784 | land.UpdateLandProperties(land_update, client); | 2100 | UpdateLandProperties(land,land_update, client); |
1785 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); | 2101 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); |
1786 | } | 2102 | } |
1787 | else | 2103 | else |
1788 | { | 2104 | { |
1789 | m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to find parcelID {0}", parcelID); | 2105 | m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to find parcelID {0}", parcelID); |
1790 | } | 2106 | } |
2107 | |||
1791 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); | 2108 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); |
1792 | } | 2109 | } |
1793 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | 2110 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the |
@@ -1940,14 +2257,93 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1940 | 2257 | ||
1941 | if (land == null) return; | 2258 | if (land == null) return; |
1942 | 2259 | ||
1943 | if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions)) | 2260 | if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions, false)) |
1944 | return; | 2261 | return; |
1945 | 2262 | ||
1946 | land.LandData.OtherCleanTime = otherCleanTime; | 2263 | land.LandData.OtherCleanTime = otherCleanTime; |
1947 | 2264 | ||
1948 | UpdateLandObject(localID, land.LandData); | 2265 | UpdateLandObject(localID, land.LandData); |
1949 | } | 2266 | } |
1950 | 2267 | ||
2268 | public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID) | ||
2269 | { | ||
2270 | ILandObject land = null; | ||
2271 | List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels(); | ||
2272 | foreach (ILandObject landObject in Land) | ||
2273 | { | ||
2274 | if (landObject.LandData.LocalID == landID) | ||
2275 | { | ||
2276 | land = landObject; | ||
2277 | } | ||
2278 | } | ||
2279 | land.DeedToGroup(DefaultGodParcelGroup); | ||
2280 | land.LandData.Name = DefaultGodParcelName; | ||
2281 | land.SendLandUpdateToAvatarsOverMe(); | ||
2282 | } | ||
2283 | |||
2284 | private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) | ||
2285 | { | ||
2286 | ScenePresence SP; | ||
2287 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP); | ||
2288 | List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); | ||
2289 | if (SP.UserLevel != 0) | ||
2290 | { | ||
2291 | if (flags == 0) //All parcels, scripted or not | ||
2292 | { | ||
2293 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
2294 | { | ||
2295 | if (e.OwnerID == targetID) | ||
2296 | { | ||
2297 | returns.Add(e); | ||
2298 | } | ||
2299 | } | ||
2300 | ); | ||
2301 | } | ||
2302 | if (flags == 4) //All parcels, scripted object | ||
2303 | { | ||
2304 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
2305 | { | ||
2306 | if (e.OwnerID == targetID) | ||
2307 | { | ||
2308 | if (e.ContainsScripts()) | ||
2309 | { | ||
2310 | returns.Add(e); | ||
2311 | } | ||
2312 | } | ||
2313 | } | ||
2314 | ); | ||
2315 | } | ||
2316 | if (flags == 4) //not target parcel, scripted object | ||
2317 | { | ||
2318 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
2319 | { | ||
2320 | if (e.OwnerID == targetID) | ||
2321 | { | ||
2322 | ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y); | ||
2323 | if (landobject.LandData.OwnerID != e.OwnerID) | ||
2324 | { | ||
2325 | if (e.ContainsScripts()) | ||
2326 | { | ||
2327 | returns.Add(e); | ||
2328 | } | ||
2329 | } | ||
2330 | } | ||
2331 | } | ||
2332 | ); | ||
2333 | } | ||
2334 | foreach (SceneObjectGroup ol in returns) | ||
2335 | { | ||
2336 | ReturnObject(ol, client); | ||
2337 | } | ||
2338 | } | ||
2339 | } | ||
2340 | public void ReturnObject(SceneObjectGroup obj, IClientAPI client) | ||
2341 | { | ||
2342 | SceneObjectGroup[] objs = new SceneObjectGroup[1]; | ||
2343 | objs[0] = obj; | ||
2344 | ((Scene)client.Scene).returnObjects(objs, client.AgentId); | ||
2345 | } | ||
2346 | |||
1951 | Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>(); | 2347 | Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>(); |
1952 | 2348 | ||
1953 | public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | 2349 | public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) |
@@ -1961,7 +2357,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1961 | if (targetAvatar.UserLevel == 0) | 2357 | if (targetAvatar.UserLevel == 0) |
1962 | { | 2358 | { |
1963 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | 2359 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); |
1964 | if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze)) | 2360 | if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true)) |
1965 | return; | 2361 | return; |
1966 | if (flags == 0) | 2362 | if (flags == 0) |
1967 | { | 2363 | { |
@@ -1983,7 +2379,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1983 | } | 2379 | } |
1984 | } | 2380 | } |
1985 | } | 2381 | } |
1986 | |||
1987 | private void OnEndParcelFrozen(object avatar) | 2382 | private void OnEndParcelFrozen(object avatar) |
1988 | { | 2383 | { |
1989 | ScenePresence targetAvatar = (ScenePresence)avatar; | 2384 | ScenePresence targetAvatar = (ScenePresence)avatar; |
@@ -1994,6 +2389,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1994 | targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false); | 2389 | targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false); |
1995 | } | 2390 | } |
1996 | 2391 | ||
2392 | |||
1997 | public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | 2393 | public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) |
1998 | { | 2394 | { |
1999 | ScenePresence targetAvatar = null; | 2395 | ScenePresence targetAvatar = null; |
@@ -2010,15 +2406,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2010 | 2406 | ||
2011 | // Check if you even have permission to do this | 2407 | // Check if you even have permission to do this |
2012 | ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | 2408 | ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); |
2013 | if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze) && | 2409 | if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true) && |
2014 | !m_scene.Permissions.IsAdministrator(client.AgentId)) | 2410 | !m_scene.Permissions.IsAdministrator(client.AgentId)) |
2015 | return; | 2411 | return; |
2412 | |||
2016 | Vector3 pos = m_scene.GetNearestAllowedPosition(targetAvatar, land); | 2413 | Vector3 pos = m_scene.GetNearestAllowedPosition(targetAvatar, land); |
2017 | 2414 | ||
2018 | targetAvatar.TeleportWithMomentum(pos, null); | 2415 | targetAvatar.TeleportWithMomentum(pos, null); |
2019 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | 2416 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); |
2020 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | 2417 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); |
2021 | 2418 | ||
2022 | if ((flags & 1) != 0) // Ban TODO: Remove magic number | 2419 | if ((flags & 1) != 0) // Ban TODO: Remove magic number |
2023 | { | 2420 | { |
2024 | LandAccessEntry entry = new LandAccessEntry(); | 2421 | LandAccessEntry entry = new LandAccessEntry(); |
@@ -2171,6 +2568,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2171 | 2568 | ||
2172 | private void AppendParcelsSummaryReport(StringBuilder report) | 2569 | private void AppendParcelsSummaryReport(StringBuilder report) |
2173 | { | 2570 | { |
2571 | <<<<<<< HEAD | ||
2174 | report.AppendFormat("Land information for {0}\n", m_scene.Name); | 2572 | report.AppendFormat("Land information for {0}\n", m_scene.Name); |
2175 | 2573 | ||
2176 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | 2574 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); |
@@ -2180,12 +2578,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2180 | cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize); | 2578 | cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize); |
2181 | cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize); | 2579 | cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize); |
2182 | cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize); | 2580 | cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize); |
2581 | ======= | ||
2582 | report.AppendFormat("Land information for {0}\n", m_scene.RegionInfo.RegionName); | ||
2583 | report.AppendFormat( | ||
2584 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", | ||
2585 | "Parcel Name", | ||
2586 | "Local ID", | ||
2587 | "Area", | ||
2588 | "AABBMin", | ||
2589 | "AABBMax", | ||
2590 | "Owner"); | ||
2591 | >>>>>>> avn/ubitvar | ||
2183 | 2592 | ||
2184 | lock (m_landList) | 2593 | lock (m_landList) |
2185 | { | 2594 | { |
2186 | foreach (ILandObject lo in m_landList.Values) | 2595 | foreach (ILandObject lo in m_landList.Values) |
2187 | { | 2596 | { |
2188 | LandData ld = lo.LandData; | 2597 | LandData ld = lo.LandData; |
2598 | <<<<<<< HEAD | ||
2189 | string ownerName; | 2599 | string ownerName; |
2190 | if (ld.IsGroupOwned) | 2600 | if (ld.IsGroupOwned) |
2191 | { | 2601 | { |
@@ -2198,6 +2608,35 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2198 | } | 2608 | } |
2199 | cdt.AddRow( | 2609 | cdt.AddRow( |
2200 | ld.Name, ld.LocalID, ld.Area, lo.StartPoint, lo.EndPoint, ownerName); | 2610 | ld.Name, ld.LocalID, ld.Area, lo.StartPoint, lo.EndPoint, ownerName); |
2611 | ======= | ||
2612 | |||
2613 | report.AppendFormat( | ||
2614 | "{0,-20} {1,-10} {2,-9} {3,-18} {4,-18} {5,-20}\n", | ||
2615 | ld.Name, ld.LocalID, ld.Area, ld.AABBMin, ld.AABBMax, m_userManager.GetUserName(ld.OwnerID)); | ||
2616 | } | ||
2617 | } | ||
2618 | |||
2619 | } | ||
2620 | |||
2621 | public void EnforceBans(ILandObject land, ScenePresence avatar) | ||
2622 | { | ||
2623 | if (avatar.AbsolutePosition.Z > LandChannel.BAN_LINE_SAFETY_HIEGHT) | ||
2624 | return; | ||
2625 | |||
2626 | if (land.IsEitherBannedOrRestricted(avatar.UUID)) | ||
2627 | { | ||
2628 | if (land.ContainsPoint(Convert.ToInt32(avatar.lastKnownAllowedPosition.X), Convert.ToInt32(avatar.lastKnownAllowedPosition.Y))) | ||
2629 | { | ||
2630 | Vector3? pos = m_scene.GetNearestAllowedPosition(avatar); | ||
2631 | if (pos == null) | ||
2632 | m_scene.TeleportClientHome(avatar.UUID, avatar.ControllingClient); | ||
2633 | else | ||
2634 | ForceAvatarToPosition(avatar, (Vector3)pos); | ||
2635 | } | ||
2636 | else | ||
2637 | { | ||
2638 | ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition); | ||
2639 | >>>>>>> avn/ubitvar | ||
2201 | } | 2640 | } |
2202 | } | 2641 | } |
2203 | 2642 | ||
@@ -2214,8 +2653,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2214 | cdl.AddRow("Description", ld.Description); | 2653 | cdl.AddRow("Description", ld.Description); |
2215 | cdl.AddRow("Snapshot ID", ld.SnapshotID); | 2654 | cdl.AddRow("Snapshot ID", ld.SnapshotID); |
2216 | cdl.AddRow("Area", ld.Area); | 2655 | cdl.AddRow("Area", ld.Area); |
2217 | cdl.AddRow("Starts", lo.StartPoint); | ||
2218 | cdl.AddRow("Ends", lo.EndPoint); | ||
2219 | cdl.AddRow("AABB Min", ld.AABBMin); | 2656 | cdl.AddRow("AABB Min", ld.AABBMin); |
2220 | cdl.AddRow("AABB Max", ld.AABBMax); | 2657 | cdl.AddRow("AABB Max", ld.AABBMax); |
2221 | string ownerName; | 2658 | string ownerName; |