@Override
    public void run() {
        while (true) {
            MessageQ.Message message = messageQ.poll();
            String[] reqSplit = message.getRequest().split("-");

            if (reqSplit[0].equals("LOGIN")) {
                if (loggedInIndex(reqSplit[1]) == -1 && login(reqSplit[1], reqSplit[2])) {
                    message.getClient().responClient("OK");
                    loggedUser.add(reqSplit[1]);
                    String date = new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss").format(new Date());
                    writeUserConf("\nlogin-" + reqSplit[1] + "-" + date);
                } else {
                    message.getClient().responClient("!OK");
                }
            } else if (reqSplit[0].equals("LOGOUT")) {
                if (logout(reqSplit[1])) {
                    message.getClient().responClient("OK");
                    String date = new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss").format(new Date());
                    writeUserConf("\nlogout-" + reqSplit[1] + "-" + date);
                } else {
                    message.getClient().responClient("!OK");
                }
            } else if (reqSplit[0].equals("REG")) {
                if (isExist(reqSplit[1])) {
                    message.getClient().responClient("!OK");
                } else {
                    message.getClient().responClient("OK");
                    String date = new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss").format(new Date());
                    writeUserConf("\nregister-" + reqSplit[1] + "-" + reqSplit[2] + "-" + date);
                }
            }
        }
    }