aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-30 21:24:08 +0100
committerJustin Clark-Casey (justincc)2010-08-30 21:24:08 +0100
commitdd14c539af0fdfb6a489f62860b94b9c6b5282fb (patch)
tree48d1dd69f76d6ff69d5a51ecfc92cc84a642324c /OpenSim/Region
parentReport exception message as well as stack trace if a region fails to register... (diff)
parentFix a casting operation to use ToString() (diff)
downloadopensim-SC_OLD-dd14c539af0fdfb6a489f62860b94b9c6b5282fb.zip
opensim-SC_OLD-dd14c539af0fdfb6a489f62860b94b9c6b5282fb.tar.gz
opensim-SC_OLD-dd14c539af0fdfb6a489f62860b94b9c6b5282fb.tar.bz2
opensim-SC_OLD-dd14c539af0fdfb6a489f62860b94b9c6b5282fb.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs132
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs120
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs65
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs7
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEventQueue.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs8
7 files changed, 166 insertions, 187 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 092c96e..0d142f4 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -37,6 +37,7 @@ using System.Xml;
37using log4net; 37using log4net;
38using OpenMetaverse; 38using OpenMetaverse;
39using OpenMetaverse.Packets; 39using OpenMetaverse.Packets;
40using OpenMetaverse.Messages.Linden;
40using OpenMetaverse.StructuredData; 41using OpenMetaverse.StructuredData;
41using OpenSim.Framework; 42using OpenSim.Framework;
42using OpenSim.Framework.Client; 43using OpenSim.Framework.Client;
@@ -4199,94 +4200,101 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4199 4200
4200 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) 4201 public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
4201 { 4202 {
4202 ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ParcelProperties); 4203 ParcelPropertiesMessage updateMessage = new ParcelPropertiesMessage();
4203 // TODO: don't create new blocks if recycling an old packet
4204 4204
4205 updatePacket.ParcelData.AABBMax = landData.AABBMax; 4205 updateMessage.AABBMax = landData.AABBMax;
4206 updatePacket.ParcelData.AABBMin = landData.AABBMin; 4206 updateMessage.AABBMin = landData.AABBMin;
4207 updatePacket.ParcelData.Area = landData.Area; 4207 updateMessage.Area = landData.Area;
4208 updatePacket.ParcelData.AuctionID = landData.AuctionID; 4208 updateMessage.AuctionID = landData.AuctionID;
4209 updatePacket.ParcelData.AuthBuyerID = landData.AuthBuyerID; 4209 updateMessage.AuthBuyerID = landData.AuthBuyerID;
4210 4210
4211 updatePacket.ParcelData.Bitmap = landData.Bitmap; 4211 updateMessage.Bitmap = landData.Bitmap;
4212 4212
4213 updatePacket.ParcelData.Desc = Utils.StringToBytes(landData.Description); 4213 updateMessage.Desc = landData.Description;
4214 updatePacket.ParcelData.Category = (byte)landData.Category; 4214 updateMessage.Category = landData.Category;
4215 updatePacket.ParcelData.ClaimDate = landData.ClaimDate; 4215 updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate);
4216 updatePacket.ParcelData.ClaimPrice = landData.ClaimPrice; 4216 updateMessage.ClaimPrice = landData.ClaimPrice;
4217 updatePacket.ParcelData.GroupID = landData.GroupID; 4217 updateMessage.GroupID = landData.GroupID;
4218 updatePacket.ParcelData.GroupPrims = landData.GroupPrims; 4218 updateMessage.GroupPrims = landData.GroupPrims;
4219 updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned; 4219 updateMessage.IsGroupOwned = landData.IsGroupOwned;
4220 updatePacket.ParcelData.LandingType = landData.LandingType; 4220 updateMessage.LandingType = (LandingType) landData.LandingType;
4221 updatePacket.ParcelData.LocalID = landData.LocalID; 4221 updateMessage.LocalID = landData.LocalID;
4222 4222
4223 if (landData.Area > 0) 4223 if (landData.Area > 0)
4224 { 4224 {
4225 updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; 4225 updateMessage.MaxPrims = parcelObjectCapacity;
4226 } 4226 }
4227 else 4227 else
4228 { 4228 {
4229 updatePacket.ParcelData.MaxPrims = 0; 4229 updateMessage.MaxPrims = 0;
4230 } 4230 }
4231 4231
4232 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; 4232 updateMessage.MediaAutoScale = Convert.ToBoolean(landData.MediaAutoScale);
4233 updatePacket.ParcelData.MediaID = landData.MediaID; 4233 updateMessage.MediaID = landData.MediaID;
4234 updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL); 4234 updateMessage.MediaURL = landData.MediaURL;
4235 updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL); 4235 updateMessage.MusicURL = landData.MusicURL;
4236 updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name); 4236 updateMessage.Name = landData.Name;
4237 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; 4237 updateMessage.OtherCleanTime = landData.OtherCleanTime;
4238 updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented 4238 updateMessage.OtherCount = 0; //TODO: Unimplemented
4239 updatePacket.ParcelData.OtherPrims = landData.OtherPrims; 4239 updateMessage.OtherPrims = landData.OtherPrims;
4240 updatePacket.ParcelData.OwnerID = landData.OwnerID; 4240 updateMessage.OwnerID = landData.OwnerID;
4241 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; 4241 updateMessage.OwnerPrims = landData.OwnerPrims;
4242 updatePacket.ParcelData.ParcelFlags = landData.Flags; 4242 updateMessage.ParcelFlags = (ParcelFlags) landData.Flags;
4243 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; 4243 updateMessage.ParcelPrimBonus = simObjectBonusFactor;
4244 updatePacket.ParcelData.PassHours = landData.PassHours; 4244 updateMessage.PassHours = landData.PassHours;
4245 updatePacket.ParcelData.PassPrice = landData.PassPrice; 4245 updateMessage.PassPrice = landData.PassPrice;
4246 updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented 4246 updateMessage.PublicCount = 0; //TODO: Unimplemented
4247 4247
4248 updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; 4248 updateMessage.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0;
4249 updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; 4249 updateMessage.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0;
4250 updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0; 4250
4251 updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0; 4251 //updateMessage.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0;
4252 4252 //updateMessage.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0;
4253 updatePacket.ParcelData.RentPrice = 0; 4253
4254 updatePacket.ParcelData.RequestResult = request_result; 4254 updateMessage.RentPrice = 0;
4255 updatePacket.ParcelData.SalePrice = landData.SalePrice; 4255 updateMessage.RequestResult = (ParcelResult) request_result;
4256 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; 4256 updateMessage.SalePrice = landData.SalePrice;
4257 updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented 4257 updateMessage.SelectedPrims = landData.SelectedPrims;
4258 updatePacket.ParcelData.SequenceID = sequence_id; 4258 updateMessage.SelfCount = 0; //TODO: Unimplemented
4259 updateMessage.SequenceID = sequence_id;
4259 if (landData.SimwideArea > 0) 4260 if (landData.SimwideArea > 0)
4260 { 4261 {
4261 updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity; 4262 updateMessage.SimWideMaxPrims = parcelObjectCapacity;
4262 } 4263 }
4263 else 4264 else
4264 { 4265 {
4265 updatePacket.ParcelData.SimWideMaxPrims = 0; 4266 updateMessage.SimWideMaxPrims = 0;
4266 } 4267 }
4267 updatePacket.ParcelData.SimWideTotalPrims = landData.SimwidePrims; 4268 updateMessage.SimWideTotalPrims = landData.SimwidePrims;
4268 updatePacket.ParcelData.SnapSelection = snap_selection; 4269 updateMessage.SnapSelection = snap_selection;
4269 updatePacket.ParcelData.SnapshotID = landData.SnapshotID; 4270 updateMessage.SnapshotID = landData.SnapshotID;
4270 updatePacket.ParcelData.Status = (byte)landData.Status; 4271 updateMessage.Status = (ParcelStatus) landData.Status;
4271 updatePacket.ParcelData.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + 4272 updateMessage.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims +
4272 landData.SelectedPrims; 4273 landData.SelectedPrims;
4273 updatePacket.ParcelData.UserLocation = landData.UserLocation; 4274 updateMessage.UserLocation = landData.UserLocation;
4274 updatePacket.ParcelData.UserLookAt = landData.UserLookAt; 4275 updateMessage.UserLookAt = landData.UserLookAt;
4275 updatePacket.Header.Zerocoded = true; 4276
4277 updateMessage.MediaType = landData.MediaType;
4278 updateMessage.MediaDesc = landData.MediaDescription;
4279 updateMessage.MediaWidth = landData.MediaWidth;
4280 updateMessage.MediaHeight = landData.MediaHeight;
4281 updateMessage.MediaLoop = landData.MediaLoop;
4282 updateMessage.ObscureMusic = landData.ObscureMusic;
4283 updateMessage.ObscureMedia = landData.ObscureMedia;
4276 4284
4277 try 4285 try
4278 { 4286 {
4279 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); 4287 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
4280 if (eq != null) 4288 if (eq != null)
4281 { 4289 {
4282 eq.ParcelProperties(updatePacket, this.AgentId); 4290 eq.ParcelProperties(updateMessage, this.AgentId);
4283 } 4291 } else {
4292 m_log.Warn("No EQ Interface when sending parcel data.");
4293 }
4284 } 4294 }
4285 catch (Exception ex) 4295 catch (Exception ex)
4286 { 4296 {
4287 m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); 4297 m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString());
4288 m_log.Warn("sending parcel data via UDP");
4289 OutPacket(updatePacket, ThrottleOutPacketType.Task);
4290 } 4298 }
4291 } 4299 }
4292 4300
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
index 0c6cb1b..35b70de 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs
@@ -34,6 +34,7 @@ using System.Threading;
34using log4net; 34using log4net;
35using Nini.Config; 35using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenMetaverse.Messages.Linden;
37using OpenMetaverse.Packets; 38using OpenMetaverse.Packets;
38using OpenMetaverse.StructuredData; 39using OpenMetaverse.StructuredData;
39using OpenSim.Framework; 40using OpenSim.Framework;
@@ -137,10 +138,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
137 { 138 {
138 if (!queues.ContainsKey(agentId)) 139 if (!queues.ContainsKey(agentId))
139 { 140 {
141 /*
140 m_log.DebugFormat( 142 m_log.DebugFormat(
141 "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", 143 "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}",
142 agentId, m_scene.RegionInfo.RegionName); 144 agentId, m_scene.RegionInfo.RegionName);
143 145 */
144 queues[agentId] = new Queue<OSD>(); 146 queues[agentId] = new Queue<OSD>();
145 } 147 }
146 148
@@ -200,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
200 202
201 private void ClientClosed(UUID AgentID, Scene scene) 203 private void ClientClosed(UUID AgentID, Scene scene)
202 { 204 {
203 m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); 205 //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName);
204 206
205 int count = 0; 207 int count = 0;
206 while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5) 208 while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5)
@@ -284,7 +286,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
284 // Reuse open queues. The client does! 286 // Reuse open queues. The client does!
285 if (m_AvatarQueueUUIDMapping.ContainsKey(agentID)) 287 if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
286 { 288 {
287 m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); 289 //m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
288 EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; 290 EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
289 } 291 }
290 else 292 else
@@ -365,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
365 { 367 {
366 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! 368 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
367 array.Add(EventQueueHelper.KeepAliveEvent()); 369 array.Add(EventQueueHelper.KeepAliveEvent());
368 m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName); 370 //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName);
369 } 371 }
370 else 372 else
371 { 373 {
@@ -394,8 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
394 responsedata["keepalive"] = false; 396 responsedata["keepalive"] = false;
395 responsedata["reusecontext"] = false; 397 responsedata["reusecontext"] = false;
396 responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); 398 responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
399 //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
397 return responsedata; 400 return responsedata;
398 //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
399 } 401 }
400 402
401 public Hashtable NoEvents(UUID requestID, UUID agentID) 403 public Hashtable NoEvents(UUID requestID, UUID agentID)
@@ -461,7 +463,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
461 { 463 {
462 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! 464 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
463 array.Add(EventQueueHelper.KeepAliveEvent()); 465 array.Add(EventQueueHelper.KeepAliveEvent());
464 m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); 466 //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
465 } 467 }
466 else 468 else
467 { 469 {
@@ -697,9 +699,9 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
697 //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); 699 //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item);
698 } 700 }
699 701
700 public void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID) 702 public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
701 { 703 {
702 OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesPacket); 704 OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
703 Enqueue(item, avatarID); 705 Enqueue(item, avatarID);
704 } 706 }
705 707
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
index e9bcae3..6294935 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
@@ -30,6 +30,7 @@ using System.Net;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenMetaverse.Packets; 31using OpenMetaverse.Packets;
32using OpenMetaverse.StructuredData; 32using OpenMetaverse.StructuredData;
33using OpenMetaverse.Messages.Linden;
33 34
34namespace OpenSim.Region.CoreModules.Framework.EventQueue 35namespace OpenSim.Region.CoreModules.Framework.EventQueue
35{ 36{
@@ -309,116 +310,6 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
309 return chatterBoxSessionAgentListUpdates; 310 return chatterBoxSessionAgentListUpdates;
310 } 311 }
311 312
312 public static OSD ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket)
313 {
314 OSDMap parcelProperties = new OSDMap();
315 OSDMap body = new OSDMap();
316
317 OSDArray ageVerificationBlock = new OSDArray();
318 OSDMap ageVerificationMap = new OSDMap();
319 ageVerificationMap.Add("RegionDenyAgeUnverified",
320 OSD.FromBoolean(parcelPropertiesPacket.AgeVerificationBlock.RegionDenyAgeUnverified));
321 ageVerificationBlock.Add(ageVerificationMap);
322 body.Add("AgeVerificationBlock", ageVerificationBlock);
323
324 // LL sims send media info in this event queue message but it's not in the UDP
325 // packet we construct this event queue message from. This should be refactored in
326 // other areas of the code so it can all be send in the same message. Until then we will
327 // still send the media info via UDP
328
329 //OSDArray mediaData = new OSDArray();
330 //OSDMap mediaDataMap = new OSDMap();
331 //mediaDataMap.Add("MediaDesc", OSD.FromString(""));
332 //mediaDataMap.Add("MediaHeight", OSD.FromInteger(0));
333 //mediaDataMap.Add("MediaLoop", OSD.FromInteger(0));
334 //mediaDataMap.Add("MediaType", OSD.FromString("type/type"));
335 //mediaDataMap.Add("MediaWidth", OSD.FromInteger(0));
336 //mediaDataMap.Add("ObscureMedia", OSD.FromInteger(0));
337 //mediaDataMap.Add("ObscureMusic", OSD.FromInteger(0));
338 //mediaData.Add(mediaDataMap);
339 //body.Add("MediaData", mediaData);
340
341 OSDArray parcelData = new OSDArray();
342 OSDMap parcelDataMap = new OSDMap();
343 OSDArray AABBMax = new OSDArray(3);
344 AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.X));
345 AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Y));
346 AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Z));
347 parcelDataMap.Add("AABBMax", AABBMax);
348
349 OSDArray AABBMin = new OSDArray(3);
350 AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.X));
351 AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Y));
352 AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Z));
353 parcelDataMap.Add("AABBMin", AABBMin);
354
355 parcelDataMap.Add("Area", OSD.FromInteger(parcelPropertiesPacket.ParcelData.Area));
356 parcelDataMap.Add("AuctionID", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.AuctionID)));
357 parcelDataMap.Add("AuthBuyerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.AuthBuyerID));
358 parcelDataMap.Add("Bitmap", OSD.FromBinary(parcelPropertiesPacket.ParcelData.Bitmap));
359 parcelDataMap.Add("Category", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Category));
360 parcelDataMap.Add("ClaimDate", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimDate));
361 parcelDataMap.Add("ClaimPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimPrice));
362 parcelDataMap.Add("Desc", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc)));
363 parcelDataMap.Add("GroupID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.GroupID));
364 parcelDataMap.Add("GroupPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.GroupPrims));
365 parcelDataMap.Add("IsGroupOwned", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.IsGroupOwned));
366 parcelDataMap.Add("LandingType", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LandingType));
367 parcelDataMap.Add("LocalID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LocalID));
368 parcelDataMap.Add("MaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.MaxPrims));
369 parcelDataMap.Add("MediaAutoScale", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.MediaAutoScale));
370 parcelDataMap.Add("MediaID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.MediaID));
371 parcelDataMap.Add("MediaURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL)));
372 parcelDataMap.Add("MusicURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL)));
373 parcelDataMap.Add("Name", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name)));
374 parcelDataMap.Add("OtherCleanTime", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCleanTime));
375 parcelDataMap.Add("OtherCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCount));
376 parcelDataMap.Add("OtherPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherPrims));
377 parcelDataMap.Add("OwnerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.OwnerID));
378 parcelDataMap.Add("OwnerPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OwnerPrims));
379 parcelDataMap.Add("ParcelFlags", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.ParcelFlags)));
380 parcelDataMap.Add("ParcelPrimBonus", OSD.FromReal(parcelPropertiesPacket.ParcelData.ParcelPrimBonus));
381 parcelDataMap.Add("PassHours", OSD.FromReal(parcelPropertiesPacket.ParcelData.PassHours));
382 parcelDataMap.Add("PassPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PassPrice));
383 parcelDataMap.Add("PublicCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PublicCount));
384 parcelDataMap.Add("RegionDenyAnonymous", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyAnonymous));
385 parcelDataMap.Add("RegionDenyIdentified", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyIdentified));
386 parcelDataMap.Add("RegionDenyTransacted", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyTransacted));
387
388 parcelDataMap.Add("RegionPushOverride", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionPushOverride));
389 parcelDataMap.Add("RentPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RentPrice));
390 parcelDataMap.Add("RequestResult", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RequestResult));
391 parcelDataMap.Add("SalePrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SalePrice));
392 parcelDataMap.Add("SelectedPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelectedPrims));
393 parcelDataMap.Add("SelfCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelfCount));
394 parcelDataMap.Add("SequenceID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SequenceID));
395 parcelDataMap.Add("SimWideMaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideMaxPrims));
396 parcelDataMap.Add("SimWideTotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideTotalPrims));
397 parcelDataMap.Add("SnapSelection", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.SnapSelection));
398 parcelDataMap.Add("SnapshotID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.SnapshotID));
399 parcelDataMap.Add("Status", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Status));
400 parcelDataMap.Add("TotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.TotalPrims));
401
402 OSDArray UserLocation = new OSDArray(3);
403 UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.X));
404 UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Y));
405 UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Z));
406 parcelDataMap.Add("UserLocation", UserLocation);
407
408 OSDArray UserLookAt = new OSDArray(3);
409 UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.X));
410 UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Y));
411 UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Z));
412 parcelDataMap.Add("UserLookAt", UserLookAt);
413
414 parcelData.Add(parcelDataMap);
415 body.Add("ParcelData", parcelData);
416 parcelProperties.Add("body", body);
417 parcelProperties.Add("message", OSD.FromString("ParcelProperties"));
418
419 return parcelProperties;
420 }
421
422 public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) 313 public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket)
423 { 314 {
424 OSDMap groupUpdate = new OSDMap(); 315 OSDMap groupUpdate = new OSDMap();
@@ -495,5 +386,14 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
495 return placesReply; 386 return placesReply;
496 } 387 }
497 388
389 public static OSD ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage)
390 {
391 OSDMap message = new OSDMap();
392 message.Add("message", OSD.FromString("ParcelProperties"));
393 OSD message_body = parcelPropertiesMessage.Serialize();
394 message.Add("body", message_body);
395 return message;
396 }
397
498 } 398 }
499} 399}
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
diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
index e093f0a..81e4952 100644
--- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
@@ -28,6 +28,7 @@
28using System.Net; 28using System.Net;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenMetaverse.Packets; 30using OpenMetaverse.Packets;
31using OpenMetaverse.Messages.Linden;
31using OpenMetaverse.StructuredData; 32using OpenMetaverse.StructuredData;
32 33
33namespace OpenSim.Region.Framework.Interfaces 34namespace OpenSim.Region.Framework.Interfaces
@@ -54,7 +55,7 @@ namespace OpenSim.Region.Framework.Interfaces
54 uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); 55 uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket);
55 void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, 56 void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat,
56 bool isModerator, bool textMute); 57 bool isModerator, bool textMute);
57 void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID); 58 void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID);
58 void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); 59 void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID);
59 } 60 }
60} 61}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index af42dae..b51b410 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -9137,8 +9137,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9137 // we send to all 9137 // we send to all
9138 landData.MediaID = new UUID(texture); 9138 landData.MediaID = new UUID(texture);
9139 landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; 9139 landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0;
9140 landData.MediaSize[0] = width; 9140 landData.MediaWidth = width;
9141 landData.MediaSize[1] = height; 9141 landData.MediaHeight = height;
9142 landData.MediaType = mediaType; 9142 landData.MediaType = mediaType;
9143 9143
9144 // do that one last, it will cause a ParcelPropertiesUpdate 9144 // do that one last, it will cause a ParcelPropertiesUpdate
@@ -9224,8 +9224,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9224 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType)); 9224 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType));
9225 break; 9225 break;
9226 case ParcelMediaCommandEnum.Size: 9226 case ParcelMediaCommandEnum.Size:
9227 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0])); 9227 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaWidth));
9228 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1])); 9228 list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaHeight));
9229 break; 9229 break;
9230 default: 9230 default:
9231 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; 9231 ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url;