aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs4
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs21
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs17
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs57
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs34
7 files changed, 90 insertions, 56 deletions
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
index c637ccf..594ce9d 100644
--- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Capabilities.Handlers
104 } 104 }
105 catch (Exception e) 105 catch (Exception e)
106 { 106 {
107 m_log.Error("[UPLOAD BAKED TEXTURE HANDLER]: " + e.ToString()); 107 m_log.ErrorFormat("[UPLOAD BAKED TEXTURE HANDLER]: {0}{1}", e.Message, e.StackTrace);
108 } 108 }
109 109
110 return null; 110 return null;
@@ -117,7 +117,7 @@ namespace OpenSim.Capabilities.Handlers
117 /// <param name="data"></param> 117 /// <param name="data"></param>
118 private void BakedTextureUploaded(UUID assetID, byte[] data) 118 private void BakedTextureUploaded(UUID assetID, byte[] data)
119 { 119 {
120 // m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString()); 120// m_log.DebugFormat("[UPLOAD BAKED TEXTURE HANDLER]: Received baked texture {0}", assetID.ToString());
121 121
122 AssetBase asset; 122 AssetBase asset;
123 asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_HostCapsObj.AgentID.ToString()); 123 asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_HostCapsObj.AgentID.ToString());
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 6c2a954..4f598b0 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -249,10 +249,12 @@ namespace OpenSim.Framework
249 } 249 }
250 250
251 /// <summary> 251 /// <summary>
252 /// Set up appearance textures. 252 /// Set up appearance texture ids.
253 /// Returns boolean that indicates whether the new entries actually change the
254 /// existing values.
255 /// </summary> 253 /// </summary>
254 /// <returns>
255 /// True if any existing texture id was changed by the new data.
256 /// False if there were no changes or no existing texture ids.
257 /// </returns>
256 public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry) 258 public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry)
257 { 259 {
258 if (textureEntry == null) 260 if (textureEntry == null)
@@ -269,25 +271,30 @@ namespace OpenSim.Framework
269 271
270 if (newface == null) 272 if (newface == null)
271 { 273 {
272 if (oldface == null) continue; 274 if (oldface == null)
275 continue;
273 } 276 }
274 else 277 else
275 { 278 {
276 if (oldface != null && oldface.TextureID == newface.TextureID) continue; 279 if (oldface != null && oldface.TextureID == newface.TextureID)
280 continue;
277 } 281 }
278 282
279 changed = true; 283 changed = true;
280 } 284 }
281 285
282 m_texture = textureEntry; 286 m_texture = textureEntry;
287
283 return changed; 288 return changed;
284 } 289 }
285 290
286 /// <summary> 291 /// <summary>
287 /// Set up visual parameters for the avatar and refresh the avatar height 292 /// Set up visual parameters for the avatar and refresh the avatar height
288 /// Returns boolean that indicates whether the new entries actually change the
289 /// existing values.
290 /// </summary> 293 /// </summary>
294 /// <returns>
295 /// True if any existing visual parameter was changed by the new data.
296 /// False if there were no changes or no existing visual parameters.
297 /// </returns>
291 public virtual bool SetVisualParams(byte[] visualParams) 298 public virtual bool SetVisualParams(byte[] visualParams)
292 { 299 {
293 if (visualParams == null) 300 if (visualParams == null)
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 8b41c49..f9a6643 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -441,6 +441,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
441 public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, 441 public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
442 UUID agentId, UUID sessionId, uint circuitCode) 442 UUID agentId, UUID sessionId, uint circuitCode)
443 { 443 {
444// DebugPacketLevel = 1;
445
444 RegisterInterface<IClientIM>(this); 446 RegisterInterface<IClientIM>(this);
445 RegisterInterface<IClientChat>(this); 447 RegisterInterface<IClientChat>(this);
446 RegisterInterface<IClientIPEndpoint>(this); 448 RegisterInterface<IClientIPEndpoint>(this);
@@ -6001,7 +6003,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6001 // for the client session anyway, in order to protect ourselves against bad code in plugins 6003 // for the client session anyway, in order to protect ourselves against bad code in plugins
6002 try 6004 try
6003 { 6005 {
6004
6005 byte[] visualparams = new byte[appear.VisualParam.Length]; 6006 byte[] visualparams = new byte[appear.VisualParam.Length];
6006 for (int i = 0; i < appear.VisualParam.Length; i++) 6007 for (int i = 0; i < appear.VisualParam.Length; i++)
6007 visualparams[i] = appear.VisualParam[i].ParamValue; 6008 visualparams[i] = appear.VisualParam[i].ParamValue;
@@ -11219,9 +11220,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11219 /// <summary> 11220 /// <summary>
11220 /// Send a response back to a client when it asks the asset server (via the region server) if it has 11221 /// Send a response back to a client when it asks the asset server (via the region server) if it has
11221 /// its appearance texture cached. 11222 /// its appearance texture cached.
11222 ///
11223 /// At the moment, we always reply that there is no cached texture.
11224 /// </summary> 11223 /// </summary>
11224 /// <remarks>
11225 /// At the moment, we always reply that there is no cached texture.
11226 /// </remarks>
11225 /// <param name="simclient"></param> 11227 /// <param name="simclient"></param>
11226 /// <param name="packet"></param> 11228 /// <param name="packet"></param>
11227 /// <returns></returns> 11229 /// <returns></returns>
@@ -11231,7 +11233,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11231 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet; 11233 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
11232 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); 11234 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
11233 11235
11234 if (cachedtex.AgentData.SessionID != SessionId) return false; 11236 if (cachedtex.AgentData.SessionID != SessionId)
11237 return false;
11235 11238
11236 // TODO: don't create new blocks if recycling an old packet 11239 // TODO: don't create new blocks if recycling an old packet
11237 cachedresp.AgentData.AgentID = AgentId; 11240 cachedresp.AgentData.AgentID = AgentId;
@@ -11629,6 +11632,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11629 if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate) 11632 if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate)
11630 logPacket = false; 11633 logPacket = false;
11631 11634
11635 if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily)
11636 logPacket = false;
11637
11632 if (logPacket) 11638 if (logPacket)
11633 m_log.DebugFormat( 11639 m_log.DebugFormat(
11634 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}", 11640 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
@@ -11686,6 +11692,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11686 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) 11692 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11687 logPacket = false; 11693 logPacket = false;
11688 11694
11695 if (DebugPacketLevel <= 25 && packet.Type == PacketType.RequestObjectPropertiesFamily)
11696 logPacket = false;
11697
11689 if (logPacket) 11698 if (logPacket)
11690 m_log.DebugFormat( 11699 m_log.DebugFormat(
11691 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", 11700 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 29e3580..f1a81ae 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -26,16 +26,15 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
31using System.Threading;
32using System.Text;
33using System.Timers;
30using log4net; 34using log4net;
31using Nini.Config; 35using Nini.Config;
32using OpenMetaverse; 36using OpenMetaverse;
33using OpenSim.Framework; 37using OpenSim.Framework;
34
35using System.Threading;
36using System.Timers;
37using System.Collections.Generic;
38
39using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes; 39using OpenSim.Region.Framework.Scenes;
41using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
@@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
45 public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule 44 public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
46 { 45 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}";
49
48 private Scene m_scene = null; 50 private Scene m_scene = null;
49 51
50 private int m_savetime = 5; // seconds to wait before saving changed appearance 52 private int m_savetime = 5; // seconds to wait before saving changed appearance
@@ -147,9 +149,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
147 // Process the baked texture array 149 // Process the baked texture array
148 if (textureEntry != null) 150 if (textureEntry != null)
149 { 151 {
152 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID);
153
154// WriteBakedTexturesReport(sp, m_log.DebugFormat);
155
150 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; 156 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
151 157
152 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID); 158// WriteBakedTexturesReport(sp, m_log.DebugFormat);
153 ValidateBakedTextureCache(sp, false); 159 ValidateBakedTextureCache(sp, false);
154 160
155 // This appears to be set only in the final stage of the appearance 161 // This appears to be set only in the final stage of the appearance
@@ -254,9 +260,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
254 } 260 }
255 261
256 /// <summary> 262 /// <summary>
257 /// Queue up a request to send appearance, makes it possible to 263 /// Queue up a request to send appearance.
258 /// accumulate changes without sending out each one separately.
259 /// </summary> 264 /// </summary>
265 /// <remarks>
266 /// Makes it possible to accumulate changes without sending out each one separately.
267 /// </remarks>
268 /// <param name="agentId"></param>
260 public void QueueAppearanceSend(UUID agentid) 269 public void QueueAppearanceSend(UUID agentid)
261 { 270 {
262// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); 271// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
@@ -557,5 +566,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
557 } 566 }
558 } 567 }
559 #endregion 568 #endregion
569
570 public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction)
571 {
572 outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName);
573 outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID");
574
575 Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID);
576
577 foreach (BakeType bt in bakedTextures.Keys)
578 {
579 string rawTextureID;
580
581 if (bakedTextures[bt] == null)
582 {
583 rawTextureID = "not set";
584 }
585 else
586 {
587 rawTextureID = bakedTextures[bt].TextureID.ToString();
588
589 if (m_scene.AssetService.Get(rawTextureID) == null)
590 rawTextureID += " (not found)";
591 else
592 rawTextureID += " (uploaded)";
593 }
594
595 outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID);
596 }
597
598 bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp);
599 outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
600 }
560 } 601 }
561} 602}
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
index 26bc922..8670229 100644
--- a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
@@ -31,9 +31,10 @@ using OpenSim.Framework;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 public delegate void ReportOutputAction(string format, params object[] args);
35
34 public interface IAvatarFactoryModule 36 public interface IAvatarFactoryModule
35 { 37 {
36
37 void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams); 38 void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
38 39
39 /// <summary> 40 /// <summary>
@@ -63,5 +64,13 @@ namespace OpenSim.Region.Framework.Interfaces
63 bool ValidateBakedTextureCache(IScenePresence sp); 64 bool ValidateBakedTextureCache(IScenePresence sp);
64 void QueueAppearanceSend(UUID agentid); 65 void QueueAppearanceSend(UUID agentid);
65 void QueueAppearanceSave(UUID agentid); 66 void QueueAppearanceSave(UUID agentid);
67
68 /// <summary>
69 /// Get a report about the current state of a scene presence's baked appearance textures.
70 /// </summary>
71 /// <param name="sp"></param>
72 /// <param name="reportOutputAction"></param>
73 /// <returns></returns>
74 void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction reportOutputAction);
66 } 75 }
67} \ No newline at end of file 76} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 7be95cd..f2e2ce7 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2667,7 +2667,7 @@ namespace OpenSim.Region.Framework.Scenes
2667 public void SendAppearanceToAgent(ScenePresence avatar) 2667 public void SendAppearanceToAgent(ScenePresence avatar)
2668 { 2668 {
2669// m_log.DebugFormat( 2669// m_log.DebugFormat(
2670// "[SCENE PRESENCE] Send appearance from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); 2670// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
2671 2671
2672 avatar.ControllingClient.SendAppearance( 2672 avatar.ControllingClient.SendAppearance(
2673 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); 2673 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
index 40cbc60..1ce24f1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs
@@ -50,8 +50,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
50 { 50 {
51// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}";
54
55 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); 53 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
56// private IAvatarFactoryModule m_avatarFactory; 54// private IAvatarFactoryModule m_avatarFactory;
57 55
@@ -197,37 +195,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
197 { 195 {
198 ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); 196 ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
199 if (sp != null && !sp.IsChildAgent) 197 if (sp != null && !sp.IsChildAgent)
200 { 198 scene.AvatarFactory.WriteBakedTexturesReport(sp, MainConsole.Instance.OutputFormat);
201 MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName);
202 MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID");
203
204 Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures
205 = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID);
206 foreach (BakeType bt in bakedTextures.Keys)
207 {
208 string rawTextureID;
209
210 if (bakedTextures[bt] == null)
211 {
212 rawTextureID = "not set";
213 }
214 else
215 {
216 rawTextureID = bakedTextures[bt].TextureID.ToString();
217
218 if (scene.AssetService.Get(rawTextureID) == null)
219 rawTextureID += " (not found)";
220 else
221 rawTextureID += " (uploaded)";
222 }
223
224 MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID);
225 }
226
227 bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
228 MainConsole.Instance.OutputFormat(
229 "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
230 }
231 } 199 }
232 else 200 else
233 { 201 {