Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-12-04 00:09:32 +00:00
commit 24af7b8384
5 changed files with 46 additions and 24 deletions

View File

@ -48,7 +48,7 @@ namespace OpenSim.Framework
public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
protected UUID m_owner; protected UUID m_owner;
protected int m_serial = 1; protected int m_serial = 0;
protected byte[] m_visualparams; protected byte[] m_visualparams;
protected Primitive.TextureEntry m_texture; protected Primitive.TextureEntry m_texture;
protected AvatarWearable[] m_wearables; protected AvatarWearable[] m_wearables;
@ -103,7 +103,7 @@ namespace OpenSim.Framework
{ {
// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance for {0}",owner); // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance for {0}",owner);
m_serial = 1; m_serial = 0;
m_owner = owner; m_owner = owner;
SetDefaultWearables(); SetDefaultWearables();
@ -127,7 +127,7 @@ namespace OpenSim.Framework
{ {
// m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance for {0}",avatarID); // m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance for {0}",avatarID);
m_serial = 1; m_serial = 0;
m_owner = avatarID; m_owner = avatarID;
if (wearables != null) if (wearables != null)
@ -160,7 +160,7 @@ namespace OpenSim.Framework
if (appearance == null) if (appearance == null)
{ {
m_serial = 1; m_serial = 0;
m_owner = UUID.Zero; m_owner = UUID.Zero;
SetDefaultWearables(); SetDefaultWearables();
@ -229,6 +229,24 @@ namespace OpenSim.Framework
m_wearables = AvatarWearable.DefaultWearables; m_wearables = AvatarWearable.DefaultWearables;
} }
/// <summary>
/// Invalidate all of the baked textures in the appearance, useful
/// if you know that none are valid
/// </summary>
public virtual void ResetAppearance()
{
m_serial = 0;
SetDefaultParams();
SetDefaultTexture();
//for (int i = 0; i < BAKE_INDICES.Length; i++)
// {
// int idx = BAKE_INDICES[i];
// m_texture.FaceTextures[idx].TextureID = UUID.Zero;
// }
}
protected virtual void SetDefaultParams() protected virtual void SetDefaultParams()
{ {
m_visualparams = new byte[] { 33,61,85,23,58,127,63,85,63,42,0,85,63,36,85,95,153,63,34,0,63,109,88,132,63,136,81,85,103,136,127,0,150,150,150,127,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,104,0,0,0,0,0,0,0,0,0,145,216,133,0,127,0,127,170,0,0,127,127,109,85,127,127,63,85,42,150,150,150,150,150,150,150,25,150,150,150,0,127,0,0,144,85,127,132,127,85,0,127,127,127,127,127,127,59,127,85,127,127,106,47,79,127,127,204,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,36,85,131,127,127,127,153,95,0,140,75,27,127,127,0,150,150,198,0,0,63,30,127,165,209,198,127,127,153,204,51,51,255,255,255,204,0,255,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,127,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 }; m_visualparams = new byte[] { 33,61,85,23,58,127,63,85,63,42,0,85,63,36,85,95,153,63,34,0,63,109,88,132,63,136,81,85,103,136,127,0,150,150,150,127,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,104,0,0,0,0,0,0,0,0,0,145,216,133,0,127,0,127,170,0,0,127,127,109,85,127,127,63,85,42,150,150,150,150,150,150,150,25,150,150,150,0,127,0,0,144,85,127,132,127,85,0,127,127,127,127,127,127,59,127,85,127,127,106,47,79,127,127,204,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,36,85,131,127,127,127,153,95,0,140,75,27,127,127,0,150,150,198,0,0,63,30,127,165,209,198,127,127,153,204,51,51,255,255,255,204,0,255,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,127,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 };
@ -255,7 +273,7 @@ namespace OpenSim.Framework
protected virtual void SetDefaultTexture() protected virtual void SetDefaultTexture()
{ {
m_texture = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
// for (uint i = 0; i < TEXTURE_COUNT; i++) // for (uint i = 0; i < TEXTURE_COUNT; i++)
// m_texture.CreateFace(i).TextureID = new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE); // m_texture.CreateFace(i).TextureID = new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE);

View File

@ -1332,7 +1332,7 @@ namespace OpenSim.Framework.Capabilities
newAssetID = UUID.Random(); newAssetID = UUID.Random();
uploaderPath = path; uploaderPath = path;
httpListener = httpServer; httpListener = httpServer;
// m_log.WarnFormat("[CAPS] baked texture upload starting for {0}",newAssetID); m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID);
} }
/// <summary> /// <summary>
@ -1362,6 +1362,8 @@ namespace OpenSim.Framework.Capabilities
handlerUpLoad(newAssetID, data); handlerUpLoad(newAssetID, data);
} }
m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID);
return res; return res;
} }
} }

View File

@ -361,13 +361,13 @@ namespace OpenSim
m_moduleLoader.InitialiseSharedModules(scene); m_moduleLoader.InitialiseSharedModules(scene);
// Use this in the future, the line above will be deprecated soon // Use this in the future, the line above will be deprecated soon
m_log.Info("[MODULES]: Loading Region's modules (new style)"); m_log.Info("[REGIONMODULE]: Loading Region's modules (new style)");
IRegionModulesController controller; IRegionModulesController controller;
if (ApplicationRegistry.TryGet(out controller)) if (ApplicationRegistry.TryGet(out controller))
{ {
controller.AddRegionToModules(scene); controller.AddRegionToModules(scene);
} }
else m_log.Error("[MODULES]: The new RegionModulesController is missing..."); else m_log.Error("[REGIONMODULE]: The new RegionModulesController is missing...");
if (m_securePermissionsLoading) if (m_securePermissionsLoading)
{ {

View File

@ -115,7 +115,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
#endregion #endregion
/// <summary>
/// Check for the existence of the baked texture assets. Request a rebake
/// unless checkonly is true.
/// </summary>
/// <param name="client"></param>
/// <param name="checkonly"></param>
public bool ValidateBakedTextureCache(IClientAPI client) public bool ValidateBakedTextureCache(IClientAPI client)
{ {
return ValidateBakedTextureCache(client, true); return ValidateBakedTextureCache(client, true);
@ -157,12 +162,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// one and we're done otherwise, ask for a rebake // one and we're done otherwise, ask for a rebake
if (checkonly) return false; if (checkonly) return false;
m_log.WarnFormat("[AVFACTORY] missing baked texture {0}, request rebake",face.TextureID); m_log.InfoFormat("[AVFACTORY] missing baked texture {0}, request rebake",face.TextureID);
client.SendRebakeAvatarTextures(face.TextureID); client.SendRebakeAvatarTextures(face.TextureID);
} }
} }
m_log.WarnFormat("[AVFACTORY]: complete texture check for {0}",client.AgentId); m_log.InfoFormat("[AVFACTORY]: complete texture check for {0}",client.AgentId);
// If we only found default textures, then the appearance is not cached // If we only found default textures, then the appearance is not cached
return (defonly ? false : true); return (defonly ? false : true);
@ -182,8 +187,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
return; return;
} }
m_log.WarnFormat("[AVFACTORY]: start SetAppearance for {0}",client.AgentId); m_log.InfoFormat("[AVFACTORY]: start SetAppearance for {0}",client.AgentId);
// TODO: This is probably not necessary any longer, just assume the
// textureEntry set implies that the appearance transaction is complete
bool changed = false; bool changed = false;
// Process the texture entry transactionally, this doesn't guarantee that Appearance is // Process the texture entry transactionally, this doesn't guarantee that Appearance is
@ -203,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{ {
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
m_log.WarnFormat("[AVFACTORY]: received texture update for {0}",client.AgentId); m_log.InfoFormat("[AVFACTORY]: received texture update for {0}",client.AgentId);
Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(client,false); }); Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(client,false); });
// This appears to be set only in the final stage of the appearance // This appears to be set only in the final stage of the appearance
@ -216,13 +223,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
} }
// // If something changed in the appearance then queue an appearance save
// if (changed)
// QueueAppearanceSave(client.AgentId);
// // And always queue up an appearance update to send out
// QueueAppearanceSend(client.AgentId);
// m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
} }
@ -377,9 +377,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId);
// we need to clean out the existing textures
sp.Appearance.ResetAppearance();
// operate on a copy of the appearance so we don't have to lock anything // operate on a copy of the appearance so we don't have to lock anything
AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false);
sp.Appearance.ResetBakedTextures(); // this makes sure we don't reuse old textures if the baking takes time
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
{ {

View File

@ -2789,7 +2789,7 @@ namespace OpenSim.Region.Framework.Scenes
// If we aren't using a cached appearance, then clear out the baked textures // If we aren't using a cached appearance, then clear out the baked textures
if (! cachedappearance) if (! cachedappearance)
{ {
m_appearance.ResetBakedTextures(); m_appearance.ResetAppearance();
if (m_scene.AvatarFactory != null) if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(UUID); m_scene.AvatarFactory.QueueAppearanceSave(UUID);
} }
@ -2799,12 +2799,12 @@ namespace OpenSim.Region.Framework.Scenes
// again here... this comes after the cached appearance check because the avatars // again here... this comes after the cached appearance check because the avatars
// appearance goes into the avatar update packet // appearance goes into the avatar update packet
SendAvatarDataToAllAgents(); SendAvatarDataToAllAgents();
SendAppearanceToAgent(this);
// If we are using the the cached appearance then send it out to everyone // If we are using the the cached appearance then send it out to everyone
if (cachedappearance) if (cachedappearance)
{ {
m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); m_log.InfoFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
SendAppearanceToAgent(this);
// If the avatars baked textures are all in the cache, then we have a // If the avatars baked textures are all in the cache, then we have a
// complete appearance... send it out, if not, then we'll send it when // complete appearance... send it out, if not, then we'll send it when