aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/UserProfiles
diff options
context:
space:
mode:
authorBlueWall2013-05-31 18:48:01 -0400
committerBlueWall2013-05-31 21:19:15 -0400
commitba2f13db63a58698ca47e9ba51a1a1509b838a77 (patch)
tree8f6cdb5c7c6199dad01e50758128ebc383a609f2 /OpenSim/Region/CoreModules/Avatar/UserProfiles
parentRemove unnecessary m_scenes and m_scene from AsyncCommandManager. (diff)
downloadopensim-SC_OLD-ba2f13db63a58698ca47e9ba51a1a1509b838a77.zip
opensim-SC_OLD-ba2f13db63a58698ca47e9ba51a1a1509b838a77.tar.gz
opensim-SC_OLD-ba2f13db63a58698ca47e9ba51a1a1509b838a77.tar.bz2
opensim-SC_OLD-ba2f13db63a58698ca47e9ba51a1a1509b838a77.tar.xz
Adding back the BasicProfileModule
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/UserProfiles')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs88
1 files changed, 15 insertions, 73 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index 563617d..5b228ee 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -124,8 +124,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
124 public void Initialise(IConfigSource source) 124 public void Initialise(IConfigSource source)
125 { 125 {
126 Config = source; 126 Config = source;
127 ReplaceableInterface = typeof(IProfileModule);
127 128
128 IConfig profileConfig = Config.Configs["Profile"]; 129 IConfig profileConfig = Config.Configs["UserProfiles"];
129 130
130 if (profileConfig == null) 131 if (profileConfig == null)
131 { 132 {
@@ -135,18 +136,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
135 136
136 // If we find ProfileURL then we configure for FULL support 137 // If we find ProfileURL then we configure for FULL support
137 // else we setup for BASIC support 138 // else we setup for BASIC support
138 ProfileServerUri = profileConfig.GetString("ProfileURL", ""); 139 ProfileServerUri = profileConfig.GetString("ProfileServiceURL", "");
139 if (ProfileServerUri == "") 140 if (ProfileServerUri == "")
140 { 141 {
141 m_log.Info("[PROFILES] UserProfiles module is activated in BASIC mode");
142 Enabled = false; 142 Enabled = false;
143 return; 143 return;
144 } 144 }
145 else 145
146 { 146 m_log.Debug("[PROFILES]: Full Profiles Enabled");
147 m_log.Info("[PROFILES] UserProfiles module is activated in FULL mode"); 147 ReplaceableInterface = null;
148 Enabled = true; 148 Enabled = true;
149 }
150 } 149 }
151 150
152 /// <summary> 151 /// <summary>
@@ -157,6 +156,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
157 /// </param> 156 /// </param>
158 public void AddRegion(Scene scene) 157 public void AddRegion(Scene scene)
159 { 158 {
159 if(!Enabled)
160 return;
161
160 Scene = scene; 162 Scene = scene;
161 Scene.RegisterModuleInterface<IProfileModule>(this); 163 Scene.RegisterModuleInterface<IProfileModule>(this);
162 Scene.EventManager.OnNewClient += OnNewClient; 164 Scene.EventManager.OnNewClient += OnNewClient;
@@ -178,6 +180,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
178 /// </param> 180 /// </param>
179 public void RemoveRegion(Scene scene) 181 public void RemoveRegion(Scene scene)
180 { 182 {
183 if(!Enabled)
184 return;
181 } 185 }
182 186
183 /// <summary> 187 /// <summary>
@@ -191,6 +195,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
191 /// </param> 195 /// </param>
192 public void RegionLoaded(Scene scene) 196 public void RegionLoaded(Scene scene)
193 { 197 {
198 if(!Enabled)
199 return;
194 } 200 }
195 201
196 /// <summary> 202 /// <summary>
@@ -206,7 +212,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
206 /// </value> 212 /// </value>
207 public Type ReplaceableInterface 213 public Type ReplaceableInterface
208 { 214 {
209 get { return typeof(IProfileModule); } 215 get; private set;
210 } 216 }
211 217
212 /// <summary> 218 /// <summary>
@@ -237,13 +243,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
237 /// </param> 243 /// </param>
238 void OnNewClient(IClientAPI client) 244 void OnNewClient(IClientAPI client)
239 { 245 {
240 // Basic or Full module?
241 if(!Enabled)
242 {
243 client.OnRequestAvatarProperties += BasicRequestProperties;
244 return;
245 }
246
247 //Profile 246 //Profile
248 client.OnRequestAvatarProperties += RequestAvatarProperties; 247 client.OnRequestAvatarProperties += RequestAvatarProperties;
249 client.OnUpdateAvatarProperties += AvatarPropertiesUpdate; 248 client.OnUpdateAvatarProperties += AvatarPropertiesUpdate;
@@ -839,63 +838,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
839 } 838 }
840 } 839 }
841 840
842 public void BasicRequestProperties(IClientAPI remoteClient, UUID avatarID)
843 {
844 IScene s = remoteClient.Scene;
845 if (!(s is Scene))
846 return;
847
848 string profileUrl = String.Empty;
849 string aboutText = String.Empty;
850 string firstLifeAboutText = String.Empty;
851 UUID image = UUID.Zero;
852 UUID firstLifeImage = UUID.Zero;
853 UUID partner = UUID.Zero;
854 uint wantMask = 0;
855 string wantText = String.Empty;
856 uint skillsMask = 0;
857 string skillsText = String.Empty;
858 string languages = String.Empty;
859
860 UserAccount account = Scene.UserAccountService.GetUserAccount(Scene.RegionInfo.ScopeID, avatarID);
861
862 string name = "Avatar";
863 int created = 0;
864 if (account != null)
865 {
866 name = account.FirstName + " " + account.LastName;
867 created = account.Created;
868 }
869 Byte[] charterMember = Utils.StringToBytes(name);
870
871 profileUrl = "No profile data";
872 aboutText = string.Empty;
873 firstLifeAboutText = string.Empty;
874 image = UUID.Zero;
875 firstLifeImage = UUID.Zero;
876 partner = UUID.Zero;
877
878 remoteClient.SendAvatarProperties(avatarID, aboutText,
879 Util.ToDateTime(created).ToString(
880 "M/d/yyyy", CultureInfo.InvariantCulture),
881 charterMember, firstLifeAboutText,
882 (uint)(0 & 0xff),
883 firstLifeImage, image, profileUrl, partner);
884
885 //Viewer expects interest data when it asks for properties.
886 remoteClient.SendAvatarInterestsReply(avatarID, wantMask, wantText,
887 skillsMask, skillsText, languages);
888 }
889
890 /// <summary>
891 /// Requests the avatar properties.
892 /// </summary>
893 /// <param name='remoteClient'>
894 /// Remote client.
895 /// </param>
896 /// <param name='avatarID'>
897 /// Avatar I.
898 /// </param>
899 public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) 841 public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
900 { 842 {
901 if ( String.IsNullOrEmpty(avatarID.ToString()) || String.IsNullOrEmpty(remoteClient.AgentId.ToString())) 843 if ( String.IsNullOrEmpty(avatarID.ToString()) || String.IsNullOrEmpty(remoteClient.AgentId.ToString()))