client = new Client(frame, hd.name);   if(!client.connect("localhost", hd.port)) { server = null; client = null; new AlertDialog(frame, "Host 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 host() {        HostDialog hd;        hd = new HostDialog(frame);        hd.show();        // verify dialog data        if(hd.name == null || hd.serverPass == null || hd.port == 0) {            return;        }        // start server        server = new Server(hd.serverPass, hd.port);        // initialize game        client = new Client(frame, hd.name);        // verify connection        if(!client.connect("localhost", hd.port)) {            server = null;            client = null;            new AlertDialog(frame, "Host a Game", "Error: could not connect to local server.").show();            return;        }        // wait for full connection        client.retrieveServerInfo();        server.getGame().getOptions().loadOptions(client, hd.serverPass);    }