testing avatar appearance as a user service

0.6.0-stable
Sean Dague 2008-05-15 20:25:42 +00:00
parent 3dcc3e4798
commit 4a9ee9f870
7 changed files with 57 additions and 38 deletions

View File

@ -747,15 +747,15 @@ namespace OpenSim.Data.MSSQL
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
override public AvatarAppearance GetUserAppearance(LLUUID user)
{
return new AvatarAppearance();
}
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// {
// return new AvatarAppearance();
// }
override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
{
return;
}
// override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
// {
// return;
// }
override public void AddAttachment(LLUUID user, LLUUID item)
{

View File

@ -630,15 +630,15 @@ namespace OpenSim.Data.MySQL
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
override public AvatarAppearance GetUserAppearance(LLUUID user)
{
return new AvatarAppearance();
}
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// {
// return new AvatarAppearance();
// }
override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
{
return;
}
// override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
// {
// return;
// }
override public void AddAttachment(LLUUID user, LLUUID item)
{

View File

@ -306,7 +306,7 @@ namespace OpenSim.Data.NHibernate
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
override public AvatarAppearance GetUserAppearance(LLUUID user)
public AvatarAppearance GetUserAppearance(LLUUID user)
{
AvatarAppearance appearance;
// TODO: I'm sure I'll have to do something silly here
@ -328,7 +328,7 @@ namespace OpenSim.Data.NHibernate
}
override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
{
bool exists = ExistsAppearance(user);
using (ISession session = factory.OpenSession())

View File

@ -480,15 +480,15 @@ namespace OpenSim.Data.SQLite
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
override public AvatarAppearance GetUserAppearance(LLUUID user)
{
return new AvatarAppearance();
}
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// {
// return new AvatarAppearance();
// }
override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
{
return;
}
// override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
// {
// return;
// }
override public void AddAttachment(LLUUID user, LLUUID item)
{

View File

@ -33,6 +33,8 @@ namespace OpenSim.Data
{
public abstract class UserDataBase : IUserData
{
private Dictionary<LLUUID, AvatarAppearance> aplist = new Dictionary<LLUUID, AvatarAppearance>();
public abstract UserProfileData GetUserByUUID(LLUUID user);
public abstract UserProfileData GetUserByName(string fname, string lname);
public abstract UserAgentData GetAgentByUUID(LLUUID user);
@ -53,8 +55,16 @@ namespace OpenSim.Data
public abstract string Name {get;}
public abstract void Initialise(string connect);
public abstract List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query);
public abstract AvatarAppearance GetUserAppearance(LLUUID user);
public abstract void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance);
public AvatarAppearance GetUserAppearance(LLUUID user) {
if (aplist[user] != null) {
aplist[user] = new AvatarAppearance();
aplist[user].Owner = user;
}
return aplist[user];
}
public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) {
aplist[user] = appearance;
}
public abstract void AddAttachment(LLUUID user, LLUUID item);
public abstract void RemoveAttachment(LLUUID user, LLUUID item);
public abstract List<LLUUID> GetAttachments(LLUUID user);

View File

@ -1797,16 +1797,18 @@ namespace OpenSim.Region.Environment.Scenes
protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance)
{
if (m_AvatarFactory == null ||
!m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance))
{
//not found Appearance
m_log.Warn("[AVATAR DEBUGGING]: Couldn't fetch avatar appearance from factory, please report this to the opensim mantis");
byte[] visualParams;
AvatarWearable[] wearables;
GetDefaultAvatarAppearance(out wearables, out visualParams);
appearance = new AvatarAppearance(client.AgentId, wearables, visualParams);
}
appearance = CommsManager.UserService.GetUserAppearance(client.AgentId);
// if (m_AvatarFactory == null ||
// !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance))
// {
// //not found Appearance
// m_log.Warn("[AVATAR DEBUGGING]: Couldn't fetch avatar appearance from factory, please report this to the opensim mantis");
// byte[] visualParams;
// AvatarWearable[] wearables;
// GetDefaultAvatarAppearance(out wearables, out visualParams);
// appearance = new AvatarAppearance(client.AgentId, wearables, visualParams);
// }
}
/// <summary>

View File

@ -405,6 +405,8 @@ namespace OpenSim.Region.Environment.Scenes
RegisterToEvents();
SetDirectionVectors();
m_appearance = m_scene.CommsManager.UserService.GetUserAppearance(client.AgentId);
try
{
m_scene.LandChannel.SendLandUpdate(this, true);
@ -1465,6 +1467,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable)
{
m_appearance.SetWearable(wearableId, wearable);
m_scene.CommsManager.UserService.UpdateUserAppearance(client.AgentId, m_appearance);
client.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
}
@ -1506,6 +1509,7 @@ 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);
SendAppearanceToAllOtherAgents();
@ -1804,6 +1808,7 @@ namespace OpenSim.Region.Environment.Scenes
static ScenePresence()
{
LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
DefaultTexture = textu.ToBytes();
}
@ -2030,6 +2035,8 @@ namespace OpenSim.Region.Environment.Scenes
m_controllingClient = client;
m_regionInfo = region;
m_scene = scene;
m_appearance = m_scene.CommsManager.UserService.GetUserAppearance(client.AgentId);
RegisterToEvents();
/*