diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 65 |
1 files changed, 63 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index d00cb07..776fe30 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -33,6 +33,8 @@ using System.Reflection; | |||
33 | using log4net; | 33 | using log4net; |
34 | using Nini.Config; | 34 | using Nini.Config; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | ||
37 | using OpenMetaverse.Messages.Linden; | ||
36 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Capabilities; | 39 | using OpenSim.Framework.Capabilities; |
38 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
@@ -1078,7 +1080,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1078 | { | 1080 | { |
1079 | for (int y = 0; y < inc_y; y++) | 1081 | for (int y = 0; y < inc_y; y++) |
1080 | { | 1082 | { |
1081 | |||
1082 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); | 1083 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); |
1083 | 1084 | ||
1084 | if (currentParcel != null) | 1085 | if (currentParcel != null) |
@@ -1378,8 +1379,68 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1378 | { | 1379 | { |
1379 | return RemoteParcelRequest(request, path, param, agentID, caps); | 1380 | return RemoteParcelRequest(request, path, param, agentID, caps); |
1380 | })); | 1381 | })); |
1381 | } | 1382 | UUID parcelCapID = UUID.Random(); |
1383 | caps.RegisterHandler("ParcelPropertiesUpdate", | ||
1384 | new RestStreamHandler("POST", "/CAPS/" + parcelCapID, | ||
1385 | delegate(string request, string path, string param, | ||
1386 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
1387 | { | ||
1388 | return ProcessPropertiesUpdate(request, path, param, agentID, caps); | ||
1389 | })); | ||
1390 | } | ||
1391 | private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) | ||
1392 | { | ||
1393 | IClientAPI client; | ||
1394 | if ( ! m_scene.TryGetClient(agentID, out client) ) { | ||
1395 | m_log.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString() ); | ||
1396 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); | ||
1397 | } | ||
1398 | |||
1399 | ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage(); | ||
1400 | OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request); | ||
1401 | |||
1402 | properties.Deserialize(args); | ||
1403 | |||
1404 | LandUpdateArgs land_update = new LandUpdateArgs(); | ||
1405 | int parcelID = properties.LocalID; | ||
1406 | land_update.AuthBuyerID = properties.AuthBuyerID; | ||
1407 | land_update.Category = properties.Category; | ||
1408 | land_update.Desc = properties.Desc; | ||
1409 | land_update.GroupID = properties.GroupID; | ||
1410 | land_update.LandingType = (byte) properties.Landing; | ||
1411 | land_update.MediaAutoScale = (byte) Convert.ToInt32(properties.MediaAutoScale); | ||
1412 | land_update.MediaID = properties.MediaID; | ||
1413 | land_update.MediaURL = properties.MediaURL; | ||
1414 | land_update.MusicURL = properties.MusicURL; | ||
1415 | land_update.Name = properties.Name; | ||
1416 | land_update.ParcelFlags = (uint) properties.ParcelFlags; | ||
1417 | land_update.PassHours = (int) properties.PassHours; | ||
1418 | land_update.PassPrice = (int) properties.PassPrice; | ||
1419 | land_update.SalePrice = (int) properties.SalePrice; | ||
1420 | land_update.SnapshotID = properties.SnapshotID; | ||
1421 | land_update.UserLocation = properties.UserLocation; | ||
1422 | land_update.UserLookAt = properties.UserLookAt; | ||
1423 | land_update.MediaDescription = properties.MediaDesc; | ||
1424 | land_update.MediaType = properties.MediaType; | ||
1425 | land_update.MediaWidth = properties.MediaWidth; | ||
1426 | land_update.MediaHeight = properties.MediaHeight; | ||
1427 | land_update.MediaLoop = properties.MediaLoop; | ||
1428 | land_update.ObscureMusic = properties.ObscureMusic; | ||
1429 | land_update.ObscureMedia = properties.ObscureMedia; | ||
1430 | |||
1431 | ILandObject land; | ||
1432 | lock (m_landList) | ||
1433 | { | ||
1434 | m_landList.TryGetValue(parcelID, out land); | ||
1435 | } | ||
1382 | 1436 | ||
1437 | if (land != null) { | ||
1438 | land.UpdateLandProperties(land_update, client); | ||
1439 | } else { | ||
1440 | m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID); | ||
1441 | } | ||
1442 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); | ||
1443 | } | ||
1383 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | 1444 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the |
1384 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. | 1445 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. |
1385 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x | 1446 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x |