aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
diff options
context:
space:
mode:
authorDiva Canto2012-03-17 21:27:28 -0700
committerDiva Canto2012-03-17 21:27:28 -0700
commitd1256536b500a0d72eb643635d10c65980ea2588 (patch)
treeb378a299d970fa5f3266a59f32baa607fee3006b /OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
parentAmend to previous commit: normalize strings ToLower. (diff)
downloadopensim-SC_OLD-d1256536b500a0d72eb643635d10c65980ea2588.zip
opensim-SC_OLD-d1256536b500a0d72eb643635d10c65980ea2588.tar.gz
opensim-SC_OLD-d1256536b500a0d72eb643635d10c65980ea2588.tar.bz2
opensim-SC_OLD-d1256536b500a0d72eb643635d10c65980ea2588.tar.xz
Added GetUUID(first, last) on UserAgentsService so that we can finally make direct user connections.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs40
1 files changed, 34 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
index 8077a7a..66de8e4 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs
@@ -92,19 +92,47 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
92 foreach (UserData d in m_UserCache.Values) 92 foreach (UserData d in m_UserCache.Values)
93 { 93 {
94 if (d.LastName.StartsWith("@") && 94 if (d.LastName.StartsWith("@") &&
95 (d.FirstName.ToLower().Equals(words[0].ToLower()) || 95 d.FirstName.ToLower().Equals(words[0].ToLower()) &&
96 d.LastName.ToLower().Equals(words[1].ToLower()))) 96 d.LastName.ToLower().Equals(words[1].ToLower()))
97 { 97 {
98 users.Add(d); 98 users.Add(d);
99 found = true; 99 found = true;
100 break; 100 break;
101 } 101 }
102 } 102 }
103 if (!found) // This is it! Let's ask the other world 103
104 if (!found && words[1].StartsWith("@") && words[0].Contains(".")) // This is it! Let's ask the other world
104 { 105 {
105 // TODO 106 string[] names = words[0].Split(new char[] { '.' });
106 //UserAgentServiceConnector uasConn = new UserAgentServiceConnector(words[0]); 107 if (names.Length >= 2)
107 //uasConn.GetUserInfo(...); 108 {
109
110 string uriStr = "http://" + words[1].Substring(1); // remove the @
111 // Let's check that the last name is a valid address
112 try
113 {
114 new Uri(uriStr);
115 }
116 catch (UriFormatException)
117 {
118 return;
119 }
120
121 UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr);
122 UUID userID = uasConn.GetUUID(names[0], names[1]);
123 if (!userID.Equals(UUID.Zero))
124 {
125 UserData ud = new UserData();
126 ud.Id = userID;
127 ud.FirstName = words[0];
128 ud.LastName = words[1];
129 users.Add(ud);
130 AddUser(userID, ud.FirstName, ud.LastName, uriStr);
131 m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0} {1} found", words[0], words[1]);
132 }
133 else
134 m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0} {1} not found", words[0], words[1]);
135 }
108 } 136 }
109 } 137 }
110 else 138 else