appearance now survives logout. Tommorrow will involve moving
the MSSQL and MYSQL mappers back in under datastores and looking at doing gid bits for this0.6.0-stable
parent
afd5da6851
commit
fc77364972
|
@ -62,19 +62,19 @@ namespace OpenSim.Data
|
|||
public AvatarAppearance GetUserAppearance(LLUUID user) {
|
||||
AvatarAppearance aa;
|
||||
try {
|
||||
m_log.Info("[APPEARANCE] Found appearance for " + user.ToString());
|
||||
aa = aplist[user];
|
||||
m_log.Info("[APPEARANCE] Found appearance for " + user.ToString() + aa.ToString());
|
||||
} catch (System.Collections.Generic.KeyNotFoundException e) {
|
||||
m_log.Info("[APPEARANCE] Setting up default appearance for " + user.ToString());
|
||||
aplist[user] = new AvatarAppearance();
|
||||
aplist[user].Owner = user;
|
||||
aa = aplist[user];
|
||||
m_log.Info("[APPEARANCE] Setting up default appearance for " + user.ToString() + aa.ToString());
|
||||
}
|
||||
return aa;
|
||||
}
|
||||
public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) {
|
||||
aplist[user] = appearance;
|
||||
m_log.Info("[APPEARANCE] Setting appearance for " + user.ToString());
|
||||
m_log.Info("[APPEARANCE] Setting appearance for " + user.ToString() + appearance.ToString() );
|
||||
}
|
||||
public abstract void AddAttachment(LLUUID user, LLUUID item);
|
||||
public abstract void RemoveAttachment(LLUUID user, LLUUID item);
|
||||
|
|
|
@ -293,6 +293,16 @@ namespace OpenSim.Framework
|
|||
return textu;
|
||||
}
|
||||
|
||||
public override String ToString()
|
||||
{
|
||||
String s = "[Wearables] =>";
|
||||
s += "Body Item: " + BodyItem.ToString() + ";";
|
||||
s += "Skin Item: " + SkinItem.ToString() + ";";
|
||||
s += "Shirt Item: " + ShirtItem.ToString() + ";";
|
||||
s += "Pants Item: " + PantsItem.ToString() + ";";
|
||||
return s;
|
||||
}
|
||||
|
||||
protected AvatarAppearance(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
//System.Console.WriteLine("AvatarAppearance Deserialize BGN");
|
||||
|
|
|
@ -1509,8 +1509,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public void SetAppearance(byte[] texture, List<byte> visualParam)
|
||||
{
|
||||
m_appearance.SetAppearance(texture, visualParam);
|
||||
m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
|
||||
SetHeight(m_appearance.AvatarHeight);
|
||||
m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
|
||||
|
||||
SendAppearanceToAllOtherAgents();
|
||||
}
|
||||
|
@ -1518,6 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public void SetWearable(int wearableId, AvatarWearable wearable)
|
||||
{
|
||||
m_appearance.SetWearable(wearableId, wearable);
|
||||
m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -274,17 +274,11 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
|||
{
|
||||
IClientAPI clientView = (IClientAPI)sender;
|
||||
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId);
|
||||
AvatarAppearance avatAppearance = m_scene.CommsManager.UserService.GetUserAppearance(clientView.AgentId);
|
||||
if (profile != null)
|
||||
{
|
||||
if (profile.RootFolder != null)
|
||||
{
|
||||
if (m_avatarsAppearance.ContainsKey(clientView.AgentId))
|
||||
{
|
||||
AvatarAppearance avatAppearance = null;
|
||||
lock (m_avatarsAppearance)
|
||||
{
|
||||
avatAppearance = m_avatarsAppearance[clientView.AgentId];
|
||||
}
|
||||
|
||||
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
|
||||
{
|
||||
|
@ -294,8 +288,6 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
|||
{
|
||||
avatAppearance.Wearables[wear.Type].ItemID = LLUUID.Zero;
|
||||
avatAppearance.Wearables[wear.Type].AssetID = LLUUID.Zero;
|
||||
|
||||
UpdateDatabase(clientView.AgentId, avatAppearance);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -308,13 +300,11 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
|||
assetId = baseItem.AssetID;
|
||||
avatAppearance.Wearables[wear.Type].AssetID = assetId;
|
||||
avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID;
|
||||
|
||||
UpdateDatabase(clientView.AgentId, avatAppearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_scene.CommsManager.UserService.UpdateUserAppearance(clientView.AgentId, avatAppearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue