diff options
Diffstat (limited to 'OpenSim')
21 files changed, 485 insertions, 87 deletions
diff --git a/OpenSim/Framework/IProfileModule.cs b/OpenSim/Framework/IProfileModule.cs new file mode 100644 index 0000000..ef03d4a --- /dev/null +++ b/OpenSim/Framework/IProfileModule.cs | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public interface IProfileModule | ||
33 | { | ||
34 | void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID); | ||
35 | |||
36 | } | ||
37 | } | ||
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs index 2bbc6c7..8aa2ff3 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | |||
@@ -102,7 +102,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
102 | { | 102 | { |
103 | m_currentPacket = 2; | 103 | m_currentPacket = 2; |
104 | } | 104 | } |
105 | 105 | ||
106 | while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket) | 106 | while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket) |
107 | { | 107 | { |
108 | sendMore = SendPacket(client); | 108 | sendMore = SendPacket(client); |
@@ -114,17 +114,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
114 | return (m_currentPacket > m_stopPacket); | 114 | return (m_currentPacket > m_stopPacket); |
115 | } | 115 | } |
116 | 116 | ||
117 | /// <summary> | ||
118 | /// This is where we decide what we need to update | ||
119 | /// and assign the real discardLevel and packetNumber | ||
120 | /// assuming of course that the connected client might be bonkers | ||
121 | /// </summary> | ||
117 | public void RunUpdate() | 122 | public void RunUpdate() |
118 | { | 123 | { |
119 | //This is where we decide what we need to update | ||
120 | //and assign the real discardLevel and packetNumber | ||
121 | //assuming of course that the connected client might be bonkers | ||
122 | |||
123 | if (!HasAsset) | 124 | if (!HasAsset) |
124 | { | 125 | { |
125 | if (!m_assetRequested) | 126 | if (!m_assetRequested) |
126 | { | 127 | { |
127 | m_assetRequested = true; | 128 | m_assetRequested = true; |
129 | // m_log.DebugFormat("[J2KIMAGE]: Requesting asset {0}", TextureID); | ||
128 | AssetService.Get(TextureID.ToString(), this, AssetReceived); | 130 | AssetService.Get(TextureID.ToString(), this, AssetReceived); |
129 | } | 131 | } |
130 | } | 132 | } |
@@ -137,6 +139,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
137 | { | 139 | { |
138 | //Request decode | 140 | //Request decode |
139 | m_decodeRequested = true; | 141 | m_decodeRequested = true; |
142 | |||
143 | // m_log.DebugFormat("[J2KIMAGE]: Requesting decode of asset {0}", TextureID); | ||
144 | |||
140 | // Do we have a jpeg decoder? | 145 | // Do we have a jpeg decoder? |
141 | if (J2KDecoder != null) | 146 | if (J2KDecoder != null) |
142 | { | 147 | { |
@@ -149,7 +154,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
149 | // Send it off to the jpeg decoder | 154 | // Send it off to the jpeg decoder |
150 | J2KDecoder.BeginDecode(TextureID, m_asset, J2KDecodedCallback); | 155 | J2KDecoder.BeginDecode(TextureID, m_asset, J2KDecodedCallback); |
151 | } | 156 | } |
152 | |||
153 | } | 157 | } |
154 | else | 158 | else |
155 | { | 159 | { |
@@ -331,14 +335,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
331 | { | 335 | { |
332 | if (m_currentPacket == 0) | 336 | if (m_currentPacket == 0) |
333 | return 0; | 337 | return 0; |
338 | |||
334 | if (m_currentPacket == 1) | 339 | if (m_currentPacket == 1) |
335 | return FIRST_PACKET_SIZE; | 340 | return FIRST_PACKET_SIZE; |
336 | 341 | ||
337 | int result = FIRST_PACKET_SIZE + ((int)m_currentPacket - 2) * IMAGE_PACKET_SIZE; | 342 | int result = FIRST_PACKET_SIZE + ((int)m_currentPacket - 2) * IMAGE_PACKET_SIZE; |
343 | |||
338 | if (result < 0) | 344 | if (result < 0) |
339 | { | ||
340 | result = FIRST_PACKET_SIZE; | 345 | result = FIRST_PACKET_SIZE; |
341 | } | 346 | |
342 | return result; | 347 | return result; |
343 | } | 348 | } |
344 | 349 | ||
@@ -377,7 +382,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
377 | { | 382 | { |
378 | UUID assetID = UUID.Zero; | 383 | UUID assetID = UUID.Zero; |
379 | if (asset != null) | 384 | if (asset != null) |
385 | { | ||
380 | assetID = asset.FullID; | 386 | assetID = asset.FullID; |
387 | } | ||
381 | else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) | 388 | else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) |
382 | { | 389 | { |
383 | // Unfortunately we need this here, there's no other way. | 390 | // Unfortunately we need this here, there's no other way. |
@@ -398,7 +405,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
398 | } | 405 | } |
399 | 406 | ||
400 | AssetDataCallback(assetID, asset); | 407 | AssetDataCallback(assetID, asset); |
401 | |||
402 | } | 408 | } |
403 | } | 409 | } |
404 | } | 410 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 083dcc0..4d3a30c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -351,7 +351,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
351 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); | 351 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); |
352 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers | 352 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers |
353 | protected Scene m_scene; | 353 | protected Scene m_scene; |
354 | protected LLImageManager m_imageManager; | 354 | private LLImageManager m_imageManager; |
355 | protected string m_firstName; | 355 | protected string m_firstName; |
356 | protected string m_lastName; | 356 | protected string m_lastName; |
357 | protected Thread m_clientThread; | 357 | protected Thread m_clientThread; |
@@ -522,8 +522,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
522 | IsActive = false; | 522 | IsActive = false; |
523 | 523 | ||
524 | // Shutdown the image manager | 524 | // Shutdown the image manager |
525 | if (m_imageManager != null) | 525 | m_imageManager.Close(); |
526 | m_imageManager.Close(); | ||
527 | 526 | ||
528 | // Fire the callback for this connection closing | 527 | // Fire the callback for this connection closing |
529 | if (OnConnectionClosed != null) | 528 | if (OnConnectionClosed != null) |
@@ -601,7 +600,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
601 | /// Add a handler for the given packet type. | 600 | /// Add a handler for the given packet type. |
602 | /// </summary> | 601 | /// </summary> |
603 | /// <remarks> | 602 | /// <remarks> |
604 | /// The packet is handled on its own thread. If packets must be handled in the order in which thye | 603 | /// The packet is handled on its own thread. If packets must be handled in the order in which they |
605 | /// are received then please use the synchronous version of this method. | 604 | /// are received then please use the synchronous version of this method. |
606 | /// </remarks> | 605 | /// </remarks> |
607 | /// <param name="packetType"></param> | 606 | /// <param name="packetType"></param> |
@@ -3984,14 +3983,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3984 | } | 3983 | } |
3985 | 3984 | ||
3986 | if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) | 3985 | if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) |
3987 | { | ||
3988 | ProcessTextureRequests(); | ||
3989 | } | ||
3990 | } | ||
3991 | |||
3992 | void ProcessTextureRequests() | ||
3993 | { | ||
3994 | if (m_imageManager != null) | ||
3995 | m_imageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); | 3986 | m_imageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); |
3996 | } | 3987 | } |
3997 | 3988 | ||
@@ -7540,12 +7531,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7540 | if ((ImageType)block.Type == ImageType.Baked) | 7531 | if ((ImageType)block.Type == ImageType.Baked) |
7541 | args.Priority *= 2.0f; | 7532 | args.Priority *= 2.0f; |
7542 | 7533 | ||
7543 | // in the end, we null this, so we have to check if it's null | 7534 | m_imageManager.EnqueueReq(args); |
7544 | if (m_imageManager != null) | ||
7545 | { | ||
7546 | m_imageManager.EnqueueReq(args); | ||
7547 | } | ||
7548 | } | 7535 | } |
7536 | |||
7549 | return true; | 7537 | return true; |
7550 | } | 7538 | } |
7551 | 7539 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs index e3a881f..3e31b7d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs | |||
@@ -84,7 +84,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
84 | /// <param name="newRequest"></param> | 84 | /// <param name="newRequest"></param> |
85 | public void EnqueueReq(TextureRequestArgs newRequest) | 85 | public void EnqueueReq(TextureRequestArgs newRequest) |
86 | { | 86 | { |
87 | //Make sure we're not shutting down.. | ||
88 | if (!m_shuttingdown) | 87 | if (!m_shuttingdown) |
89 | { | 88 | { |
90 | J2KImage imgrequest; | 89 | J2KImage imgrequest; |
@@ -99,19 +98,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
99 | { | 98 | { |
100 | //m_log.Debug("[TEX]: (CAN) ID=" + newRequest.RequestedAssetID); | 99 | //m_log.Debug("[TEX]: (CAN) ID=" + newRequest.RequestedAssetID); |
101 | 100 | ||
102 | try | 101 | try |
103 | { | 102 | { |
104 | lock (m_syncRoot) | 103 | lock (m_syncRoot) |
105 | m_priorityQueue.Delete(imgrequest.PriorityQueueHandle); | 104 | m_priorityQueue.Delete(imgrequest.PriorityQueueHandle); |
106 | } | 105 | } |
107 | catch (Exception) { } | 106 | catch (Exception) { } |
108 | } | 107 | } |
109 | else | 108 | else |
110 | { | 109 | { |
110 | // m_log.DebugFormat( | ||
111 | // "[LL IMAGE MANAGER]: Received duplicate of existing request for {0}, start packet {1} from {2}", | ||
112 | // newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name); | ||
113 | |||
111 | //m_log.DebugFormat("[TEX]: (UPD) ID={0}: D={1}, S={2}, P={3}", | 114 | //m_log.DebugFormat("[TEX]: (UPD) ID={0}: D={1}, S={2}, P={3}", |
112 | // newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority); | 115 | // newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority); |
113 | 116 | ||
114 | //Check the packet sequence to make sure this isn't older than | 117 | //Check the packet sequence to make sure this isn't older than |
115 | //one we've already received | 118 | //one we've already received |
116 | if (newRequest.requestSequence > imgrequest.LastSequence) | 119 | if (newRequest.requestSequence > imgrequest.LastSequence) |
117 | { | 120 | { |
@@ -126,11 +129,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
126 | 129 | ||
127 | //Update the requested priority | 130 | //Update the requested priority |
128 | imgrequest.Priority = newRequest.Priority; | 131 | imgrequest.Priority = newRequest.Priority; |
132 | |||
129 | UpdateImageInQueue(imgrequest); | 133 | UpdateImageInQueue(imgrequest); |
130 | 134 | ||
131 | //Run an update | ||
132 | imgrequest.RunUpdate(); | 135 | imgrequest.RunUpdate(); |
136 | |||
137 | // J2KImage imgrequest2 = new J2KImage(this); | ||
138 | // imgrequest2.J2KDecoder = m_j2kDecodeModule; | ||
139 | // imgrequest2.AssetService = m_assetCache; | ||
140 | // imgrequest2.AgentID = m_client.AgentId; | ||
141 | // imgrequest2.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>(); | ||
142 | // imgrequest2.DiscardLevel = newRequest.DiscardLevel; | ||
143 | // imgrequest2.StartPacket = Math.Max(1, newRequest.PacketNumber); | ||
144 | // imgrequest2.Priority = newRequest.Priority; | ||
145 | // imgrequest2.TextureID = newRequest.RequestedAssetID; | ||
146 | // imgrequest2.Priority = newRequest.Priority; | ||
147 | // | ||
148 | // //Add this download to the priority queue | ||
149 | // AddImageToQueue(imgrequest2); | ||
150 | // | ||
151 | // imgrequest2.RunUpdate(); | ||
152 | |||
133 | } | 153 | } |
154 | // else | ||
155 | // { | ||
156 | // m_log.DebugFormat( | ||
157 | // "[LL IMAGE MANAGER]: Ignoring duplicate of existing request for {0} (sequence {1}) from {2} as its request sequence {3} is not greater", | ||
158 | // newRequest.RequestedAssetID, imgrequest.LastSequence, m_client.Name, newRequest.requestSequence); | ||
159 | // } | ||
134 | } | 160 | } |
135 | } | 161 | } |
136 | else | 162 | else |
@@ -142,6 +168,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
142 | } | 168 | } |
143 | else | 169 | else |
144 | { | 170 | { |
171 | // m_log.DebugFormat( | ||
172 | // "[LL IMAGE MANAGER]: Received request for {0}, start packet {1} from {2}", | ||
173 | // newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name); | ||
174 | |||
145 | //m_log.DebugFormat("[TEX]: (NEW) ID={0}: D={1}, S={2}, P={3}", | 175 | //m_log.DebugFormat("[TEX]: (NEW) ID={0}: D={1}, S={2}, P={3}", |
146 | // newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority); | 176 | // newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority); |
147 | 177 | ||
@@ -159,7 +189,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
159 | //Add this download to the priority queue | 189 | //Add this download to the priority queue |
160 | AddImageToQueue(imgrequest); | 190 | AddImageToQueue(imgrequest); |
161 | 191 | ||
162 | //Run an update | ||
163 | imgrequest.RunUpdate(); | 192 | imgrequest.RunUpdate(); |
164 | } | 193 | } |
165 | } | 194 | } |
@@ -176,7 +205,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
176 | 205 | ||
177 | // If null was returned, the texture priority queue is currently empty | 206 | // If null was returned, the texture priority queue is currently empty |
178 | if (image == null) | 207 | if (image == null) |
179 | return false; | 208 | break; |
180 | 209 | ||
181 | if (image.IsDecoded) | 210 | if (image.IsDecoded) |
182 | { | 211 | { |
@@ -194,10 +223,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
194 | // written. Undecoded textures should not be going into the priority | 223 | // written. Undecoded textures should not be going into the priority |
195 | // queue, because a high priority undecoded texture will clog up the | 224 | // queue, because a high priority undecoded texture will clog up the |
196 | // pipeline for a client | 225 | // pipeline for a client |
197 | return true; | 226 | // m_log.DebugFormat( |
227 | // "[LL IMAGE MANAGER]: Exiting image queue processing early on encountering undecoded image {0}", | ||
228 | // image.TextureID); | ||
229 | |||
230 | break; | ||
198 | } | 231 | } |
199 | } | 232 | } |
200 | 233 | ||
234 | // if (packetsSent != 0) | ||
235 | // m_log.DebugFormat("[LL IMAGE MANAGER]: Processed {0} packets from image queue", packetsSent); | ||
236 | |||
201 | return m_priorityQueue.Count > 0; | 237 | return m_priorityQueue.Count > 0; |
202 | } | 238 | } |
203 | 239 | ||
@@ -219,7 +255,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
219 | { | 255 | { |
220 | if (m_priorityQueue.Count > 0) | 256 | if (m_priorityQueue.Count > 0) |
221 | { | 257 | { |
222 | try { image = m_priorityQueue.FindMax(); } | 258 | try |
259 | { | ||
260 | image = m_priorityQueue.FindMax(); | ||
261 | } | ||
223 | catch (Exception) { } | 262 | catch (Exception) { } |
224 | } | 263 | } |
225 | } | 264 | } |
@@ -232,7 +271,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
232 | 271 | ||
233 | lock (m_syncRoot) | 272 | lock (m_syncRoot) |
234 | { | 273 | { |
235 | try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); } | 274 | try |
275 | { | ||
276 | m_priorityQueue.Add(ref image.PriorityQueueHandle, image); | ||
277 | } | ||
236 | catch (Exception) { } | 278 | catch (Exception) { } |
237 | } | 279 | } |
238 | } | 280 | } |
@@ -241,7 +283,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
241 | { | 283 | { |
242 | lock (m_syncRoot) | 284 | lock (m_syncRoot) |
243 | { | 285 | { |
244 | try { m_priorityQueue.Delete(image.PriorityQueueHandle); } | 286 | try |
287 | { | ||
288 | m_priorityQueue.Delete(image.PriorityQueueHandle); | ||
289 | } | ||
245 | catch (Exception) { } | 290 | catch (Exception) { } |
246 | } | 291 | } |
247 | } | 292 | } |
@@ -250,7 +295,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
250 | { | 295 | { |
251 | lock (m_syncRoot) | 296 | lock (m_syncRoot) |
252 | { | 297 | { |
253 | try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); } | 298 | try |
299 | { | ||
300 | m_priorityQueue.Replace(image.PriorityQueueHandle, image); | ||
301 | } | ||
254 | catch (Exception) | 302 | catch (Exception) |
255 | { | 303 | { |
256 | image.PriorityQueueHandle = null; | 304 | image.PriorityQueueHandle = null; |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 7dd9087..14dee84 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -103,6 +103,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
103 | // If it's cached, return the cached results | 103 | // If it's cached, return the cached results |
104 | if (m_decodedCache.TryGetValue(assetID, out result)) | 104 | if (m_decodedCache.TryGetValue(assetID, out result)) |
105 | { | 105 | { |
106 | // m_log.DebugFormat( | ||
107 | // "[J2KDecoderModule]: Returning existing cached {0} layers j2k decode for {1}", | ||
108 | // result.Length, assetID); | ||
109 | |||
106 | callback(assetID, result); | 110 | callback(assetID, result); |
107 | } | 111 | } |
108 | else | 112 | else |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index bc7bf66..9df0592 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -156,7 +156,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
156 | changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; | 156 | changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; |
157 | 157 | ||
158 | // WriteBakedTexturesReport(sp, m_log.DebugFormat); | 158 | // WriteBakedTexturesReport(sp, m_log.DebugFormat); |
159 | ValidateBakedTextureCache(sp, false); | 159 | if (!ValidateBakedTextureCache(sp)) |
160 | RequestRebake(sp, true); | ||
160 | 161 | ||
161 | // This appears to be set only in the final stage of the appearance | 162 | // This appears to be set only in the final stage of the appearance |
162 | // update transaction. In theory, we should be able to do an immediate | 163 | // update transaction. In theory, we should be able to do an immediate |
@@ -251,15 +252,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
251 | } | 252 | } |
252 | 253 | ||
253 | /// <summary> | 254 | /// <summary> |
254 | /// Check for the existence of the baked texture assets. | ||
255 | /// </summary> | ||
256 | /// <param name="sp"></param> | ||
257 | public bool ValidateBakedTextureCache(IScenePresence sp) | ||
258 | { | ||
259 | return ValidateBakedTextureCache(sp, true); | ||
260 | } | ||
261 | |||
262 | /// <summary> | ||
263 | /// Queue up a request to send appearance. | 255 | /// Queue up a request to send appearance. |
264 | /// </summary> | 256 | /// </summary> |
265 | /// <remarks> | 257 | /// <remarks> |
@@ -292,17 +284,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
292 | } | 284 | } |
293 | } | 285 | } |
294 | 286 | ||
295 | #endregion | 287 | public bool ValidateBakedTextureCache(IScenePresence sp) |
296 | |||
297 | #region AvatarFactoryModule private methods | ||
298 | |||
299 | /// <summary> | ||
300 | /// Check for the existence of the baked texture assets. Request a rebake | ||
301 | /// unless checkonly is true. | ||
302 | /// </summary> | ||
303 | /// <param name="client"></param> | ||
304 | /// <param name="checkonly"></param> | ||
305 | private bool ValidateBakedTextureCache(IScenePresence sp, bool checkonly) | ||
306 | { | 288 | { |
307 | bool defonly = true; // are we only using default textures | 289 | bool defonly = true; // are we only using default textures |
308 | 290 | ||
@@ -330,12 +312,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
330 | defonly = false; // found a non-default texture reference | 312 | defonly = false; // found a non-default texture reference |
331 | 313 | ||
332 | if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) | 314 | if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) |
333 | { | 315 | return false; |
334 | if (checkonly) | ||
335 | return false; | ||
336 | |||
337 | sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID); | ||
338 | } | ||
339 | } | 316 | } |
340 | 317 | ||
341 | m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0}", sp.UUID); | 318 | m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0}", sp.UUID); |
@@ -344,6 +321,52 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
344 | return (defonly ? false : true); | 321 | return (defonly ? false : true); |
345 | } | 322 | } |
346 | 323 | ||
324 | public void RequestRebake(IScenePresence sp, bool missingTexturesOnly) | ||
325 | { | ||
326 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | ||
327 | { | ||
328 | int idx = AvatarAppearance.BAKE_INDICES[i]; | ||
329 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; | ||
330 | |||
331 | // if there is no texture entry, skip it | ||
332 | if (face == null) | ||
333 | continue; | ||
334 | |||
335 | // m_log.DebugFormat( | ||
336 | // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", | ||
337 | // face.TextureID, idx, client.Name, client.AgentId); | ||
338 | |||
339 | // if the texture is one of the "defaults" then skip it | ||
340 | // this should probably be more intelligent (skirt texture doesnt matter | ||
341 | // if the avatar isnt wearing a skirt) but if any of the main baked | ||
342 | // textures is default then the rest should be as well | ||
343 | if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE) | ||
344 | continue; | ||
345 | |||
346 | if (missingTexturesOnly) | ||
347 | { | ||
348 | if (m_scene.AssetService.Get(face.TextureID.ToString()) != null) | ||
349 | continue; | ||
350 | else | ||
351 | m_log.DebugFormat( | ||
352 | "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", | ||
353 | face.TextureID, idx, sp.Name); | ||
354 | } | ||
355 | else | ||
356 | { | ||
357 | m_log.DebugFormat( | ||
358 | "[AVFACTORY]: Requesting rebake of {0} ({1}) for {2}.", | ||
359 | face.TextureID, idx, sp.Name); | ||
360 | } | ||
361 | |||
362 | sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID); | ||
363 | } | ||
364 | } | ||
365 | |||
366 | #endregion | ||
367 | |||
368 | #region AvatarFactoryModule private methods | ||
369 | |||
347 | private Dictionary<BakeType, Primitive.TextureEntryFace> GetBakedTextureFaces(ScenePresence sp) | 370 | private Dictionary<BakeType, Primitive.TextureEntryFace> GetBakedTextureFaces(ScenePresence sp) |
348 | { | 371 | { |
349 | if (sp.IsChildAgent) | 372 | if (sp.IsChildAgent) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs index dee0ad4..eb1e4b5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs | |||
@@ -43,7 +43,7 @@ using OpenSim.Services.Interfaces; | |||
43 | namespace OpenSim.Region.CoreModules.Avatar.Profile | 43 | namespace OpenSim.Region.CoreModules.Avatar.Profile |
44 | { | 44 | { |
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
46 | public class BasicProfileModule : ISharedRegionModule | 46 | public class BasicProfileModule : IProfileModule, ISharedRegionModule |
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
@@ -57,6 +57,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
57 | 57 | ||
58 | public void Initialise(IConfigSource config) | 58 | public void Initialise(IConfigSource config) |
59 | { | 59 | { |
60 | // This can be reduced later as the loader will determine | ||
61 | // whether we are needed | ||
60 | if (config.Configs["Profile"] != null) | 62 | if (config.Configs["Profile"] != null) |
61 | { | 63 | { |
62 | if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule") | 64 | if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule") |
@@ -65,14 +67,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
65 | 67 | ||
66 | m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled"); | 68 | m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled"); |
67 | m_Enabled = true; | 69 | m_Enabled = true; |
68 | |||
69 | } | 70 | } |
70 | 71 | ||
71 | public void AddRegion(Scene scene) | 72 | public void AddRegion(Scene scene) |
72 | { | 73 | { |
73 | if (!m_Enabled) | 74 | if (!m_Enabled) |
74 | return; | 75 | return; |
75 | 76 | ||
76 | lock (m_Scenes) | 77 | lock (m_Scenes) |
77 | { | 78 | { |
78 | if (!m_Scenes.Contains(scene)) | 79 | if (!m_Scenes.Contains(scene)) |
@@ -80,6 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
80 | m_Scenes.Add(scene); | 81 | m_Scenes.Add(scene); |
81 | // Hook up events | 82 | // Hook up events |
82 | scene.EventManager.OnNewClient += OnNewClient; | 83 | scene.EventManager.OnNewClient += OnNewClient; |
84 | scene.RegisterModuleInterface<IProfileModule>(this); | ||
83 | } | 85 | } |
84 | } | 86 | } |
85 | } | 87 | } |
@@ -116,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
116 | 118 | ||
117 | public Type ReplaceableInterface | 119 | public Type ReplaceableInterface |
118 | { | 120 | { |
119 | get { return null; } | 121 | get { return typeof(IProfileModule); } |
120 | } | 122 | } |
121 | 123 | ||
122 | #endregion | 124 | #endregion |
@@ -170,4 +172,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
170 | } | 172 | } |
171 | 173 | ||
172 | } | 174 | } |
173 | } \ No newline at end of file | 175 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index dbe2560..37292d6 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -50,6 +50,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
50 | public string LastName { get; set; } | 50 | public string LastName { get; set; } |
51 | public string HomeURL { get; set; } | 51 | public string HomeURL { get; set; } |
52 | public Dictionary<string, object> ServerURLs { get; set; } | 52 | public Dictionary<string, object> ServerURLs { get; set; } |
53 | public string Title { get; set; } | ||
54 | public int Flags { get; set; } | ||
55 | public int Created { get; set; } | ||
53 | } | 56 | } |
54 | 57 | ||
55 | public class UserManagementModule : ISharedRegionModule, IUserManagement | 58 | public class UserManagementModule : ISharedRegionModule, IUserManagement |
@@ -281,6 +284,94 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
281 | return string.Empty; | 284 | return string.Empty; |
282 | } | 285 | } |
283 | 286 | ||
287 | public int GetUserFlags(UUID userID) | ||
288 | { | ||
289 | UserData userdata; | ||
290 | lock (m_UserCache) | ||
291 | m_UserCache.TryGetValue(userID, out userdata); | ||
292 | |||
293 | if (userdata.Flags == -1) | ||
294 | GetUserInfo(userID); | ||
295 | |||
296 | if (userdata.Flags != -1) | ||
297 | return userdata.Flags; | ||
298 | |||
299 | return 0; | ||
300 | } | ||
301 | |||
302 | public int GetUserCreated(UUID userID) | ||
303 | { | ||
304 | UserData userdata; | ||
305 | lock (m_UserCache) | ||
306 | m_UserCache.TryGetValue(userID, out userdata); | ||
307 | |||
308 | if (userdata.Flags == -1) | ||
309 | GetUserInfo(userID); | ||
310 | |||
311 | if (userdata.Created != -1) | ||
312 | return userdata.Created; | ||
313 | |||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | public string GetUserTitle(UUID userID) | ||
318 | { | ||
319 | UserData userdata; | ||
320 | lock (m_UserCache) | ||
321 | m_UserCache.TryGetValue(userID, out userdata); | ||
322 | |||
323 | if (userdata.Flags == -1) | ||
324 | GetUserInfo(userID); | ||
325 | |||
326 | if (userdata.Created != -1) | ||
327 | return userdata.Title; | ||
328 | |||
329 | return string.Empty; | ||
330 | } | ||
331 | |||
332 | // This will cache the user data | ||
333 | // Change this to return bool | ||
334 | private bool GetUserInfo(UUID userID) | ||
335 | { | ||
336 | UserData userdata; | ||
337 | lock (m_UserCache) | ||
338 | m_UserCache.TryGetValue(userID, out userdata); | ||
339 | |||
340 | if (userdata != null) | ||
341 | { | ||
342 | // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Requested url type {0} for {1}", serverType, userID); | ||
343 | |||
344 | if (userdata.Flags >= 0) | ||
345 | { | ||
346 | // This is already populated | ||
347 | return true; | ||
348 | } | ||
349 | |||
350 | if (userdata.HomeURL != null && userdata.HomeURL != string.Empty) | ||
351 | { | ||
352 | m_log.DebugFormat( | ||
353 | "[USER MANAGEMENT MODULE]: Requesting user flags from '{0}' for {1}", | ||
354 | userdata.HomeURL, userID); | ||
355 | |||
356 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL); | ||
357 | Dictionary<string, object> info = uConn.GetUserInfo(userID); | ||
358 | |||
359 | // Pull our data now | ||
360 | if (info["result"].ToString() == "success") | ||
361 | { | ||
362 | userdata.Flags = (int)info["user_flags"]; | ||
363 | userdata.Created = (int)info["user_created"]; | ||
364 | userdata.Title = (string)info["user_title"]; | ||
365 | |||
366 | return true; | ||
367 | } | ||
368 | } | ||
369 | } | ||
370 | |||
371 | return false; | ||
372 | } | ||
373 | |||
374 | |||
284 | public string GetUserUUI(UUID userID) | 375 | public string GetUserUUI(UUID userID) |
285 | { | 376 | { |
286 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); | 377 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); |
@@ -352,6 +443,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
352 | { | 443 | { |
353 | UserData user = new UserData(); | 444 | UserData user = new UserData(); |
354 | user.Id = id; | 445 | user.Id = id; |
446 | user.Flags = -1; | ||
447 | user.Created = -1; | ||
355 | 448 | ||
356 | if (creatorData != null && creatorData != string.Empty) | 449 | if (creatorData != null && creatorData != string.Empty) |
357 | { | 450 | { |
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs index 8670229..04df9c3 100644 --- a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs | |||
@@ -61,7 +61,29 @@ namespace OpenSim.Region.Framework.Interfaces | |||
61 | /// <returns>true if a valid agent was found, false otherwise</returns> | 61 | /// <returns>true if a valid agent was found, false otherwise</returns> |
62 | bool SaveBakedTextures(UUID agentId); | 62 | bool SaveBakedTextures(UUID agentId); |
63 | 63 | ||
64 | /// <summary> | ||
65 | /// Validate that OpenSim can find the baked textures need to display a given avatar | ||
66 | /// </summary> | ||
67 | /// <param name="client"></param> | ||
68 | /// <param name="checkonly"></param> | ||
69 | /// <returns> | ||
70 | /// true if all the baked textures referenced by the texture IDs exist or the appearance is only using default textures. false otherwise. | ||
71 | /// </returns> | ||
64 | bool ValidateBakedTextureCache(IScenePresence sp); | 72 | bool ValidateBakedTextureCache(IScenePresence sp); |
73 | |||
74 | /// <summary> | ||
75 | /// Request a rebake of textures for an avatar. | ||
76 | /// </summary> | ||
77 | /// <remarks> | ||
78 | /// This will send the request to the viewer, since it's there that the rebake is done. | ||
79 | /// </remarks> | ||
80 | /// <param name="sp">Avatar to rebake.</param> | ||
81 | /// <param name="missingTexturesOnly"> | ||
82 | /// If true, only request a rebake for the textures that are missing. | ||
83 | /// If false then we request a rebake of all textures for which we already have references. | ||
84 | /// </param> | ||
85 | void RequestRebake(IScenePresence sp, bool missingTexturesOnly); | ||
86 | |||
65 | void QueueAppearanceSend(UUID agentid); | 87 | void QueueAppearanceSend(UUID agentid); |
66 | void QueueAppearanceSave(UUID agentid); | 88 | void QueueAppearanceSave(UUID agentid); |
67 | 89 | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs index ea0ba593..54dfaf4 100644 --- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs +++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs | |||
@@ -14,6 +14,9 @@ namespace OpenSim.Region.Framework.Interfaces | |||
14 | string GetUserHomeURL(UUID uuid); | 14 | string GetUserHomeURL(UUID uuid); |
15 | string GetUserUUI(UUID uuid); | 15 | string GetUserUUI(UUID uuid); |
16 | string GetUserServerURL(UUID uuid, string serverType); | 16 | string GetUserServerURL(UUID uuid, string serverType); |
17 | int GetUserFlags(UUID userID); | ||
18 | int GetUserCreated(UUID userID); | ||
19 | string GetUserTitle(UUID userID); | ||
17 | 20 | ||
18 | /// <summary> | 21 | /// <summary> |
19 | /// Add a user. | 22 | /// Add a user. |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 209a0a6..74d9e60 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -405,6 +405,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
405 | public delegate void RegionUp(GridRegion region); | 405 | public delegate void RegionUp(GridRegion region); |
406 | public event RegionUp OnRegionUp; | 406 | public event RegionUp OnRegionUp; |
407 | 407 | ||
408 | public delegate void RegionStarted(Scene scene); | ||
409 | public event RegionStarted OnRegionStarted; | ||
410 | |||
408 | public delegate void LoginsEnabled(string regionName); | 411 | public delegate void LoginsEnabled(string regionName); |
409 | public event LoginsEnabled OnLoginsEnabled; | 412 | public event LoginsEnabled OnLoginsEnabled; |
410 | 413 | ||
@@ -2267,6 +2270,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2267 | } | 2270 | } |
2268 | } | 2271 | } |
2269 | 2272 | ||
2273 | public void TriggerOnRegionStarted(Scene scene) | ||
2274 | { | ||
2275 | RegionStarted handler = OnRegionStarted; | ||
2276 | |||
2277 | if (handler != null) | ||
2278 | { | ||
2279 | foreach (RegionStarted d in handler.GetInvocationList()) | ||
2280 | { | ||
2281 | try | ||
2282 | { | ||
2283 | d(scene); | ||
2284 | } | ||
2285 | catch (Exception e) | ||
2286 | { | ||
2287 | m_log.ErrorFormat("[EVENT MANAGER]: Delegate for RegionStarted failed - continuing {0} - {1}", | ||
2288 | e.Message, e.StackTrace); | ||
2289 | } | ||
2290 | } | ||
2291 | } | ||
2292 | } | ||
2293 | |||
2270 | public void TriggerLoginsEnabled (string regionName) | 2294 | public void TriggerLoginsEnabled (string regionName) |
2271 | { | 2295 | { |
2272 | LoginsEnabled handler = OnLoginsEnabled; | 2296 | LoginsEnabled handler = OnLoginsEnabled; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 26f915b..d2e0ab0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1236,6 +1236,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1236 | 1236 | ||
1237 | try | 1237 | try |
1238 | { | 1238 | { |
1239 | m_eventManager.TriggerOnRegionStarted(this); | ||
1239 | while (!shuttingdown) | 1240 | while (!shuttingdown) |
1240 | Update(); | 1241 | Update(); |
1241 | } | 1242 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index fa8b1c0..c45cfb8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2015,13 +2015,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2015 | axPos *= parentRot; | 2015 | axPos *= parentRot; |
2016 | Vector3 translationOffsetPosition = axPos; | 2016 | Vector3 translationOffsetPosition = axPos; |
2017 | if(_parentID == 0) | 2017 | if(_parentID == 0) |
2018 | { | 2018 | return GroupPosition; |
2019 | return GroupPosition; | 2019 | else |
2020 | } | 2020 | return ParentGroup.AbsolutePosition + translationOffsetPosition; |
2021 | else | ||
2022 | { | ||
2023 | return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position | ||
2024 | } | ||
2025 | } | 2021 | } |
2026 | 2022 | ||
2027 | /// <summary> | 2023 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 845553a..a301ccb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2855,7 +2855,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2855 | Velocity = Vector3.Zero; | 2855 | Velocity = Vector3.Zero; |
2856 | AbsolutePosition = pos; | 2856 | AbsolutePosition = pos; |
2857 | 2857 | ||
2858 | m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); | 2858 | // m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); |
2859 | 2859 | ||
2860 | AddToPhysicalScene(isFlying); | 2860 | AddToPhysicalScene(isFlying); |
2861 | } | 2861 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 5f2f7d8..3f24991 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -1279,7 +1279,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1279 | writer.WriteElementString(name, flagsStr.Replace(",", "")); | 1279 | writer.WriteElementString(name, flagsStr.Replace(",", "")); |
1280 | } | 1280 | } |
1281 | 1281 | ||
1282 | static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene) | 1282 | public static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene) |
1283 | { | 1283 | { |
1284 | if (tinv.Count > 0) // otherwise skip this | 1284 | if (tinv.Count > 0) // otherwise skip this |
1285 | { | 1285 | { |
@@ -1333,7 +1333,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1333 | } | 1333 | } |
1334 | } | 1334 | } |
1335 | 1335 | ||
1336 | static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp, Dictionary<string, object> options) | 1336 | public static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp, Dictionary<string, object> options) |
1337 | { | 1337 | { |
1338 | if (shp != null) | 1338 | if (shp != null) |
1339 | { | 1339 | { |
@@ -1508,7 +1508,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1508 | return obj; | 1508 | return obj; |
1509 | } | 1509 | } |
1510 | 1510 | ||
1511 | static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name) | 1511 | public static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name) |
1512 | { | 1512 | { |
1513 | TaskInventoryDictionary tinv = new TaskInventoryDictionary(); | 1513 | TaskInventoryDictionary tinv = new TaskInventoryDictionary(); |
1514 | 1514 | ||
@@ -1548,7 +1548,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1548 | /// <param name="name">The name of the xml element containing the shape</param> | 1548 | /// <param name="name">The name of the xml element containing the shape</param> |
1549 | /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> | 1549 | /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> |
1550 | /// <returns>The shape parsed</returns> | 1550 | /// <returns>The shape parsed</returns> |
1551 | static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) | 1551 | public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) |
1552 | { | 1552 | { |
1553 | errors = false; | 1553 | errors = false; |
1554 | 1554 | ||
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 1ce24f1..7e15718 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | |||
@@ -114,6 +114,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
114 | "Send appearance data for each avatar in the simulator to other viewers.", | 114 | "Send appearance data for each avatar in the simulator to other viewers.", |
115 | "Optionally, you can specify that only a particular avatar's appearance data is sent.", | 115 | "Optionally, you can specify that only a particular avatar's appearance data is sent.", |
116 | HandleSendAppearanceCommand); | 116 | HandleSendAppearanceCommand); |
117 | |||
118 | scene.AddCommand( | ||
119 | this, "appearance rebake", | ||
120 | "appearance rebake <first-name> <last-name>", | ||
121 | "Send a request to the user's viewer for it to rebake and reupload its appearance textures.", | ||
122 | "This is currently done for all baked texture references previously received, whether the simulator can find the asset or not." | ||
123 | + "\nThis will only work for texture ids that the viewer has already uploaded." | ||
124 | + "\nIf the viewer has not yet sent the server any texture ids then nothing will happen" | ||
125 | + "\nsince requests can only be made for ids that the client has already sent us", | ||
126 | HandleRebakeAppearanceCommand); | ||
117 | } | 127 | } |
118 | 128 | ||
119 | private void HandleSendAppearanceCommand(string module, string[] cmd) | 129 | private void HandleSendAppearanceCommand(string module, string[] cmd) |
@@ -210,6 +220,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
210 | } | 220 | } |
211 | } | 221 | } |
212 | } | 222 | } |
213 | } | 223 | } |
224 | |||
225 | private void HandleRebakeAppearanceCommand(string module, string[] cmd) | ||
226 | { | ||
227 | if (cmd.Length != 4) | ||
228 | { | ||
229 | MainConsole.Instance.OutputFormat("Usage: appearance rebake <first-name> <last-name>"); | ||
230 | return; | ||
231 | } | ||
232 | |||
233 | string firstname = cmd[2]; | ||
234 | string lastname = cmd[3]; | ||
235 | |||
236 | lock (m_scenes) | ||
237 | { | ||
238 | foreach (Scene scene in m_scenes.Values) | ||
239 | { | ||
240 | ScenePresence sp = scene.GetScenePresence(firstname, lastname); | ||
241 | if (sp != null && !sp.IsChildAgent) | ||
242 | { | ||
243 | MainConsole.Instance.OutputFormat( | ||
244 | "Requesting rebake of uploaded textures for {0}", | ||
245 | sp.Name, scene.RegionInfo.RegionName); | ||
246 | |||
247 | scene.AvatarFactory.RequestRebake(sp, false); | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | } | ||
214 | } | 252 | } |
215 | } \ No newline at end of file | 253 | } \ No newline at end of file |
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 07c6962..1bd3706 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs | |||
@@ -91,6 +91,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
91 | 91 | ||
92 | server.AddXmlRPCHandler("status_notification", StatusNotification, false); | 92 | server.AddXmlRPCHandler("status_notification", StatusNotification, false); |
93 | server.AddXmlRPCHandler("get_online_friends", GetOnlineFriends, false); | 93 | server.AddXmlRPCHandler("get_online_friends", GetOnlineFriends, false); |
94 | server.AddXmlRPCHandler("get_user_info", GetUserInfo, false); | ||
94 | server.AddXmlRPCHandler("get_server_urls", GetServerURLs, false); | 95 | server.AddXmlRPCHandler("get_server_urls", GetServerURLs, false); |
95 | 96 | ||
96 | server.AddXmlRPCHandler("locate_user", LocateUser, false); | 97 | server.AddXmlRPCHandler("locate_user", LocateUser, false); |
@@ -299,6 +300,38 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
299 | 300 | ||
300 | } | 301 | } |
301 | 302 | ||
303 | public XmlRpcResponse GetUserInfo(XmlRpcRequest request, IPEndPoint remoteClient) | ||
304 | { | ||
305 | Hashtable hash = new Hashtable(); | ||
306 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
307 | |||
308 | // This needs checking! | ||
309 | if (requestData.ContainsKey("userID")) | ||
310 | { | ||
311 | string userID_str = (string)requestData["userID"]; | ||
312 | UUID userID = UUID.Zero; | ||
313 | UUID.TryParse(userID_str, out userID); | ||
314 | |||
315 | //int userFlags = m_HomeUsersService.GetUserFlags(userID); | ||
316 | Dictionary<string,object> userInfo = m_HomeUsersService.GetUserInfo(userID); | ||
317 | if (userInfo.Count > 0) | ||
318 | { | ||
319 | foreach (KeyValuePair<string, object> kvp in userInfo) | ||
320 | { | ||
321 | hash[kvp.Key] = kvp.Value; | ||
322 | } | ||
323 | } | ||
324 | else | ||
325 | { | ||
326 | hash["result"] = "failure"; | ||
327 | } | ||
328 | } | ||
329 | |||
330 | XmlRpcResponse response = new XmlRpcResponse(); | ||
331 | response.Value = hash; | ||
332 | return response; | ||
333 | } | ||
334 | |||
302 | public XmlRpcResponse GetServerURLs(XmlRpcRequest request, IPEndPoint remoteClient) | 335 | public XmlRpcResponse GetServerURLs(XmlRpcRequest request, IPEndPoint remoteClient) |
303 | { | 336 | { |
304 | Hashtable hash = new Hashtable(); | 337 | Hashtable hash = new Hashtable(); |
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index a73bf9e..d617aee 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -559,6 +559,60 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
559 | return online; | 559 | return online; |
560 | } | 560 | } |
561 | 561 | ||
562 | public Dictionary<string,object> GetUserInfo (UUID userID) | ||
563 | { | ||
564 | Hashtable hash = new Hashtable(); | ||
565 | hash["userID"] = userID.ToString(); | ||
566 | |||
567 | IList paramList = new ArrayList(); | ||
568 | paramList.Add(hash); | ||
569 | |||
570 | XmlRpcRequest request = new XmlRpcRequest("get_user_info", paramList); | ||
571 | |||
572 | Dictionary<string, object> info = new Dictionary<string, object>(); | ||
573 | XmlRpcResponse response = null; | ||
574 | try | ||
575 | { | ||
576 | response = request.Send(m_ServerURL, 10000); | ||
577 | } | ||
578 | catch | ||
579 | { | ||
580 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUserInfo", m_ServerURL); | ||
581 | return info; | ||
582 | } | ||
583 | |||
584 | if (response.IsFault) | ||
585 | { | ||
586 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetServerURLs returned an error: {1}", m_ServerURL, response.FaultString); | ||
587 | return info; | ||
588 | } | ||
589 | |||
590 | hash = (Hashtable)response.Value; | ||
591 | try | ||
592 | { | ||
593 | if (hash == null) | ||
594 | { | ||
595 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUserInfo Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
596 | return info; | ||
597 | } | ||
598 | |||
599 | // Here is the actual response | ||
600 | foreach (object key in hash.Keys) | ||
601 | { | ||
602 | if (hash[key] != null) | ||
603 | { | ||
604 | info.Add(key.ToString(), hash[key]); | ||
605 | } | ||
606 | } | ||
607 | } | ||
608 | catch | ||
609 | { | ||
610 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); | ||
611 | } | ||
612 | |||
613 | return info; | ||
614 | } | ||
615 | |||
562 | public Dictionary<string, object> GetServerURLs(UUID userID) | 616 | public Dictionary<string, object> GetServerURLs(UUID userID) |
563 | { | 617 | { |
564 | Hashtable hash = new Hashtable(); | 618 | Hashtable hash = new Hashtable(); |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 38bcce6..1a839f3 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -486,6 +486,31 @@ namespace OpenSim.Services.HypergridService | |||
486 | return online; | 486 | return online; |
487 | } | 487 | } |
488 | 488 | ||
489 | public Dictionary<string, object> GetUserInfo(UUID userID) | ||
490 | { | ||
491 | Dictionary<string, object> info = new Dictionary<string, object>(); | ||
492 | |||
493 | if (m_UserAccountService == null) | ||
494 | { | ||
495 | m_log.WarnFormat("[USER AGENT SERVICE]: Unable to get user flags because user account service is missing"); | ||
496 | info["result"] = "fail"; | ||
497 | info["message"] = "UserAccountService is missing!"; | ||
498 | return info; | ||
499 | } | ||
500 | |||
501 | UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero /*!!!*/, userID); | ||
502 | |||
503 | if (account != null) | ||
504 | { | ||
505 | info.Add("user_flags", (object)account.UserFlags); | ||
506 | info.Add("user_created", (object)account.Created); | ||
507 | info.Add("user_title", (object)account.UserTitle); | ||
508 | info.Add("result", "success"); | ||
509 | } | ||
510 | |||
511 | return info; | ||
512 | } | ||
513 | |||
489 | public Dictionary<string, object> GetServerURLs(UUID userID) | 514 | public Dictionary<string, object> GetServerURLs(UUID userID) |
490 | { | 515 | { |
491 | if (m_UserAccountService == null) | 516 | if (m_UserAccountService == null) |
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index e86ec51..5b293ac 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs | |||
@@ -55,6 +55,7 @@ namespace OpenSim.Services.Interfaces | |||
55 | void LogoutAgent(UUID userID, UUID sessionID); | 55 | void LogoutAgent(UUID userID, UUID sessionID); |
56 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); | 56 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); |
57 | Dictionary<string, object> GetServerURLs(UUID userID); | 57 | Dictionary<string, object> GetServerURLs(UUID userID); |
58 | Dictionary<string,object> GetUserInfo(UUID userID); | ||
58 | 59 | ||
59 | string LocateUser(UUID userID); | 60 | string LocateUser(UUID userID); |
60 | // Tries to get the universal user identifier for the targetUserId | 61 | // Tries to get the universal user identifier for the targetUserId |
diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs index 6249fae..a73fcbe 100644 --- a/OpenSim/Tools/pCampBot/pCampBot.cs +++ b/OpenSim/Tools/pCampBot/pCampBot.cs | |||
@@ -112,10 +112,10 @@ namespace pCampBot | |||
112 | " -lastname lastname for the bots. Each lastname will have _<bot-number> appended, e.g. Ima Bot_0\n" + | 112 | " -lastname lastname for the bots. Each lastname will have _<bot-number> appended, e.g. Ima Bot_0\n" + |
113 | " -password password for the bots\n" + | 113 | " -password password for the bots\n" + |
114 | " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p\n" + | 114 | " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p\n" + |
115 | " current options are:" + | 115 | " current options are:\n" + |
116 | " p (physics)" + | 116 | " p (physics)\n" + |
117 | " g (grab)" + | 117 | " g (grab)\n" + |
118 | " t (teleport)" + | 118 | " t (teleport)\n" + |
119 | // " c (cross)" + | 119 | // " c (cross)" + |
120 | " -wear set appearance folder to load from (default: no)\n" + | 120 | " -wear set appearance folder to load from (default: no)\n" + |
121 | " -h, -help show this message"); | 121 | " -h, -help show this message"); |