From cbf492109ccda213971c09d1048e9d26d09d9b37 Mon Sep 17 00:00:00 2001 From: gareth Date: Tue, 8 May 2007 09:56:20 +0000 Subject: Fixed nant build files Added ExportBot code (ZOMG! IMPORTED THE EXPORT BOT!) Fixed ExportBot's build --- ExportBot/Commands/CloneProfileCommand.cs | 25 ++++++------- ExportBot/Commands/Communication/TtsCommand.cs | 51 -------------------------- 2 files changed, 12 insertions(+), 64 deletions(-) delete mode 100644 ExportBot/Commands/Communication/TtsCommand.cs (limited to 'ExportBot/Commands') diff --git a/ExportBot/Commands/CloneProfileCommand.cs b/ExportBot/Commands/CloneProfileCommand.cs index d7fb5fc..d608318 100644 --- a/ExportBot/Commands/CloneProfileCommand.cs +++ b/ExportBot/Commands/CloneProfileCommand.cs @@ -10,6 +10,7 @@ namespace libsecondlife.TestClient { Avatar.AvatarProperties Properties; Avatar.Interests Interests; + private Dictionary Avatars = new Dictionary(); List Groups = new List(); bool ReceivedProperties = false; bool ReceivedInterests = false; @@ -23,12 +24,22 @@ namespace libsecondlife.TestClient testClient.Avatars.OnAvatarGroups += new AvatarManager.AvatarGroupsCallback(Avatars_OnAvatarGroups); testClient.Self.OnJoinGroup += new MainAvatar.JoinGroupCallback(Self_OnJoinGroup); + testClient.Self.Objects.OnNewAvatar += new ObjectManager.NewAvatarCallback(AvatarSeen); + Name = "cloneprofile"; Description = "Clones another avatars profile as closely as possible. WARNING: This command will " + "destroy your existing profile! Usage: cloneprofile [targetuuid]"; } - public override string Execute(string[] args, LLUUID fromAgentID) + void AvatarSeen(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation) + { + lock (Avatars) + { + Avatars.Add(avatar.UUID,avatar.LocalID); + } + } + + public override string Execute(string[] args, LLUUID fromAgentID) { if (args.Length != 1) return Description; @@ -58,20 +69,8 @@ namespace libsecondlife.TestClient if (!ReceivedInterests || !ReceivedProperties || !ReceivedGroups) return "Failed to retrieve a complete profile for that UUID"; - // Synchronize our profile - Client.Self.ProfileInterests = Interests; - Client.Self.ProfileProperties = Properties; Client.Self.SetAvatarInformation(); - // TODO: Leave all the groups we're currently a member of? This could - // break TestClient connectivity that might be relying on group authentication - - // Attempt to join all the groups - foreach (LLUUID groupID in Groups) - { - Client.Self.RequestJoinGroup(groupID); - } - return "Synchronized our profile to the profile of " + targetID.ToStringHyphenated(); } diff --git a/ExportBot/Commands/Communication/TtsCommand.cs b/ExportBot/Commands/Communication/TtsCommand.cs deleted file mode 100644 index e8bd122..0000000 --- a/ExportBot/Commands/Communication/TtsCommand.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Speech.Synthesis; -using libsecondlife; -using libsecondlife.Packets; -using libsecondlife.AssetSystem; - - -// Since this requires .Net 3.0 I've left it out of the project by default. -// To use this: include it in the project and add a reference to the System.Speech.dll - -namespace libsecondlife.TestClient -{ - public class TtsCommand : Command - { - SpeechSynthesizer _speechSynthesizer; - - public TtsCommand(TestClient testClient) - { - Name = "tts"; - Description = "Text To Speech. When activated, client will echo all recieved chat messages out thru the computer's speakers."; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - if (!Active) - { - if (_speechSynthesizer == null) - _speechSynthesizer = new SpeechSynthesizer(); - Active = true; - Client.Self.OnChat += new MainAvatar.ChatCallback(Self_OnChat); - return "TTS is now on."; - } - else - { - Active = false; - Client.Self.OnChat -= new MainAvatar.ChatCallback(Self_OnChat); - return "TTS is now off."; - } - } - - void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position) - { - if (message.Length > 0) - { - _speechSynthesizer.SpeakAsync(message); - } - } - } -} \ No newline at end of file -- cgit v1.1