aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
index 4bb0638..d8a90c5 100644
--- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
@@ -1,3 +1,4 @@
1using System;
1using libsecondlife; 2using libsecondlife;
2using Nini.Config; 3using Nini.Config;
3using OpenSim.Framework; 4using OpenSim.Framework;
@@ -8,6 +9,8 @@ namespace OpenSim.Region.Environment.Modules
8{ 9{
9 public class AvatarFactoryModule : IAvatarFactory 10 public class AvatarFactoryModule : IAvatarFactory
10 { 11 {
12 private Scene m_scene = null;
13
11 public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, 14 public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables,
12 out byte[] visualParams) 15 out byte[] visualParams)
13 { 16 {
@@ -18,6 +21,12 @@ namespace OpenSim.Region.Environment.Modules
18 public void Initialise(Scene scene, IConfigSource source) 21 public void Initialise(Scene scene, IConfigSource source)
19 { 22 {
20 scene.RegisterModuleInterface<IAvatarFactory>(this); 23 scene.RegisterModuleInterface<IAvatarFactory>(this);
24 // scene.EventManager.OnNewClient += NewClient;
25
26 if (m_scene == null)
27 {
28 m_scene = scene;
29 }
21 } 30 }
22 31
23 public void PostInitialise() 32 public void PostInitialise()
@@ -38,6 +47,27 @@ namespace OpenSim.Region.Environment.Modules
38 get { return true; } 47 get { return true; }
39 } 48 }
40 49
50 public void NewClient(IClientAPI client)
51 {
52 // client.OnAvatarNowWearing += AvatarIsWearing;
53 }
54
55 public void RemoveClient(IClientAPI client)
56 {
57 // client.OnAvatarNowWearing -= AvatarIsWearing;
58 }
59
60 public void AvatarIsWearing(Object sender, AvatarWearingArgs e)
61 {
62 IClientAPI clientView = (IClientAPI) sender;
63 //Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs
64 // then store assetid and itemId and wearable type in a database
65 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
66 {
67 LLUUID assetID = m_scene.CommsManager.UserProfileCache.GetUserDetails(clientView.AgentId).RootFolder.HasItem(wear.ItemID).assetID;
68 }
69 }
70
41 public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) 71 public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams)
42 { 72 {
43 visualParams = new byte[218]; 73 visualParams = new byte[218];