public static void main(String[] args) {
        ExceptionHandler.registerErrorHandling();
        File logFile = new File("forge.log");
        logFile.delete();
        try {
            OutputStream logFileStream = new BufferedOutputStream(new FileOutputStream(logFile));
            System.setOut(new PrintStream(new MultiplexOutputStream(System.out, logFileStream), true));
            System.setErr(new PrintStream(new MultiplexOutputStream(System.err, logFileStream), true));
        } catch (FileNotFoundException ex) {
            ErrorViewer.showError(ex);
        }
        try {
            preferences = new ForgePreferences("forge.preferences");
            useLAFFonts.setSelected(preferences.lafFonts);
            //newGuiCheckBox.setSelected(preferences.newGui);
            smoothLandCheckBox.setSelected(preferences.stackAiLand);
            Constant.Runtime.Mill[0] = preferences.millingLossCondition;
            Constant.Runtime.DevMode[0] = preferences.developerMode;
            devModeCheckBox.setSelected(preferences.developerMode);
            cardOverlay.setSelected(preferences.cardOverlay);
            ImageCache.scaleLargerThanOriginal = preferences.scaleLargerThanOriginal;
            cardScale.setSelected(preferences.scaleLargerThanOriginal);
            CardStackOffsetAction.set(preferences.stackOffset);
            CardStackAction.setVal(preferences.maxStackSize);
            CardSizesAction.set(preferences.cardSize);
            Constant.Runtime.UpldDrft[0] = preferences.uploadDraftAI;
            upldDrftCheckBox.setSelected(preferences.uploadDraftAI);
            Constant.Runtime.RndCFoil[0] = preferences.randCFoil;
            foilRandomCheckBox.setSelected(preferences.randCFoil);
            
            HttpUtil pinger = new HttpUtil();
            if (pinger.getURL("http://cardforge.org/draftAI/ping.php").equals("pong"))
            	Constant.Runtime.NetConn[0] = true;
            else {
            	Constant.Runtime.UpldDrft[0] = false;
            }
            
        } catch (Exception e) {
            Log.error("Error loading preferences");
        }

        loadDynamicGamedata();
        
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                try {
                    if (preferences.laf.equals(""))
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                    else
                        UIManager.setLookAndFeel(preferences.laf);
                } catch (Exception ex) {
                    ErrorViewer.showError(ex);
                }
            }
        });

        try {
            Constant.Runtime.GameType[0] = Constant.GameType.Constructed;
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    AllZone.setComputer(new ComputerAI_Input(new ComputerAI_General()));
                    new Gui_NewGame();
                }
            });
        } catch (Exception ex) {
            ErrorViewer.showError(ex);
        }
        
        
    }