diff options
author | Jeff Ames | 2010-09-12 13:43:49 -0400 |
---|---|---|
committer | Jeff Ames | 2010-09-12 13:43:49 -0400 |
commit | f1f0bc23f4501ba99035283d3407ddad2b21b785 (patch) | |
tree | 2b62a244eddf18f5608405abcefa9f763ab54340 /OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |
parent | Add copyright headers. (diff) | |
download | opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.zip opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.gz opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.bz2 opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 115 |
1 files changed, 55 insertions, 60 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index ea71fd9..634685a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -72,12 +72,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
72 | #pragma warning restore 0429 | 72 | #pragma warning restore 0429 |
73 | 73 | ||
74 | /// <value> | 74 | /// <value> |
75 | /// Local land ids at specified region co-ordinates (region size / 4) | 75 | /// Local land ids at specified region co-ordinates (region size / 4) |
76 | /// </value> | 76 | /// </value> |
77 | private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax]; | 77 | private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax]; |
78 | 78 | ||
79 | /// <value> | 79 | /// <value> |
80 | /// Land objects keyed by local id | 80 | /// Land objects keyed by local id |
81 | /// </value> | 81 | /// </value> |
82 | private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); | 82 | private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); |
83 | 83 | ||
@@ -92,8 +92,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
92 | 92 | ||
93 | #region INonSharedRegionModule Members | 93 | #region INonSharedRegionModule Members |
94 | 94 | ||
95 | public Type ReplaceableInterface | 95 | public Type ReplaceableInterface |
96 | { | 96 | { |
97 | get { return null; } | 97 | get { return null; } |
98 | } | 98 | } |
99 | 99 | ||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
192 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); | 192 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); |
193 | forcedPosition = null; | 193 | forcedPosition = null; |
194 | } | 194 | } |
195 | //if we are far away, teleport | 195 | //if we are far away, teleport |
196 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) | 196 | else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) |
197 | { | 197 | { |
198 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); | 198 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); |
@@ -321,8 +321,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
321 | } | 321 | } |
322 | } | 322 | } |
323 | 323 | ||
324 | |||
325 | |||
326 | private void ForceAvatarToPosition(ScenePresence avatar, Vector3? position) | 324 | private void ForceAvatarToPosition(ScenePresence avatar, Vector3? position) |
327 | { | 325 | { |
328 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; | 326 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; |
@@ -336,7 +334,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
336 | { | 334 | { |
337 | avatar.ControllingClient.SendAlertMessage( | 335 | avatar.ControllingClient.SendAlertMessage( |
338 | "You are not allowed on this parcel because the land owner has restricted access."); | 336 | "You are not allowed on this parcel because the land owner has restricted access."); |
339 | |||
340 | } | 337 | } |
341 | 338 | ||
342 | public void EventManagerOnAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) | 339 | public void EventManagerOnAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) |
@@ -448,7 +445,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
448 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | 445 | if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && |
449 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) | 446 | clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) |
450 | { | 447 | { |
451 | EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, | 448 | EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, |
452 | m_scene.RegionInfo.RegionID); | 449 | m_scene.RegionInfo.RegionID); |
453 | //They are going under the safety line! | 450 | //They are going under the safety line! |
454 | if (!parcel.IsBannedFromLand(clientAvatar.UUID)) | 451 | if (!parcel.IsBannedFromLand(clientAvatar.UUID)) |
@@ -652,7 +649,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
652 | 649 | ||
653 | if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) | 650 | if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) |
654 | return null; | 651 | return null; |
655 | 652 | ||
656 | try | 653 | try |
657 | { | 654 | { |
658 | x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0)); | 655 | x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0)); |
@@ -667,7 +664,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
667 | { | 664 | { |
668 | return null; | 665 | return null; |
669 | } | 666 | } |
670 | 667 | ||
671 | lock (m_landList) | 668 | lock (m_landList) |
672 | { | 669 | { |
673 | // Corner case. If an autoreturn happens during sim startup | 670 | // Corner case. If an autoreturn happens during sim startup |
@@ -687,7 +684,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
687 | // they happen every time at border crossings | 684 | // they happen every time at border crossings |
688 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); | 685 | throw new Exception("Error: Parcel not found at point " + x + ", " + y); |
689 | } | 686 | } |
690 | 687 | ||
691 | lock (m_landIDList) | 688 | lock (m_landIDList) |
692 | { | 689 | { |
693 | try | 690 | try |
@@ -741,7 +738,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
741 | 738 | ||
742 | public void EventManagerOnObjectBeingRemovedFromScene(SceneObjectGroup obj) | 739 | public void EventManagerOnObjectBeingRemovedFromScene(SceneObjectGroup obj) |
743 | { | 740 | { |
744 | |||
745 | lock (m_landList) | 741 | lock (m_landList) |
746 | { | 742 | { |
747 | foreach (LandObject p in m_landList.Values) | 743 | foreach (LandObject p in m_landList.Values) |
@@ -936,7 +932,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
936 | return; | 932 | return; |
937 | } | 933 | } |
938 | } | 934 | } |
939 | 935 | ||
940 | lock (m_landList) | 936 | lock (m_landList) |
941 | { | 937 | { |
942 | foreach (ILandObject slaveLandObject in selectedLandObjects) | 938 | foreach (ILandObject slaveLandObject in selectedLandObjects) |
@@ -1078,7 +1074,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1078 | temp.Add(currentParcel); | 1074 | temp.Add(currentParcel); |
1079 | } | 1075 | } |
1080 | } | 1076 | } |
1081 | |||
1082 | } | 1077 | } |
1083 | } | 1078 | } |
1084 | 1079 | ||
@@ -1121,7 +1116,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1121 | join(west, south, east, north, remote_client.AgentId); | 1116 | join(west, south, east, north, remote_client.AgentId); |
1122 | } | 1117 | } |
1123 | 1118 | ||
1124 | public void ClientOnParcelSelectObjects(int local_id, int request_type, | 1119 | public void ClientOnParcelSelectObjects(int local_id, int request_type, |
1125 | List<UUID> returnIDs, IClientAPI remote_client) | 1120 | List<UUID> returnIDs, IClientAPI remote_client) |
1126 | { | 1121 | { |
1127 | m_landList[local_id].SendForceObjectSelect(local_id, request_type, returnIDs, remote_client); | 1122 | m_landList[local_id].SendForceObjectSelect(local_id, request_type, returnIDs, remote_client); |
@@ -1358,31 +1353,31 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1358 | { | 1353 | { |
1359 | return RemoteParcelRequest(request, path, param, agentID, caps); | 1354 | return RemoteParcelRequest(request, path, param, agentID, caps); |
1360 | })); | 1355 | })); |
1361 | UUID parcelCapID = UUID.Random(); | 1356 | UUID parcelCapID = UUID.Random(); |
1362 | caps.RegisterHandler("ParcelPropertiesUpdate", | 1357 | caps.RegisterHandler("ParcelPropertiesUpdate", |
1363 | new RestStreamHandler("POST", "/CAPS/" + parcelCapID, | 1358 | new RestStreamHandler("POST", "/CAPS/" + parcelCapID, |
1364 | delegate(string request, string path, string param, | 1359 | delegate(string request, string path, string param, |
1365 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 1360 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
1366 | { | 1361 | { |
1367 | return ProcessPropertiesUpdate(request, path, param, agentID, caps); | 1362 | return ProcessPropertiesUpdate(request, path, param, agentID, caps); |
1368 | })); | 1363 | })); |
1369 | } | 1364 | } |
1370 | private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) | 1365 | private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) |
1371 | { | 1366 | { |
1372 | IClientAPI client; | 1367 | IClientAPI client; |
1373 | if ( ! m_scene.TryGetClient(agentID, out client) ) { | 1368 | if (! m_scene.TryGetClient(agentID, out client)) { |
1374 | m_log.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString() ); | 1369 | m_log.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString()); |
1375 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); | 1370 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); |
1376 | } | 1371 | } |
1377 | 1372 | ||
1378 | ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage(); | 1373 | ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage(); |
1379 | OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request); | 1374 | OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request); |
1380 | 1375 | ||
1381 | properties.Deserialize(args); | 1376 | properties.Deserialize(args); |
1382 | 1377 | ||
1383 | LandUpdateArgs land_update = new LandUpdateArgs(); | 1378 | LandUpdateArgs land_update = new LandUpdateArgs(); |
1384 | int parcelID = properties.LocalID; | 1379 | int parcelID = properties.LocalID; |
1385 | land_update.AuthBuyerID = properties.AuthBuyerID; | 1380 | land_update.AuthBuyerID = properties.AuthBuyerID; |
1386 | land_update.Category = properties.Category; | 1381 | land_update.Category = properties.Category; |
1387 | land_update.Desc = properties.Desc; | 1382 | land_update.Desc = properties.Desc; |
1388 | land_update.GroupID = properties.GroupID; | 1383 | land_update.GroupID = properties.GroupID; |
@@ -1399,15 +1394,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1399 | land_update.SnapshotID = properties.SnapshotID; | 1394 | land_update.SnapshotID = properties.SnapshotID; |
1400 | land_update.UserLocation = properties.UserLocation; | 1395 | land_update.UserLocation = properties.UserLocation; |
1401 | land_update.UserLookAt = properties.UserLookAt; | 1396 | land_update.UserLookAt = properties.UserLookAt; |
1402 | land_update.MediaDescription = properties.MediaDesc; | 1397 | land_update.MediaDescription = properties.MediaDesc; |
1403 | land_update.MediaType = properties.MediaType; | 1398 | land_update.MediaType = properties.MediaType; |
1404 | land_update.MediaWidth = properties.MediaWidth; | 1399 | land_update.MediaWidth = properties.MediaWidth; |
1405 | land_update.MediaHeight = properties.MediaHeight; | 1400 | land_update.MediaHeight = properties.MediaHeight; |
1406 | land_update.MediaLoop = properties.MediaLoop; | 1401 | land_update.MediaLoop = properties.MediaLoop; |
1407 | land_update.ObscureMusic = properties.ObscureMusic; | 1402 | land_update.ObscureMusic = properties.ObscureMusic; |
1408 | land_update.ObscureMedia = properties.ObscureMedia; | 1403 | land_update.ObscureMedia = properties.ObscureMedia; |
1409 | 1404 | ||
1410 | ILandObject land; | 1405 | ILandObject land; |
1411 | lock (m_landList) | 1406 | lock (m_landList) |
1412 | { | 1407 | { |
1413 | m_landList.TryGetValue(parcelID, out land); | 1408 | m_landList.TryGetValue(parcelID, out land); |
@@ -1415,15 +1410,15 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1415 | 1410 | ||
1416 | if (land != null) | 1411 | if (land != null) |
1417 | { | 1412 | { |
1418 | land.UpdateLandProperties(land_update, client); | 1413 | land.UpdateLandProperties(land_update, client); |
1419 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); | 1414 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); |
1420 | } | 1415 | } |
1421 | else | 1416 | else |
1422 | { | 1417 | { |
1423 | m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID); | 1418 | m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID); |
1424 | } | 1419 | } |
1425 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); | 1420 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); |
1426 | } | 1421 | } |
1427 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | 1422 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the |
1428 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. | 1423 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. |
1429 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x | 1424 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x |
@@ -1500,19 +1495,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1500 | if (parcelID == UUID.Zero) | 1495 | if (parcelID == UUID.Zero) |
1501 | return; | 1496 | return; |
1502 | 1497 | ||
1503 | ExtendedLandData data = | 1498 | ExtendedLandData data = |
1504 | (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), | 1499 | (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), |
1505 | delegate(string id) | 1500 | delegate(string id) |
1506 | { | 1501 | { |
1507 | UUID parcel = UUID.Zero; | 1502 | UUID parcel = UUID.Zero; |
1508 | UUID.TryParse(id, out parcel); | 1503 | UUID.TryParse(id, out parcel); |
1509 | // assume we've got the parcelID we just computed in RemoteParcelRequest | 1504 | // assume we've got the parcelID we just computed in RemoteParcelRequest |
1510 | ExtendedLandData extLandData = new ExtendedLandData(); | 1505 | ExtendedLandData extLandData = new ExtendedLandData(); |
1511 | Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, | 1506 | Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, |
1512 | out extLandData.X, out extLandData.Y); | 1507 | out extLandData.X, out extLandData.Y); |
1513 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", | 1508 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", |
1514 | extLandData.RegionHandle, extLandData.X, extLandData.Y); | 1509 | extLandData.RegionHandle, extLandData.X, extLandData.Y); |
1515 | 1510 | ||
1516 | // for this region or for somewhere else? | 1511 | // for this region or for somewhere else? |
1517 | if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) | 1512 | if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) |
1518 | { | 1513 | { |