aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
diff options
context:
space:
mode:
authorMW2007-12-01 14:20:37 +0000
committerMW2007-12-01 14:20:37 +0000
commit27f182ac54ffee16da730b2053480944f9ca5412 (patch)
tree86b7188f3d05afd3753d833a2000827a623e0b55 /OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
parentset svn:eol-style (diff)
downloadopensim-SC_OLD-27f182ac54ffee16da730b2053480944f9ca5412.zip
opensim-SC_OLD-27f182ac54ffee16da730b2053480944f9ca5412.tar.gz
opensim-SC_OLD-27f182ac54ffee16da730b2053480944f9ca5412.tar.bz2
opensim-SC_OLD-27f182ac54ffee16da730b2053480944f9ca5412.tar.xz
Part 1 of a commit. This revision will not compile, part 2 will be added in a couple of minutes that should fix that.
Some work towards persisting Avatar Appearance (what is being worn). Added OnAvatarNowWearing event to IClientAPI that is triggered by AgentIsNowWearing packets. stub code to subscribe to this event in AvatarFactoryModule. Todo: code needs to be added to AvatarFactoryModule to save the uuids to a database and then read them back when that modules TryGetIntialAvatarAppearance() method is called. Done some changes to Scene to make it easier to subclass it: including changed some private fields to protected and made some methods virtual.
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];