Ejemplo n.º 1
0
int main()
{
    string outdir = "_out_shots";
    string log = "_shots.log";
    string input = "input_full";
    string spreadOut = "_out3";

    Misc::Logger logger(log);
    logger.print = true;

    bf::remove_all(outdir);
    bf::remove_all(spreadOut);

    Spread::SpreadLib spread(spreadOut, "_tmp3");

    cout << "Importing screenshots:\n";
    Spread::JobInfoPtr info = Import::importShots(input, outdir, &spread, logger);
    if(info)
    {
        cout << "Waiting for job to finish...\n";
        info->wait();
        if(info->isError())
            cout << "FAILURE: " << info->getMessage() << endl;
    }
    else
        cout << "ERROR: Info was empty\n";

    if(bf::exists(outdir))
        printDir(outdir);

    return 0;
}
Ejemplo n.º 2
0
int main()
{
  string url = "http://tiggit.net/client/latest.tig";
  cout << "Downloading " << url << "...\n";

  Spread::DownloadTask dlj(url, "_output.txt");
  Spread::JobInfoPtr info = dlj.getInfo();

  dlj.run();

  if(info->isSuccess())
    cout << "Success!\n";
  else
    cout << "Failure: " << info->getMessage() << endl;

  cout << "Progress: " << info->getCurrent() << "/" << info->getTotal() << endl;

  return 0;
}
Ejemplo n.º 3
0
void GameInf::launchGame()
{
  /* Simple ad-hoc solution for now, improve it later.
   */
  Spread::JobInfoPtr job = info.update();
  bool run = true;
  if(job)
    {
      JobProgress prog(job);

      if(!prog.start("Downloading update for " + info.ent->title + "..."))
        {
          if(job->isError())
            run = Boxes::ask("Update failed: " + job->getMessage() + "\n\nRun anyway?");
        }
    }

  if(run)
    info.launch();
}