28 using System.Collections;
29 using System.Collections.Generic;
30 using System.Globalization;
31 using System.Reflection;
38 using OpenSim.Framework;
39 using OpenSim.Region.Framework.Interfaces;
40 using OpenSim.Region.Framework.Scenes;
41 using OpenSim.Services.Interfaces;
45 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"BasicProfileModule")]
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 private List<Scene> m_Scenes =
new List<Scene>();
54 private bool m_Enabled =
false;
56 #region ISharedRegionModule
60 if(config.Configs[
"UserProfiles"] != null)
63 m_log.DebugFormat(
"[PROFILE MODULE]: Basic Profile Module enabled");
74 if (!m_Scenes.Contains(scene))
78 scene.EventManager.OnNewClient += OnNewClient;
97 m_Scenes.Remove(scene);
111 get {
return "BasicProfileModule"; }
114 public Type ReplaceableInterface
130 IScene s = remoteClient.Scene;
136 string profileUrl = String.Empty;
137 string aboutText = String.Empty;
138 string firstLifeAboutText = String.Empty;
139 UUID image = UUID.Zero;
140 UUID firstLifeImage = UUID.Zero;
141 UUID partner = UUID.Zero;
143 string wantText = String.Empty;
145 string skillsText = String.Empty;
146 string languages = String.Empty;
148 UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, avatarID);
150 string name =
"Avatar";
154 name = account.FirstName +
" " + account.LastName;
155 created = account.Created;
157 Byte[] charterMember = Utils.StringToBytes(name);
159 profileUrl =
"No profile data";
160 aboutText = string.Empty;
161 firstLifeAboutText = string.Empty;
163 firstLifeImage = UUID.Zero;
166 remoteClient.SendAvatarProperties(avatarID, aboutText,
167 Util.ToDateTime(created).ToString(
168 "M/d/yyyy", CultureInfo.InvariantCulture),
169 charterMember, firstLifeAboutText,
171 firstLifeImage, image, profileUrl, partner);
174 remoteClient.SendAvatarInterestsReply(avatarID, wantMask, wantText,
175 skillsMask, skillsText, languages);
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void Initialise(IConfigSource config)
This is called to initialize the region module. For shared modules, this is called exactly once...
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
Interactive OpenSim region server
delegate void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...