aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJonathan Freedman2010-08-29 21:28:31 -0400
committerMelanie2010-08-30 02:07:55 +0100
commit0a83fde85c8cffa1da46ef0a17390399ae74fa61 (patch)
tree5e1b8b09f17b214f050c102c750d962a4f4b3ffa /OpenSim/Region/CoreModules/World
parentReplace hardcoded 0 with KickFlags provided by the client. (diff)
downloadopensim-SC_OLD-0a83fde85c8cffa1da46ef0a17390399ae74fa61.zip
opensim-SC_OLD-0a83fde85c8cffa1da46ef0a17390399ae74fa61.tar.gz
opensim-SC_OLD-0a83fde85c8cffa1da46ef0a17390399ae74fa61.tar.bz2
opensim-SC_OLD-0a83fde85c8cffa1da46ef0a17390399ae74fa61.tar.xz
Implements parcel media setting persistence and packet / CAPS handling
properly for the new media settings. Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs65
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs7
2 files changed, 70 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 15dc301..3e79ec0 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -33,6 +33,8 @@ using System.Reflection;
33using log4net; 33using log4net;
34using Nini.Config; 34using Nini.Config;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenMetaverse.StructuredData;
37using OpenMetaverse.Messages.Linden;
36using OpenSim.Framework; 38using OpenSim.Framework;
37using OpenSim.Framework.Capabilities; 39using OpenSim.Framework.Capabilities;
38using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
@@ -1066,7 +1068,6 @@ namespace OpenSim.Region.CoreModules.World.Land
1066 { 1068 {
1067 for (int y = 0; y < inc_y; y++) 1069 for (int y = 0; y < inc_y; y++)
1068 { 1070 {
1069
1070 ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); 1071 ILandObject currentParcel = GetLandObject(start_x + x, start_y + y);
1071 1072
1072 if (currentParcel != null) 1073 if (currentParcel != null)
@@ -1353,8 +1354,68 @@ namespace OpenSim.Region.CoreModules.World.Land
1353 { 1354 {
1354 return RemoteParcelRequest(request, path, param, agentID, caps); 1355 return RemoteParcelRequest(request, path, param, agentID, caps);
1355 })); 1356 }));
1356 } 1357 UUID parcelCapID = UUID.Random();
1358 caps.RegisterHandler("ParcelPropertiesUpdate",
1359 new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
1360 delegate(string request, string path, string param,
1361 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
1362 {
1363 return ProcessPropertiesUpdate(request, path, param, agentID, caps);
1364 }));
1365 }
1366 private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
1367 {
1368 IClientAPI client;
1369 if ( ! m_scene.TryGetClient(agentID, out client) ) {
1370 m_log.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString() );
1371 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
1372 }
1373
1374 ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage();
1375 OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request);
1376
1377 properties.Deserialize(args);
1378
1379 LandUpdateArgs land_update = new LandUpdateArgs();
1380 int parcelID = properties.LocalID;
1381 land_update.AuthBuyerID = properties.AuthBuyerID;
1382 land_update.Category = properties.Category;
1383 land_update.Desc = properties.Desc;
1384 land_update.GroupID = properties.GroupID;
1385 land_update.LandingType = (byte) properties.Landing;
1386 land_update.MediaAutoScale = (byte) Convert.ToInt32(properties.MediaAutoScale);
1387 land_update.MediaID = properties.MediaID;
1388 land_update.MediaURL = properties.MediaURL;
1389 land_update.MusicURL = properties.MusicURL;
1390 land_update.Name = properties.Name;
1391 land_update.ParcelFlags = (uint) properties.ParcelFlags;
1392 land_update.PassHours = (int) properties.PassHours;
1393 land_update.PassPrice = (int) properties.PassPrice;
1394 land_update.SalePrice = (int) properties.SalePrice;
1395 land_update.SnapshotID = properties.SnapshotID;
1396 land_update.UserLocation = properties.UserLocation;
1397 land_update.UserLookAt = properties.UserLookAt;
1398 land_update.MediaDescription = properties.MediaDesc;
1399 land_update.MediaType = properties.MediaType;
1400 land_update.MediaWidth = properties.MediaWidth;
1401 land_update.MediaHeight = properties.MediaHeight;
1402 land_update.MediaLoop = properties.MediaLoop;
1403 land_update.ObscureMusic = properties.ObscureMusic;
1404 land_update.ObscureMedia = properties.ObscureMedia;
1405
1406 ILandObject land;
1407 lock (m_landList)
1408 {
1409 m_landList.TryGetValue(parcelID, out land);
1410 }
1357 1411
1412 if (land != null) {
1413 land.UpdateLandProperties(land_update, client);
1414 } else {
1415 m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID);
1416 }
1417 return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
1418 }
1358 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the 1419 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the
1359 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. 1420 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to.
1360 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x 1421 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 6864629..499b60c 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -229,6 +229,13 @@ namespace OpenSim.Region.CoreModules.World.Land
229 newData.SnapshotID = args.SnapshotID; 229 newData.SnapshotID = args.SnapshotID;
230 newData.UserLocation = args.UserLocation; 230 newData.UserLocation = args.UserLocation;
231 newData.UserLookAt = args.UserLookAt; 231 newData.UserLookAt = args.UserLookAt;
232 newData.MediaType = args.MediaType;
233 newData.MediaDescription = args.MediaDescription;
234 newData.MediaWidth = args.MediaWidth;
235 newData.MediaHeight = args.MediaHeight;
236 newData.MediaLoop = args.MediaLoop;
237 newData.ObscureMusic = args.ObscureMusic;
238 newData.ObscureMedia = args.ObscureMedia;
232 239
233 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); 240 m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);
234 241