aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ExportBot/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ExportBot/Program.cs141
1 files changed, 0 insertions, 141 deletions
diff --git a/ExportBot/Program.cs b/ExportBot/Program.cs
deleted file mode 100644
index 8855be1..0000000
--- a/ExportBot/Program.cs
+++ /dev/null
@@ -1,141 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Threading;
5using CommandLine.Utility;
6using OpenSim.Framework;
7using OpenSim.Framework.Console;
8using OpenSim.Servers;
9
10namespace libsecondlife.TestClient
11{
12 public class Program : conscmd_callback
13 {
14 private static void Usage()
15 {
16 }
17
18 public void RunCmd(string cmd, string[] cmdparams) {}
19 public void Show(string ShowWhat) {}
20
21 static void Main(string[] args)
22 {
23 ConsoleBase m_console = new ConsoleBase("exportbot-console.log", "ExportBot", new Program() , false);
24 MainConsole.Instance = m_console;
25
26 Arguments arguments = new Arguments(args);
27
28 ClientManager manager;
29 List<LoginDetails> accounts = new List<LoginDetails>();
30 LoginDetails account;
31 string masterName = String.Empty;
32 LLUUID masterKey = LLUUID.Zero;
33 string file = String.Empty;
34 string contact = String.Empty;
35
36 if (arguments["masterkey"] != null)
37 {
38 masterKey = LLUUID.Parse(arguments["masterkey"]);
39 }
40 if (arguments["master"] != null)
41 {
42 masterName = arguments["master"];
43 }
44
45 if (arguments["contact"] != null)
46 {
47 contact = arguments["contact"];
48 if (arguments["file"] != null)
49 {
50 file = arguments["file"];
51
52 // Loading names from a file
53 try
54 {
55 using (StreamReader reader = new StreamReader(file))
56 {
57 string line;
58 int lineNumber = 0;
59
60 while ((line = reader.ReadLine()) != null)
61 {
62 lineNumber++;
63 string[] tokens = line.Trim().Split(new char[] { ' ', ',' });
64
65 if (tokens.Length >= 3)
66 {
67 account = new LoginDetails();
68 account.FirstName = tokens[0];
69 account.LastName = tokens[1];
70 account.Password = tokens[2];
71
72 accounts.Add(account);
73
74 // Leaving this out until we have per-account masters (if that
75 // is desirable). For now the command-line option can
76 // specify the single master that TestClient supports
77
78 //if (tokens.Length == 5)
79 //{
80 // master = tokens[3] + " " + tokens[4];
81 //}
82 }
83 else
84 {
85 Console.WriteLine("Invalid data on line " + lineNumber +
86 ", must be in the format of: FirstName LastName Password");
87 }
88 }
89 }
90 }
91 catch (Exception e)
92 {
93 Console.WriteLine("Error reading from " + args[1]);
94 Console.WriteLine(e.ToString());
95 return;
96 }
97 }
98 else
99 {
100 if (arguments["first"] != null && arguments["last"] != null && arguments["pass"] != null)
101 {
102 // Taking a single login off the command-line
103 account = new LoginDetails();
104 account.FirstName = arguments["first"];
105 account.LastName = arguments["last"];
106 account.Password = arguments["pass"];
107
108 accounts.Add(account);
109 }
110 }
111 }
112 else
113 {
114 Usage();
115 return;
116 }
117
118 foreach (LoginDetails a in accounts)
119 {
120 a.MasterName = masterName;
121 a.MasterKey = masterKey;
122 }
123
124 // Login the accounts and run the input loop
125 manager = new ClientManager(accounts, contact, "Theta/16/229/25");
126/* if ( arguments["start"] != null ) {
127 manager = new ClientManager(accounts, contact, arguments["start"]);
128 } else {
129 manager = new ClientManager(accounts, contact);
130 }*/
131
132 Console.WriteLine("Starting the HTTP listener");
133 BaseHttpServer httpServer = new BaseHttpServer(12035);
134 httpServer.AddRestHandler("GET", "/exportaccount/", manager.ExportAvatarRestMethod);
135 httpServer.Start();
136
137 manager.Run();
138
139 }
140 }
141}