From 3234472d6203671a492a73042a0b56d6301903e0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 19 Nov 2008 06:15:21 +0000 Subject: Reverting the texture sending patch and the new libOMV. This makes this release a direct descendant of the stable 7364, with all the features and none of the issues. This omits the following patch chain: r7383 r7382 r7381 r7377 r7375 r7373 r7372 r7370 r7369 r7368 r7367 r7366 --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 4 +- OpenSim/Region/DataSnapshot/DataRequestHandler.cs | 2 +- OpenSim/Region/DataSnapshot/LLSDDiscovery.cs | 6 +- .../Agent/TextureDownload/TextureDownloadModule.cs | 58 ++-- .../Agent/TextureDownload/TextureNotFoundSender.cs | 1 + .../TextureDownload/UserTextureDownloadService.cs | 9 +- .../Modules/Agent/TextureSender/TextureSender.cs | 307 +++++++-------------- .../Environment/Modules/Agent/Xfer/XferModule.cs | 4 +- .../Modules/Avatar/Friends/FriendsModule.cs | 1 + .../Modules/Framework/EventQueueGetModule.cs | 30 +- .../Modules/Framework/EventQueueHelper.cs | 110 ++++---- .../Modules/InterGrid/OpenGridProtocolModule.cs | 284 +++++++++---------- .../Environment/Modules/World/Land/LandObject.cs | 4 +- .../Modules/World/WorldMap/WorldMapModule.cs | 112 ++++---- .../Region/Environment/Scenes/Scene.Inventory.cs | 1 + .../Scenes/SceneCommunicationService.cs | 8 +- .../Scenes/SceneObjectPart.Inventory.cs | 12 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 6 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 6 +- OpenSim/Region/Interfaces/IEventQueue.cs | 2 +- .../ScriptEngine/DotNetEngine/AppDomainManager.cs | 5 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 3 +- 22 files changed, 430 insertions(+), 545 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3265817..502fe6a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3890,7 +3890,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { uint regionX; uint regionY; - Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY); + Helpers.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY); locx = Convert.ToSingle(Utils.BytesToString(gmParams[0].Parameter)) - regionX; locy = Convert.ToSingle(Utils.BytesToString(gmParams[1].Parameter)) - regionY; locz = Convert.ToSingle(Utils.BytesToString(gmParams[2].Parameter)); @@ -7175,7 +7175,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP Transfer.TransferInfo.Params = new byte[20]; Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); int assType = req.AssetInf.Type; - Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); + Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); } else if (req.AssetRequestSource == 3) { diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs index 878aa4b..8030b59 100644 --- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.DataSnapshot { //Very static for now, flexible enough to add new formats LLSDDiscoveryResponse llsd_response = new LLSDDiscoveryResponse(); - llsd_response.snapshot_resources = new OSDArray(); + llsd_response.snapshot_resources = new LLSDArray(); LLSDDiscoveryDataURL llsd_dataurl = new LLSDDiscoveryDataURL(); llsd_dataurl.snapshot_format = "os-datasnapshot-v1"; diff --git a/OpenSim/Region/DataSnapshot/LLSDDiscovery.cs b/OpenSim/Region/DataSnapshot/LLSDDiscovery.cs index 73e41ee..e1d7ac3 100644 --- a/OpenSim/Region/DataSnapshot/LLSDDiscovery.cs +++ b/OpenSim/Region/DataSnapshot/LLSDDiscovery.cs @@ -30,13 +30,13 @@ using OpenSim.Framework.Communications.Capabilities; namespace OpenSim.Region.DataSnapshot { - [OSDMap] + [LLSDMap] public class LLSDDiscoveryResponse { - public OSDArray snapshot_resources; + public LLSDArray snapshot_resources; } - [OSDMap] + [LLSDMap] public class LLSDDiscoveryDataURL { public string snapshot_format; diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs index aac6e35..af51df6 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs @@ -176,52 +176,44 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload { ITextureSender sender = null; -// try -// { + try + { while (true) { - try + sender = m_queueSenders.Dequeue(); + + if (sender.Cancel) { - sender = m_queueSenders.Dequeue(); + TextureSent(sender); - if (sender.Cancel) + sender.Cancel = false; + } + else + { + bool finished = sender.SendTexturePacket(); + if (finished) { TextureSent(sender); - - sender.Cancel = false; } else { - bool finished = sender.SendTexturePacket(); - if (finished) - { - TextureSent(sender); - } - else - { - m_queueSenders.Enqueue(sender); - } + m_queueSenders.Enqueue(sender); } + } - // Make sure that any sender we currently have can get garbage collected - sender = null; + // Make sure that any sender we currently have can get garbage collected + sender = null; - //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); - } - catch(Exception e) - { - m_log.ErrorFormat( - "[TEXTURE]: Texture send thread caught exception. The texture send was aborted. Exception is {0}", e); - } + //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); } -// } -// catch (Exception e) -// { -// // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened -// m_log.ErrorFormat( -// "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", -// e); -// } + } + catch (Exception e) + { + // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened + m_log.ErrorFormat( + "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", + e); + } } /// diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs index 044ee76..c064064 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs @@ -28,6 +28,7 @@ using System.Reflection; using log4net; using OpenMetaverse; +using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index bcae259..715dc4b 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -57,10 +57,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// /// We will allow the client to request the same texture n times before dropping further requests /// - /// This number contains repeated requests for the same texture at different resolutions (which - /// are handled since r7368). However, this situation should be handled in a more sophisticated way. + /// This number includes repeated requests for the same texture at different resolutions (which we don't + /// currently handle properly as far as I know). However, this situation should be handled in a more + /// sophisticated way. /// - private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 15; + private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5; /// /// XXX Also going to limit requests for found textures. @@ -149,7 +150,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload m_scene.AddPendingDownloads(1); - TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber, e.Priority); + TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); m_textureSenders.Add(e.RequestedAssetID, requestHandler); m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true); diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs index 65ca854..cd61798 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs @@ -27,188 +27,106 @@ using System; using System.Reflection; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Region.Environment.Interfaces; namespace OpenSim.Region.Environment.Modules.Agent.TextureSender { - public class ImageDownload + /// + /// A TextureSender handles the process of receiving a texture requested by the client from the + /// AssetCache, and then sending that texture back to the client. + /// + public class TextureSender : ITextureSender { - public const int FIRST_IMAGE_PACKET_SIZE = 600; - public const int IMAGE_PACKET_SIZE = 1000; - - public OpenMetaverse.AssetTexture Texture; - public int DiscardLevel; - public float Priority; - public int CurrentPacket; - public int StopPacket; - - public ImageDownload(OpenMetaverse.AssetTexture texture, int discardLevel, float priority, int packet) - { - Texture = texture; - Update(discardLevel, priority, packet); - } - - /// - /// Updates an image transfer with new information and recalculates - /// offsets - /// - /// New requested discard level - /// New requested priority - /// New requested packet offset - public void Update(int discardLevel, float priority, int packet) - { - Priority = priority; - DiscardLevel = Clamp(discardLevel, 0, Texture.LayerInfo.Length - 1); - StopPacket = GetPacketForBytePosition(Texture.LayerInfo[(Texture.LayerInfo.Length - 1) - DiscardLevel].End); - CurrentPacket = Clamp(packet, 1, TexturePacketCount()); - } - - /// - /// Returns the total number of packets needed to transfer this texture, - /// including the first packet of size FIRST_IMAGE_PACKET_SIZE - /// - /// Total number of packets needed to transfer this texture - public int TexturePacketCount() - { - return ((Texture.AssetData.Length - FIRST_IMAGE_PACKET_SIZE + IMAGE_PACKET_SIZE - 1) / IMAGE_PACKET_SIZE) + 1; - } + private static readonly ILog m_log + = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// - /// Returns the current byte offset for this transfer, calculated from - /// the CurrentPacket + /// Records the number of times texture send has been called. /// - /// Current byte offset for this transfer - public int CurrentBytePosition() - { - return FIRST_IMAGE_PACKET_SIZE + (CurrentPacket - 1) * IMAGE_PACKET_SIZE; - } + public int counter = 0; - /// - /// Returns the size, in bytes, of the last packet. This will be somewhere - /// between 1 and IMAGE_PACKET_SIZE bytes - /// - /// Size of the last packet in the transfer - public int LastPacketSize() - { - return Texture.AssetData.Length - (FIRST_IMAGE_PACKET_SIZE + ((TexturePacketCount() - 2) * IMAGE_PACKET_SIZE)); - } + public bool ImageLoaded = false; /// - /// Find the packet number that contains a given byte position + /// Holds the texture asset to send. /// - /// Byte position - /// Packet number that contains the given byte position - int GetPacketForBytePosition(int bytePosition) - { - return ((bytePosition - FIRST_IMAGE_PACKET_SIZE + IMAGE_PACKET_SIZE - 1) / IMAGE_PACKET_SIZE); - } + private AssetBase m_asset; - /// - /// Clamp a given value between a range - /// - /// Value to clamp - /// Minimum allowable value - /// Maximum allowable value - /// A value inclusively between lower and upper - static int Clamp(int value, int min, int max) - { - // First we check to see if we're greater than the max - value = (value > max) ? max : value; + //public UUID assetID { get { return m_asset.FullID; } } - // Then we check to see if we're less than the min. - value = (value < min) ? min : value; + // private bool m_cancel = false; - // There's no check to see if min > max. - return value; - } - } + // See ITextureSender - /// - /// A TextureSender handles the process of receiving a texture requested by the client from the - /// AssetCache, and then sending that texture back to the client. - /// - public class TextureSender : ITextureSender - { - private static readonly ILog m_log - = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // private bool m_sending = false; - public bool ImageLoaded = false; + /// + /// This is actually the number of extra packets required to send the texture data! We always assume + /// at least one is required. + /// + private int NumPackets = 0; /// - /// Holds the texture asset to send. + /// Holds the packet number to send next. In this case, each packet is 1000 bytes long and starts + /// at the 600th byte (0th indexed). /// - private AssetBase m_asset; - private bool m_cancel = false; - private bool m_sending = false; - private bool sendFirstPacket = false; - private int initialDiscardLevel = 0; - private int initialPacketNum = 0; - private float initialPriority = 0.0f; + private int PacketCounter = 0; - private ImageDownload download; + private int RequestedDiscardLevel = -1; private IClientAPI RequestUser; + private uint StartPacketNumber = 0; - public TextureSender(IClientAPI client, int discardLevel, uint packetNumber, float priority) + public TextureSender(IClientAPI client, int discardLevel, uint packetNumber) { RequestUser = client; - initialDiscardLevel = discardLevel; - initialPacketNum = (int)packetNumber; - initialPriority = priority; + RequestedDiscardLevel = discardLevel; + StartPacketNumber = packetNumber; } #region ITextureSender Members public bool Cancel { - get { return m_cancel; } - set { m_cancel = value; } + get { return false; } + set + { + // m_cancel = value; + } } public bool Sending { - get { return m_sending; } - set { m_sending = value; } + get { return false; } + set + { + // m_sending = value; + } } // See ITextureSender public void UpdateRequest(int discardLevel, uint packetNumber) { - if (download == null) - return; - - lock (download) - { - if (discardLevel < download.DiscardLevel) - m_log.DebugFormat("Image download {0} is changing from DiscardLevel {1} to {2}", - m_asset.FullID, download.DiscardLevel, discardLevel); - - if (packetNumber != download.CurrentPacket) - m_log.DebugFormat("Image download {0} is changing from Packet {1} to {2}", - m_asset.FullID, download.CurrentPacket, packetNumber); - - download.Update(discardLevel, download.Priority, (int)packetNumber); - - sendFirstPacket = true; - } + RequestedDiscardLevel = discardLevel; + StartPacketNumber = packetNumber; + PacketCounter = (int) StartPacketNumber; } // See ITextureSender public bool SendTexturePacket() { - if (download != null && !m_cancel && (sendFirstPacket || download.CurrentPacket <= download.StopPacket)) - { - SendPacket(); - return false; - } - else + //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID); + + SendPacket(); + counter++; + if ((NumPackets == 0) || (RequestedDiscardLevel == -1) || (PacketCounter > NumPackets) || + ((RequestedDiscardLevel > 0) && (counter > 50 + (NumPackets / (RequestedDiscardLevel + 1))))) { - m_sending = false; - m_cancel = true; - sendFirstPacket = false; return true; } + return false; } #endregion @@ -222,52 +140,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender public void TextureReceived(AssetBase asset) { m_asset = asset; - - try - { - OpenMetaverse.AssetTexture texture = new OpenMetaverse.AssetTexture(m_asset.FullID, m_asset.Data); - if (texture.DecodeLayerBoundaries()) - { - bool sane = true; - - // Sanity check all of the layers - for (int i = 0; i < texture.LayerInfo.Length; i++) - { - if (texture.LayerInfo[i].End > texture.AssetData.Length) - { - sane = false; - break; - } - } - - if (sane) - { - download = new ImageDownload(texture, initialDiscardLevel, initialPriority, initialPacketNum); - ImageLoaded = true; - m_sending = true; - m_cancel = false; - sendFirstPacket = true; - return; - } - else - { - m_log.Error("JPEG2000 texture decoding succeeded, but sanity check failed for " + - m_asset.FullID.ToString()); - } - } - else - { - m_log.Error("JPEG2000 texture decoding failed for " + m_asset.FullID.ToString()); - } - } - catch (Exception ex) - { - m_log.Error("JPEG2000 texture decoding threw an exception for " + m_asset.FullID.ToString(), ex); - } - - ImageLoaded = false; - m_sending = false; - m_cancel = true; + NumPackets = CalculateNumPackets(asset.Data.Length); + PacketCounter = (int) StartPacketNumber; + ImageLoaded = true; } /// @@ -275,48 +150,66 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender /// private void SendPacket() { - lock (download) + if (PacketCounter <= NumPackets) { - if (sendFirstPacket) + if (PacketCounter == 0) { - sendFirstPacket = false; - - if (m_asset.Data.Length <= ImageDownload.FIRST_IMAGE_PACKET_SIZE) + if (NumPackets == 0) { RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); - return; + PacketCounter++; } else { - byte[] firstImageData = new byte[ImageDownload.FIRST_IMAGE_PACKET_SIZE]; - try { Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, ImageDownload.FIRST_IMAGE_PACKET_SIZE); } - catch (Exception) - { - m_log.Error("Texture data copy failed on first packet for " + m_asset.FullID.ToString()); - m_cancel = true; - m_sending = false; - return; - } - RequestUser.SendImageFirstPart((ushort)download.TexturePacketCount(), m_asset.FullID, (uint)m_asset.Data.Length, firstImageData, 2); + byte[] ImageData1 = new byte[600]; + Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); + + RequestUser.SendImageFirstPart( + (ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2); + PacketCounter++; } } - - int imagePacketSize = (download.CurrentPacket == download.TexturePacketCount() - 1) ? - download.LastPacketSize() : ImageDownload.IMAGE_PACKET_SIZE; - - byte[] imageData = new byte[imagePacketSize]; - try { Buffer.BlockCopy(m_asset.Data, download.CurrentBytePosition(), imageData, 0, imagePacketSize); } - catch (Exception) + else { - m_log.Error("Texture data copy failed for " + m_asset.FullID.ToString()); - m_cancel = true; - m_sending = false; - return; + int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1)); + if (size > 1000) size = 1000; + byte[] imageData = new byte[size]; + try + { + Array.Copy(m_asset.Data, 600 + (1000 * (PacketCounter - 1)), imageData, 0, size); + } + catch (ArgumentOutOfRangeException) + { + m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + + m_asset.FullID.ToString()); + return; + } + + RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData); + PacketCounter++; } + } + } - RequestUser.SendImageNextPart((ushort)download.CurrentPacket, m_asset.FullID, imageData); - ++download.CurrentPacket; + /// + /// Calculate the number of packets that will be required to send the texture loaded into this sender + /// This is actually the number of 1000 byte packets not including an initial 600 byte packet... + /// + /// + /// + private int CalculateNumPackets(int length) + { + int numPackets = 0; + + if (length > 600) + { + //over 600 bytes so split up file + int restData = (length - 600); + int restPackets = ((restData + 999) / 1000); + numPackets = restPackets; } + + return numPackets; } } } diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs index 5b6c2a6..2f9a691 100644 --- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs @@ -174,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer { // for now (testing) we only support files under 1000 bytes byte[] transferData = new byte[Data.Length + 4]; - Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); + Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); Array.Copy(Data, 0, transferData, 4, Data.Length); Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); @@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer else { byte[] transferData = new byte[1000 + 4]; - Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); + Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); Array.Copy(Data, 0, transferData, 4, 1000); Client.SendXferPacket(XferID, 0, transferData); Packet++; diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index 989f36c..daff760 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs @@ -29,6 +29,7 @@ using System.Collections; using System.Collections.Generic; using System.Reflection; using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using Nini.Config; using Nwc.XmlRpc; diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs index 3fc8005..c532ac0 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs @@ -44,18 +44,18 @@ using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Interfaces; using OpenSim.Region.Environment.Scenes; -using OSD = OpenMetaverse.StructuredData.OSD; -using OSDMap = OpenMetaverse.StructuredData.OSDMap; -using OSDArray = OpenMetaverse.StructuredData.OSDArray; +using LLSD = OpenMetaverse.StructuredData.LLSD; +using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; +using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; using Caps = OpenSim.Framework.Communications.Capabilities.Caps; -using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue; +using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue; namespace OpenSim.Region.Environment.Modules.Framework { public struct QueueItem { public int id; - public OSDMap body; + public LLSDMap body; } public class EventQueueGetModule : IEventQueue, IRegionModule @@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.Framework #region IEventQueue Members - public bool Enqueue(OSD ev, UUID avatarID) + public bool Enqueue(LLSD ev, UUID avatarID) { m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); try @@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.Framework // } BlockingLLSDQueue queue = GetQueue(agentID); - OSD element = queue.Dequeue(15000); // 15s timeout + LLSD element = queue.Dequeue(15000); // 15s timeout Hashtable responsedata = new Hashtable(); @@ -337,7 +337,7 @@ namespace OpenSim.Region.Environment.Modules.Framework - OSDArray array = new OSDArray(); + LLSDArray array = new LLSDArray(); if (element == null) // didn't have an event in 15s { // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! @@ -354,10 +354,10 @@ namespace OpenSim.Region.Environment.Modules.Framework } } - OSDMap events = new OSDMap(); + LLSDMap events = new LLSDMap(); events.Add("events", array); - events.Add("id", new OSDInteger(thisID)); + events.Add("id", new LLSDInteger(thisID)); lock (m_ids) { m_ids[agentID] = thisID + 1; @@ -366,7 +366,7 @@ namespace OpenSim.Region.Environment.Modules.Framework responsedata["int_response_code"] = 200; responsedata["content_type"] = "application/xml"; responsedata["keepalive"] = false; - responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); + responsedata["str_response_string"] = LLSDParser.SerializeXmlString(events); m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); return responsedata; @@ -424,7 +424,7 @@ namespace OpenSim.Region.Environment.Modules.Framework } - public OSD EventQueueFallBack(string path, OSD request, string endpoint) + public LLSD EventQueueFallBack(string path, LLSD request, string endpoint) { // This is a fallback element to keep the client from loosing EventQueueGet // Why does CAPS fail sometimes!? @@ -473,7 +473,7 @@ namespace OpenSim.Region.Environment.Modules.Framework thisID = m_ids[AvatarID]; BlockingLLSDQueue queue = GetQueue(AvatarID); - OSDArray array = new OSDArray(); + LLSDArray array = new LLSDArray(); LLSD element = queue.Dequeue(15000); // 15s timeout if (element == null) { @@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.Framework thisID++; } } - OSDMap events = new OSDMap(); + LLSDMap events = new LLSDMap(); events.Add("events", array); events.Add("id", new LLSDInteger(thisID)); @@ -512,7 +512,7 @@ namespace OpenSim.Region.Environment.Modules.Framework { //return new LLSD(); } - return new OSDString("shutdown404!"); + return new LLSDString("shutdown404!"); } } } diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs index 21be82a..0d0eed2 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs @@ -52,70 +52,70 @@ namespace OpenSim.Region.Environment }; } - public static OSD buildEvent(string eventName, OSD eventBody) + public static LLSD buildEvent(string eventName, LLSD eventBody) { - OSDMap llsdEvent = new OSDMap(2); - llsdEvent.Add("message", new OSDString(eventName)); + LLSDMap llsdEvent = new LLSDMap(2); + llsdEvent.Add("message", new LLSDString(eventName)); llsdEvent.Add("body", eventBody); return llsdEvent; } - public static OSD EnableSimulator(ulong Handle, IPEndPoint endPoint) + public static LLSD EnableSimulator(ulong Handle, IPEndPoint endPoint) { - OSDMap llsdSimInfo = new OSDMap(3); + LLSDMap llsdSimInfo = new LLSDMap(3); - llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle))); - llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); - llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); + llsdSimInfo.Add("Handle", new LLSDBinary(regionHandleToByteArray(Handle))); + llsdSimInfo.Add("IP", new LLSDBinary(endPoint.Address.GetAddressBytes())); + llsdSimInfo.Add("Port", new LLSDInteger(endPoint.Port)); - OSDArray arr = new OSDArray(1); + LLSDArray arr = new LLSDArray(1); arr.Add(llsdSimInfo); - OSDMap llsdBody = new OSDMap(1); + LLSDMap llsdBody = new LLSDMap(1); llsdBody.Add("SimulatorInfo", arr); return buildEvent("EnableSimulator", llsdBody); } - public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, + public static LLSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL, UUID AgentID, UUID SessionID) { - OSDArray LookAtArr = new OSDArray(3); - LookAtArr.Add(OSD.FromReal(lookAt.X)); - LookAtArr.Add(OSD.FromReal(lookAt.Y)); - LookAtArr.Add(OSD.FromReal(lookAt.Z)); + LLSDArray LookAtArr = new LLSDArray(3); + LookAtArr.Add(LLSD.FromReal(lookAt.X)); + LookAtArr.Add(LLSD.FromReal(lookAt.Y)); + LookAtArr.Add(LLSD.FromReal(lookAt.Z)); - OSDArray PositionArr = new OSDArray(3); - PositionArr.Add(OSD.FromReal(pos.X)); - PositionArr.Add(OSD.FromReal(pos.Y)); - PositionArr.Add(OSD.FromReal(pos.Z)); + LLSDArray PositionArr = new LLSDArray(3); + PositionArr.Add(LLSD.FromReal(pos.X)); + PositionArr.Add(LLSD.FromReal(pos.Y)); + PositionArr.Add(LLSD.FromReal(pos.Z)); - OSDMap InfoMap = new OSDMap(2); + LLSDMap InfoMap = new LLSDMap(2); InfoMap.Add("LookAt", LookAtArr); InfoMap.Add("Position", PositionArr); - OSDArray InfoArr = new OSDArray(1); + LLSDArray InfoArr = new LLSDArray(1); InfoArr.Add(InfoMap); - OSDMap AgentDataMap = new OSDMap(2); - AgentDataMap.Add("AgentID", OSD.FromUUID(AgentID)); - AgentDataMap.Add("SessionID", OSD.FromUUID(SessionID)); + LLSDMap AgentDataMap = new LLSDMap(2); + AgentDataMap.Add("AgentID", LLSD.FromUUID(AgentID)); + AgentDataMap.Add("SessionID", LLSD.FromUUID(SessionID)); - OSDArray AgentDataArr = new OSDArray(1); + LLSDArray AgentDataArr = new LLSDArray(1); AgentDataArr.Add(AgentDataMap); - OSDMap RegionDataMap = new OSDMap(4); - RegionDataMap.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(Handle))); - RegionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); - RegionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); - RegionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); + LLSDMap RegionDataMap = new LLSDMap(4); + RegionDataMap.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(Handle))); + RegionDataMap.Add("SeedCapability", LLSD.FromString(capsURL)); + RegionDataMap.Add("SimIP", LLSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); + RegionDataMap.Add("SimPort", LLSD.FromInteger(newRegionExternalEndPoint.Port)); - OSDArray RegionDataArr = new OSDArray(1); + LLSDArray RegionDataArr = new LLSDArray(1); RegionDataArr.Add(RegionDataMap); - OSDMap llsdBody = new OSDMap(3); + LLSDMap llsdBody = new LLSDMap(3); llsdBody.Add("Info", InfoArr); llsdBody.Add("AgentData", AgentDataArr); llsdBody.Add("RegionData", RegionDataArr); @@ -123,49 +123,49 @@ namespace OpenSim.Region.Environment return buildEvent("CrossedRegion", llsdBody); } - public static OSD TeleportFinishEvent( + public static LLSD TeleportFinishEvent( ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, UUID AgentID) { - OSDMap info = new OSDMap(); - info.Add("AgentID", OSD.FromUUID(AgentID)); - info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? - info.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(regionHandle))); - info.Add("SeedCapability", OSD.FromString(capsURL)); - info.Add("SimAccess", OSD.FromInteger(simAccess)); - info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); - info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); - info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation - - OSDArray infoArr = new OSDArray(); + LLSDMap info = new LLSDMap(); + info.Add("AgentID", LLSD.FromUUID(AgentID)); + info.Add("LocationID", LLSD.FromInteger(4)); // TODO what is this? + info.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(regionHandle))); + info.Add("SeedCapability", LLSD.FromString(capsURL)); + info.Add("SimAccess", LLSD.FromInteger(simAccess)); + info.Add("SimIP", LLSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); + info.Add("SimPort", LLSD.FromInteger(regionExternalEndPoint.Port)); + info.Add("TeleportFlags", LLSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation + + LLSDArray infoArr = new LLSDArray(); infoArr.Add(info); - OSDMap body = new OSDMap(); + LLSDMap body = new LLSDMap(); body.Add("Info", infoArr); return buildEvent("TeleportFinish", body); } - public static OSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono) + public static LLSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono) { - OSDMap script = new OSDMap(); - script.Add("ObjectID", OSD.FromUUID(objectID)); - script.Add("ItemID", OSD.FromUUID(itemID)); - script.Add("Running", OSD.FromBoolean(running)); - script.Add("Mono", OSD.FromBoolean(mono)); + LLSDMap script = new LLSDMap(); + script.Add("ObjectID", LLSD.FromUUID(objectID)); + script.Add("ItemID", LLSD.FromUUID(itemID)); + script.Add("Running", LLSD.FromBoolean(running)); + script.Add("Mono", LLSD.FromBoolean(mono)); - OSDArray scriptArr = new OSDArray(); + LLSDArray scriptArr = new LLSDArray(); scriptArr.Add(script); - OSDMap body = new OSDMap(); + LLSDMap body = new LLSDMap(); body.Add("Script", scriptArr); return buildEvent("ScriptRunningReply", body); } - public static OSD KeepAliveEvent() + public static LLSD KeepAliveEvent() { - return buildEvent("FAKEEVENT", new OSDMap()); + return buildEvent("FAKEEVENT", new LLSDMap()); } } } diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index 1c86c2f..5b06408 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs @@ -46,9 +46,9 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; -using OSD = OpenMetaverse.StructuredData.OSD; -using OSDMap = OpenMetaverse.StructuredData.OSDMap; -using OSDArray = OpenMetaverse.StructuredData.OSDArray; +using LLSD = OpenMetaverse.StructuredData.LLSD; +using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; +using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; namespace OpenSim.Region.Environment.Modules.InterGrid { @@ -218,7 +218,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid #endregion - public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) + public LLSD ProcessRegionDomainSeed(string path, LLSD request, string endpoint) { string[] pathSegments = path.Split('/'); @@ -234,11 +234,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid //m_log.InfoFormat("[OGP]: path {0}, segments {1} segment[1] {2} Last segment {3}", // path, pathSegments.Length, pathSegments[1], pathSegments[pathSegments.Length - 1]); - //return new OSDMap(); + //return new LLSDMap(); } - public OSD ProcessAgentDomainMessage(string path, OSD request, string endpoint) + public LLSD ProcessAgentDomainMessage(string path, LLSD request, string endpoint) { // /agent/* @@ -288,7 +288,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid //return null; } - private OSD GenerateRezAvatarRequestMessage(string regionname) + private LLSD GenerateRezAvatarRequestMessage(string regionname) { Scene region = null; bool usedroot = false; @@ -319,7 +319,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid RegionInfo reg = region.RegionInfo; - OSDMap responseMap = new OSDMap(); + LLSDMap responseMap = new LLSDMap(); string rezHttpProtocol = "http://"; //string regionCapsHttpProtocol = "http://"; string httpaddr = reg.ExternalHostName; @@ -347,9 +347,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid httpaddr = httpsCN; } - responseMap["connect"] = OSD.FromBoolean(true); - OSDMap capabilitiesMap = new OSDMap(); - capabilitiesMap["rez_avatar/request"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + requestpath); + responseMap["connect"] = LLSD.FromBoolean(true); + LLSDMap capabilitiesMap = new LLSDMap(); + capabilitiesMap["rez_avatar/request"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + requestpath); responseMap["capabilities"] = capabilitiesMap; return responseMap; @@ -376,11 +376,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid } - public OSD RequestRezAvatarMethod(string path, OSD request) + public LLSD RequestRezAvatarMethod(string path, LLSD request) { //System.Console.WriteLine("[REQUESTREZAVATAR]: " + request.ToString()); - OSDMap requestMap = (OSDMap)request; + LLSDMap requestMap = (LLSDMap)request; Scene homeScene = null; @@ -441,27 +441,27 @@ namespace OpenSim.Region.Environment.Modules.InterGrid UpdateOGPState(LocalAgentID, userState); - OSDMap responseMap = new OSDMap(); + LLSDMap responseMap = new LLSDMap(); if (RemoteAgentID == UUID.Zero) { - responseMap["connect"] = OSD.FromBoolean(false); - responseMap["message"] = OSD.FromString("No agent ID was specified in rez_avatar/request"); + responseMap["connect"] = LLSD.FromBoolean(false); + responseMap["message"] = LLSD.FromString("No agent ID was specified in rez_avatar/request"); m_log.Error("[OGP]: rez_avatar/request failed because no avatar UUID was provided in the request body"); return responseMap; } - responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName); + responseMap["sim_host"] = LLSD.FromString(reg.ExternalHostName); // DEPRECIATED - responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); + responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); - responseMap["connect"] = OSD.FromBoolean(true); - responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port); - responseMap["region_x"] = OSD.FromInteger(reg.RegionLocX * (uint)Constants.RegionSize); // LLX - responseMap["region_y"] = OSD.FromInteger(reg.RegionLocY * (uint)Constants.RegionSize); // LLY - responseMap["region_id"] = OSD.FromUUID(reg.originRegionID); - responseMap["sim_access"] = OSD.FromString((reg.RegionSettings.Maturity == 1) ? "Mature" : "PG"); + responseMap["connect"] = LLSD.FromBoolean(true); + responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); + responseMap["region_x"] = LLSD.FromInteger(reg.RegionLocX * (uint)Constants.RegionSize); // LLX + responseMap["region_y"] = LLSD.FromInteger(reg.RegionLocY * (uint)Constants.RegionSize); // LLY + responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); + responseMap["sim_access"] = LLSD.FromString((reg.RegionSettings.Maturity == 1) ? "Mature" : "PG"); // Generate a dummy agent for the user so we can get back a CAPS path AgentCircuitData agentData = new AgentCircuitData(); @@ -575,14 +575,14 @@ namespace OpenSim.Region.Environment.Modules.InterGrid // DEPRECIATED - responseMap["seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); + responseMap["seed_capability"] = LLSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); // REPLACEMENT - responseMap["region_seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); + responseMap["region_seed_capability"] = LLSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); - responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); - responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); - responseMap["rez_avatar/derez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + derezAvatarPath); + responseMap["rez_avatar"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); + responseMap["rez_avatar/rez"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); + responseMap["rez_avatar/derez"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + derezAvatarPath); // Add the user to the list of CAPS that are outstanding. // well allow the caps hosts in this dictionary @@ -605,27 +605,27 @@ namespace OpenSim.Region.Environment.Modules.InterGrid return responseMap; } - public OSD RezAvatarMethod(string path, OSD request) + public LLSD RezAvatarMethod(string path, LLSD request) { m_log.WarnFormat("[REZAVATAR]: {0}", request.ToString()); - OSDMap responseMap = new OSDMap(); + LLSDMap responseMap = new LLSDMap(); AgentCircuitData userData = null; // Only people we've issued a cap can go further if (TryGetAgentCircuitData(path,out userData)) { - OSDMap requestMap = (OSDMap)request; + LLSDMap requestMap = (LLSDMap)request; // take these values to start. There's a few more UUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); UUID SessionID = requestMap["session_id"].AsUUID(); int circuitcode = requestMap["circuit_code"].AsInteger(); - OSDArray Parameter = new OSDArray(); + LLSDArray Parameter = new LLSDArray(); if (requestMap.ContainsKey("parameter")) { - Parameter = (OSDArray)requestMap["parameter"]; + Parameter = (LLSDArray)((LLSD)requestMap["parameter"]); } //int version = 1; @@ -636,7 +636,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid for (int i = 0; i < Parameter.Count; i++) { - OSDMap item = (OSDMap)Parameter[i]; + LLSDMap item = (LLSDMap)Parameter[i]; // if (item.ContainsKey("version")) // { // version = item["version"].AsInteger(); @@ -714,15 +714,15 @@ namespace OpenSim.Region.Environment.Modules.InterGrid RegionInfo reg = homeScene.RegionInfo; // Dummy positional and look at info.. we don't have it. - OSDArray PositionArray = new OSDArray(); - PositionArray.Add(OSD.FromInteger(128)); - PositionArray.Add(OSD.FromInteger(128)); - PositionArray.Add(OSD.FromInteger(40)); + LLSDArray PositionArray = new LLSDArray(); + PositionArray.Add(LLSD.FromInteger(128)); + PositionArray.Add(LLSD.FromInteger(128)); + PositionArray.Add(LLSD.FromInteger(40)); - OSDArray LookAtArray = new OSDArray(); - LookAtArray.Add(OSD.FromInteger(1)); - LookAtArray.Add(OSD.FromInteger(1)); - LookAtArray.Add(OSD.FromInteger(1)); + LLSDArray LookAtArray = new LLSDArray(); + LookAtArray.Add(LLSD.FromInteger(1)); + LookAtArray.Add(LLSD.FromInteger(1)); + LookAtArray.Add(LLSD.FromInteger(1)); // Our region's X and Y position in OpenSimulator space. uint fooX = reg.RegionLocX; @@ -732,31 +732,31 @@ namespace OpenSim.Region.Environment.Modules.InterGrid m_log.InfoFormat("[OGO]: region UUID {0} ", reg.RegionID); // Convert the X and Y position to LL space - responseMap["region_x"] = OSD.FromInteger(fooX * (uint)Constants.RegionSize); // convert it to LL X - responseMap["region_y"] = OSD.FromInteger(fooY * (uint)Constants.RegionSize); // convert it to LL Y + responseMap["region_x"] = LLSD.FromInteger(fooX * (uint)Constants.RegionSize); // convert it to LL X + responseMap["region_y"] = LLSD.FromInteger(fooY * (uint)Constants.RegionSize); // convert it to LL Y // Give em a new seed capability - responseMap["seed_capability"] = OSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); - responseMap["region"] = OSD.FromUUID(reg.originRegionID); + responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); + responseMap["region"] = LLSD.FromUUID(reg.originRegionID); responseMap["look_at"] = LookAtArray; - responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port); - responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString()); + responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); + responseMap["sim_host"] = LLSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString()); // DEPRECIATED - responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); + responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); - responseMap["session_id"] = OSD.FromUUID(SessionID); - responseMap["secure_session_id"] = OSD.FromUUID(SecureSessionID); - responseMap["circuit_code"] = OSD.FromInteger(circuitcode); + responseMap["session_id"] = LLSD.FromUUID(SessionID); + responseMap["secure_session_id"] = LLSD.FromUUID(SecureSessionID); + responseMap["circuit_code"] = LLSD.FromInteger(circuitcode); responseMap["position"] = PositionArray; - responseMap["region_id"] = OSD.FromUUID(reg.originRegionID); + responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); - responseMap["sim_access"] = OSD.FromString("Mature"); + responseMap["sim_access"] = LLSD.FromString("Mature"); - responseMap["connect"] = OSD.FromBoolean(true); + responseMap["connect"] = LLSD.FromBoolean(true); @@ -767,12 +767,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid return responseMap; } - public OSD DerezAvatarMethod(string path, OSD request) + public LLSD DerezAvatarMethod(string path, LLSD request) { m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString()); //LLSD llsdResponse = null; - OSDMap responseMap = new OSDMap(); + LLSDMap responseMap = new LLSDMap(); string[] PathArray = path.Split('/'); m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]); @@ -790,34 +790,34 @@ namespace OpenSim.Region.Environment.Modules.InterGrid OGPState userState = GetOGPState(LocalID); if (userState.agent_id != UUID.Zero) { - //OSDMap outboundRequestMap = new OSDMap(); - OSDMap inboundRequestMap = (OSDMap)request; + //LLSDMap outboundRequestMap = new LLSDMap(); + LLSDMap inboundRequestMap = (LLSDMap)request; string rezAvatarString = inboundRequestMap["rez_avatar"].AsString(); if (rezAvatarString.Length == 0) { rezAvatarString = inboundRequestMap["rez_avatar/rez"].AsString(); } - OSDArray LookAtArray = new OSDArray(); - LookAtArray.Add(OSD.FromInteger(1)); - LookAtArray.Add(OSD.FromInteger(1)); - LookAtArray.Add(OSD.FromInteger(1)); - - OSDArray PositionArray = new OSDArray(); - PositionArray.Add(OSD.FromInteger(128)); - PositionArray.Add(OSD.FromInteger(128)); - PositionArray.Add(OSD.FromInteger(40)); - - OSDArray lookArray = new OSDArray(); - lookArray.Add(OSD.FromInteger(128)); - lookArray.Add(OSD.FromInteger(128)); - lookArray.Add(OSD.FromInteger(40)); - - responseMap["connect"] = OSD.FromBoolean(true);// it's okay to give this user up + LLSDArray LookAtArray = new LLSDArray(); + LookAtArray.Add(LLSD.FromInteger(1)); + LookAtArray.Add(LLSD.FromInteger(1)); + LookAtArray.Add(LLSD.FromInteger(1)); + + LLSDArray PositionArray = new LLSDArray(); + PositionArray.Add(LLSD.FromInteger(128)); + PositionArray.Add(LLSD.FromInteger(128)); + PositionArray.Add(LLSD.FromInteger(40)); + + LLSDArray lookArray = new LLSDArray(); + lookArray.Add(LLSD.FromInteger(128)); + lookArray.Add(LLSD.FromInteger(128)); + lookArray.Add(LLSD.FromInteger(40)); + + responseMap["connect"] = LLSD.FromBoolean(true);// it's okay to give this user up responseMap["look_at"] = LookAtArray; m_log.WarnFormat("[OGP]: Invoking rez_avatar on host:{0} for avatar: {1} {2}", rezAvatarString, userState.first_name, userState.last_name); - OSDMap rezResponseMap = invokeRezAvatarCap(responseMap, rezAvatarString,userState); + LLSDMap rezResponseMap = invokeRezAvatarCap(responseMap, rezAvatarString,userState); // If invoking it returned an error, parse and end if (rezResponseMap.ContainsKey("connect")) @@ -852,34 +852,34 @@ namespace OpenSim.Region.Environment.Modules.InterGrid int rrY = rezResponseMap["region_y"].AsInteger(); m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY); UUID rrRID = rezResponseMap["region_id"].AsUUID(); - OSDArray RezResponsePositionArray = null; + LLSDArray RezResponsePositionArray = null; string rrAccess = rezResponseMap["sim_access"].AsString(); if (rezResponseMap.ContainsKey("position")) { - RezResponsePositionArray = (OSDArray)rezResponseMap["position"]; + RezResponsePositionArray = (LLSDArray)rezResponseMap["position"]; } // DEPRECIATED - responseMap["seed_capability"] = OSD.FromString(rezRespSeedCap); + responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap); // REPLACEMENT r3 - responseMap["region_seed_capability"] = OSD.FromString(rezRespSeedCap); + responseMap["region_seed_capability"] = LLSD.FromString(rezRespSeedCap); // DEPRECIATED - responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); + responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); - responseMap["sim_host"] = OSD.FromString(rezRespSim_host); - responseMap["sim_port"] = OSD.FromInteger(rrPort); - responseMap["region_x"] = OSD.FromInteger(rrX ); - responseMap["region_y"] = OSD.FromInteger(rrY ); - responseMap["region_id"] = OSD.FromUUID(rrRID); - responseMap["sim_access"] = OSD.FromString(rrAccess); + responseMap["sim_host"] = LLSD.FromString(rezRespSim_host); + responseMap["sim_port"] = LLSD.FromInteger(rrPort); + responseMap["region_x"] = LLSD.FromInteger(rrX ); + responseMap["region_y"] = LLSD.FromInteger(rrY ); + responseMap["region_id"] = LLSD.FromUUID(rrRID); + responseMap["sim_access"] = LLSD.FromString(rrAccess); if (RezResponsePositionArray != null) { responseMap["position"] = RezResponsePositionArray; } responseMap["look_at"] = lookArray; - responseMap["connect"] = OSD.FromBoolean(true); + responseMap["connect"] = LLSD.FromBoolean(true); ShutdownConnection(LocalID,this); // PLEASE STOP CHANGING THIS TO an M_LOG, M_LOG DOESN'T WORK ON MULTILINE .TOSTRINGS @@ -899,7 +899,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid //return responseMap; } - private OSDMap invokeRezAvatarCap(OSDMap responseMap, string CapAddress, OGPState userState) + private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState) { Scene reg = GetRootScene(); @@ -907,38 +907,38 @@ namespace OpenSim.Region.Environment.Modules.InterGrid DeRezRequest.Method = "POST"; DeRezRequest.ContentType = "application/xml+llsd"; - OSDMap RAMap = new OSDMap(); - OSDMap AgentParms = new OSDMap(); - OSDMap RegionParms = new OSDMap(); - - OSDArray Parameter = new OSDArray(2); - - OSDMap version = new OSDMap(); - version["version"] = OSD.FromInteger(userState.src_version); - Parameter.Add(version); - - OSDMap SrcData = new OSDMap(); - SrcData["estate_id"] = OSD.FromInteger(reg.RegionInfo.EstateSettings.EstateID); - SrcData["parent_estate_id"] = OSD.FromInteger((reg.RegionInfo.EstateSettings.ParentEstateID == 100 ? 1 : reg.RegionInfo.EstateSettings.ParentEstateID)); - SrcData["region_id"] = OSD.FromUUID(reg.RegionInfo.originRegionID); - SrcData["visible_to_parent"] = OSD.FromBoolean(userState.visible_to_parent); - Parameter.Add(SrcData); - - AgentParms["first_name"] = OSD.FromString(userState.first_name); - AgentParms["last_name"] = OSD.FromString(userState.last_name); - AgentParms["agent_id"] = OSD.FromUUID(userState.agent_id); - RegionParms["region_id"] = OSD.FromUUID(userState.region_id); - AgentParms["circuit_code"] = OSD.FromInteger(userState.circuit_code); - AgentParms["secure_session_id"] = OSD.FromUUID(userState.secure_session_id); - AgentParms["session_id"] = OSD.FromUUID(userState.session_id); - AgentParms["agent_access"] = OSD.FromBoolean(userState.agent_access); - AgentParms["god_level"] = OSD.FromInteger(userState.god_level); - AgentParms["god_overide"] = OSD.FromBoolean(userState.god_overide); - AgentParms["identified"] = OSD.FromBoolean(userState.identified); - AgentParms["transacted"] = OSD.FromBoolean(userState.transacted); - AgentParms["age_verified"] = OSD.FromBoolean(userState.age_verified); - AgentParms["limited_to_estate"] = OSD.FromInteger(userState.limited_to_estate); - AgentParms["inventory_host"] = OSD.FromString(userState.inventory_host); + LLSDMap RAMap = new LLSDMap(); + LLSDMap AgentParms = new LLSDMap(); + LLSDMap RegionParms = new LLSDMap(); + + LLSDArray Parameter = new LLSDArray(2); + + LLSDMap version = new LLSDMap(); + version["version"] = LLSD.FromInteger(userState.src_version); + Parameter.Add((LLSD)version); + + LLSDMap SrcData = new LLSDMap(); + SrcData["estate_id"] = LLSD.FromInteger(reg.RegionInfo.EstateSettings.EstateID); + SrcData["parent_estate_id"] = LLSD.FromInteger((reg.RegionInfo.EstateSettings.ParentEstateID == 100 ? 1 : reg.RegionInfo.EstateSettings.ParentEstateID)); + SrcData["region_id"] = LLSD.FromUUID(reg.RegionInfo.originRegionID); + SrcData["visible_to_parent"] = LLSD.FromBoolean(userState.visible_to_parent); + Parameter.Add((LLSD)SrcData); + + AgentParms["first_name"] = LLSD.FromString(userState.first_name); + AgentParms["last_name"] = LLSD.FromString(userState.last_name); + AgentParms["agent_id"] = LLSD.FromUUID(userState.agent_id); + RegionParms["region_id"] = LLSD.FromUUID(userState.region_id); + AgentParms["circuit_code"] = LLSD.FromInteger(userState.circuit_code); + AgentParms["secure_session_id"] = LLSD.FromUUID(userState.secure_session_id); + AgentParms["session_id"] = LLSD.FromUUID(userState.session_id); + AgentParms["agent_access"] = LLSD.FromBoolean(userState.agent_access); + AgentParms["god_level"] = LLSD.FromInteger(userState.god_level); + AgentParms["god_overide"] = LLSD.FromBoolean(userState.god_overide); + AgentParms["identified"] = LLSD.FromBoolean(userState.identified); + AgentParms["transacted"] = LLSD.FromBoolean(userState.transacted); + AgentParms["age_verified"] = LLSD.FromBoolean(userState.age_verified); + AgentParms["limited_to_estate"] = LLSD.FromInteger(userState.limited_to_estate); + AgentParms["inventory_host"] = LLSD.FromString(userState.inventory_host); // version 1 RAMap = AgentParms; @@ -951,11 +951,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid string RAMapString = RAMap.ToString(); m_log.InfoFormat("[OGP] RAMap string {0}", RAMapString); - OSD LLSDofRAMap = RAMap; // RENAME if this works + LLSD LLSDofRAMap = RAMap; // RENAME if this works m_log.InfoFormat("[OGP]: LLSD of map as string was {0}", LLSDofRAMap.ToString()); //m_log.InfoFormat("[OGP]: LLSD+XML: {0}", LLSDParser.SerializeXmlString(LLSDofRAMap)); - byte[] buffer = OSDParser.SerializeLLSDXmlBytes(LLSDofRAMap); + byte[] buffer = LLSDParser.SerializeXmlBytes(LLSDofRAMap); //string bufferDump = System.Text.Encoding.ASCII.GetString(buffer); //m_log.InfoFormat("[OGP]: buffer form is {0}",bufferDump); @@ -973,7 +973,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid catch (WebException ex) { m_log.InfoFormat("[OGP] Bad send on de_rez_avatar {0}", ex.Message); - responseMap["connect"] = OSD.FromBoolean(false); + responseMap["connect"] = LLSD.FromBoolean(false); return responseMap; } @@ -997,21 +997,21 @@ namespace OpenSim.Region.Environment.Modules.InterGrid catch (WebException ex) { m_log.InfoFormat("[OGP]: exception on read after send of rez avatar {0}", ex.Message); - responseMap["connect"] = OSD.FromBoolean(false); + responseMap["connect"] = LLSD.FromBoolean(false); return responseMap; } - OSD rezResponse = null; + LLSD rezResponse = null; try { - rezResponse = OSDParser.DeserializeLLSDXml(rez_avatar_reply); + rezResponse = LLSDParser.DeserializeXml(rez_avatar_reply); - responseMap = (OSDMap)rezResponse; + responseMap = (LLSDMap)rezResponse; } catch (Exception ex) { m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); - responseMap["connect"] = OSD.FromBoolean(false); + responseMap["connect"] = LLSD.FromBoolean(false); return responseMap; } @@ -1019,22 +1019,22 @@ namespace OpenSim.Region.Environment.Modules.InterGrid return responseMap; } - public OSD GenerateNoHandlerMessage() + public LLSD GenerateNoHandlerMessage() { - OSDMap map = new OSDMap(); - map["reason"] = OSD.FromString("LLSDRequest"); - map["message"] = OSD.FromString("No handler registered for LLSD Requests"); - map["login"] = OSD.FromString("false"); - map["connect"] = OSD.FromString("false"); + LLSDMap map = new LLSDMap(); + map["reason"] = LLSD.FromString("LLSDRequest"); + map["message"] = LLSD.FromString("No handler registered for LLSD Requests"); + map["login"] = LLSD.FromString("false"); + map["connect"] = LLSD.FromString("false"); return map; } - public OSD GenerateNoStateMessage(UUID passedAvatar) + public LLSD GenerateNoStateMessage(UUID passedAvatar) { - OSDMap map = new OSDMap(); - map["reason"] = OSD.FromString("derez failed"); - map["message"] = OSD.FromString("Unable to locate OGP state for avatar " + passedAvatar.ToString()); - map["login"] = OSD.FromString("false"); - map["connect"] = OSD.FromString("false"); + LLSDMap map = new LLSDMap(); + map["reason"] = LLSD.FromString("derez failed"); + map["message"] = LLSD.FromString("Unable to locate OGP state for avatar " + passedAvatar.ToString()); + map["login"] = LLSD.FromString("false"); + map["connect"] = LLSD.FromString("false"); return map; } private bool TryGetAgentCircuitData(string path, out AgentCircuitData userdata) diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 197d5c2..27c7014 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -369,7 +369,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land List toRemove = new List(); foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) { - if (entry.Flags == (AccessList)flags) + if (entry.Flags == (AccessList) flags) { toRemove.Add(entry); } @@ -384,7 +384,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry(); temp.AgentID = entry.AgentID; temp.Time = new DateTime(); //Pointless? Yes. - temp.Flags = (AccessList)flags; + temp.Flags = (AccessList) flags; if (!newData.ParcelAccessList.Contains(temp)) { diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 8318cdc..c51a314 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs @@ -48,9 +48,9 @@ using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Types; using Caps = OpenSim.Framework.Communications.Capabilities.Caps; -using OSD = OpenMetaverse.StructuredData.OSD; -using OSDMap = OpenMetaverse.StructuredData.OSDMap; -using OSDArray = OpenMetaverse.StructuredData.OSDArray; +using LLSD = OpenMetaverse.StructuredData.LLSD; +using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; +using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; namespace OpenSim.Region.Environment.Modules.World.WorldMap { @@ -202,7 +202,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } } LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); - mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); + mapResponse.LayerData.Array.Add(GetLLSDMapLayerResponse()); return mapResponse.ToString(); } @@ -215,7 +215,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap { m_log.Debug("[CAPS]: MapLayer Request in region: " + m_scene.RegionInfo.RegionName); LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); - mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); + mapResponse.LayerData.Array.Add(GetLLSDMapLayerResponse()); return mapResponse; } @@ -223,9 +223,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap /// /// /// - protected static OSDMapLayer GetOSDMapLayerResponse() + protected static LLSDMapLayer GetLLSDMapLayerResponse() { - OSDMapLayer mapLayer = new OSDMapLayer(); + LLSDMapLayer mapLayer = new LLSDMapLayer(); mapLayer.Right = 5000; mapLayer.Top = 5000; mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006"); @@ -321,7 +321,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } uint xstart = 0; uint ystart = 0; - Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart); + Helpers.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart); if (itemtype == 6) // we only sevice 6 right now (avatar green dots) { if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle) @@ -407,7 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap if (dorequest) { - OSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); + LLSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); RequestMapItemsCompleted(response); } } @@ -433,8 +433,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap /// /// Sends the mapitem response to the IClientAPI /// - /// The OSDMap Response for the mapitem - private void RequestMapItemsCompleted(OSDMap response) + /// The LLSDMap Response for the mapitem + private void RequestMapItemsCompleted(LLSDMap response) { UUID requestID = response["requestID"].AsUUID(); @@ -460,10 +460,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap if (response.ContainsKey(mrs.itemtype.ToString())) { List returnitems = new List(); - OSDArray itemarray = (OSDArray)response[mrs.itemtype.ToString()]; + LLSDArray itemarray = (LLSDArray)response[mrs.itemtype.ToString()]; for (int i = 0; i < itemarray.Count; i++) { - OSDMap mapitem = (OSDMap)itemarray[i]; + LLSDMap mapitem = (LLSDMap)itemarray[i]; mapItemReply mi = new mapItemReply(); mi.x = (uint)mapitem["X"].AsInteger(); mi.y = (uint)mapitem["Y"].AsInteger(); @@ -517,7 +517,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap /// passed in from packet /// Region we're looking up /// - private OSDMap RequestMapItemsAsync(string httpserver, UUID id, uint flags, + private LLSDMap RequestMapItemsAsync(string httpserver, UUID id, uint flags, uint EstateID, bool godlike, uint itemtype, ulong regionhandle) { bool blacklisted = false; @@ -528,7 +528,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } if (blacklisted) - return new OSDMap(); + return new LLSDMap(); UUID requestID = UUID.Random(); lock (m_cachedRegionMapItemsAddress) @@ -569,7 +569,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // Can't find the http server if (httpserver.Length == 0 || blacklisted) - return new OSDMap(); + return new LLSDMap(); MapRequestState mrs = new MapRequestState(); mrs.agentID = id; @@ -585,14 +585,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap WebRequest mapitemsrequest = WebRequest.Create(httpserver); mapitemsrequest.Method = "POST"; mapitemsrequest.ContentType = "application/xml+llsd"; - OSDMap RAMap = new OSDMap(); + LLSDMap RAMap = new LLSDMap(); // string RAMapString = RAMap.ToString(); - OSD LLSDofRAMap = RAMap; // RENAME if this works + LLSD LLSDofRAMap = RAMap; // RENAME if this works - byte[] buffer = OSDParser.SerializeLLSDXmlBytes(LLSDofRAMap); - OSDMap responseMap = new OSDMap(); - responseMap["requestID"] = OSD.FromUUID(requestID); + byte[] buffer = LLSDParser.SerializeXmlBytes(LLSDofRAMap); + LLSDMap responseMap = new LLSDMap(); + responseMap["requestID"] = LLSD.FromUUID(requestID); Stream os = null; try @@ -606,7 +606,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap catch (WebException ex) { m_log.InfoFormat("[WorldMap] Bad send on GetMapItems {0}", ex.Message); - responseMap["connect"] = OSD.FromBoolean(false); + responseMap["connect"] = LLSD.FromBoolean(false); lock (m_blacklistedurls) { if (!m_blacklistedurls.ContainsKey(httpserver)) @@ -630,12 +630,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } else { - return new OSDMap(); + return new LLSDMap(); } } catch (WebException) { - responseMap["connect"] = OSD.FromBoolean(false); + responseMap["connect"] = LLSD.FromBoolean(false); lock (m_blacklistedurls) { if (!m_blacklistedurls.ContainsKey(httpserver)) @@ -646,18 +646,18 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap return responseMap; } - OSD rezResponse = null; + LLSD rezResponse = null; try { - rezResponse = OSDParser.DeserializeLLSDXml(response_mapItems_reply); + rezResponse = LLSDParser.DeserializeXml(response_mapItems_reply); - responseMap = (OSDMap)rezResponse; - responseMap["requestID"] = OSD.FromUUID(requestID); + responseMap = (LLSDMap)rezResponse; + responseMap["requestID"] = LLSD.FromUUID(requestID); } catch (Exception) { //m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); - responseMap["connect"] = OSD.FromBoolean(false); + responseMap["connect"] = LLSD.FromBoolean(false); return responseMap; } @@ -793,57 +793,57 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap return null; } - public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint) + public LLSD HandleRemoteMapItemRequest(string path, LLSD request, string endpoint) { uint xstart = 0; uint ystart = 0; - Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart); + Helpers.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart); - OSDMap responsemap = new OSDMap(); + LLSDMap responsemap = new LLSDMap(); List avatars = m_scene.GetAvatars(); - OSDArray responsearr = new OSDArray(avatars.Count); - OSDMap responsemapdata = new OSDMap(); + LLSDArray responsearr = new LLSDArray(avatars.Count); + LLSDMap responsemapdata = new LLSDMap(); int tc = System.Environment.TickCount; /* foreach (ScenePresence av in avatars) { - responsemapdata = new OSDMap(); - responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); - responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); - responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); - responsemapdata["Name"] = OSD.FromString("TH"); - responsemapdata["Extra"] = OSD.FromInteger(0); - responsemapdata["Extra2"] = OSD.FromInteger(0); + responsemapdata = new LLSDMap(); + responsemapdata["X"] = LLSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); + responsemapdata["Y"] = LLSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); + responsemapdata["ID"] = LLSD.FromUUID(UUID.Zero); + responsemapdata["Name"] = LLSD.FromString("TH"); + responsemapdata["Extra"] = LLSD.FromInteger(0); + responsemapdata["Extra2"] = LLSD.FromInteger(0); responsearr.Add(responsemapdata); } responsemap["1"] = responsearr; */ if (avatars.Count == 0) { - responsemapdata = new OSDMap(); - responsemapdata["X"] = OSD.FromInteger((int)(xstart + 1)); - responsemapdata["Y"] = OSD.FromInteger((int)(ystart + 1)); - responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); - responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); - responsemapdata["Extra"] = OSD.FromInteger(0); - responsemapdata["Extra2"] = OSD.FromInteger(0); + responsemapdata = new LLSDMap(); + responsemapdata["X"] = LLSD.FromInteger((int)(xstart + 1)); + responsemapdata["Y"] = LLSD.FromInteger((int)(ystart + 1)); + responsemapdata["ID"] = LLSD.FromUUID(UUID.Zero); + responsemapdata["Name"] = LLSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); + responsemapdata["Extra"] = LLSD.FromInteger(0); + responsemapdata["Extra2"] = LLSD.FromInteger(0); responsearr.Add(responsemapdata); responsemap["6"] = responsearr; } else { - responsearr = new OSDArray(avatars.Count); + responsearr = new LLSDArray(avatars.Count); foreach (ScenePresence av in avatars) { - responsemapdata = new OSDMap(); - responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); - responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); - responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); - responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); - responsemapdata["Extra"] = OSD.FromInteger(1); - responsemapdata["Extra2"] = OSD.FromInteger(0); + responsemapdata = new LLSDMap(); + responsemapdata["X"] = LLSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); + responsemapdata["Y"] = LLSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); + responsemapdata["ID"] = LLSD.FromUUID(UUID.Zero); + responsemapdata["Name"] = LLSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); + responsemapdata["Extra"] = LLSD.FromInteger(1); + responsemapdata["Extra2"] = LLSD.FromInteger(0); responsearr.Add(responsemapdata); } responsemap["6"] = responsearr; diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 324e38c..79d79ef 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -31,6 +31,7 @@ using System.Reflection; using System.Text; using System.Timers; using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 8167c68..3948d31 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -36,7 +36,7 @@ using log4net; using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Region.Interfaces; -using OSD = OpenMetaverse.StructuredData.OSD; +using LLSD = OpenMetaverse.StructuredData.LLSD; namespace OpenSim.Region.Environment.Scenes { @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes IEventQueue eq = avatar.Scene.RequestModuleInterface(); if (eq != null) { - OSD Item = EventQueueHelper.EnableSimulator(regionHandle, endPoint); + LLSD Item = EventQueueHelper.EnableSimulator(regionHandle, endPoint); eq.Enqueue(Item, avatar.UUID); } else @@ -698,7 +698,7 @@ namespace OpenSim.Region.Environment.Scenes if (eq != null) { - OSD Item = EventQueueHelper.TeleportFinishEvent(reg.RegionHandle, 13, reg.ExternalEndPoint, + LLSD Item = EventQueueHelper.TeleportFinishEvent(reg.RegionHandle, 13, reg.ExternalEndPoint, 4, teleportFlags, capsPath, avatar.UUID); eq.Enqueue(Item, avatar.UUID); } @@ -748,7 +748,7 @@ namespace OpenSim.Region.Environment.Scenes // and set the map-tile to '(Offline)' uint regX, regY; - Utils.LongToUInts(regionHandle, out regX, out regY); + Helpers.LongToUInts(regionHandle, out regX, out regY); MapBlockData block = new MapBlockData(); block.X = (ushort)(regX / Constants.RegionSize); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index ba638e5..1309e77 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -584,11 +584,11 @@ namespace OpenSim.Region.Environment.Scenes invString.AddPermissionsStart(); - invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); - invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); - invString.AddNameValueLine("group_mask", Utils.UIntToHexString(0)); - invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); - invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); + invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(baseMask)); + invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(ownerMask)); + invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(0)); + invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(everyoneMask)); + invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextPermissions)); invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); invString.AddNameValueLine("owner_id", ownerID.ToString()); @@ -601,7 +601,7 @@ namespace OpenSim.Region.Environment.Scenes invString.AddNameValueLine("asset_id", item.AssetID.ToString()); invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); - invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); + invString.AddNameValueLine("flags", Helpers.UIntToHexString(item.Flags)); invString.AddSaleStart(); invString.AddNameValueLine("sale_type", "not"); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index c7862ec..227a941 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1089,9 +1089,9 @@ if (m_shape != null) { data[pos] = (byte)pTexAnim.SizeX; pos++; data[pos] = (byte)pTexAnim.SizeY; pos++; - Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); - Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); - Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); + Helpers.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); + Helpers.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); + Helpers.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); m_TextureAnimation = data; } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 19f0f9c..19532e6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -39,7 +39,7 @@ using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Types; using OpenSim.Region.Interfaces; using OpenSim.Region.Physics.Manager; -using OSD = OpenMetaverse.StructuredData.OSD; +using LLSD = OpenMetaverse.StructuredData.LLSD; namespace OpenSim.Region.Environment.Scenes @@ -2171,7 +2171,7 @@ namespace OpenSim.Region.Environment.Scenes } Vector3 vel = m_velocity; - ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); + ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); if (neighbourRegion != null && ValidateAttachments()) { @@ -2209,7 +2209,7 @@ namespace OpenSim.Region.Environment.Scenes if (eq != null) { - OSD Item = EventQueueHelper.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, + LLSD Item = EventQueueHelper.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, capsPath, UUID, ControllingClient.SessionId); eq.Enqueue(Item, UUID); } diff --git a/OpenSim/Region/Interfaces/IEventQueue.cs b/OpenSim/Region/Interfaces/IEventQueue.cs index 5c327d9..42fdcae 100644 --- a/OpenSim/Region/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Interfaces/IEventQueue.cs @@ -36,6 +36,6 @@ namespace OpenSim.Region.Interfaces { public interface IEventQueue { - bool Enqueue(OSD o, UUID avatarID); + bool Enqueue(LLSD o, UUID avatarID); } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs index eeca143..9cdd006 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs @@ -29,9 +29,6 @@ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; -using System.Security; -using System.Security.Policy; -using System.Security.Permissions; using OpenSim.Region.ScriptEngine.Interfaces; using OpenSim.Region.ScriptEngine.Shared.ScriptBase; @@ -135,9 +132,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; + AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads); - m_scriptEngine.Log.Info("[" + m_scriptEngine.ScriptEngineName + "]: AppDomain Loading: " + AssemblyName.GetAssemblyName( diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 98d4f3b..e5dfb2b 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -30,7 +30,6 @@ using System.IO; using System.Threading; using System.Collections; using System.Collections.Generic; -using System.Security; using System.Security.Policy; using System.Reflection; using System.Globalization; @@ -541,7 +540,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine AppDomain.CreateDomain( m_Scene.RegionInfo.RegionID.ToString(), evidence, appSetup); - + m_AppDomains[appDomain].AssemblyResolve += new ResolveEventHandler( AssemblyResolver.OnAssemblyResolve); -- cgit v1.1