Example #1
0
 private static void main2(String[] args) {
   Config.cmdline(args);
   try {
     javabughack();
   } catch (InterruptedException e) {
     return;
   }
   setupres();
   MainFrame f = new MainFrame(null);
   if (Utils.getprefb("fullscreen", false)) f.setfs();
   f.mt.start();
   try {
     f.mt.join();
   } catch (InterruptedException e) {
     f.g.interrupt();
     return;
   }
   dumplist(Resource.remote().loadwaited(), Config.loadwaited);
   dumplist(Resource.remote().cached(), Config.allused);
   if (ResCache.global != null) {
     try {
       Writer w = new OutputStreamWriter(ResCache.global.store("tmp/allused"), "UTF-8");
       try {
         Resource.dumplist(Resource.remote().used(), w);
       } finally {
         w.close();
       }
     } catch (IOException e) {
     }
   }
   System.exit(0);
 }
Example #2
0
 public static void setupres() {
   if (ResCache.global != null) Resource.setcache(ResCache.global);
   if (Config.resurl != null) Resource.addurl(Config.resurl);
   if (ResCache.global != null) {
     try {
       Resource.loadlist(Resource.remote(), ResCache.global.fetch("tmp/allused"), -10);
     } catch (IOException e) {
     }
   }
   if (!Config.nopreload) {
     try {
       InputStream pls;
       pls = Resource.class.getResourceAsStream("res-preload");
       if (pls != null) Resource.loadlist(Resource.remote(), pls, -5);
       pls = Resource.class.getResourceAsStream("res-bgload");
       if (pls != null) Resource.loadlist(Resource.remote(), pls, -10);
     } catch (IOException e) {
       throw (new Error(e));
     }
   }
 }