diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
11 files changed, 404 insertions, 516 deletions
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 | |||
176 | { | 176 | { |
177 | ITextureSender sender = null; | 177 | ITextureSender sender = null; |
178 | 178 | ||
179 | // try | 179 | try |
180 | // { | 180 | { |
181 | while (true) | 181 | while (true) |
182 | { | 182 | { |
183 | try | 183 | sender = m_queueSenders.Dequeue(); |
184 | |||
185 | if (sender.Cancel) | ||
184 | { | 186 | { |
185 | sender = m_queueSenders.Dequeue(); | 187 | TextureSent(sender); |
186 | 188 | ||
187 | if (sender.Cancel) | 189 | sender.Cancel = false; |
190 | } | ||
191 | else | ||
192 | { | ||
193 | bool finished = sender.SendTexturePacket(); | ||
194 | if (finished) | ||
188 | { | 195 | { |
189 | TextureSent(sender); | 196 | TextureSent(sender); |
190 | |||
191 | sender.Cancel = false; | ||
192 | } | 197 | } |
193 | else | 198 | else |
194 | { | 199 | { |
195 | bool finished = sender.SendTexturePacket(); | 200 | m_queueSenders.Enqueue(sender); |
196 | if (finished) | ||
197 | { | ||
198 | TextureSent(sender); | ||
199 | } | ||
200 | else | ||
201 | { | ||
202 | m_queueSenders.Enqueue(sender); | ||
203 | } | ||
204 | } | 201 | } |
202 | } | ||
205 | 203 | ||
206 | // Make sure that any sender we currently have can get garbage collected | 204 | // Make sure that any sender we currently have can get garbage collected |
207 | sender = null; | 205 | sender = null; |
208 | 206 | ||
209 | //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); | 207 | //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); |
210 | } | ||
211 | catch(Exception e) | ||
212 | { | ||
213 | m_log.ErrorFormat( | ||
214 | "[TEXTURE]: Texture send thread caught exception. The texture send was aborted. Exception is {0}", e); | ||
215 | } | ||
216 | } | 208 | } |
217 | // } | 209 | } |
218 | // catch (Exception e) | 210 | catch (Exception e) |
219 | // { | 211 | { |
220 | // // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened | 212 | // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened |
221 | // m_log.ErrorFormat( | 213 | m_log.ErrorFormat( |
222 | // "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", | 214 | "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", |
223 | // e); | 215 | e); |
224 | // } | 216 | } |
225 | } | 217 | } |
226 | 218 | ||
227 | /// <summary> | 219 | /// <summary> |
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 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using log4net; | 29 | using log4net; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenMetaverse.Packets; | ||
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
32 | using OpenSim.Region.Environment.Interfaces; | 33 | using OpenSim.Region.Environment.Interfaces; |
33 | 34 | ||
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 | |||
57 | /// <summary> | 57 | /// <summary> |
58 | /// We will allow the client to request the same texture n times before dropping further requests | 58 | /// We will allow the client to request the same texture n times before dropping further requests |
59 | /// | 59 | /// |
60 | /// This number contains repeated requests for the same texture at different resolutions (which | 60 | /// This number includes repeated requests for the same texture at different resolutions (which we don't |
61 | /// are handled since r7368). However, this situation should be handled in a more sophisticated way. | 61 | /// currently handle properly as far as I know). However, this situation should be handled in a more |
62 | /// sophisticated way. | ||
62 | /// </summary> | 63 | /// </summary> |
63 | private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 15; | 64 | private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5; |
64 | 65 | ||
65 | /// <summary> | 66 | /// <summary> |
66 | /// XXX Also going to limit requests for found textures. | 67 | /// XXX Also going to limit requests for found textures. |
@@ -149,7 +150,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
149 | 150 | ||
150 | m_scene.AddPendingDownloads(1); | 151 | m_scene.AddPendingDownloads(1); |
151 | 152 | ||
152 | TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber, e.Priority); | 153 | TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); |
153 | m_textureSenders.Add(e.RequestedAssetID, requestHandler); | 154 | m_textureSenders.Add(e.RequestedAssetID, requestHandler); |
154 | 155 | ||
155 | m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true); | 156 | 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 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using OpenMetaverse.Packets; | ||
30 | using log4net; | 31 | using log4net; |
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
32 | using OpenSim.Region.Environment.Interfaces; | 33 | using OpenSim.Region.Environment.Interfaces; |
33 | 34 | ||
34 | namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | 35 | namespace OpenSim.Region.Environment.Modules.Agent.TextureSender |
35 | { | 36 | { |
36 | public class ImageDownload | 37 | /// <summary> |
38 | /// A TextureSender handles the process of receiving a texture requested by the client from the | ||
39 | /// AssetCache, and then sending that texture back to the client. | ||
40 | /// </summary> | ||
41 | public class TextureSender : ITextureSender | ||
37 | { | 42 | { |
38 | public const int FIRST_IMAGE_PACKET_SIZE = 600; | 43 | private static readonly ILog m_log |
39 | public const int IMAGE_PACKET_SIZE = 1000; | 44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | |||
41 | public OpenMetaverse.AssetTexture Texture; | ||
42 | public int DiscardLevel; | ||
43 | public float Priority; | ||
44 | public int CurrentPacket; | ||
45 | public int StopPacket; | ||
46 | |||
47 | public ImageDownload(OpenMetaverse.AssetTexture texture, int discardLevel, float priority, int packet) | ||
48 | { | ||
49 | Texture = texture; | ||
50 | Update(discardLevel, priority, packet); | ||
51 | } | ||
52 | |||
53 | /// <summary> | ||
54 | /// Updates an image transfer with new information and recalculates | ||
55 | /// offsets | ||
56 | /// </summary> | ||
57 | /// <param name="discardLevel">New requested discard level</param> | ||
58 | /// <param name="priority">New requested priority</param> | ||
59 | /// <param name="packet">New requested packet offset</param> | ||
60 | public void Update(int discardLevel, float priority, int packet) | ||
61 | { | ||
62 | Priority = priority; | ||
63 | DiscardLevel = Clamp(discardLevel, 0, Texture.LayerInfo.Length - 1); | ||
64 | StopPacket = GetPacketForBytePosition(Texture.LayerInfo[(Texture.LayerInfo.Length - 1) - DiscardLevel].End); | ||
65 | CurrentPacket = Clamp(packet, 1, TexturePacketCount()); | ||
66 | } | ||
67 | |||
68 | /// <summary> | ||
69 | /// Returns the total number of packets needed to transfer this texture, | ||
70 | /// including the first packet of size FIRST_IMAGE_PACKET_SIZE | ||
71 | /// </summary> | ||
72 | /// <returns>Total number of packets needed to transfer this texture</returns> | ||
73 | public int TexturePacketCount() | ||
74 | { | ||
75 | return ((Texture.AssetData.Length - FIRST_IMAGE_PACKET_SIZE + IMAGE_PACKET_SIZE - 1) / IMAGE_PACKET_SIZE) + 1; | ||
76 | } | ||
77 | 45 | ||
78 | /// <summary> | 46 | /// <summary> |
79 | /// Returns the current byte offset for this transfer, calculated from | 47 | /// Records the number of times texture send has been called. |
80 | /// the CurrentPacket | ||
81 | /// </summary> | 48 | /// </summary> |
82 | /// <returns>Current byte offset for this transfer</returns> | 49 | public int counter = 0; |
83 | public int CurrentBytePosition() | ||
84 | { | ||
85 | return FIRST_IMAGE_PACKET_SIZE + (CurrentPacket - 1) * IMAGE_PACKET_SIZE; | ||
86 | } | ||
87 | 50 | ||
88 | /// <summary> | 51 | public bool ImageLoaded = false; |
89 | /// Returns the size, in bytes, of the last packet. This will be somewhere | ||
90 | /// between 1 and IMAGE_PACKET_SIZE bytes | ||
91 | /// </summary> | ||
92 | /// <returns>Size of the last packet in the transfer</returns> | ||
93 | public int LastPacketSize() | ||
94 | { | ||
95 | return Texture.AssetData.Length - (FIRST_IMAGE_PACKET_SIZE + ((TexturePacketCount() - 2) * IMAGE_PACKET_SIZE)); | ||
96 | } | ||
97 | 52 | ||
98 | /// <summary> | 53 | /// <summary> |
99 | /// Find the packet number that contains a given byte position | 54 | /// Holds the texture asset to send. |
100 | /// </summary> | 55 | /// </summary> |
101 | /// <param name="bytePosition">Byte position</param> | 56 | private AssetBase m_asset; |
102 | /// <returns>Packet number that contains the given byte position</returns> | ||
103 | int GetPacketForBytePosition(int bytePosition) | ||
104 | { | ||
105 | return ((bytePosition - FIRST_IMAGE_PACKET_SIZE + IMAGE_PACKET_SIZE - 1) / IMAGE_PACKET_SIZE); | ||
106 | } | ||
107 | 57 | ||
108 | /// <summary> | 58 | //public UUID assetID { get { return m_asset.FullID; } } |
109 | /// Clamp a given value between a range | ||
110 | /// </summary> | ||
111 | /// <param name="value">Value to clamp</param> | ||
112 | /// <param name="min">Minimum allowable value</param> | ||
113 | /// <param name="max">Maximum allowable value</param> | ||
114 | /// <returns>A value inclusively between lower and upper</returns> | ||
115 | static int Clamp(int value, int min, int max) | ||
116 | { | ||
117 | // First we check to see if we're greater than the max | ||
118 | value = (value > max) ? max : value; | ||
119 | 59 | ||
120 | // Then we check to see if we're less than the min. | 60 | // private bool m_cancel = false; |
121 | value = (value < min) ? min : value; | ||
122 | 61 | ||
123 | // There's no check to see if min > max. | 62 | // See ITextureSender |
124 | return value; | ||
125 | } | ||
126 | } | ||
127 | 63 | ||
128 | /// <summary> | 64 | // private bool m_sending = false; |
129 | /// A TextureSender handles the process of receiving a texture requested by the client from the | ||
130 | /// AssetCache, and then sending that texture back to the client. | ||
131 | /// </summary> | ||
132 | public class TextureSender : ITextureSender | ||
133 | { | ||
134 | private static readonly ILog m_log | ||
135 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
136 | 65 | ||
137 | public bool ImageLoaded = false; | 66 | /// <summary> |
67 | /// This is actually the number of extra packets required to send the texture data! We always assume | ||
68 | /// at least one is required. | ||
69 | /// </summary> | ||
70 | private int NumPackets = 0; | ||
138 | 71 | ||
139 | /// <summary> | 72 | /// <summary> |
140 | /// Holds the texture asset to send. | 73 | /// Holds the packet number to send next. In this case, each packet is 1000 bytes long and starts |
74 | /// at the 600th byte (0th indexed). | ||
141 | /// </summary> | 75 | /// </summary> |
142 | private AssetBase m_asset; | 76 | private int PacketCounter = 0; |
143 | private bool m_cancel = false; | ||
144 | private bool m_sending = false; | ||
145 | private bool sendFirstPacket = false; | ||
146 | private int initialDiscardLevel = 0; | ||
147 | private int initialPacketNum = 0; | ||
148 | private float initialPriority = 0.0f; | ||
149 | 77 | ||
150 | private ImageDownload download; | 78 | private int RequestedDiscardLevel = -1; |
151 | private IClientAPI RequestUser; | 79 | private IClientAPI RequestUser; |
80 | private uint StartPacketNumber = 0; | ||
152 | 81 | ||
153 | public TextureSender(IClientAPI client, int discardLevel, uint packetNumber, float priority) | 82 | public TextureSender(IClientAPI client, int discardLevel, uint packetNumber) |
154 | { | 83 | { |
155 | RequestUser = client; | 84 | RequestUser = client; |
156 | initialDiscardLevel = discardLevel; | 85 | RequestedDiscardLevel = discardLevel; |
157 | initialPacketNum = (int)packetNumber; | 86 | StartPacketNumber = packetNumber; |
158 | initialPriority = priority; | ||
159 | } | 87 | } |
160 | 88 | ||
161 | #region ITextureSender Members | 89 | #region ITextureSender Members |
162 | 90 | ||
163 | public bool Cancel | 91 | public bool Cancel |
164 | { | 92 | { |
165 | get { return m_cancel; } | 93 | get { return false; } |
166 | set { m_cancel = value; } | 94 | set |
95 | { | ||
96 | // m_cancel = value; | ||
97 | } | ||
167 | } | 98 | } |
168 | 99 | ||
169 | public bool Sending | 100 | public bool Sending |
170 | { | 101 | { |
171 | get { return m_sending; } | 102 | get { return false; } |
172 | set { m_sending = value; } | 103 | set |
104 | { | ||
105 | // m_sending = value; | ||
106 | } | ||
173 | } | 107 | } |
174 | 108 | ||
175 | // See ITextureSender | 109 | // See ITextureSender |
176 | public void UpdateRequest(int discardLevel, uint packetNumber) | 110 | public void UpdateRequest(int discardLevel, uint packetNumber) |
177 | { | 111 | { |
178 | if (download == null) | 112 | RequestedDiscardLevel = discardLevel; |
179 | return; | 113 | StartPacketNumber = packetNumber; |
180 | 114 | PacketCounter = (int) StartPacketNumber; | |
181 | lock (download) | ||
182 | { | ||
183 | if (discardLevel < download.DiscardLevel) | ||
184 | m_log.DebugFormat("Image download {0} is changing from DiscardLevel {1} to {2}", | ||
185 | m_asset.FullID, download.DiscardLevel, discardLevel); | ||
186 | |||
187 | if (packetNumber != download.CurrentPacket) | ||
188 | m_log.DebugFormat("Image download {0} is changing from Packet {1} to {2}", | ||
189 | m_asset.FullID, download.CurrentPacket, packetNumber); | ||
190 | |||
191 | download.Update(discardLevel, download.Priority, (int)packetNumber); | ||
192 | |||
193 | sendFirstPacket = true; | ||
194 | } | ||
195 | } | 115 | } |
196 | 116 | ||
197 | // See ITextureSender | 117 | // See ITextureSender |
198 | public bool SendTexturePacket() | 118 | public bool SendTexturePacket() |
199 | { | 119 | { |
200 | if (download != null && !m_cancel && (sendFirstPacket || download.CurrentPacket <= download.StopPacket)) | 120 | //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID); |
201 | { | 121 | |
202 | SendPacket(); | 122 | SendPacket(); |
203 | return false; | 123 | counter++; |
204 | } | 124 | if ((NumPackets == 0) || (RequestedDiscardLevel == -1) || (PacketCounter > NumPackets) || |
205 | else | 125 | ((RequestedDiscardLevel > 0) && (counter > 50 + (NumPackets / (RequestedDiscardLevel + 1))))) |
206 | { | 126 | { |
207 | m_sending = false; | ||
208 | m_cancel = true; | ||
209 | sendFirstPacket = false; | ||
210 | return true; | 127 | return true; |
211 | } | 128 | } |
129 | return false; | ||
212 | } | 130 | } |
213 | 131 | ||
214 | #endregion | 132 | #endregion |
@@ -222,52 +140,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
222 | public void TextureReceived(AssetBase asset) | 140 | public void TextureReceived(AssetBase asset) |
223 | { | 141 | { |
224 | m_asset = asset; | 142 | m_asset = asset; |
225 | 143 | NumPackets = CalculateNumPackets(asset.Data.Length); | |
226 | try | 144 | PacketCounter = (int) StartPacketNumber; |
227 | { | 145 | ImageLoaded = true; |
228 | OpenMetaverse.AssetTexture texture = new OpenMetaverse.AssetTexture(m_asset.FullID, m_asset.Data); | ||
229 | if (texture.DecodeLayerBoundaries()) | ||
230 | { | ||
231 | bool sane = true; | ||
232 | |||
233 | // Sanity check all of the layers | ||
234 | for (int i = 0; i < texture.LayerInfo.Length; i++) | ||
235 | { | ||
236 | if (texture.LayerInfo[i].End > texture.AssetData.Length) | ||
237 | { | ||
238 | sane = false; | ||
239 | break; | ||
240 | } | ||
241 | } | ||
242 | |||
243 | if (sane) | ||
244 | { | ||
245 | download = new ImageDownload(texture, initialDiscardLevel, initialPriority, initialPacketNum); | ||
246 | ImageLoaded = true; | ||
247 | m_sending = true; | ||
248 | m_cancel = false; | ||
249 | sendFirstPacket = true; | ||
250 | return; | ||
251 | } | ||
252 | else | ||
253 | { | ||
254 | m_log.Error("JPEG2000 texture decoding succeeded, but sanity check failed for " + | ||
255 | m_asset.FullID.ToString()); | ||
256 | } | ||
257 | } | ||
258 | else | ||
259 | { | ||
260 | m_log.Error("JPEG2000 texture decoding failed for " + m_asset.FullID.ToString()); | ||
261 | } | ||
262 | } | ||
263 | catch (Exception ex) | ||
264 | { | ||
265 | m_log.Error("JPEG2000 texture decoding threw an exception for " + m_asset.FullID.ToString(), ex); | ||
266 | } | ||
267 | |||
268 | ImageLoaded = false; | ||
269 | m_sending = false; | ||
270 | m_cancel = true; | ||
271 | } | 146 | } |
272 | 147 | ||
273 | /// <summary> | 148 | /// <summary> |
@@ -275,48 +150,66 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender | |||
275 | /// </summary> | 150 | /// </summary> |
276 | private void SendPacket() | 151 | private void SendPacket() |
277 | { | 152 | { |
278 | lock (download) | 153 | if (PacketCounter <= NumPackets) |
279 | { | 154 | { |
280 | if (sendFirstPacket) | 155 | if (PacketCounter == 0) |
281 | { | 156 | { |
282 | sendFirstPacket = false; | 157 | if (NumPackets == 0) |
283 | |||
284 | if (m_asset.Data.Length <= ImageDownload.FIRST_IMAGE_PACKET_SIZE) | ||
285 | { | 158 | { |
286 | RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); | 159 | RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); |
287 | return; | 160 | PacketCounter++; |
288 | } | 161 | } |
289 | else | 162 | else |
290 | { | 163 | { |
291 | byte[] firstImageData = new byte[ImageDownload.FIRST_IMAGE_PACKET_SIZE]; | 164 | byte[] ImageData1 = new byte[600]; |
292 | try { Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, ImageDownload.FIRST_IMAGE_PACKET_SIZE); } | 165 | Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); |
293 | catch (Exception) | 166 | |
294 | { | 167 | RequestUser.SendImageFirstPart( |
295 | m_log.Error("Texture data copy failed on first packet for " + m_asset.FullID.ToString()); | 168 | (ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2); |
296 | m_cancel = true; | 169 | PacketCounter++; |
297 | m_sending = false; | ||
298 | return; | ||
299 | } | ||
300 | RequestUser.SendImageFirstPart((ushort)download.TexturePacketCount(), m_asset.FullID, (uint)m_asset.Data.Length, firstImageData, 2); | ||
301 | } | 170 | } |
302 | } | 171 | } |
303 | 172 | else | |
304 | int imagePacketSize = (download.CurrentPacket == download.TexturePacketCount() - 1) ? | ||
305 | download.LastPacketSize() : ImageDownload.IMAGE_PACKET_SIZE; | ||
306 | |||
307 | byte[] imageData = new byte[imagePacketSize]; | ||
308 | try { Buffer.BlockCopy(m_asset.Data, download.CurrentBytePosition(), imageData, 0, imagePacketSize); } | ||
309 | catch (Exception) | ||
310 | { | 173 | { |
311 | m_log.Error("Texture data copy failed for " + m_asset.FullID.ToString()); | 174 | int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1)); |
312 | m_cancel = true; | 175 | if (size > 1000) size = 1000; |
313 | m_sending = false; | 176 | byte[] imageData = new byte[size]; |
314 | return; | 177 | try |
178 | { | ||
179 | Array.Copy(m_asset.Data, 600 + (1000 * (PacketCounter - 1)), imageData, 0, size); | ||
180 | } | ||
181 | catch (ArgumentOutOfRangeException) | ||
182 | { | ||
183 | m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + | ||
184 | m_asset.FullID.ToString()); | ||
185 | return; | ||
186 | } | ||
187 | |||
188 | RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData); | ||
189 | PacketCounter++; | ||
315 | } | 190 | } |
191 | } | ||
192 | } | ||
316 | 193 | ||
317 | RequestUser.SendImageNextPart((ushort)download.CurrentPacket, m_asset.FullID, imageData); | 194 | /// <summary> |
318 | ++download.CurrentPacket; | 195 | /// Calculate the number of packets that will be required to send the texture loaded into this sender |
196 | /// This is actually the number of 1000 byte packets not including an initial 600 byte packet... | ||
197 | /// </summary> | ||
198 | /// <param name="length"></param> | ||
199 | /// <returns></returns> | ||
200 | private int CalculateNumPackets(int length) | ||
201 | { | ||
202 | int numPackets = 0; | ||
203 | |||
204 | if (length > 600) | ||
205 | { | ||
206 | //over 600 bytes so split up file | ||
207 | int restData = (length - 600); | ||
208 | int restPackets = ((restData + 999) / 1000); | ||
209 | numPackets = restPackets; | ||
319 | } | 210 | } |
211 | |||
212 | return numPackets; | ||
320 | } | 213 | } |
321 | } | 214 | } |
322 | } | 215 | } |
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 | |||
174 | { | 174 | { |
175 | // for now (testing) we only support files under 1000 bytes | 175 | // for now (testing) we only support files under 1000 bytes |
176 | byte[] transferData = new byte[Data.Length + 4]; | 176 | byte[] transferData = new byte[Data.Length + 4]; |
177 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); | 177 | Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); |
178 | Array.Copy(Data, 0, transferData, 4, Data.Length); | 178 | Array.Copy(Data, 0, transferData, 4, Data.Length); |
179 | Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); | 179 | Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); |
180 | 180 | ||
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer | |||
183 | else | 183 | else |
184 | { | 184 | { |
185 | byte[] transferData = new byte[1000 + 4]; | 185 | byte[] transferData = new byte[1000 + 4]; |
186 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); | 186 | Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); |
187 | Array.Copy(Data, 0, transferData, 4, 1000); | 187 | Array.Copy(Data, 0, transferData, 4, 1000); |
188 | Client.SendXferPacket(XferID, 0, transferData); | 188 | Client.SendXferPacket(XferID, 0, transferData); |
189 | Packet++; | 189 | 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; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenMetaverse.Packets; | ||
32 | using log4net; | 33 | using log4net; |
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using Nwc.XmlRpc; | 35 | 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; | |||
44 | using OpenSim.Region.Interfaces; | 44 | using OpenSim.Region.Interfaces; |
45 | using OpenSim.Region.Environment.Scenes; | 45 | using OpenSim.Region.Environment.Scenes; |
46 | 46 | ||
47 | using OSD = OpenMetaverse.StructuredData.OSD; | 47 | using LLSD = OpenMetaverse.StructuredData.LLSD; |
48 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 48 | using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; |
49 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | 49 | using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; |
50 | using Caps = OpenSim.Framework.Communications.Capabilities.Caps; | 50 | using Caps = OpenSim.Framework.Communications.Capabilities.Caps; |
51 | using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.OSD>; | 51 | using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.LLSD>; |
52 | 52 | ||
53 | namespace OpenSim.Region.Environment.Modules.Framework | 53 | namespace OpenSim.Region.Environment.Modules.Framework |
54 | { | 54 | { |
55 | public struct QueueItem | 55 | public struct QueueItem |
56 | { | 56 | { |
57 | public int id; | 57 | public int id; |
58 | public OSDMap body; | 58 | public LLSDMap body; |
59 | } | 59 | } |
60 | 60 | ||
61 | public class EventQueueGetModule : IEventQueue, IRegionModule | 61 | public class EventQueueGetModule : IEventQueue, IRegionModule |
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
146 | 146 | ||
147 | 147 | ||
148 | #region IEventQueue Members | 148 | #region IEventQueue Members |
149 | public bool Enqueue(OSD ev, UUID avatarID) | 149 | public bool Enqueue(LLSD ev, UUID avatarID) |
150 | { | 150 | { |
151 | m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); | 151 | m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); |
152 | try | 152 | try |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
308 | // } | 308 | // } |
309 | 309 | ||
310 | BlockingLLSDQueue queue = GetQueue(agentID); | 310 | BlockingLLSDQueue queue = GetQueue(agentID); |
311 | OSD element = queue.Dequeue(15000); // 15s timeout | 311 | LLSD element = queue.Dequeue(15000); // 15s timeout |
312 | 312 | ||
313 | Hashtable responsedata = new Hashtable(); | 313 | Hashtable responsedata = new Hashtable(); |
314 | 314 | ||
@@ -337,7 +337,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
337 | 337 | ||
338 | 338 | ||
339 | 339 | ||
340 | OSDArray array = new OSDArray(); | 340 | LLSDArray array = new LLSDArray(); |
341 | if (element == null) // didn't have an event in 15s | 341 | if (element == null) // didn't have an event in 15s |
342 | { | 342 | { |
343 | // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! | 343 | // 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 | |||
354 | } | 354 | } |
355 | } | 355 | } |
356 | 356 | ||
357 | OSDMap events = new OSDMap(); | 357 | LLSDMap events = new LLSDMap(); |
358 | events.Add("events", array); | 358 | events.Add("events", array); |
359 | 359 | ||
360 | events.Add("id", new OSDInteger(thisID)); | 360 | events.Add("id", new LLSDInteger(thisID)); |
361 | lock (m_ids) | 361 | lock (m_ids) |
362 | { | 362 | { |
363 | m_ids[agentID] = thisID + 1; | 363 | m_ids[agentID] = thisID + 1; |
@@ -366,7 +366,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
366 | responsedata["int_response_code"] = 200; | 366 | responsedata["int_response_code"] = 200; |
367 | responsedata["content_type"] = "application/xml"; | 367 | responsedata["content_type"] = "application/xml"; |
368 | responsedata["keepalive"] = false; | 368 | responsedata["keepalive"] = false; |
369 | responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); | 369 | responsedata["str_response_string"] = LLSDParser.SerializeXmlString(events); |
370 | m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); | 370 | m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); |
371 | 371 | ||
372 | return responsedata; | 372 | return responsedata; |
@@ -424,7 +424,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
424 | 424 | ||
425 | } | 425 | } |
426 | 426 | ||
427 | public OSD EventQueueFallBack(string path, OSD request, string endpoint) | 427 | public LLSD EventQueueFallBack(string path, LLSD request, string endpoint) |
428 | { | 428 | { |
429 | // This is a fallback element to keep the client from loosing EventQueueGet | 429 | // This is a fallback element to keep the client from loosing EventQueueGet |
430 | // Why does CAPS fail sometimes!? | 430 | // Why does CAPS fail sometimes!? |
@@ -473,7 +473,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
473 | thisID = m_ids[AvatarID]; | 473 | thisID = m_ids[AvatarID]; |
474 | 474 | ||
475 | BlockingLLSDQueue queue = GetQueue(AvatarID); | 475 | BlockingLLSDQueue queue = GetQueue(AvatarID); |
476 | OSDArray array = new OSDArray(); | 476 | LLSDArray array = new LLSDArray(); |
477 | LLSD element = queue.Dequeue(15000); // 15s timeout | 477 | LLSD element = queue.Dequeue(15000); // 15s timeout |
478 | if (element == null) | 478 | if (element == null) |
479 | { | 479 | { |
@@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
489 | thisID++; | 489 | thisID++; |
490 | } | 490 | } |
491 | } | 491 | } |
492 | OSDMap events = new OSDMap(); | 492 | LLSDMap events = new LLSDMap(); |
493 | events.Add("events", array); | 493 | events.Add("events", array); |
494 | 494 | ||
495 | events.Add("id", new LLSDInteger(thisID)); | 495 | events.Add("id", new LLSDInteger(thisID)); |
@@ -512,7 +512,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
512 | { | 512 | { |
513 | //return new LLSD(); | 513 | //return new LLSD(); |
514 | } | 514 | } |
515 | return new OSDString("shutdown404!"); | 515 | return new LLSDString("shutdown404!"); |
516 | } | 516 | } |
517 | } | 517 | } |
518 | } | 518 | } |
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 | |||
52 | }; | 52 | }; |
53 | } | 53 | } |
54 | 54 | ||
55 | public static OSD buildEvent(string eventName, OSD eventBody) | 55 | public static LLSD buildEvent(string eventName, LLSD eventBody) |
56 | { | 56 | { |
57 | OSDMap llsdEvent = new OSDMap(2); | 57 | LLSDMap llsdEvent = new LLSDMap(2); |
58 | llsdEvent.Add("message", new OSDString(eventName)); | 58 | llsdEvent.Add("message", new LLSDString(eventName)); |
59 | llsdEvent.Add("body", eventBody); | 59 | llsdEvent.Add("body", eventBody); |
60 | 60 | ||
61 | return llsdEvent; | 61 | return llsdEvent; |
62 | } | 62 | } |
63 | 63 | ||
64 | public static OSD EnableSimulator(ulong Handle, IPEndPoint endPoint) | 64 | public static LLSD EnableSimulator(ulong Handle, IPEndPoint endPoint) |
65 | { | 65 | { |
66 | OSDMap llsdSimInfo = new OSDMap(3); | 66 | LLSDMap llsdSimInfo = new LLSDMap(3); |
67 | 67 | ||
68 | llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle))); | 68 | llsdSimInfo.Add("Handle", new LLSDBinary(regionHandleToByteArray(Handle))); |
69 | llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); | 69 | llsdSimInfo.Add("IP", new LLSDBinary(endPoint.Address.GetAddressBytes())); |
70 | llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); | 70 | llsdSimInfo.Add("Port", new LLSDInteger(endPoint.Port)); |
71 | 71 | ||
72 | OSDArray arr = new OSDArray(1); | 72 | LLSDArray arr = new LLSDArray(1); |
73 | arr.Add(llsdSimInfo); | 73 | arr.Add(llsdSimInfo); |
74 | 74 | ||
75 | OSDMap llsdBody = new OSDMap(1); | 75 | LLSDMap llsdBody = new LLSDMap(1); |
76 | llsdBody.Add("SimulatorInfo", arr); | 76 | llsdBody.Add("SimulatorInfo", arr); |
77 | 77 | ||
78 | return buildEvent("EnableSimulator", llsdBody); | 78 | return buildEvent("EnableSimulator", llsdBody); |
79 | } | 79 | } |
80 | 80 | ||
81 | public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, | 81 | public static LLSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, |
82 | IPEndPoint newRegionExternalEndPoint, | 82 | IPEndPoint newRegionExternalEndPoint, |
83 | string capsURL, UUID AgentID, UUID SessionID) | 83 | string capsURL, UUID AgentID, UUID SessionID) |
84 | { | 84 | { |
85 | OSDArray LookAtArr = new OSDArray(3); | 85 | LLSDArray LookAtArr = new LLSDArray(3); |
86 | LookAtArr.Add(OSD.FromReal(lookAt.X)); | 86 | LookAtArr.Add(LLSD.FromReal(lookAt.X)); |
87 | LookAtArr.Add(OSD.FromReal(lookAt.Y)); | 87 | LookAtArr.Add(LLSD.FromReal(lookAt.Y)); |
88 | LookAtArr.Add(OSD.FromReal(lookAt.Z)); | 88 | LookAtArr.Add(LLSD.FromReal(lookAt.Z)); |
89 | 89 | ||
90 | OSDArray PositionArr = new OSDArray(3); | 90 | LLSDArray PositionArr = new LLSDArray(3); |
91 | PositionArr.Add(OSD.FromReal(pos.X)); | 91 | PositionArr.Add(LLSD.FromReal(pos.X)); |
92 | PositionArr.Add(OSD.FromReal(pos.Y)); | 92 | PositionArr.Add(LLSD.FromReal(pos.Y)); |
93 | PositionArr.Add(OSD.FromReal(pos.Z)); | 93 | PositionArr.Add(LLSD.FromReal(pos.Z)); |
94 | 94 | ||
95 | OSDMap InfoMap = new OSDMap(2); | 95 | LLSDMap InfoMap = new LLSDMap(2); |
96 | InfoMap.Add("LookAt", LookAtArr); | 96 | InfoMap.Add("LookAt", LookAtArr); |
97 | InfoMap.Add("Position", PositionArr); | 97 | InfoMap.Add("Position", PositionArr); |
98 | 98 | ||
99 | OSDArray InfoArr = new OSDArray(1); | 99 | LLSDArray InfoArr = new LLSDArray(1); |
100 | InfoArr.Add(InfoMap); | 100 | InfoArr.Add(InfoMap); |
101 | 101 | ||
102 | OSDMap AgentDataMap = new OSDMap(2); | 102 | LLSDMap AgentDataMap = new LLSDMap(2); |
103 | AgentDataMap.Add("AgentID", OSD.FromUUID(AgentID)); | 103 | AgentDataMap.Add("AgentID", LLSD.FromUUID(AgentID)); |
104 | AgentDataMap.Add("SessionID", OSD.FromUUID(SessionID)); | 104 | AgentDataMap.Add("SessionID", LLSD.FromUUID(SessionID)); |
105 | 105 | ||
106 | OSDArray AgentDataArr = new OSDArray(1); | 106 | LLSDArray AgentDataArr = new LLSDArray(1); |
107 | AgentDataArr.Add(AgentDataMap); | 107 | AgentDataArr.Add(AgentDataMap); |
108 | 108 | ||
109 | OSDMap RegionDataMap = new OSDMap(4); | 109 | LLSDMap RegionDataMap = new LLSDMap(4); |
110 | RegionDataMap.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(Handle))); | 110 | RegionDataMap.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(Handle))); |
111 | RegionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); | 111 | RegionDataMap.Add("SeedCapability", LLSD.FromString(capsURL)); |
112 | RegionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); | 112 | RegionDataMap.Add("SimIP", LLSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); |
113 | RegionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); | 113 | RegionDataMap.Add("SimPort", LLSD.FromInteger(newRegionExternalEndPoint.Port)); |
114 | 114 | ||
115 | OSDArray RegionDataArr = new OSDArray(1); | 115 | LLSDArray RegionDataArr = new LLSDArray(1); |
116 | RegionDataArr.Add(RegionDataMap); | 116 | RegionDataArr.Add(RegionDataMap); |
117 | 117 | ||
118 | OSDMap llsdBody = new OSDMap(3); | 118 | LLSDMap llsdBody = new LLSDMap(3); |
119 | llsdBody.Add("Info", InfoArr); | 119 | llsdBody.Add("Info", InfoArr); |
120 | llsdBody.Add("AgentData", AgentDataArr); | 120 | llsdBody.Add("AgentData", AgentDataArr); |
121 | llsdBody.Add("RegionData", RegionDataArr); | 121 | llsdBody.Add("RegionData", RegionDataArr); |
@@ -123,49 +123,49 @@ namespace OpenSim.Region.Environment | |||
123 | return buildEvent("CrossedRegion", llsdBody); | 123 | return buildEvent("CrossedRegion", llsdBody); |
124 | } | 124 | } |
125 | 125 | ||
126 | public static OSD TeleportFinishEvent( | 126 | public static LLSD TeleportFinishEvent( |
127 | ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, | 127 | ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, |
128 | uint locationID, uint flags, string capsURL, UUID AgentID) | 128 | uint locationID, uint flags, string capsURL, UUID AgentID) |
129 | { | 129 | { |
130 | OSDMap info = new OSDMap(); | 130 | LLSDMap info = new LLSDMap(); |
131 | info.Add("AgentID", OSD.FromUUID(AgentID)); | 131 | info.Add("AgentID", LLSD.FromUUID(AgentID)); |
132 | info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? | 132 | info.Add("LocationID", LLSD.FromInteger(4)); // TODO what is this? |
133 | info.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(regionHandle))); | 133 | info.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(regionHandle))); |
134 | info.Add("SeedCapability", OSD.FromString(capsURL)); | 134 | info.Add("SeedCapability", LLSD.FromString(capsURL)); |
135 | info.Add("SimAccess", OSD.FromInteger(simAccess)); | 135 | info.Add("SimAccess", LLSD.FromInteger(simAccess)); |
136 | info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); | 136 | info.Add("SimIP", LLSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); |
137 | info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); | 137 | info.Add("SimPort", LLSD.FromInteger(regionExternalEndPoint.Port)); |
138 | info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation | 138 | info.Add("TeleportFlags", LLSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation |
139 | 139 | ||
140 | OSDArray infoArr = new OSDArray(); | 140 | LLSDArray infoArr = new LLSDArray(); |
141 | infoArr.Add(info); | 141 | infoArr.Add(info); |
142 | 142 | ||
143 | OSDMap body = new OSDMap(); | 143 | LLSDMap body = new LLSDMap(); |
144 | body.Add("Info", infoArr); | 144 | body.Add("Info", infoArr); |
145 | 145 | ||
146 | return buildEvent("TeleportFinish", body); | 146 | return buildEvent("TeleportFinish", body); |
147 | } | 147 | } |
148 | 148 | ||
149 | public static OSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono) | 149 | public static LLSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono) |
150 | { | 150 | { |
151 | OSDMap script = new OSDMap(); | 151 | LLSDMap script = new LLSDMap(); |
152 | script.Add("ObjectID", OSD.FromUUID(objectID)); | 152 | script.Add("ObjectID", LLSD.FromUUID(objectID)); |
153 | script.Add("ItemID", OSD.FromUUID(itemID)); | 153 | script.Add("ItemID", LLSD.FromUUID(itemID)); |
154 | script.Add("Running", OSD.FromBoolean(running)); | 154 | script.Add("Running", LLSD.FromBoolean(running)); |
155 | script.Add("Mono", OSD.FromBoolean(mono)); | 155 | script.Add("Mono", LLSD.FromBoolean(mono)); |
156 | 156 | ||
157 | OSDArray scriptArr = new OSDArray(); | 157 | LLSDArray scriptArr = new LLSDArray(); |
158 | scriptArr.Add(script); | 158 | scriptArr.Add(script); |
159 | 159 | ||
160 | OSDMap body = new OSDMap(); | 160 | LLSDMap body = new LLSDMap(); |
161 | body.Add("Script", scriptArr); | 161 | body.Add("Script", scriptArr); |
162 | 162 | ||
163 | return buildEvent("ScriptRunningReply", body); | 163 | return buildEvent("ScriptRunningReply", body); |
164 | } | 164 | } |
165 | 165 | ||
166 | public static OSD KeepAliveEvent() | 166 | public static LLSD KeepAliveEvent() |
167 | { | 167 | { |
168 | return buildEvent("FAKEEVENT", new OSDMap()); | 168 | return buildEvent("FAKEEVENT", new LLSDMap()); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | } | 171 | } |
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; | |||
46 | using OpenSim.Region.Environment.Interfaces; | 46 | using OpenSim.Region.Environment.Interfaces; |
47 | using OpenSim.Region.Environment.Scenes; | 47 | using OpenSim.Region.Environment.Scenes; |
48 | 48 | ||
49 | using OSD = OpenMetaverse.StructuredData.OSD; | 49 | using LLSD = OpenMetaverse.StructuredData.LLSD; |
50 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 50 | using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; |
51 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | 51 | using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; |
52 | 52 | ||
53 | namespace OpenSim.Region.Environment.Modules.InterGrid | 53 | namespace OpenSim.Region.Environment.Modules.InterGrid |
54 | { | 54 | { |
@@ -218,7 +218,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
218 | 218 | ||
219 | #endregion | 219 | #endregion |
220 | 220 | ||
221 | public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) | 221 | public LLSD ProcessRegionDomainSeed(string path, LLSD request, string endpoint) |
222 | { | 222 | { |
223 | string[] pathSegments = path.Split('/'); | 223 | string[] pathSegments = path.Split('/'); |
224 | 224 | ||
@@ -234,11 +234,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
234 | 234 | ||
235 | //m_log.InfoFormat("[OGP]: path {0}, segments {1} segment[1] {2} Last segment {3}", | 235 | //m_log.InfoFormat("[OGP]: path {0}, segments {1} segment[1] {2} Last segment {3}", |
236 | // path, pathSegments.Length, pathSegments[1], pathSegments[pathSegments.Length - 1]); | 236 | // path, pathSegments.Length, pathSegments[1], pathSegments[pathSegments.Length - 1]); |
237 | //return new OSDMap(); | 237 | //return new LLSDMap(); |
238 | 238 | ||
239 | } | 239 | } |
240 | 240 | ||
241 | public OSD ProcessAgentDomainMessage(string path, OSD request, string endpoint) | 241 | public LLSD ProcessAgentDomainMessage(string path, LLSD request, string endpoint) |
242 | { | 242 | { |
243 | // /agent/* | 243 | // /agent/* |
244 | 244 | ||
@@ -288,7 +288,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
288 | //return null; | 288 | //return null; |
289 | } | 289 | } |
290 | 290 | ||
291 | private OSD GenerateRezAvatarRequestMessage(string regionname) | 291 | private LLSD GenerateRezAvatarRequestMessage(string regionname) |
292 | { | 292 | { |
293 | Scene region = null; | 293 | Scene region = null; |
294 | bool usedroot = false; | 294 | bool usedroot = false; |
@@ -319,7 +319,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
319 | 319 | ||
320 | RegionInfo reg = region.RegionInfo; | 320 | RegionInfo reg = region.RegionInfo; |
321 | 321 | ||
322 | OSDMap responseMap = new OSDMap(); | 322 | LLSDMap responseMap = new LLSDMap(); |
323 | string rezHttpProtocol = "http://"; | 323 | string rezHttpProtocol = "http://"; |
324 | //string regionCapsHttpProtocol = "http://"; | 324 | //string regionCapsHttpProtocol = "http://"; |
325 | string httpaddr = reg.ExternalHostName; | 325 | string httpaddr = reg.ExternalHostName; |
@@ -347,9 +347,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
347 | httpaddr = httpsCN; | 347 | httpaddr = httpsCN; |
348 | } | 348 | } |
349 | 349 | ||
350 | responseMap["connect"] = OSD.FromBoolean(true); | 350 | responseMap["connect"] = LLSD.FromBoolean(true); |
351 | OSDMap capabilitiesMap = new OSDMap(); | 351 | LLSDMap capabilitiesMap = new LLSDMap(); |
352 | capabilitiesMap["rez_avatar/request"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + requestpath); | 352 | capabilitiesMap["rez_avatar/request"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + requestpath); |
353 | responseMap["capabilities"] = capabilitiesMap; | 353 | responseMap["capabilities"] = capabilitiesMap; |
354 | 354 | ||
355 | return responseMap; | 355 | return responseMap; |
@@ -376,11 +376,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
376 | } | 376 | } |
377 | 377 | ||
378 | 378 | ||
379 | public OSD RequestRezAvatarMethod(string path, OSD request) | 379 | public LLSD RequestRezAvatarMethod(string path, LLSD request) |
380 | { | 380 | { |
381 | //System.Console.WriteLine("[REQUESTREZAVATAR]: " + request.ToString()); | 381 | //System.Console.WriteLine("[REQUESTREZAVATAR]: " + request.ToString()); |
382 | 382 | ||
383 | OSDMap requestMap = (OSDMap)request; | 383 | LLSDMap requestMap = (LLSDMap)request; |
384 | 384 | ||
385 | 385 | ||
386 | Scene homeScene = null; | 386 | Scene homeScene = null; |
@@ -441,27 +441,27 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
441 | 441 | ||
442 | UpdateOGPState(LocalAgentID, userState); | 442 | UpdateOGPState(LocalAgentID, userState); |
443 | 443 | ||
444 | OSDMap responseMap = new OSDMap(); | 444 | LLSDMap responseMap = new LLSDMap(); |
445 | 445 | ||
446 | if (RemoteAgentID == UUID.Zero) | 446 | if (RemoteAgentID == UUID.Zero) |
447 | { | 447 | { |
448 | responseMap["connect"] = OSD.FromBoolean(false); | 448 | responseMap["connect"] = LLSD.FromBoolean(false); |
449 | responseMap["message"] = OSD.FromString("No agent ID was specified in rez_avatar/request"); | 449 | responseMap["message"] = LLSD.FromString("No agent ID was specified in rez_avatar/request"); |
450 | m_log.Error("[OGP]: rez_avatar/request failed because no avatar UUID was provided in the request body"); | 450 | m_log.Error("[OGP]: rez_avatar/request failed because no avatar UUID was provided in the request body"); |
451 | return responseMap; | 451 | return responseMap; |
452 | } | 452 | } |
453 | 453 | ||
454 | responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName); | 454 | responseMap["sim_host"] = LLSD.FromString(reg.ExternalHostName); |
455 | 455 | ||
456 | // DEPRECIATED | 456 | // DEPRECIATED |
457 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); | 457 | responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); |
458 | 458 | ||
459 | responseMap["connect"] = OSD.FromBoolean(true); | 459 | responseMap["connect"] = LLSD.FromBoolean(true); |
460 | responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port); | 460 | responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); |
461 | responseMap["region_x"] = OSD.FromInteger(reg.RegionLocX * (uint)Constants.RegionSize); // LLX | 461 | responseMap["region_x"] = LLSD.FromInteger(reg.RegionLocX * (uint)Constants.RegionSize); // LLX |
462 | responseMap["region_y"] = OSD.FromInteger(reg.RegionLocY * (uint)Constants.RegionSize); // LLY | 462 | responseMap["region_y"] = LLSD.FromInteger(reg.RegionLocY * (uint)Constants.RegionSize); // LLY |
463 | responseMap["region_id"] = OSD.FromUUID(reg.originRegionID); | 463 | responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); |
464 | responseMap["sim_access"] = OSD.FromString((reg.RegionSettings.Maturity == 1) ? "Mature" : "PG"); | 464 | responseMap["sim_access"] = LLSD.FromString((reg.RegionSettings.Maturity == 1) ? "Mature" : "PG"); |
465 | 465 | ||
466 | // Generate a dummy agent for the user so we can get back a CAPS path | 466 | // Generate a dummy agent for the user so we can get back a CAPS path |
467 | AgentCircuitData agentData = new AgentCircuitData(); | 467 | AgentCircuitData agentData = new AgentCircuitData(); |
@@ -575,14 +575,14 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
575 | 575 | ||
576 | 576 | ||
577 | // DEPRECIATED | 577 | // DEPRECIATED |
578 | responseMap["seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); | 578 | responseMap["seed_capability"] = LLSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); |
579 | 579 | ||
580 | // REPLACEMENT | 580 | // REPLACEMENT |
581 | responseMap["region_seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); | 581 | responseMap["region_seed_capability"] = LLSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); |
582 | 582 | ||
583 | responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 583 | responseMap["rez_avatar"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
584 | responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 584 | responseMap["rez_avatar/rez"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
585 | responseMap["rez_avatar/derez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + derezAvatarPath); | 585 | responseMap["rez_avatar/derez"] = LLSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + derezAvatarPath); |
586 | 586 | ||
587 | // Add the user to the list of CAPS that are outstanding. | 587 | // Add the user to the list of CAPS that are outstanding. |
588 | // well allow the caps hosts in this dictionary | 588 | // well allow the caps hosts in this dictionary |
@@ -605,27 +605,27 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
605 | return responseMap; | 605 | return responseMap; |
606 | } | 606 | } |
607 | 607 | ||
608 | public OSD RezAvatarMethod(string path, OSD request) | 608 | public LLSD RezAvatarMethod(string path, LLSD request) |
609 | { | 609 | { |
610 | m_log.WarnFormat("[REZAVATAR]: {0}", request.ToString()); | 610 | m_log.WarnFormat("[REZAVATAR]: {0}", request.ToString()); |
611 | 611 | ||
612 | OSDMap responseMap = new OSDMap(); | 612 | LLSDMap responseMap = new LLSDMap(); |
613 | 613 | ||
614 | AgentCircuitData userData = null; | 614 | AgentCircuitData userData = null; |
615 | 615 | ||
616 | // Only people we've issued a cap can go further | 616 | // Only people we've issued a cap can go further |
617 | if (TryGetAgentCircuitData(path,out userData)) | 617 | if (TryGetAgentCircuitData(path,out userData)) |
618 | { | 618 | { |
619 | OSDMap requestMap = (OSDMap)request; | 619 | LLSDMap requestMap = (LLSDMap)request; |
620 | 620 | ||
621 | // take these values to start. There's a few more | 621 | // take these values to start. There's a few more |
622 | UUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); | 622 | UUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); |
623 | UUID SessionID = requestMap["session_id"].AsUUID(); | 623 | UUID SessionID = requestMap["session_id"].AsUUID(); |
624 | int circuitcode = requestMap["circuit_code"].AsInteger(); | 624 | int circuitcode = requestMap["circuit_code"].AsInteger(); |
625 | OSDArray Parameter = new OSDArray(); | 625 | LLSDArray Parameter = new LLSDArray(); |
626 | if (requestMap.ContainsKey("parameter")) | 626 | if (requestMap.ContainsKey("parameter")) |
627 | { | 627 | { |
628 | Parameter = (OSDArray)requestMap["parameter"]; | 628 | Parameter = (LLSDArray)((LLSD)requestMap["parameter"]); |
629 | } | 629 | } |
630 | 630 | ||
631 | //int version = 1; | 631 | //int version = 1; |
@@ -636,7 +636,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
636 | 636 | ||
637 | for (int i = 0; i < Parameter.Count; i++) | 637 | for (int i = 0; i < Parameter.Count; i++) |
638 | { | 638 | { |
639 | OSDMap item = (OSDMap)Parameter[i]; | 639 | LLSDMap item = (LLSDMap)Parameter[i]; |
640 | // if (item.ContainsKey("version")) | 640 | // if (item.ContainsKey("version")) |
641 | // { | 641 | // { |
642 | // version = item["version"].AsInteger(); | 642 | // version = item["version"].AsInteger(); |
@@ -714,15 +714,15 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
714 | RegionInfo reg = homeScene.RegionInfo; | 714 | RegionInfo reg = homeScene.RegionInfo; |
715 | 715 | ||
716 | // Dummy positional and look at info.. we don't have it. | 716 | // Dummy positional and look at info.. we don't have it. |
717 | OSDArray PositionArray = new OSDArray(); | 717 | LLSDArray PositionArray = new LLSDArray(); |
718 | PositionArray.Add(OSD.FromInteger(128)); | 718 | PositionArray.Add(LLSD.FromInteger(128)); |
719 | PositionArray.Add(OSD.FromInteger(128)); | 719 | PositionArray.Add(LLSD.FromInteger(128)); |
720 | PositionArray.Add(OSD.FromInteger(40)); | 720 | PositionArray.Add(LLSD.FromInteger(40)); |
721 | 721 | ||
722 | OSDArray LookAtArray = new OSDArray(); | 722 | LLSDArray LookAtArray = new LLSDArray(); |
723 | LookAtArray.Add(OSD.FromInteger(1)); | 723 | LookAtArray.Add(LLSD.FromInteger(1)); |
724 | LookAtArray.Add(OSD.FromInteger(1)); | 724 | LookAtArray.Add(LLSD.FromInteger(1)); |
725 | LookAtArray.Add(OSD.FromInteger(1)); | 725 | LookAtArray.Add(LLSD.FromInteger(1)); |
726 | 726 | ||
727 | // Our region's X and Y position in OpenSimulator space. | 727 | // Our region's X and Y position in OpenSimulator space. |
728 | uint fooX = reg.RegionLocX; | 728 | uint fooX = reg.RegionLocX; |
@@ -732,31 +732,31 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
732 | m_log.InfoFormat("[OGO]: region UUID {0} ", reg.RegionID); | 732 | m_log.InfoFormat("[OGO]: region UUID {0} ", reg.RegionID); |
733 | 733 | ||
734 | // Convert the X and Y position to LL space | 734 | // Convert the X and Y position to LL space |
735 | responseMap["region_x"] = OSD.FromInteger(fooX * (uint)Constants.RegionSize); // convert it to LL X | 735 | responseMap["region_x"] = LLSD.FromInteger(fooX * (uint)Constants.RegionSize); // convert it to LL X |
736 | responseMap["region_y"] = OSD.FromInteger(fooY * (uint)Constants.RegionSize); // convert it to LL Y | 736 | responseMap["region_y"] = LLSD.FromInteger(fooY * (uint)Constants.RegionSize); // convert it to LL Y |
737 | 737 | ||
738 | // Give em a new seed capability | 738 | // Give em a new seed capability |
739 | responseMap["seed_capability"] = OSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); | 739 | responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); |
740 | responseMap["region"] = OSD.FromUUID(reg.originRegionID); | 740 | responseMap["region"] = LLSD.FromUUID(reg.originRegionID); |
741 | responseMap["look_at"] = LookAtArray; | 741 | responseMap["look_at"] = LookAtArray; |
742 | 742 | ||
743 | responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port); | 743 | responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); |
744 | responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString()); | 744 | responseMap["sim_host"] = LLSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString()); |
745 | 745 | ||
746 | // DEPRECIATED | 746 | // DEPRECIATED |
747 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); | 747 | responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); |
748 | 748 | ||
749 | responseMap["session_id"] = OSD.FromUUID(SessionID); | 749 | responseMap["session_id"] = LLSD.FromUUID(SessionID); |
750 | responseMap["secure_session_id"] = OSD.FromUUID(SecureSessionID); | 750 | responseMap["secure_session_id"] = LLSD.FromUUID(SecureSessionID); |
751 | responseMap["circuit_code"] = OSD.FromInteger(circuitcode); | 751 | responseMap["circuit_code"] = LLSD.FromInteger(circuitcode); |
752 | 752 | ||
753 | responseMap["position"] = PositionArray; | 753 | responseMap["position"] = PositionArray; |
754 | 754 | ||
755 | responseMap["region_id"] = OSD.FromUUID(reg.originRegionID); | 755 | responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); |
756 | 756 | ||
757 | responseMap["sim_access"] = OSD.FromString("Mature"); | 757 | responseMap["sim_access"] = LLSD.FromString("Mature"); |
758 | 758 | ||
759 | responseMap["connect"] = OSD.FromBoolean(true); | 759 | responseMap["connect"] = LLSD.FromBoolean(true); |
760 | 760 | ||
761 | 761 | ||
762 | 762 | ||
@@ -767,12 +767,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
767 | return responseMap; | 767 | return responseMap; |
768 | } | 768 | } |
769 | 769 | ||
770 | public OSD DerezAvatarMethod(string path, OSD request) | 770 | public LLSD DerezAvatarMethod(string path, LLSD request) |
771 | { | 771 | { |
772 | m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString()); | 772 | m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString()); |
773 | 773 | ||
774 | //LLSD llsdResponse = null; | 774 | //LLSD llsdResponse = null; |
775 | OSDMap responseMap = new OSDMap(); | 775 | LLSDMap responseMap = new LLSDMap(); |
776 | 776 | ||
777 | string[] PathArray = path.Split('/'); | 777 | string[] PathArray = path.Split('/'); |
778 | m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]); | 778 | 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 | |||
790 | OGPState userState = GetOGPState(LocalID); | 790 | OGPState userState = GetOGPState(LocalID); |
791 | if (userState.agent_id != UUID.Zero) | 791 | if (userState.agent_id != UUID.Zero) |
792 | { | 792 | { |
793 | //OSDMap outboundRequestMap = new OSDMap(); | 793 | //LLSDMap outboundRequestMap = new LLSDMap(); |
794 | OSDMap inboundRequestMap = (OSDMap)request; | 794 | LLSDMap inboundRequestMap = (LLSDMap)request; |
795 | string rezAvatarString = inboundRequestMap["rez_avatar"].AsString(); | 795 | string rezAvatarString = inboundRequestMap["rez_avatar"].AsString(); |
796 | if (rezAvatarString.Length == 0) | 796 | if (rezAvatarString.Length == 0) |
797 | { | 797 | { |
798 | rezAvatarString = inboundRequestMap["rez_avatar/rez"].AsString(); | 798 | rezAvatarString = inboundRequestMap["rez_avatar/rez"].AsString(); |
799 | } | 799 | } |
800 | OSDArray LookAtArray = new OSDArray(); | 800 | LLSDArray LookAtArray = new LLSDArray(); |
801 | LookAtArray.Add(OSD.FromInteger(1)); | 801 | LookAtArray.Add(LLSD.FromInteger(1)); |
802 | LookAtArray.Add(OSD.FromInteger(1)); | 802 | LookAtArray.Add(LLSD.FromInteger(1)); |
803 | LookAtArray.Add(OSD.FromInteger(1)); | 803 | LookAtArray.Add(LLSD.FromInteger(1)); |
804 | 804 | ||
805 | OSDArray PositionArray = new OSDArray(); | 805 | LLSDArray PositionArray = new LLSDArray(); |
806 | PositionArray.Add(OSD.FromInteger(128)); | 806 | PositionArray.Add(LLSD.FromInteger(128)); |
807 | PositionArray.Add(OSD.FromInteger(128)); | 807 | PositionArray.Add(LLSD.FromInteger(128)); |
808 | PositionArray.Add(OSD.FromInteger(40)); | 808 | PositionArray.Add(LLSD.FromInteger(40)); |
809 | 809 | ||
810 | OSDArray lookArray = new OSDArray(); | 810 | LLSDArray lookArray = new LLSDArray(); |
811 | lookArray.Add(OSD.FromInteger(128)); | 811 | lookArray.Add(LLSD.FromInteger(128)); |
812 | lookArray.Add(OSD.FromInteger(128)); | 812 | lookArray.Add(LLSD.FromInteger(128)); |
813 | lookArray.Add(OSD.FromInteger(40)); | 813 | lookArray.Add(LLSD.FromInteger(40)); |
814 | 814 | ||
815 | responseMap["connect"] = OSD.FromBoolean(true);// it's okay to give this user up | 815 | responseMap["connect"] = LLSD.FromBoolean(true);// it's okay to give this user up |
816 | responseMap["look_at"] = LookAtArray; | 816 | responseMap["look_at"] = LookAtArray; |
817 | 817 | ||
818 | m_log.WarnFormat("[OGP]: Invoking rez_avatar on host:{0} for avatar: {1} {2}", rezAvatarString, userState.first_name, userState.last_name); | 818 | m_log.WarnFormat("[OGP]: Invoking rez_avatar on host:{0} for avatar: {1} {2}", rezAvatarString, userState.first_name, userState.last_name); |
819 | 819 | ||
820 | OSDMap rezResponseMap = invokeRezAvatarCap(responseMap, rezAvatarString,userState); | 820 | LLSDMap rezResponseMap = invokeRezAvatarCap(responseMap, rezAvatarString,userState); |
821 | 821 | ||
822 | // If invoking it returned an error, parse and end | 822 | // If invoking it returned an error, parse and end |
823 | if (rezResponseMap.ContainsKey("connect")) | 823 | if (rezResponseMap.ContainsKey("connect")) |
@@ -852,34 +852,34 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
852 | int rrY = rezResponseMap["region_y"].AsInteger(); | 852 | int rrY = rezResponseMap["region_y"].AsInteger(); |
853 | m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY); | 853 | m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY); |
854 | UUID rrRID = rezResponseMap["region_id"].AsUUID(); | 854 | UUID rrRID = rezResponseMap["region_id"].AsUUID(); |
855 | OSDArray RezResponsePositionArray = null; | 855 | LLSDArray RezResponsePositionArray = null; |
856 | string rrAccess = rezResponseMap["sim_access"].AsString(); | 856 | string rrAccess = rezResponseMap["sim_access"].AsString(); |
857 | if (rezResponseMap.ContainsKey("position")) | 857 | if (rezResponseMap.ContainsKey("position")) |
858 | { | 858 | { |
859 | RezResponsePositionArray = (OSDArray)rezResponseMap["position"]; | 859 | RezResponsePositionArray = (LLSDArray)rezResponseMap["position"]; |
860 | } | 860 | } |
861 | // DEPRECIATED | 861 | // DEPRECIATED |
862 | responseMap["seed_capability"] = OSD.FromString(rezRespSeedCap); | 862 | responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap); |
863 | 863 | ||
864 | // REPLACEMENT r3 | 864 | // REPLACEMENT r3 |
865 | responseMap["region_seed_capability"] = OSD.FromString(rezRespSeedCap); | 865 | responseMap["region_seed_capability"] = LLSD.FromString(rezRespSeedCap); |
866 | 866 | ||
867 | // DEPRECIATED | 867 | // DEPRECIATED |
868 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); | 868 | responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); |
869 | 869 | ||
870 | responseMap["sim_host"] = OSD.FromString(rezRespSim_host); | 870 | responseMap["sim_host"] = LLSD.FromString(rezRespSim_host); |
871 | responseMap["sim_port"] = OSD.FromInteger(rrPort); | 871 | responseMap["sim_port"] = LLSD.FromInteger(rrPort); |
872 | responseMap["region_x"] = OSD.FromInteger(rrX ); | 872 | responseMap["region_x"] = LLSD.FromInteger(rrX ); |
873 | responseMap["region_y"] = OSD.FromInteger(rrY ); | 873 | responseMap["region_y"] = LLSD.FromInteger(rrY ); |
874 | responseMap["region_id"] = OSD.FromUUID(rrRID); | 874 | responseMap["region_id"] = LLSD.FromUUID(rrRID); |
875 | responseMap["sim_access"] = OSD.FromString(rrAccess); | 875 | responseMap["sim_access"] = LLSD.FromString(rrAccess); |
876 | 876 | ||
877 | if (RezResponsePositionArray != null) | 877 | if (RezResponsePositionArray != null) |
878 | { | 878 | { |
879 | responseMap["position"] = RezResponsePositionArray; | 879 | responseMap["position"] = RezResponsePositionArray; |
880 | } | 880 | } |
881 | responseMap["look_at"] = lookArray; | 881 | responseMap["look_at"] = lookArray; |
882 | responseMap["connect"] = OSD.FromBoolean(true); | 882 | responseMap["connect"] = LLSD.FromBoolean(true); |
883 | 883 | ||
884 | ShutdownConnection(LocalID,this); | 884 | ShutdownConnection(LocalID,this); |
885 | // PLEASE STOP CHANGING THIS TO an M_LOG, M_LOG DOESN'T WORK ON MULTILINE .TOSTRINGS | 885 | // 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 | |||
899 | //return responseMap; | 899 | //return responseMap; |
900 | } | 900 | } |
901 | 901 | ||
902 | private OSDMap invokeRezAvatarCap(OSDMap responseMap, string CapAddress, OGPState userState) | 902 | private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState) |
903 | { | 903 | { |
904 | Scene reg = GetRootScene(); | 904 | Scene reg = GetRootScene(); |
905 | 905 | ||
@@ -907,38 +907,38 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
907 | DeRezRequest.Method = "POST"; | 907 | DeRezRequest.Method = "POST"; |
908 | DeRezRequest.ContentType = "application/xml+llsd"; | 908 | DeRezRequest.ContentType = "application/xml+llsd"; |
909 | 909 | ||
910 | OSDMap RAMap = new OSDMap(); | 910 | LLSDMap RAMap = new LLSDMap(); |
911 | OSDMap AgentParms = new OSDMap(); | 911 | LLSDMap AgentParms = new LLSDMap(); |
912 | OSDMap RegionParms = new OSDMap(); | 912 | LLSDMap RegionParms = new LLSDMap(); |
913 | 913 | ||
914 | OSDArray Parameter = new OSDArray(2); | 914 | LLSDArray Parameter = new LLSDArray(2); |
915 | 915 | ||
916 | OSDMap version = new OSDMap(); | 916 | LLSDMap version = new LLSDMap(); |
917 | version["version"] = OSD.FromInteger(userState.src_version); | 917 | version["version"] = LLSD.FromInteger(userState.src_version); |
918 | Parameter.Add(version); | 918 | Parameter.Add((LLSD)version); |
919 | 919 | ||
920 | OSDMap SrcData = new OSDMap(); | 920 | LLSDMap SrcData = new LLSDMap(); |
921 | SrcData["estate_id"] = OSD.FromInteger(reg.RegionInfo.EstateSettings.EstateID); | 921 | SrcData["estate_id"] = LLSD.FromInteger(reg.RegionInfo.EstateSettings.EstateID); |
922 | SrcData["parent_estate_id"] = OSD.FromInteger((reg.RegionInfo.EstateSettings.ParentEstateID == 100 ? 1 : reg.RegionInfo.EstateSettings.ParentEstateID)); | 922 | SrcData["parent_estate_id"] = LLSD.FromInteger((reg.RegionInfo.EstateSettings.ParentEstateID == 100 ? 1 : reg.RegionInfo.EstateSettings.ParentEstateID)); |
923 | SrcData["region_id"] = OSD.FromUUID(reg.RegionInfo.originRegionID); | 923 | SrcData["region_id"] = LLSD.FromUUID(reg.RegionInfo.originRegionID); |
924 | SrcData["visible_to_parent"] = OSD.FromBoolean(userState.visible_to_parent); | 924 | SrcData["visible_to_parent"] = LLSD.FromBoolean(userState.visible_to_parent); |
925 | Parameter.Add(SrcData); | 925 | Parameter.Add((LLSD)SrcData); |
926 | 926 | ||
927 | AgentParms["first_name"] = OSD.FromString(userState.first_name); | 927 | AgentParms["first_name"] = LLSD.FromString(userState.first_name); |
928 | AgentParms["last_name"] = OSD.FromString(userState.last_name); | 928 | AgentParms["last_name"] = LLSD.FromString(userState.last_name); |
929 | AgentParms["agent_id"] = OSD.FromUUID(userState.agent_id); | 929 | AgentParms["agent_id"] = LLSD.FromUUID(userState.agent_id); |
930 | RegionParms["region_id"] = OSD.FromUUID(userState.region_id); | 930 | RegionParms["region_id"] = LLSD.FromUUID(userState.region_id); |
931 | AgentParms["circuit_code"] = OSD.FromInteger(userState.circuit_code); | 931 | AgentParms["circuit_code"] = LLSD.FromInteger(userState.circuit_code); |
932 | AgentParms["secure_session_id"] = OSD.FromUUID(userState.secure_session_id); | 932 | AgentParms["secure_session_id"] = LLSD.FromUUID(userState.secure_session_id); |
933 | AgentParms["session_id"] = OSD.FromUUID(userState.session_id); | 933 | AgentParms["session_id"] = LLSD.FromUUID(userState.session_id); |
934 | AgentParms["agent_access"] = OSD.FromBoolean(userState.agent_access); | 934 | AgentParms["agent_access"] = LLSD.FromBoolean(userState.agent_access); |
935 | AgentParms["god_level"] = OSD.FromInteger(userState.god_level); | 935 | AgentParms["god_level"] = LLSD.FromInteger(userState.god_level); |
936 | AgentParms["god_overide"] = OSD.FromBoolean(userState.god_overide); | 936 | AgentParms["god_overide"] = LLSD.FromBoolean(userState.god_overide); |
937 | AgentParms["identified"] = OSD.FromBoolean(userState.identified); | 937 | AgentParms["identified"] = LLSD.FromBoolean(userState.identified); |
938 | AgentParms["transacted"] = OSD.FromBoolean(userState.transacted); | 938 | AgentParms["transacted"] = LLSD.FromBoolean(userState.transacted); |
939 | AgentParms["age_verified"] = OSD.FromBoolean(userState.age_verified); | 939 | AgentParms["age_verified"] = LLSD.FromBoolean(userState.age_verified); |
940 | AgentParms["limited_to_estate"] = OSD.FromInteger(userState.limited_to_estate); | 940 | AgentParms["limited_to_estate"] = LLSD.FromInteger(userState.limited_to_estate); |
941 | AgentParms["inventory_host"] = OSD.FromString(userState.inventory_host); | 941 | AgentParms["inventory_host"] = LLSD.FromString(userState.inventory_host); |
942 | 942 | ||
943 | // version 1 | 943 | // version 1 |
944 | RAMap = AgentParms; | 944 | RAMap = AgentParms; |
@@ -951,11 +951,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
951 | 951 | ||
952 | string RAMapString = RAMap.ToString(); | 952 | string RAMapString = RAMap.ToString(); |
953 | m_log.InfoFormat("[OGP] RAMap string {0}", RAMapString); | 953 | m_log.InfoFormat("[OGP] RAMap string {0}", RAMapString); |
954 | OSD LLSDofRAMap = RAMap; // RENAME if this works | 954 | LLSD LLSDofRAMap = RAMap; // RENAME if this works |
955 | 955 | ||
956 | m_log.InfoFormat("[OGP]: LLSD of map as string was {0}", LLSDofRAMap.ToString()); | 956 | m_log.InfoFormat("[OGP]: LLSD of map as string was {0}", LLSDofRAMap.ToString()); |
957 | //m_log.InfoFormat("[OGP]: LLSD+XML: {0}", LLSDParser.SerializeXmlString(LLSDofRAMap)); | 957 | //m_log.InfoFormat("[OGP]: LLSD+XML: {0}", LLSDParser.SerializeXmlString(LLSDofRAMap)); |
958 | byte[] buffer = OSDParser.SerializeLLSDXmlBytes(LLSDofRAMap); | 958 | byte[] buffer = LLSDParser.SerializeXmlBytes(LLSDofRAMap); |
959 | 959 | ||
960 | //string bufferDump = System.Text.Encoding.ASCII.GetString(buffer); | 960 | //string bufferDump = System.Text.Encoding.ASCII.GetString(buffer); |
961 | //m_log.InfoFormat("[OGP]: buffer form is {0}",bufferDump); | 961 | //m_log.InfoFormat("[OGP]: buffer form is {0}",bufferDump); |
@@ -973,7 +973,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
973 | catch (WebException ex) | 973 | catch (WebException ex) |
974 | { | 974 | { |
975 | m_log.InfoFormat("[OGP] Bad send on de_rez_avatar {0}", ex.Message); | 975 | m_log.InfoFormat("[OGP] Bad send on de_rez_avatar {0}", ex.Message); |
976 | responseMap["connect"] = OSD.FromBoolean(false); | 976 | responseMap["connect"] = LLSD.FromBoolean(false); |
977 | 977 | ||
978 | return responseMap; | 978 | return responseMap; |
979 | } | 979 | } |
@@ -997,21 +997,21 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
997 | catch (WebException ex) | 997 | catch (WebException ex) |
998 | { | 998 | { |
999 | m_log.InfoFormat("[OGP]: exception on read after send of rez avatar {0}", ex.Message); | 999 | m_log.InfoFormat("[OGP]: exception on read after send of rez avatar {0}", ex.Message); |
1000 | responseMap["connect"] = OSD.FromBoolean(false); | 1000 | responseMap["connect"] = LLSD.FromBoolean(false); |
1001 | 1001 | ||
1002 | return responseMap; | 1002 | return responseMap; |
1003 | } | 1003 | } |
1004 | OSD rezResponse = null; | 1004 | LLSD rezResponse = null; |
1005 | try | 1005 | try |
1006 | { | 1006 | { |
1007 | rezResponse = OSDParser.DeserializeLLSDXml(rez_avatar_reply); | 1007 | rezResponse = LLSDParser.DeserializeXml(rez_avatar_reply); |
1008 | 1008 | ||
1009 | responseMap = (OSDMap)rezResponse; | 1009 | responseMap = (LLSDMap)rezResponse; |
1010 | } | 1010 | } |
1011 | catch (Exception ex) | 1011 | catch (Exception ex) |
1012 | { | 1012 | { |
1013 | m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); | 1013 | m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); |
1014 | responseMap["connect"] = OSD.FromBoolean(false); | 1014 | responseMap["connect"] = LLSD.FromBoolean(false); |
1015 | 1015 | ||
1016 | return responseMap; | 1016 | return responseMap; |
1017 | } | 1017 | } |
@@ -1019,22 +1019,22 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
1019 | return responseMap; | 1019 | return responseMap; |
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | public OSD GenerateNoHandlerMessage() | 1022 | public LLSD GenerateNoHandlerMessage() |
1023 | { | 1023 | { |
1024 | OSDMap map = new OSDMap(); | 1024 | LLSDMap map = new LLSDMap(); |
1025 | map["reason"] = OSD.FromString("LLSDRequest"); | 1025 | map["reason"] = LLSD.FromString("LLSDRequest"); |
1026 | map["message"] = OSD.FromString("No handler registered for LLSD Requests"); | 1026 | map["message"] = LLSD.FromString("No handler registered for LLSD Requests"); |
1027 | map["login"] = OSD.FromString("false"); | 1027 | map["login"] = LLSD.FromString("false"); |
1028 | map["connect"] = OSD.FromString("false"); | 1028 | map["connect"] = LLSD.FromString("false"); |
1029 | return map; | 1029 | return map; |
1030 | } | 1030 | } |
1031 | public OSD GenerateNoStateMessage(UUID passedAvatar) | 1031 | public LLSD GenerateNoStateMessage(UUID passedAvatar) |
1032 | { | 1032 | { |
1033 | OSDMap map = new OSDMap(); | 1033 | LLSDMap map = new LLSDMap(); |
1034 | map["reason"] = OSD.FromString("derez failed"); | 1034 | map["reason"] = LLSD.FromString("derez failed"); |
1035 | map["message"] = OSD.FromString("Unable to locate OGP state for avatar " + passedAvatar.ToString()); | 1035 | map["message"] = LLSD.FromString("Unable to locate OGP state for avatar " + passedAvatar.ToString()); |
1036 | map["login"] = OSD.FromString("false"); | 1036 | map["login"] = LLSD.FromString("false"); |
1037 | map["connect"] = OSD.FromString("false"); | 1037 | map["connect"] = LLSD.FromString("false"); |
1038 | return map; | 1038 | return map; |
1039 | } | 1039 | } |
1040 | private bool TryGetAgentCircuitData(string path, out AgentCircuitData userdata) | 1040 | 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 | |||
369 | List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>(); | 369 | List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>(); |
370 | foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) | 370 | foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) |
371 | { | 371 | { |
372 | if (entry.Flags == (AccessList)flags) | 372 | if (entry.Flags == (AccessList) flags) |
373 | { | 373 | { |
374 | toRemove.Add(entry); | 374 | toRemove.Add(entry); |
375 | } | 375 | } |
@@ -384,7 +384,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
384 | ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry(); | 384 | ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry(); |
385 | temp.AgentID = entry.AgentID; | 385 | temp.AgentID = entry.AgentID; |
386 | temp.Time = new DateTime(); //Pointless? Yes. | 386 | temp.Time = new DateTime(); //Pointless? Yes. |
387 | temp.Flags = (AccessList)flags; | 387 | temp.Flags = (AccessList) flags; |
388 | 388 | ||
389 | if (!newData.ParcelAccessList.Contains(temp)) | 389 | if (!newData.ParcelAccessList.Contains(temp)) |
390 | { | 390 | { |
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; | |||
48 | using OpenSim.Region.Environment.Types; | 48 | using OpenSim.Region.Environment.Types; |
49 | using Caps = OpenSim.Framework.Communications.Capabilities.Caps; | 49 | using Caps = OpenSim.Framework.Communications.Capabilities.Caps; |
50 | 50 | ||
51 | using OSD = OpenMetaverse.StructuredData.OSD; | 51 | using LLSD = OpenMetaverse.StructuredData.LLSD; |
52 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 52 | using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; |
53 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | 53 | using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; |
54 | 54 | ||
55 | namespace OpenSim.Region.Environment.Modules.World.WorldMap | 55 | namespace OpenSim.Region.Environment.Modules.World.WorldMap |
56 | { | 56 | { |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
202 | } | 202 | } |
203 | } | 203 | } |
204 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); | 204 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); |
205 | mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); | 205 | mapResponse.LayerData.Array.Add(GetLLSDMapLayerResponse()); |
206 | return mapResponse.ToString(); | 206 | return mapResponse.ToString(); |
207 | } | 207 | } |
208 | 208 | ||
@@ -215,7 +215,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
215 | { | 215 | { |
216 | m_log.Debug("[CAPS]: MapLayer Request in region: " + m_scene.RegionInfo.RegionName); | 216 | m_log.Debug("[CAPS]: MapLayer Request in region: " + m_scene.RegionInfo.RegionName); |
217 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); | 217 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); |
218 | mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); | 218 | mapResponse.LayerData.Array.Add(GetLLSDMapLayerResponse()); |
219 | return mapResponse; | 219 | return mapResponse; |
220 | } | 220 | } |
221 | 221 | ||
@@ -223,9 +223,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
223 | /// | 223 | /// |
224 | /// </summary> | 224 | /// </summary> |
225 | /// <returns></returns> | 225 | /// <returns></returns> |
226 | protected static OSDMapLayer GetOSDMapLayerResponse() | 226 | protected static LLSDMapLayer GetLLSDMapLayerResponse() |
227 | { | 227 | { |
228 | OSDMapLayer mapLayer = new OSDMapLayer(); | 228 | LLSDMapLayer mapLayer = new LLSDMapLayer(); |
229 | mapLayer.Right = 5000; | 229 | mapLayer.Right = 5000; |
230 | mapLayer.Top = 5000; | 230 | mapLayer.Top = 5000; |
231 | mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006"); | 231 | mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006"); |
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
321 | } | 321 | } |
322 | uint xstart = 0; | 322 | uint xstart = 0; |
323 | uint ystart = 0; | 323 | uint ystart = 0; |
324 | Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart); | 324 | Helpers.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart); |
325 | if (itemtype == 6) // we only sevice 6 right now (avatar green dots) | 325 | if (itemtype == 6) // we only sevice 6 right now (avatar green dots) |
326 | { | 326 | { |
327 | if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle) | 327 | if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle) |
@@ -407,7 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
407 | 407 | ||
408 | if (dorequest) | 408 | if (dorequest) |
409 | { | 409 | { |
410 | OSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); | 410 | LLSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); |
411 | RequestMapItemsCompleted(response); | 411 | RequestMapItemsCompleted(response); |
412 | } | 412 | } |
413 | } | 413 | } |
@@ -433,8 +433,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
433 | /// <summary> | 433 | /// <summary> |
434 | /// Sends the mapitem response to the IClientAPI | 434 | /// Sends the mapitem response to the IClientAPI |
435 | /// </summary> | 435 | /// </summary> |
436 | /// <param name="response">The OSDMap Response for the mapitem</param> | 436 | /// <param name="response">The LLSDMap Response for the mapitem</param> |
437 | private void RequestMapItemsCompleted(OSDMap response) | 437 | private void RequestMapItemsCompleted(LLSDMap response) |
438 | { | 438 | { |
439 | UUID requestID = response["requestID"].AsUUID(); | 439 | UUID requestID = response["requestID"].AsUUID(); |
440 | 440 | ||
@@ -460,10 +460,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
460 | if (response.ContainsKey(mrs.itemtype.ToString())) | 460 | if (response.ContainsKey(mrs.itemtype.ToString())) |
461 | { | 461 | { |
462 | List<mapItemReply> returnitems = new List<mapItemReply>(); | 462 | List<mapItemReply> returnitems = new List<mapItemReply>(); |
463 | OSDArray itemarray = (OSDArray)response[mrs.itemtype.ToString()]; | 463 | LLSDArray itemarray = (LLSDArray)response[mrs.itemtype.ToString()]; |
464 | for (int i = 0; i < itemarray.Count; i++) | 464 | for (int i = 0; i < itemarray.Count; i++) |
465 | { | 465 | { |
466 | OSDMap mapitem = (OSDMap)itemarray[i]; | 466 | LLSDMap mapitem = (LLSDMap)itemarray[i]; |
467 | mapItemReply mi = new mapItemReply(); | 467 | mapItemReply mi = new mapItemReply(); |
468 | mi.x = (uint)mapitem["X"].AsInteger(); | 468 | mi.x = (uint)mapitem["X"].AsInteger(); |
469 | mi.y = (uint)mapitem["Y"].AsInteger(); | 469 | mi.y = (uint)mapitem["Y"].AsInteger(); |
@@ -517,7 +517,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
517 | /// <param name="itemtype">passed in from packet</param> | 517 | /// <param name="itemtype">passed in from packet</param> |
518 | /// <param name="regionhandle">Region we're looking up</param> | 518 | /// <param name="regionhandle">Region we're looking up</param> |
519 | /// <returns></returns> | 519 | /// <returns></returns> |
520 | private OSDMap RequestMapItemsAsync(string httpserver, UUID id, uint flags, | 520 | private LLSDMap RequestMapItemsAsync(string httpserver, UUID id, uint flags, |
521 | uint EstateID, bool godlike, uint itemtype, ulong regionhandle) | 521 | uint EstateID, bool godlike, uint itemtype, ulong regionhandle) |
522 | { | 522 | { |
523 | bool blacklisted = false; | 523 | bool blacklisted = false; |
@@ -528,7 +528,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
528 | } | 528 | } |
529 | 529 | ||
530 | if (blacklisted) | 530 | if (blacklisted) |
531 | return new OSDMap(); | 531 | return new LLSDMap(); |
532 | 532 | ||
533 | UUID requestID = UUID.Random(); | 533 | UUID requestID = UUID.Random(); |
534 | lock (m_cachedRegionMapItemsAddress) | 534 | lock (m_cachedRegionMapItemsAddress) |
@@ -569,7 +569,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
569 | 569 | ||
570 | // Can't find the http server | 570 | // Can't find the http server |
571 | if (httpserver.Length == 0 || blacklisted) | 571 | if (httpserver.Length == 0 || blacklisted) |
572 | return new OSDMap(); | 572 | return new LLSDMap(); |
573 | 573 | ||
574 | MapRequestState mrs = new MapRequestState(); | 574 | MapRequestState mrs = new MapRequestState(); |
575 | mrs.agentID = id; | 575 | mrs.agentID = id; |
@@ -585,14 +585,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
585 | WebRequest mapitemsrequest = WebRequest.Create(httpserver); | 585 | WebRequest mapitemsrequest = WebRequest.Create(httpserver); |
586 | mapitemsrequest.Method = "POST"; | 586 | mapitemsrequest.Method = "POST"; |
587 | mapitemsrequest.ContentType = "application/xml+llsd"; | 587 | mapitemsrequest.ContentType = "application/xml+llsd"; |
588 | OSDMap RAMap = new OSDMap(); | 588 | LLSDMap RAMap = new LLSDMap(); |
589 | 589 | ||
590 | // string RAMapString = RAMap.ToString(); | 590 | // string RAMapString = RAMap.ToString(); |
591 | OSD LLSDofRAMap = RAMap; // RENAME if this works | 591 | LLSD LLSDofRAMap = RAMap; // RENAME if this works |
592 | 592 | ||
593 | byte[] buffer = OSDParser.SerializeLLSDXmlBytes(LLSDofRAMap); | 593 | byte[] buffer = LLSDParser.SerializeXmlBytes(LLSDofRAMap); |
594 | OSDMap responseMap = new OSDMap(); | 594 | LLSDMap responseMap = new LLSDMap(); |
595 | responseMap["requestID"] = OSD.FromUUID(requestID); | 595 | responseMap["requestID"] = LLSD.FromUUID(requestID); |
596 | 596 | ||
597 | Stream os = null; | 597 | Stream os = null; |
598 | try | 598 | try |
@@ -606,7 +606,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
606 | catch (WebException ex) | 606 | catch (WebException ex) |
607 | { | 607 | { |
608 | m_log.InfoFormat("[WorldMap] Bad send on GetMapItems {0}", ex.Message); | 608 | m_log.InfoFormat("[WorldMap] Bad send on GetMapItems {0}", ex.Message); |
609 | responseMap["connect"] = OSD.FromBoolean(false); | 609 | responseMap["connect"] = LLSD.FromBoolean(false); |
610 | lock (m_blacklistedurls) | 610 | lock (m_blacklistedurls) |
611 | { | 611 | { |
612 | if (!m_blacklistedurls.ContainsKey(httpserver)) | 612 | if (!m_blacklistedurls.ContainsKey(httpserver)) |
@@ -630,12 +630,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
630 | } | 630 | } |
631 | else | 631 | else |
632 | { | 632 | { |
633 | return new OSDMap(); | 633 | return new LLSDMap(); |
634 | } | 634 | } |
635 | } | 635 | } |
636 | catch (WebException) | 636 | catch (WebException) |
637 | { | 637 | { |
638 | responseMap["connect"] = OSD.FromBoolean(false); | 638 | responseMap["connect"] = LLSD.FromBoolean(false); |
639 | lock (m_blacklistedurls) | 639 | lock (m_blacklistedurls) |
640 | { | 640 | { |
641 | if (!m_blacklistedurls.ContainsKey(httpserver)) | 641 | if (!m_blacklistedurls.ContainsKey(httpserver)) |
@@ -646,18 +646,18 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
646 | 646 | ||
647 | return responseMap; | 647 | return responseMap; |
648 | } | 648 | } |
649 | OSD rezResponse = null; | 649 | LLSD rezResponse = null; |
650 | try | 650 | try |
651 | { | 651 | { |
652 | rezResponse = OSDParser.DeserializeLLSDXml(response_mapItems_reply); | 652 | rezResponse = LLSDParser.DeserializeXml(response_mapItems_reply); |
653 | 653 | ||
654 | responseMap = (OSDMap)rezResponse; | 654 | responseMap = (LLSDMap)rezResponse; |
655 | responseMap["requestID"] = OSD.FromUUID(requestID); | 655 | responseMap["requestID"] = LLSD.FromUUID(requestID); |
656 | } | 656 | } |
657 | catch (Exception) | 657 | catch (Exception) |
658 | { | 658 | { |
659 | //m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); | 659 | //m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); |
660 | responseMap["connect"] = OSD.FromBoolean(false); | 660 | responseMap["connect"] = LLSD.FromBoolean(false); |
661 | 661 | ||
662 | return responseMap; | 662 | return responseMap; |
663 | } | 663 | } |
@@ -793,57 +793,57 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
793 | return null; | 793 | return null; |
794 | } | 794 | } |
795 | 795 | ||
796 | public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint) | 796 | public LLSD HandleRemoteMapItemRequest(string path, LLSD request, string endpoint) |
797 | { | 797 | { |
798 | uint xstart = 0; | 798 | uint xstart = 0; |
799 | uint ystart = 0; | 799 | uint ystart = 0; |
800 | 800 | ||
801 | Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart); | 801 | Helpers.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart); |
802 | 802 | ||
803 | OSDMap responsemap = new OSDMap(); | 803 | LLSDMap responsemap = new LLSDMap(); |
804 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 804 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
805 | OSDArray responsearr = new OSDArray(avatars.Count); | 805 | LLSDArray responsearr = new LLSDArray(avatars.Count); |
806 | OSDMap responsemapdata = new OSDMap(); | 806 | LLSDMap responsemapdata = new LLSDMap(); |
807 | int tc = System.Environment.TickCount; | 807 | int tc = System.Environment.TickCount; |
808 | /* | 808 | /* |
809 | foreach (ScenePresence av in avatars) | 809 | foreach (ScenePresence av in avatars) |
810 | { | 810 | { |
811 | responsemapdata = new OSDMap(); | 811 | responsemapdata = new LLSDMap(); |
812 | responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); | 812 | responsemapdata["X"] = LLSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); |
813 | responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); | 813 | responsemapdata["Y"] = LLSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); |
814 | responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); | 814 | responsemapdata["ID"] = LLSD.FromUUID(UUID.Zero); |
815 | responsemapdata["Name"] = OSD.FromString("TH"); | 815 | responsemapdata["Name"] = LLSD.FromString("TH"); |
816 | responsemapdata["Extra"] = OSD.FromInteger(0); | 816 | responsemapdata["Extra"] = LLSD.FromInteger(0); |
817 | responsemapdata["Extra2"] = OSD.FromInteger(0); | 817 | responsemapdata["Extra2"] = LLSD.FromInteger(0); |
818 | responsearr.Add(responsemapdata); | 818 | responsearr.Add(responsemapdata); |
819 | } | 819 | } |
820 | responsemap["1"] = responsearr; | 820 | responsemap["1"] = responsearr; |
821 | */ | 821 | */ |
822 | if (avatars.Count == 0) | 822 | if (avatars.Count == 0) |
823 | { | 823 | { |
824 | responsemapdata = new OSDMap(); | 824 | responsemapdata = new LLSDMap(); |
825 | responsemapdata["X"] = OSD.FromInteger((int)(xstart + 1)); | 825 | responsemapdata["X"] = LLSD.FromInteger((int)(xstart + 1)); |
826 | responsemapdata["Y"] = OSD.FromInteger((int)(ystart + 1)); | 826 | responsemapdata["Y"] = LLSD.FromInteger((int)(ystart + 1)); |
827 | responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); | 827 | responsemapdata["ID"] = LLSD.FromUUID(UUID.Zero); |
828 | responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); | 828 | responsemapdata["Name"] = LLSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); |
829 | responsemapdata["Extra"] = OSD.FromInteger(0); | 829 | responsemapdata["Extra"] = LLSD.FromInteger(0); |
830 | responsemapdata["Extra2"] = OSD.FromInteger(0); | 830 | responsemapdata["Extra2"] = LLSD.FromInteger(0); |
831 | responsearr.Add(responsemapdata); | 831 | responsearr.Add(responsemapdata); |
832 | 832 | ||
833 | responsemap["6"] = responsearr; | 833 | responsemap["6"] = responsearr; |
834 | } | 834 | } |
835 | else | 835 | else |
836 | { | 836 | { |
837 | responsearr = new OSDArray(avatars.Count); | 837 | responsearr = new LLSDArray(avatars.Count); |
838 | foreach (ScenePresence av in avatars) | 838 | foreach (ScenePresence av in avatars) |
839 | { | 839 | { |
840 | responsemapdata = new OSDMap(); | 840 | responsemapdata = new LLSDMap(); |
841 | responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); | 841 | responsemapdata["X"] = LLSD.FromInteger((int)(xstart + av.AbsolutePosition.X)); |
842 | responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); | 842 | responsemapdata["Y"] = LLSD.FromInteger((int)(ystart + av.AbsolutePosition.Y)); |
843 | responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); | 843 | responsemapdata["ID"] = LLSD.FromUUID(UUID.Zero); |
844 | responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); | 844 | responsemapdata["Name"] = LLSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString())); |
845 | responsemapdata["Extra"] = OSD.FromInteger(1); | 845 | responsemapdata["Extra"] = LLSD.FromInteger(1); |
846 | responsemapdata["Extra2"] = OSD.FromInteger(0); | 846 | responsemapdata["Extra2"] = LLSD.FromInteger(0); |
847 | responsearr.Add(responsemapdata); | 847 | responsearr.Add(responsemapdata); |
848 | } | 848 | } |
849 | responsemap["6"] = responsearr; | 849 | responsemap["6"] = responsearr; |