client = new Client(frame, hd.name); if (!client.connect("localhost", hd.port)) { server = null; client = null; new AlertDialog(frame, "Load a Game", "Error: could not connect to local server.").show(); return; } client.retrieveServerInfo();
client = new Client(hd.name, "localhost", hd.port); launch(client.getFrame());
    public void loadGame() {        FileDialog fd = new FileDialog(frame,                "Select saved game...",                FileDialog.LOAD);        fd.show();        if (fd.getFile() == null) {            return;        }        HostDialog hd = new HostDialog(frame);        hd.show();        if (hd.name == null || hd.serverPass == null || hd.port == 0) {            return;        }        server = new Server(hd.serverPass, hd.port);        if (!server.loadGame(new File(fd.getDirectory(), fd.getFile()))) {            new AlertDialog(frame, "Load a Game", "Error: unable to load game file.").show();            server = null;            return;        }        client = new Client(frame, hd.name);        if (!client.connect("localhost", hd.port)) {            server = null;            client = null;            new AlertDialog(frame, "Load a Game", "Error: could not connect to local server.").show();            return;        }        client.retrieveServerInfo();    }