LIBOMV-686 Implements new event patterns based on the Microsoft Framework Design Guidelines in AgentManager

* Many other code cleanups and example updates
* BREAKING - this is a major shift in the way events are internally handled.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3145 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-10-16 02:53:53 +00:00
parent 0567a983fc
commit ba491c6a63
16 changed files with 1591 additions and 627 deletions

View File

@@ -20,22 +20,21 @@ namespace OpenMetaverse.TestClient
if (!Active)
{
Active = true;
Client.Self.OnChat += new AgentManager.ChatCallback(Self_OnChat);
Client.Self.ChatFromSimulator += Self_ChatFromSimulator;
return "Echoing is now on.";
}
else
{
Active = false;
Client.Self.OnChat -= new AgentManager.ChatCallback(Self_OnChat);
Client.Self.ChatFromSimulator -= Self_ChatFromSimulator;
return "Echoing is now off.";
}
}
void Self_OnChat(string message, ChatAudibleLevel audible, ChatType type,
ChatSourceType sourcetype, string fromName, UUID id, UUID ownerid, Vector3 position)
{
if (message.Length > 0 && (Client.MasterKey == id || (Client.MasterName == fromName && !Client.AllowObjectMaster)))
Client.Self.Chat(message, 0, ChatType.Normal);
}
void Self_ChatFromSimulator(object sender, ChatEventArgs e)
{
if (e.Message.Length > 0 && (Client.MasterKey == e.SourceID || (Client.MasterName == e.FromName && !Client.AllowObjectMaster)))
Client.Self.Chat(e.Message, 0, ChatType.Normal);
}
}
}