private void establishConnection() {
        log("Attempting a connection to " + ip + ":" + port + " as " + username + "...");
        boolean connect = packetFactory.connect();
        log(connect ? "Connected!" : "Could not connect.");
        connected = connect;
        packetFactory.sendMessage("/c/" + username);
    }