コード例 #1
0
        static void MainSimExportExample(string[] args)
        {
            string loginServer = Settings.AGNI_LOGIN_SERVER;
            string filename = "simexport.tgz";
            string regionName = "OpenSim Test", firstName = "My", lastName = "Bot", password = "******";
            bool   showhelp = false;

            NDesk.Options.OptionSet argParser = new NDesk.Options.OptionSet()
                                                .Add("s|login-server=", "URL of the login server (default is '" + loginServer + "')", delegate(string v) { loginServer = v; })
                                                .Add("r|region-name=", "name of the region to export", delegate(string v) { regionName = v; })
                                                .Add("f|firstname=", "first name of the bot to log in", delegate(string v) { firstName = v; })
                                                .Add("l|lastname=", "last name of the bot to log in", delegate(string v) { lastName = v; })
                                                .Add("p|password="******"password of the bot to log in", delegate(string v) { password = v; })
                                                .Add("o|output=", "filename of the OAR to write (default is 'simexport.tgz')", delegate(string v) { filename = v; })
                                                .Add("h|?|help", delegate(string v) { showhelp = (v != null); })
                                                .Add("v|verbose", delegate(string v) { if (v != null)
                                                                                       {
                                                                                           ++Verbosity;
                                                                                       }
                                                     });
            argParser.Parse(args);

            if (!showhelp && !String.IsNullOrEmpty(regionName) &&
                !String.IsNullOrEmpty(firstName) && !String.IsNullOrEmpty(lastName) && !String.IsNullOrEmpty(password))
            {
                SimExport exporter = new SimExport(firstName, lastName, password, loginServer, regionName, filename);
            }
            else
            {
                WriteLine("Usage: SimExport.exe [OPTION]...");
                WriteLine("An interactive client for exporting assets");
                WriteLine("Options:");
                argParser.WriteOptionDescriptions(Console.Out);
            }
        }
コード例 #2
0
        static void MainSimExportExample(string[] args)
        {
            string loginServer = Settings.AGNI_LOGIN_SERVER;
            string filename = "simexport.tgz";
            string regionName = "OpenSim Test", firstName = "My", lastName = "Bot", password = "******";
            bool showhelp = false;

            NDesk.Options.OptionSet argParser = new NDesk.Options.OptionSet()
                .Add("s|login-server=", "URL of the login server (default is '" + loginServer + "')", delegate(string v) { loginServer = v; })
                .Add("r|region-name=", "name of the region to export", delegate(string v) { regionName = v; })
                .Add("f|firstname=", "first name of the bot to log in", delegate(string v) { firstName = v; })
                .Add("l|lastname=", "last name of the bot to log in", delegate(string v) { lastName = v; })
                .Add("p|password="******"password of the bot to log in", delegate(string v) { password = v; })
                .Add("o|output=", "filename of the OAR to write (default is 'simexport.tgz')", delegate(string v) { filename = v; })
                .Add("h|?|help", delegate(string v) { showhelp = (v != null); })
                .Add("v|verbose", delegate(string v) { if (v != null) ++Verbosity; });
            argParser.Parse(args);

            if (!showhelp && !String.IsNullOrEmpty(regionName) &&
                !String.IsNullOrEmpty(firstName) && !String.IsNullOrEmpty(lastName) && !String.IsNullOrEmpty(password))
            {
                SimExport exporter = new SimExport(firstName, lastName, password, loginServer, regionName, filename);
            }
            else
            {
                WriteLine("Usage: SimExport.exe [OPTION]...");
                WriteLine("An interactive client for exporting assets");
                WriteLine("Options:");
                argParser.WriteOptionDescriptions(Console.Out);
            }
        }