@Override
    public void run() {
        while (true) {
            if (!in.isEmpty()) {
                String s = in.poll();
                //System.out.println("the server updater heard "+s);
                String header = s.substring(1, s.indexOf(")"));
                s = s.substring(s.indexOf(")") + 1);

                System.out.println("the header was " + header);

                if (header.equals("k")) {//sending public key to server (create user from handshake)
                    int c = Integer.parseInt(s.substring(0, s.indexOf('|') - 1));
                    s = s.substring(s.indexOf('|') + 1);
                    int e = Integer.parseInt(s.substring(0, s.indexOf('|') - 1));
                    s = s.substring(s.indexOf('|') + 1);
                    String ip = s;
                    users.add(new User(ip, e, c));

                    System.out.println("we made a new user with IP " + ip + " e: " + e + " c: " + c);

                } else if (header.equals("n")) {//new user

                } else if (header.equals("v")) {
                    try {
                        //verify user
                        if (data.checkData(s.substring(1, s.indexOf("|") - 1), "username") && data.checkData(s.substring(s.indexOf("|") + 1), "password")) {
                            String name = encrypt.decryptMessage(s.substring(1, s.indexOf("|") - 1), serverD, serverC);
                            //Andrew is here!!!!
                        }
                    }catch (SQLException ex) {
                        Logger.getLogger(ServerUpdater.class.getName()).log(Level.SEVERE, null, ex);
                                    }
                    }else if (header.equals("m")) {//message
                            s = s.substring(1,s.indexOf("]")-1);
                            System.out.println("hi");
                            String message = encrypt.decryptMessage(s, serverD, serverD);
                            System.out.println(message);
                        }
            }
        }
    }