aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs25
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs66
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs7
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs34
5 files changed, 91 insertions, 52 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 6648a60..083dcc0 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -452,6 +452,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
452 public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, 452 public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
453 UUID agentId, UUID sessionId, uint circuitCode) 453 UUID agentId, UUID sessionId, uint circuitCode)
454 { 454 {
455// DebugPacketLevel = 1;
456
455 RegisterInterface<IClientIM>(this); 457 RegisterInterface<IClientIM>(this);
456 RegisterInterface<IClientChat>(this); 458 RegisterInterface<IClientChat>(this);
457 RegisterInterface<IClientIPEndpoint>(this); 459 RegisterInterface<IClientIPEndpoint>(this);
@@ -4951,8 +4953,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4951 update.Scale = new Vector3(0.45f, 0.6f, 1.9f); 4953 update.Scale = new Vector3(0.45f, 0.6f, 1.9f);
4952 update.Text = Utils.EmptyBytes; 4954 update.Text = Utils.EmptyBytes;
4953 update.TextColor = new byte[4]; 4955 update.TextColor = new byte[4];
4956
4957 // Don't send texture anim for avatars - this has no meaning for them.
4954 update.TextureAnim = Utils.EmptyBytes; 4958 update.TextureAnim = Utils.EmptyBytes;
4955 update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes; 4959
4960 // Don't send texture entry for avatars here - this is accomplished via the AvatarAppearance packet
4961 update.TextureEntry = Utils.EmptyBytes;
4962// update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes;
4963
4956 update.UpdateFlags = (uint)( 4964 update.UpdateFlags = (uint)(
4957 PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner | 4965 PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner |
4958 PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer | 4966 PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer |
@@ -6062,7 +6070,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6062 // for the client session anyway, in order to protect ourselves against bad code in plugins 6070 // for the client session anyway, in order to protect ourselves against bad code in plugins
6063 try 6071 try
6064 { 6072 {
6065
6066 byte[] visualparams = new byte[appear.VisualParam.Length]; 6073 byte[] visualparams = new byte[appear.VisualParam.Length];
6067 for (int i = 0; i < appear.VisualParam.Length; i++) 6074 for (int i = 0; i < appear.VisualParam.Length; i++)
6068 visualparams[i] = appear.VisualParam[i].ParamValue; 6075 visualparams[i] = appear.VisualParam[i].ParamValue;
@@ -11344,9 +11351,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11344 /// <summary> 11351 /// <summary>
11345 /// Send a response back to a client when it asks the asset server (via the region server) if it has 11352 /// Send a response back to a client when it asks the asset server (via the region server) if it has
11346 /// its appearance texture cached. 11353 /// its appearance texture cached.
11347 ///
11348 /// At the moment, we always reply that there is no cached texture.
11349 /// </summary> 11354 /// </summary>
11355 /// <remarks>
11356 /// At the moment, we always reply that there is no cached texture.
11357 /// </remarks>
11350 /// <param name="simclient"></param> 11358 /// <param name="simclient"></param>
11351 /// <param name="packet"></param> 11359 /// <param name="packet"></param>
11352 /// <returns></returns> 11360 /// <returns></returns>
@@ -11356,7 +11364,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11356 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet; 11364 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
11357 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); 11365 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
11358 11366
11359 if (cachedtex.AgentData.SessionID != SessionId) return false; 11367 if (cachedtex.AgentData.SessionID != SessionId)
11368 return false;
11360 11369
11361 // TODO: don't create new blocks if recycling an old packet 11370 // TODO: don't create new blocks if recycling an old packet
11362 cachedresp.AgentData.AgentID = AgentId; 11371 cachedresp.AgentData.AgentID = AgentId;
@@ -11754,6 +11763,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11754 if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate) 11763 if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate)
11755 logPacket = false; 11764 logPacket = false;
11756 11765
11766 if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily)
11767 logPacket = false;
11768
11757 if (logPacket) 11769 if (logPacket)
11758 m_log.DebugFormat( 11770 m_log.DebugFormat(
11759 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}", 11771 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
@@ -11811,6 +11823,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11811 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) 11823 if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11812 logPacket = false; 11824 logPacket = false;
11813 11825
11826 if (DebugPacketLevel <= 25 && packet.Type == PacketType.RequestObjectPropertiesFamily)
11827 logPacket = false;
11828
11814 if (logPacket) 11829 if (logPacket)
11815 m_log.DebugFormat( 11830 m_log.DebugFormat(
11816 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", 11831 "[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 acf36df..bc7bf66 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);
@@ -404,10 +413,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
404 m_savequeue.Remove(avatarID); 413 m_savequeue.Remove(avatarID);
405 } 414 }
406 } 415 }
407 }
408 416
409 if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) 417 // We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on
410 m_updateTimer.Stop(); 418 // another thread inbetween the first count calls and m_updateTimer.Stop() on this thread.
419 lock (m_sendqueue)
420 if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
421 m_updateTimer.Stop();
422 }
411 } 423 }
412 424
413 private void SaveAppearance(UUID agentid) 425 private void SaveAppearance(UUID agentid)
@@ -553,5 +565,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
553 } 565 }
554 } 566 }
555 #endregion 567 #endregion
568
569 public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction)
570 {
571 outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName);
572 outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID");
573
574 Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID);
575
576 foreach (BakeType bt in bakedTextures.Keys)
577 {
578 string rawTextureID;
579
580 if (bakedTextures[bt] == null)
581 {
582 rawTextureID = "not set";
583 }
584 else
585 {
586 rawTextureID = bakedTextures[bt].TextureID.ToString();
587
588 if (m_scene.AssetService.Get(rawTextureID) == null)
589 rawTextureID += " (not found)";
590 else
591 rawTextureID += " (uploaded)";
592 }
593
594 outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID);
595 }
596
597 bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp);
598 outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
599 }
556 } 600 }
557} 601}
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 0eecf77..f5b37d3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2554,7 +2554,10 @@ namespace OpenSim.Region.Framework.Scenes
2554 // again here... this comes after the cached appearance check because the avatars 2554 // again here... this comes after the cached appearance check because the avatars
2555 // appearance goes into the avatar update packet 2555 // appearance goes into the avatar update packet
2556 SendAvatarDataToAllAgents(); 2556 SendAvatarDataToAllAgents();
2557 SendAppearanceToAgent(this); 2557
2558 // Sending us our own appearance does not seem to be necessary, and the viewer warns in the log if you do
2559 // this.
2560// SendAppearanceToAgent(this);
2558 2561
2559 // If we are using the the cached appearance then send it out to everyone 2562 // If we are using the the cached appearance then send it out to everyone
2560 if (cachedappearance) 2563 if (cachedappearance)
@@ -2689,7 +2692,7 @@ namespace OpenSim.Region.Framework.Scenes
2689 public void SendAppearanceToAgent(ScenePresence avatar) 2692 public void SendAppearanceToAgent(ScenePresence avatar)
2690 { 2693 {
2691// m_log.DebugFormat( 2694// m_log.DebugFormat(
2692// "[SCENE PRESENCE] Send appearance from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); 2695// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
2693 2696
2694 avatar.ControllingClient.SendAppearance( 2697 avatar.ControllingClient.SendAppearance(
2695 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); 2698 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 {