aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Modules/AvatarFactory
diff options
context:
space:
mode:
authorSean Dague2008-05-17 12:45:43 +0000
committerSean Dague2008-05-17 12:45:43 +0000
commit06b1535ec5054068e65a085fabd25680d145594c (patch)
tree96f364dc52f998d90592276ee0b93b8f80665a4b /OpenSim/Region/Modules/AvatarFactory
parent0001303: [PATCH] Make prim owner and data show for prims not owned. From Mel... (diff)
downloadopensim-SC-06b1535ec5054068e65a085fabd25680d145594c.zip
opensim-SC-06b1535ec5054068e65a085fabd25680d145594c.tar.gz
opensim-SC-06b1535ec5054068e65a085fabd25680d145594c.tar.bz2
opensim-SC-06b1535ec5054068e65a085fabd25680d145594c.tar.xz
while this doesn't fix the initial no pants issue in grid (which still baffles me)
it does make setting appearance in grid stick.
Diffstat (limited to 'OpenSim/Region/Modules/AvatarFactory')
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs69
1 files changed, 41 insertions, 28 deletions
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
index bac2252..f5e0ca2 100644
--- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
@@ -27,8 +27,11 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
31
30using System.Threading; 32using System.Threading;
31using libsecondlife; 33using libsecondlife;
34using log4net;
32using Nini.Config; 35using Nini.Config;
33using OpenSim.Data.Base; 36using OpenSim.Data.Base;
34using OpenSim.Data.MapperFactory; 37using OpenSim.Data.MapperFactory;
@@ -41,6 +44,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
41{ 44{
42 public class AvatarFactoryModule : IAvatarFactory, IRegionModule 45 public class AvatarFactoryModule : IAvatarFactory, IRegionModule
43 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 private Scene m_scene = null; 48 private Scene m_scene = null;
45 private readonly Dictionary<LLUUID, AvatarAppearance> m_avatarsAppearance = new Dictionary<LLUUID, AvatarAppearance>(); 49 private readonly Dictionary<LLUUID, AvatarAppearance> m_avatarsAppearance = new Dictionary<LLUUID, AvatarAppearance>();
46 50
@@ -215,31 +219,31 @@ namespace OpenSim.Region.Modules.AvatarFactory
215 m_scene = scene; 219 m_scene = scene;
216 } 220 }
217 221
218 if (!m_configured) 222 // if (!m_configured)
219 { 223 // {
220 m_configured = true; 224 // m_configured = true;
221 try 225 // try
222 { 226 // {
223 m_enablePersist = source.Configs["Startup"].GetBoolean("appearance_persist", false); 227 // m_enablePersist = source.Configs["Startup"].GetBoolean("appearance_persist", false);
224 } 228 // }
225 catch (Exception) 229 // catch (Exception)
226 { 230 // {
227 } 231 // }
228 if (m_enablePersist) 232 // if (m_enablePersist)
229 { 233 // {
230 m_connectionString = source.Configs["Startup"].GetString("appearance_connection_string", ""); 234 // m_connectionString = source.Configs["Startup"].GetString("appearance_connection_string", "");
231 235
232 string mapperTypeStr = source.Configs["Startup"].GetString("appearance_database", "MySQL"); 236 // string mapperTypeStr = source.Configs["Startup"].GetString("appearance_database", "MySQL");
233 237
234 DataMapperFactory.MAPPER_TYPE mapperType = 238 // DataMapperFactory.MAPPER_TYPE mapperType =
235 (DataMapperFactory.MAPPER_TYPE) 239 // (DataMapperFactory.MAPPER_TYPE)
236 Enum.Parse(typeof (DataMapperFactory.MAPPER_TYPE), mapperTypeStr); 240 // Enum.Parse(typeof (DataMapperFactory.MAPPER_TYPE), mapperTypeStr);
237 241
238 m_databaseMapper = DataMapperFactory.GetDataBaseMapper(mapperType, m_connectionString); 242 // m_databaseMapper = DataMapperFactory.GetDataBaseMapper(mapperType, m_connectionString);
239 243
240 m_appearanceMapper = new AppearanceTableMapper(m_databaseMapper, "AvatarAppearance"); 244 // m_appearanceMapper = new AppearanceTableMapper(m_databaseMapper, "AvatarAppearance");
241 } 245 // }
242 } 246 // }
243 } 247 }
244 248
245 public void PostInitialise() 249 public void PostInitialise()
@@ -273,13 +277,14 @@ namespace OpenSim.Region.Modules.AvatarFactory
273 public void AvatarIsWearing(Object sender, AvatarWearingArgs e) 277 public void AvatarIsWearing(Object sender, AvatarWearingArgs e)
274 { 278 {
275 IClientAPI clientView = (IClientAPI)sender; 279 IClientAPI clientView = (IClientAPI)sender;
280 ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId);
276 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); 281 CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId);
277 AvatarAppearance avatAppearance = m_scene.CommsManager.UserService.GetUserAppearance(clientView.AgentId); 282 AvatarAppearance avatAppearance = avatar.Appearance;
283 m_log.Info("Calling Avatar is Wearing");
278 if (profile != null) 284 if (profile != null)
279 { 285 {
280 if (profile.RootFolder != null) 286 if (profile.RootFolder != null)
281 { 287 {
282
283 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) 288 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
284 { 289 {
285 if (wear.Type < 13) 290 if (wear.Type < 13)
@@ -292,7 +297,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
292 else 297 else
293 { 298 {
294 LLUUID assetId; 299 LLUUID assetId;
295 300
296 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID); 301 InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID);
297 302
298 if (baseItem != null) 303 if (baseItem != null)
@@ -301,10 +306,18 @@ namespace OpenSim.Region.Modules.AvatarFactory
301 avatAppearance.Wearables[wear.Type].AssetID = assetId; 306 avatAppearance.Wearables[wear.Type].AssetID = assetId;
302 avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; 307 avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID;
303 } 308 }
309 else
310 {
311 m_log.ErrorFormat("[APPEARANCE] Can't find inventory item {0}, not wearing", wear.ItemID);
312 }
304 } 313 }
305 } 314 }
306 } 315 }
307 m_scene.CommsManager.UserService.UpdateUserAppearance(clientView.AgentId, avatAppearance); 316 m_scene.CommsManager.UserService.UpdateUserAppearance(clientView.AgentId, avatAppearance);
317 }
318 else
319 {
320 m_log.Error("Root Profile is null, we can't set the appearance");
308 } 321 }
309 } 322 }
310 } 323 }