* Added TryGetAvatarByName

afrisby
lbsa71 2007-09-24 04:49:05 +00:00
parent 5818958a9a
commit 13c1c33ed4
3 changed files with 37 additions and 6 deletions

View File

@ -44,18 +44,15 @@ namespace OpenSim.Framework.UserManagement
bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
bool GoodLogin = false;
string firstname = "";
string lastname = "";
string passwd = "";
UserProfileData userProfile;
LoginResponse logResponse = new LoginResponse();
if (GoodXML)
{
firstname = (string)requestData["first"];
lastname = (string)requestData["last"];
passwd = (string)requestData["passwd"];
string firstname = (string)requestData["first"];
string lastname = (string)requestData["last"];
string passwd = (string)requestData["passwd"];
userProfile = GetTheUser(firstname, lastname);
if (userProfile == null)

View File

@ -1363,5 +1363,25 @@ namespace OpenSim.Region.Environment.Scenes
base.Close();
}
internal bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
{
foreach( ScenePresence presence in m_scenePresences.Values )
{
if( !presence.IsChildAgent )
{
string name = presence.ControllingClient.FirstName + " " + presence.ControllingClient.LastName;
if( String.Compare( avatarName, name, true ) == 0 )
{
avatar = presence;
return true;
}
}
}
avatar = null;
return false;
}
}
}

View File

@ -233,5 +233,19 @@ namespace OpenSim.Region.Environment.Scenes
m_localScenes.Remove(scene);
scene.Close();
}
public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
{
foreach (Scene scene in m_localScenes)
{
if (scene.TryGetAvatarByName(avatarName, out avatar))
{
return true;
}
}
avatar = null;
return false;
}
}
}