2002/05/05 08:37:32
[org.ibex.core.git] / src / org / xwt / Main.java
index 1f7903c..0c0c7b9 100644 (file)
@@ -90,8 +90,13 @@ public class Main extends Applet {
                 if (args[startargs].startsWith("http://")) {
                     if (Log.on) Log.log(Main.class, "downloading xwar");
                     URL u = new URL(args[startargs]);
-                    originAddr = InetAddress.getByName(u.getHost());
-                    Resources.loadArchive(Platform.urlToInputStream(u));
+                    try {
+                        originAddr = InetAddress.getByName(u.getHost());
+                        // FIXME: use XMLRPC resolver?
+                    } catch (UnknownHostException e) {
+                        if (Log.on) Log.log(Main.class, "couldn't resolve " + u.getHost() + " -- hopefully there is a proxy that can");
+                    }
+                    Resources.loadArchive(new HTTP(args[startargs]).getInputStream());
                     
                 } else {
 
@@ -199,7 +204,7 @@ public class Main extends Applet {
             } else {
                 barPos = barW / 2 + (instantiatedUnits * barW) / (initialTemplate.numUnits() * 2);
                 surf.backbuffer.drawString(Platform.getDefaultFont(), "initializing user interface: " +
-                                           ((instantiatedUnits * 100) / (initialTemplate.numUnits())) + 
+                                           Math.min(100, (instantiatedUnits * 100) / (initialTemplate.numUnits())) + 
                                            "% complete", barX, barY - 5, 0xffffffff);
             }
             if (barPos > barW) barPos = barW;