28 using System.Collections.Generic;
30 using System.Reflection;
32 using OpenSim.Framework;
33 using OpenSim.Framework.Console;
34 using OpenSim.Region.Framework;
35 using OpenSim.Region.Framework.Interfaces;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Services.Interfaces;
38 using OpenSim.Services.Connectors.Hypergrid;
41 using OpenMetaverse.Packets;
48 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"HGUserManagementModule")]
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 #region ISharedRegionModule
57 string umanmod = config.Configs[
"Modules"].GetString(
"UserManagementModule", null);
62 m_log.DebugFormat(
"[USER MANAGEMENT MODULE]: {0} is enabled", Name);
66 public override string Name
68 get {
return "HGUserManagementModule"; }
71 #endregion ISharedRegionModule
75 if (query.Contains(
"@"))
77 string[] words = query.Split(
new char[] {
'@' });
78 if (words.Length != 2)
80 m_log.DebugFormat(
"[USER MANAGEMENT MODULE]: Malformed address {0}", query);
84 words[0] = words[0].Trim();
85 words[1] = words[1].Trim();
87 if (words[0] ==
String.Empty)
89 foreach (
UserData d
in m_UserCache.Values)
91 if (d.
LastName.ToLower().StartsWith(
"@" + words[1].ToLower()))
101 foreach (
UserData d
in m_UserCache.Values)
104 d.FirstName.ToLower().Equals(words[0].ToLower()) &&
105 d.
LastName.ToLower().Equals(
"@" + words[1].ToLower()))
114 if (words[0].Contains(
"."))
116 string[] names = words[0].Split(
new char[] {
'.' });
117 if (names.Length >= 2)
120 string uriStr =
"http://" + words[1];
126 catch (UriFormatException)
128 m_log.DebugFormat(
"[USER MANAGEMENT MODULE]: Malformed address {0}", uriStr);
134 UUID userID = UUID.Zero;
137 userID = uasConn.GetUUID(names[0], names[1]);
141 m_log.Debug(
"[USER MANAGEMENT MODULE]: GetUUID call failed ", e);
144 if (!userID.Equals(
UUID.Zero))
148 ud.FirstName = words[0];
149 ud.LastName =
"@" + words[1];
154 AddUser(userID, names[0], names[1], uriStr);
155 m_log.DebugFormat(
"[USER MANAGEMENT MODULE]: User {0}@{1} found", words[0], words[1]);
158 m_log.DebugFormat(
"[USER MANAGEMENT MODULE]: User {0}@{1} not found", words[0], words[1]);
new void Initialise(IConfigSource config)
This is called to initialize the region module. For shared modules, this is called exactly once...
override void AddAdditionalUsers(string query, List< UserData > users)
Interactive OpenSim region server
This maintains the relationship between a UUID and a user name.