Ejemplo n.º 1
0
 public async Task SearchPn([QueryField] string pn, [QueryField] int trans)
 {
     ProcessResponse();
     await HttpContext.SendStringAsync(
         PeachPieHelper.searchPn(Program.GetContext(), GetQuery(), GetRemote(), trans != 0, pn),
         "application/json; charset=utf-8", Encoding.UTF8);
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            PrintHeader();
            var address = "";
            var result  = new Parser(with => with.HelpWriter = null).ParseArguments <Options>(args);

            result.WithParsed(opts =>
            {
                address = opts.Address;
                if (!opts.Verbose)
                {
                    Logger.UnregisterLogger <ConsoleLogger>();
                }
            })
            .WithNotParsed(err =>
            {
                if (err.IsHelp())
                {
                    Console.WriteLine(HelpText.AutoBuild(result, h =>
                    {
                        h.AdditionalNewLineAfterOption = false;
                        h.Heading   = "";
                        h.Copyright = "";
                        return(HelpText.DefaultParsingErrorsHandler(result, h));
                    }, e => e));
                }

                Environment.Exit(0);
            });

            context = Context.CreateEmpty();
            PeachPieHelper.load(context);
            FlashDetector.registerProcessor(context, new SharpProcessor(context));
            Console.WriteLine();
            Console.WriteLine("iTXTech FlashDetector version: " + Loader.getInstance(context).getInfo().getVersion());
            Console.WriteLine("Starting server on " + address);
            Console.WriteLine("Press Enter to exit.");
            Console.WriteLine();

            using var server = CreateWebServer(address);
            server.RunAsync();
            Console.ReadLine();
        }
Ejemplo n.º 3
0
 public async Task SearchPn([QueryField] string lang, [QueryField] string pn)
 {
     await SendResponse(PeachPieHelper.searchPn(Program.GetContext(), GetQuery(), GetRemote(), lang, pn));
 }
Ejemplo n.º 4
0
 public async Task Info()
 {
     await SendResponse(PeachPieHelper.info(Program.GetContext(), GetQuery(), GetRemote()));
 }
Ejemplo n.º 5
0
 public async Task Summary([QueryField] string pn)
 {
     ProcessResponse();
     await HttpContext.SendStringAsync(PeachPieHelper.summary(Program.GetContext(), GetQuery(), GetRemote(), pn),
                                       "application/json; charset=utf-8", Encoding.UTF8);
 }
Ejemplo n.º 6
0
 public async Task Info()
 {
     ProcessResponse();
     await HttpContext.SendStringAsync(PeachPieHelper.info(Program.GetContext(), GetQuery(), GetRemote()),
                                       "application/json; charset=utf-8", Encoding.UTF8);
 }