aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorlbsa712007-09-24 04:49:05 +0000
committerlbsa712007-09-24 04:49:05 +0000
commit13c1c33ed410566fa341c5affcb93f540f1df95f (patch)
treeaa9ca8ec0c0464b19bf27dc9344aac1963bfd1e4 /OpenSim
parent*** CHANGED CONFIG BEHAVIOUR *** (diff)
downloadopensim-SC_OLD-13c1c33ed410566fa341c5affcb93f540f1df95f.zip
opensim-SC_OLD-13c1c33ed410566fa341c5affcb93f540f1df95f.tar.gz
opensim-SC_OLD-13c1c33ed410566fa341c5affcb93f540f1df95f.tar.bz2
opensim-SC_OLD-13c1c33ed410566fa341c5affcb93f540f1df95f.tar.xz
* Added TryGetAvatarByName
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/UserManager/LoginService.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs20
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs14
3 files changed, 37 insertions, 6 deletions
diff --git a/OpenSim/Framework/UserManager/LoginService.cs b/OpenSim/Framework/UserManager/LoginService.cs
index 483665e..8e7cf80 100644
--- a/OpenSim/Framework/UserManager/LoginService.cs
+++ b/OpenSim/Framework/UserManager/LoginService.cs
@@ -44,18 +44,15 @@ namespace OpenSim.Framework.UserManagement
44 44
45 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); 45 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
46 bool GoodLogin = false; 46 bool GoodLogin = false;
47 string firstname = "";
48 string lastname = "";
49 string passwd = "";
50 47
51 UserProfileData userProfile; 48 UserProfileData userProfile;
52 LoginResponse logResponse = new LoginResponse(); 49 LoginResponse logResponse = new LoginResponse();
53 50
54 if (GoodXML) 51 if (GoodXML)
55 { 52 {
56 firstname = (string)requestData["first"]; 53 string firstname = (string)requestData["first"];
57 lastname = (string)requestData["last"]; 54 string lastname = (string)requestData["last"];
58 passwd = (string)requestData["passwd"]; 55 string passwd = (string)requestData["passwd"];
59 56
60 userProfile = GetTheUser(firstname, lastname); 57 userProfile = GetTheUser(firstname, lastname);
61 if (userProfile == null) 58 if (userProfile == null)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 97a4ae1..cff832e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1363,5 +1363,25 @@ namespace OpenSim.Region.Environment.Scenes
1363 1363
1364 base.Close(); 1364 base.Close();
1365 } 1365 }
1366
1367 internal bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
1368 {
1369 foreach( ScenePresence presence in m_scenePresences.Values )
1370 {
1371 if( !presence.IsChildAgent )
1372 {
1373 string name = presence.ControllingClient.FirstName + " " + presence.ControllingClient.LastName;
1374
1375 if( String.Compare( avatarName, name, true ) == 0 )
1376 {
1377 avatar = presence;
1378 return true;
1379 }
1380 }
1381 }
1382
1383 avatar = null;
1384 return false;
1385 }
1366 } 1386 }
1367} 1387}
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index 79fdff7..196976c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -233,5 +233,19 @@ namespace OpenSim.Region.Environment.Scenes
233 m_localScenes.Remove(scene); 233 m_localScenes.Remove(scene);
234 scene.Close(); 234 scene.Close();
235 } 235 }
236
237 public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
238 {
239 foreach (Scene scene in m_localScenes)
240 {
241 if (scene.TryGetAvatarByName(avatarName, out avatar))
242 {
243 return true;
244 }
245 }
246
247 avatar = null;
248 return false;
249 }
236 } 250 }
237} \ No newline at end of file 251} \ No newline at end of file