From 9ec87a847edc88339bb4f2fed1462a4dbc3992a6 Mon Sep 17 00:00:00 2001 From: gareth Date: Sun, 13 May 2007 19:46:09 +0000 Subject: [PATCH] bla --- ExportBot/ClientManager.cs | 15 +++++++++------ ExportBot/Commands/CloneProfileCommand.cs | 6 +++--- ExportBot/Commands/ExportOutfitCommand.cs | 14 ++++++++------ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ExportBot/ClientManager.cs b/ExportBot/ClientManager.cs index 65c01ee007..79528ed2fc 100644 --- a/ExportBot/ClientManager.cs +++ b/ExportBot/ClientManager.cs @@ -42,6 +42,8 @@ namespace libsecondlife.TestClient public bool Running = true; + public static SecondLife MainClient; + string contactPerson = String.Empty; private LLUUID resolvedMasterKey = LLUUID.Zero; private ManualResetEvent keyResolution = new ManualResetEvent(false); @@ -71,14 +73,14 @@ namespace libsecondlife.TestClient } } - public string ExportAvatarRestMethod( string request, string path, string param ) + public string ExportAvatarRestMethod( string request, string path, string param ) { Console.WriteLine("Got a request to export an avatar!"); - Console.WriteLine("Executing cloneprofile " + param); - DoCommandAll("cloneprofile " + param, null, null); - DoCommandAll("say copied avatar, preparing to upload to remote server...", null, null); - return "OK"; + DoCommandAll("Executing exportoutfitcommand " + param + " " + param + ".xml", null, null); + MainClient.Self.InstantMessage(new LLUUID(param), "(automated bot message) Your avatar has been copied OK, if you wish to use it to create your account please type yes, otherwise ignore this message. Note that you are responsible for obtaining all copyright permissions for textures etc on your avatar", new LLUUID(param)); + + return "OK"; } @@ -156,7 +158,8 @@ namespace libsecondlife.TestClient Clients[client.Network.AgentID] = client; - Console.WriteLine("Logged in " + client.ToString()); + MainClient = client; + Console.WriteLine("Logged in " + client.ToString()); } return client; diff --git a/ExportBot/Commands/CloneProfileCommand.cs b/ExportBot/Commands/CloneProfileCommand.cs index d608318ec2..68712ff171 100644 --- a/ExportBot/Commands/CloneProfileCommand.cs +++ b/ExportBot/Commands/CloneProfileCommand.cs @@ -24,20 +24,20 @@ 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); +// 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]"; } - void AvatarSeen(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation) + /* 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) { diff --git a/ExportBot/Commands/ExportOutfitCommand.cs b/ExportBot/Commands/ExportOutfitCommand.cs index 6ec277655c..5945942f8b 100644 --- a/ExportBot/Commands/ExportOutfitCommand.cs +++ b/ExportBot/Commands/ExportOutfitCommand.cs @@ -37,16 +37,18 @@ namespace libsecondlife.TestClient { try { - XmlWriterSettings settings = new XmlWriterSettings(); - settings.Indent = true; - XmlWriter writer = XmlWriter.Create(args[1], settings); + StreamWriter Outfile = File.AppendText(args[1]); + + try { - Client.Appearances[id].ToXml(writer); + Outfile.Write(Client.Appearances[id].ToString()); + Console.WriteLine(Client.Appearances[id].ToString()); + //Client.Appearances[id].ToXml(writer); } finally { - writer.Close(); + Outfile.Close(); } } catch (Exception e) @@ -63,4 +65,4 @@ namespace libsecondlife.TestClient } } } -} \ No newline at end of file +}