diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 29307534bc..d26a1bddc9 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -1545,7 +1545,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
options["profile"] = (string)requestData["profile"];
}
- if (requestData["noassets"].ToString() == "true")
+ if ((string)requestData["noassets"] == "true")
{
options["noassets"] = (string)requestData["noassets"] ;
}
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
index c637ccf180..594ce9dad9 100644
--- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Capabilities.Handlers
}
catch (Exception e)
{
- m_log.Error("[UPLOAD BAKED TEXTURE HANDLER]: " + e.ToString());
+ m_log.ErrorFormat("[UPLOAD BAKED TEXTURE HANDLER]: {0}{1}", e.Message, e.StackTrace);
}
return null;
@@ -117,7 +117,7 @@ namespace OpenSim.Capabilities.Handlers
///
private void BakedTextureUploaded(UUID assetID, byte[] data)
{
- // m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
+// m_log.DebugFormat("[UPLOAD BAKED TEXTURE HANDLER]: Received baked texture {0}", assetID.ToString());
AssetBase asset;
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 f0580dfdeb..3a0b861ee8 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -264,10 +264,12 @@ namespace OpenSim.Framework
}
///
- /// Set up appearance textures.
- /// Returns boolean that indicates whether the new entries actually change the
- /// existing values.
+ /// Set up appearance texture ids.
///
+ ///
+ /// True if any existing texture id was changed by the new data.
+ /// False if there were no changes or no existing texture ids.
+ ///
public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry)
{
if (textureEntry == null)
@@ -284,25 +286,30 @@ namespace OpenSim.Framework
if (newface == null)
{
- if (oldface == null) continue;
+ if (oldface == null)
+ continue;
}
else
{
- if (oldface != null && oldface.TextureID == newface.TextureID) continue;
+ if (oldface != null && oldface.TextureID == newface.TextureID)
+ continue;
}
changed = true;
}
m_texture = textureEntry;
+
return changed;
}
///
/// Set up visual parameters for the avatar and refresh the avatar height
- /// Returns boolean that indicates whether the new entries actually change the
- /// existing values.
///
+ ///
+ /// True if any existing visual parameter was changed by the new data.
+ /// False if there were no changes or no existing visual parameters.
+ ///
public virtual bool SetVisualParams(byte[] visualParams)
{
if (visualParams == null)
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 6648a60abc..083dcc0b0c 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
public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
UUID agentId, UUID sessionId, uint circuitCode)
{
+// DebugPacketLevel = 1;
+
RegisterInterface(this);
RegisterInterface(this);
RegisterInterface(this);
@@ -4951,8 +4953,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
update.Scale = new Vector3(0.45f, 0.6f, 1.9f);
update.Text = Utils.EmptyBytes;
update.TextColor = new byte[4];
+
+ // Don't send texture anim for avatars - this has no meaning for them.
update.TextureAnim = Utils.EmptyBytes;
- update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes;
+
+ // Don't send texture entry for avatars here - this is accomplished via the AvatarAppearance packet
+ update.TextureEntry = Utils.EmptyBytes;
+// update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes;
+
update.UpdateFlags = (uint)(
PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner |
PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer |
@@ -6062,7 +6070,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// for the client session anyway, in order to protect ourselves against bad code in plugins
try
{
-
byte[] visualparams = new byte[appear.VisualParam.Length];
for (int i = 0; i < appear.VisualParam.Length; i++)
visualparams[i] = appear.VisualParam[i].ParamValue;
@@ -11344,9 +11351,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
///
/// Send a response back to a client when it asks the asset server (via the region server) if it has
/// its appearance texture cached.
- ///
- /// At the moment, we always reply that there is no cached texture.
///
+ ///
+ /// At the moment, we always reply that there is no cached texture.
+ ///
///
///
///
@@ -11356,7 +11364,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
- if (cachedtex.AgentData.SessionID != SessionId) return false;
+ if (cachedtex.AgentData.SessionID != SessionId)
+ return false;
// TODO: don't create new blocks if recycling an old packet
cachedresp.AgentData.AgentID = AgentId;
@@ -11754,6 +11763,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate)
logPacket = false;
+ if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily)
+ logPacket = false;
+
if (logPacket)
m_log.DebugFormat(
"[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
@@ -11811,6 +11823,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
logPacket = false;
+ if (DebugPacketLevel <= 25 && packet.Type == PacketType.RequestObjectPropertiesFamily)
+ logPacket = false;
+
if (logPacket)
m_log.DebugFormat(
"[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 acf36dfb1e..bc7bf664c2 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -26,16 +26,15 @@
*/
using System;
+using System.Collections.Generic;
using System.Reflection;
+using System.Threading;
+using System.Text;
+using System.Timers;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
-
-using System.Threading;
-using System.Timers;
-using System.Collections.Generic;
-
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
@@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
+ public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}";
+
private Scene m_scene = null;
private int m_savetime = 5; // seconds to wait before saving changed appearance
@@ -147,9 +149,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// Process the baked texture array
if (textureEntry != null)
{
+ m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID);
+
+// WriteBakedTexturesReport(sp, m_log.DebugFormat);
+
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
- m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID);
+// WriteBakedTexturesReport(sp, m_log.DebugFormat);
ValidateBakedTextureCache(sp, false);
// This appears to be set only in the final stage of the appearance
@@ -254,9 +260,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
}
///
- /// Queue up a request to send appearance, makes it possible to
- /// accumulate changes without sending out each one separately.
+ /// Queue up a request to send appearance.
///
+ ///
+ /// Makes it possible to accumulate changes without sending out each one separately.
+ ///
+ ///
public void QueueAppearanceSend(UUID agentid)
{
// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
@@ -404,10 +413,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
m_savequeue.Remove(avatarID);
}
}
- }
- if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
- m_updateTimer.Stop();
+ // We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on
+ // another thread inbetween the first count calls and m_updateTimer.Stop() on this thread.
+ lock (m_sendqueue)
+ if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
+ m_updateTimer.Stop();
+ }
}
private void SaveAppearance(UUID agentid)
@@ -553,5 +565,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
}
}
#endregion
+
+ public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction)
+ {
+ outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName);
+ outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID");
+
+ Dictionary bakedTextures = GetBakedTextureFaces(sp.UUID);
+
+ foreach (BakeType bt in bakedTextures.Keys)
+ {
+ string rawTextureID;
+
+ if (bakedTextures[bt] == null)
+ {
+ rawTextureID = "not set";
+ }
+ else
+ {
+ rawTextureID = bakedTextures[bt].TextureID.ToString();
+
+ if (m_scene.AssetService.Get(rawTextureID) == null)
+ rawTextureID += " (not found)";
+ else
+ rawTextureID += " (uploaded)";
+ }
+
+ outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID);
+ }
+
+ bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp);
+ outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
+ }
}
}
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
index 26bc922748..8670229e8b 100644
--- a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
@@ -31,9 +31,10 @@ using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces
{
+ public delegate void ReportOutputAction(string format, params object[] args);
+
public interface IAvatarFactoryModule
{
-
void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
///
@@ -63,5 +64,13 @@ namespace OpenSim.Region.Framework.Interfaces
bool ValidateBakedTextureCache(IScenePresence sp);
void QueueAppearanceSend(UUID agentid);
void QueueAppearanceSave(UUID agentid);
+
+ ///
+ /// Get a report about the current state of a scene presence's baked appearance textures.
+ ///
+ ///
+ ///
+ ///
+ void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction reportOutputAction);
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0eecf77611..f5b37d3fc5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2554,7 +2554,10 @@ namespace OpenSim.Region.Framework.Scenes
// again here... this comes after the cached appearance check because the avatars
// appearance goes into the avatar update packet
SendAvatarDataToAllAgents();
- SendAppearanceToAgent(this);
+
+ // Sending us our own appearance does not seem to be necessary, and the viewer warns in the log if you do
+ // this.
+// SendAppearanceToAgent(this);
// If we are using the the cached appearance then send it out to everyone
if (cachedappearance)
@@ -2689,7 +2692,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendAppearanceToAgent(ScenePresence avatar)
{
// m_log.DebugFormat(
-// "[SCENE PRESENCE] Send appearance from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
+// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
avatar.ControllingClient.SendAppearance(
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 40cbc606a1..1ce24f1745 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
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}";
-
private Dictionary m_scenes = new Dictionary();
// private IAvatarFactoryModule m_avatarFactory;
@@ -197,37 +195,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName);
if (sp != null && !sp.IsChildAgent)
- {
- MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName);
- MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID");
-
- Dictionary bakedTextures
- = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID);
- foreach (BakeType bt in bakedTextures.Keys)
- {
- string rawTextureID;
-
- if (bakedTextures[bt] == null)
- {
- rawTextureID = "not set";
- }
- else
- {
- rawTextureID = bakedTextures[bt].TextureID.ToString();
-
- if (scene.AssetService.Get(rawTextureID) == null)
- rawTextureID += " (not found)";
- else
- rawTextureID += " (uploaded)";
- }
-
- MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID);
- }
-
- bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
- MainConsole.Instance.OutputFormat(
- "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
- }
+ scene.AvatarFactory.WriteBakedTexturesReport(sp, MainConsole.Instance.OutputFormat);
}
else
{