Half of the compatibility is working. Login into a new region with

old data works. Teleport out of a new region with old data works.
Teleport into a new region with old data does not trigger the
necessary rebake.
viewer-2-initial-appearance
Master ScienceSim 2010-10-25 14:11:47 -07:00
parent 657cceb884
commit 6e58c3d563
4 changed files with 29 additions and 21 deletions

View File

@ -368,15 +368,12 @@ namespace OpenSim.Framework
} }
} }
if (args["packed_appearance"] != null) if (args.ContainsKey("packed_appearance") && (args["packed_appearance"].Type == OSDType.Map))
{ {
if (args["packed_appearance"].Type == OSDType.Map) Appearance.Unpack((OSDMap)args["packed_appearance"]);
{ // DEBUG ON
Appearance.Unpack((OSDMap)args["packed_appearance"]); m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance");
m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); // DEBUG OFF
}
else
m_log.WarnFormat("[AGENTCIRCUITDATA] packed_appearance is not a map:\n{0}",args["packed_appearance"].ToString());
} }
// DEBUG ON // DEBUG ON
else else

View File

@ -389,7 +389,7 @@ namespace OpenSim.Framework
changed = true; changed = true;
// DEBUG ON // DEBUG ON
if (newface != null) if (newface != null)
m_log.WarnFormat("[SCENEPRESENCE] index {0}, new texture id {1}",i,newface.TextureID); m_log.WarnFormat("[AVATAR APPEARANCE] index {0}, new texture id {1}",i,newface.TextureID);
// DEBUG OFF // DEBUG OFF
} }

View File

@ -390,8 +390,11 @@ namespace OpenSim.Framework
// The code to pack textures, visuals, wearables and attachments // The code to pack textures, visuals, wearables and attachments
// should be removed; packed appearance contains the full appearance // should be removed; packed appearance contains the full appearance
// This is retained for backward compatibility only // This is retained for backward compatibility only
if ((Appearance.Texture != null) && (Appearance.Texture.Length > 0)) if (Appearance.Texture != null)
args["texture_entry"] = OSD.FromBinary(Appearance.Texture); {
byte[] rawtextures = Appearance.Texture.GetBytes();
args["texture_entry"] = OSD.FromBinary(rawtextures);
}
if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0)) if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0))
args["visual_params"] = OSD.FromBinary(Appearance.VisualParams); args["visual_params"] = OSD.FromBinary(Appearance.VisualParams);
@ -408,10 +411,10 @@ namespace OpenSim.Framework
args["wearables"] = wears; args["wearables"] = wears;
} }
List<AvatarAttachments> attachments = Appearance.GetAttachments(); List<AvatarAttachment> attachments = Appearance.GetAttachments();
if ((attachments != null) && (attachments.Length > 0)) if ((attachments != null) && (attachments.Count > 0))
{ {
OSDArray attachs = new OSDArray(attachments.Length); OSDArray attachs = new OSDArray(attachments.Count);
foreach (AvatarAttachment att in attachments) foreach (AvatarAttachment att in attachments)
attachs.Add(att.Pack()); attachs.Add(att.Pack());
args["attachments"] = attachs; args["attachments"] = attachs;
@ -560,7 +563,11 @@ namespace OpenSim.Framework
// should be removed; packed appearance contains the full appearance // should be removed; packed appearance contains the full appearance
// This is retained for backward compatibility only // This is retained for backward compatibility only
if (args["texture_entry"] != null) if (args["texture_entry"] != null)
Appearance.SetTextureEntries(args["texture_entry"].AsBinary()); {
byte[] rawtextures = args["texture_entry"].AsBinary();
Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length);
Appearance.SetTextureEntries(textures);
}
if (args["visual_params"] != null) if (args["visual_params"] != null)
Appearance.SetVisualParams(args["visual_params"].AsBinary()); Appearance.SetVisualParams(args["visual_params"].AsBinary());
@ -578,21 +585,25 @@ namespace OpenSim.Framework
if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
{ {
OSDArray attachs = (OSDArray)(args["attachments"]); OSDArray attachs = (OSDArray)(args["attachments"]);
AvatarAttachment[] attachments = new AvatarAttachment[attachs.Count];
int i = 0;
foreach (OSD o in attachs) foreach (OSD o in attachs)
{ {
if (o.Type == OSDType.Map) if (o.Type == OSDType.Map)
{ {
attachments[i++] = new AvatarAttachment((OSDMap)o); // We know all of these must end up as attachments so we
// append rather than replace to ensure multiple attachments
// per point continues to work
Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
} }
} }
Appearance.SetAttachments(attachments);
} }
// end of code to remove // end of code to remove
if (args["packed_appearance"] != null) if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]); Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]);
// DEBUG ON
else
System.Console.WriteLine("No packed appearance in AgentUpdate");
// DEBUG OFF
if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
{ {

View File

@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{ {
if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) if (m_scene.AssetService.Get(face.TextureID.ToString()) == null)
{ {
m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",face.TextureID,j,this.Name); m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",face.TextureID,j,client.Name);
client.SendRebakeAvatarTextures(face.TextureID); client.SendRebakeAvatarTextures(face.TextureID);
} }
} }