LIBOMV-686 Implements new event patterns based on the Microsoft Framework Design Guidelines in DirectoryManager
* Completes Full documentation of DirectoryManager class * Cleaned up Search Methods in DirectoryManager to be more developer friendly * Adds Several TestClient commands related to DirectoryManager: searchgroups, searchland, searchpeople * Adds a StructToString method to helpers to simplify parsing and printing Structs for debugging purposes * Many other code cleanups * BREAKING - this is a major shift in the way events are internally handled, Take a look at the newly added TestClient commands for example code that implement this pattern. git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3139 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -139,26 +139,26 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
if (client.MasterKey == UUID.Zero)
|
||||
{
|
||||
UUID query = UUID.Random();
|
||||
DirectoryManager.DirPeopleReplyCallback peopleDirCallback =
|
||||
delegate(UUID queryID, List<DirectoryManager.AgentSearchData> matchedPeople)
|
||||
UUID query = UUID.Zero;
|
||||
EventHandler<DirPeopleReplyEventArgs> peopleDirCallback =
|
||||
delegate(object sender, DirPeopleReplyEventArgs e)
|
||||
{
|
||||
if (queryID == query)
|
||||
if (e.QueryID == query)
|
||||
{
|
||||
if (matchedPeople.Count != 1)
|
||||
if (e.MatchedPeople.Count != 1)
|
||||
{
|
||||
Logger.Log("Unable to resolve master key from " + client.MasterName, Helpers.LogLevel.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
client.MasterKey = matchedPeople[0].AgentID;
|
||||
client.MasterKey = e.MatchedPeople[0].AgentID;
|
||||
Logger.Log("Master key resolved to " + client.MasterKey, Helpers.LogLevel.Info);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
client.Directory.OnDirPeopleReply += peopleDirCallback;
|
||||
client.Directory.StartPeopleSearch(DirectoryManager.DirFindFlags.People, client.MasterName, 0, query);
|
||||
client.Directory.DirPeopleReply += peopleDirCallback;
|
||||
query = client.Directory.StartPeopleSearch(client.MasterName, 0);
|
||||
}
|
||||
|
||||
Logger.Log("Logged in " + client.ToString(), Helpers.LogLevel.Info);
|
||||
|
||||
Reference in New Issue
Block a user