client = new Client(hd.name, "localhost", hd.port);
client = new Client(hd.playerName, "localhost", hd.port);
    public void loadGame() {        FileDialog fd = new FileDialog(frame, Messages.getString("MegaMek.SaveGameDialog.title"), FileDialog.LOAD); //$NON-NLS-1$        fd.setDirectory("savegames"); //$NON-NLS-1$        // limit file-list to savedgames only        fd.setFilenameFilter(new FilenameFilter() {            public boolean accept(File dir, String name) {                return (null != name && name.endsWith(".sav")); //$NON-NLS-1$            }        });        //Using the FilenameFilter class would be the appropriate way to        // filter for certain extensions, but it's broken under windoze.  See        // http://developer.java.sun.com/developer/bugParade/bugs/4031440.html        // for details.  The hack below is better than nothing.        //New note: Since we have a dedicated save dir now, I'm commenting        // this out.        //fd.setFile("*.sav"); //$NON-NLS-1$        fd.setVisible(true);        if (fd.getFile() == null) {            return;        }        HostDialog hd = new HostDialog(frame);        hd.setVisible(true);        if (hd.name == null || hd.serverPass == null || hd.port == 0) {            return;        }        // Players should have to enter a non-blank, non-whitespace name.        boolean foundValid = false;        char[] nameChars = hd.name.toCharArray();        for (int loop = 0; !foundValid && loop < nameChars.length; loop++) {            if (!Character.isWhitespace(nameChars[loop])) {                foundValid = true;            }        }        if (!foundValid) {            new AlertDialog(frame, Messages.getString("MegaMek.PlayerNameAlert1.title"), Messages.getString("MegaMek.PlayerNameAlert1.message")).setVisible(true); //$NON-NLS-1$ //$NON-NLS-2$            return;        }        // kick off a RNG check        d6();        // start server        server = new Server(hd.serverPass, hd.port);        if (!server.loadGame(new File(fd.getDirectory(), fd.getFile()))) {            new AlertDialog(frame, Messages.getString("MegaMek.LoadGameAlert.title"), Messages.getString("MegaMek.LoadGameAlert.message")).setVisible(true); //$NON-NLS-1$ //$NON-NLS-2$            server = null;            return;        }        client = new Client(hd.name, "localhost", hd.port); //$NON-NLS-1$        ClientGUI gui = new ClientGUI(client);        gui.initialize();        if (!client.connect()) {        }        optdlg = null;        launch(gui.getFrame());    }