From 77e43f480154b0a950d9d5f54df5c225fc64e77a Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 11 Jan 2010 17:30:05 -0800
Subject: Fixed a couple of bugs with Appearance. Appearance is all good now.
---
OpenSim/Region/Application/OpenSimBase.cs | 1 -
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 1 +
.../Avatar/AvatarFactory/AvatarFactoryModule.cs | 17 ++++++++++-------
.../Avatar/LocalAvatarServiceConnector.cs | 10 +++++-----
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 ++--
OpenSim/Region/Framework/Scenes/Scene.cs | 2 +-
.../Framework/Scenes/SceneCommunicationService.cs | 4 ++--
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++++
OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 2 +-
9 files changed, 26 insertions(+), 19 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index c6932cf..f3f715a 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -197,7 +197,6 @@ namespace OpenSim
LoadPlugins();
foreach (IApplicationPlugin plugin in m_plugins)
{
- m_log.Debug("XXX PostInitialise " + plugin.Name);
plugin.PostInitialise();
}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 795b099..b937226 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -5474,6 +5474,7 @@ 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;
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 87d0b0d..c01d66a 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
//if ((profile != null) && (profile.RootFolder != null))
if (avatar != null)
{
- appearance = avatar.ToAvatarAppearance();
+ appearance = avatar.ToAvatarAppearance(avatarId);
return true;
}
@@ -153,6 +153,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
///
public void AvatarIsWearing(Object sender, AvatarWearingArgs e)
{
+ m_log.DebugFormat("[APPEARANCE]: AvatarIsWearing");
+
IClientAPI clientView = (IClientAPI)sender;
ScenePresence sp = m_scene.GetScenePresence(clientView.AgentId);
@@ -162,12 +164,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
return;
}
- AvatarAppearance avatAppearance = null;
- if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance))
- {
- m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence");
- avatAppearance = sp.Appearance;
- }
+ AvatarAppearance avatAppearance = sp.Appearance;
+ //if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance))
+ //{
+ // m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence");
+ // avatAppearance = sp.Appearance;
+ //}
//m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name);
@@ -194,6 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
public void UpdateDatabase(UUID user, AvatarAppearance appearance)
{
+ m_log.DebugFormat("[APPEARANCE]: UpdateDatabase");
AvatarData adata = new AvatarData(appearance);
m_scene.AvatarService.SetAvatar(user, adata);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs
index 0c8ee61..47f19a3 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar
IConfig userConfig = source.Configs["AvatarService"];
if (userConfig == null)
{
- m_log.Error("[USER CONNECTOR]: AvatarService missing from OpenSim.ini");
+ m_log.Error("[AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini");
return;
}
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar
if (serviceDll == String.Empty)
{
- m_log.Error("[USER CONNECTOR]: No LocalServiceModule named in section AvatarService");
+ m_log.Error("[AVATAR CONNECTOR]: No LocalServiceModule named in section AvatarService");
return;
}
@@ -92,11 +92,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar
if (m_AvatarService == null)
{
- m_log.Error("[USER CONNECTOR]: Can't load user account service");
+ m_log.Error("[AVATAR CONNECTOR]: Can't load user account service");
return;
}
m_Enabled = true;
- m_log.Info("[USER CONNECTOR]: Local avatar connector enabled");
+ m_log.Info("[AVATAR CONNECTOR]: Local avatar connector enabled");
}
}
}
@@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar
if (!m_Enabled)
return;
- scene.RegisterModuleInterface(m_AvatarService);
+ scene.RegisterModuleInterface(this);
}
public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3f71715..70aea75 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2358,7 +2358,7 @@ namespace OpenSim.Region.Framework.Scenes
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
- presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
+ presence.Appearance.SetAttachment((int)AttachmentPt, itemID, /*item.AssetID*/ att.UUID);
}
return att.UUID;
}
@@ -2403,7 +2403,7 @@ namespace OpenSim.Region.Framework.Scenes
// XXYY!!
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
- presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
+ presence.Appearance.SetAttachment((int)AttachmentPt, itemID, /*item.AssetID*/ att.UUID);
if (m_AvatarFactory != null)
{
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index db0da34..db7b3ff 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -300,7 +300,7 @@ namespace OpenSim.Region.Framework.Scenes
get
{
if (m_AvatarService == null)
- m_AvatarService = RequestModuleInterface();
+ m_AvatarService = RequestModuleInterface();
return m_AvatarService;
}
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 7d9b427..11cb8cd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -250,7 +250,7 @@ namespace OpenSim.Region.Framework.Scenes
{
InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate) iar.AsyncState;
icon.EndInvoke(iar);
- m_log.WarnFormat(" --> InformClientOfNeighbourCompleted");
+ //m_log.WarnFormat(" --> InformClientOfNeighbourCompleted");
}
///
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Framework.Scenes
int count = 0;
foreach (GridRegion neighbour in neighbours)
{
- m_log.WarnFormat("--> Going to send child agent to {0}", neighbour.RegionName);
+ //m_log.WarnFormat("--> Going to send child agent to {0}", neighbour.RegionName);
// Don't do it if there's already an agent in that region
if (newRegions.Contains(neighbour.RegionHandle))
newAgent = true;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 47eaa95..ae586a1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2565,14 +2565,18 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
+
}
+
#endregion Bake Cache Check
m_appearance.SetAppearance(textureEntry, visualParams);
if (m_appearance.AvatarHeight > 0)
SetHeight(m_appearance.AvatarHeight);
+
AvatarData adata = new AvatarData(m_appearance);
+
m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
SendAppearanceToAllOtherAgents();
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index a6d4a93..6e742f1 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
AvatarData adata = scene.AvatarService.GetAvatar(target);
if (adata != null)
{
- AvatarAppearance x = adata.ToAvatarAppearance();
+ AvatarAppearance x = adata.ToAvatarAppearance(target);
m_appearanceCache.Add(target, x);
--
cgit v1.1