@Override
    public void handleIncoming(SoeUdpConnection connection, ClientIdMsg message) throws Exception {
        // Validate client version
        if (!message.getClientVersion().equals(requiredClientVersion)) {
            ErrorMessage error = new ErrorMessage("Login Error", "The client you are attempting to connect with does not match that required by the server.", false);
            connection.sendMessage(error);
            logger.info("Sending Client Error");
            return;
        }
        SoeAccount account = accountService.validateSession(message.getToken());
        if (account == null) {
            ErrorMessage error = new ErrorMessage("Error", "Invalid Session", false);
            connection.sendMessage(error);
            logger.info("Invalid Session: " + message.getToken());
            return;
        }
        connection.setAccountId(account.getId());
        connection.setAccountUsername(account.getUsername());
        connection.addRole(ConnectionRole.AUTHENTICATED);
        // TODO: Actually implement permissions
        ClientPermissionsMessage cpm = new ClientPermissionsMessage(true, true, true, true);
        connection.sendMessage(cpm);
    }
@Override
    public void handleIncoming(SoeUdpConnection connection, ClientIdMsg message) throws Exception {
       
        if (!message.getClientVersion().equals(requiredClientVersion)) {
            ErrorMessage error = new ErrorMessage("Login Error", "The client you are attempting to connect with does not match that required by the server.", false);
            connection.sendMessage(error);
            logger.info("Sending Client Error");
            return;
        }
        SoeAccount account = accountService.validateSession(message.getToken());
        if (account == null) {
            ErrorMessage error = new ErrorMessage("Error", "Invalid Session", false);
            connection.sendMessage(error);
            logger.info("Invalid Session: " + message.getToken());
            return;
        }
        connection.setAccountId(account.getId());
        connection.setAccountUsername(account.getUsername());
        connection.addRole(ConnectionRole.AUTHENTICATED);
       
        ClientPermissionsMessage cpm = new ClientPermissionsMessage(true, true, true, true);
        connection.sendMessage(cpm);
    }
@override public void handleincoming(soeudpconnection connection, clientidmsg message) throws exception { if (!message.getclientversion().equals(requiredclientversion)) { errormessage error = new errormessage("login error", "the client you are attempting to connect with does not match that required by the server.", false); connection.sendmessage(error); logger.info("sending client error"); return; } soeaccount account = accountservice.validatesession(message.gettoken()); if (account == null) { errormessage error = new errormessage("error", "invalid session", false); connection.sendmessage(error); logger.info("invalid session: " + message.gettoken()); return; } connection.setaccountid(account.getid()); connection.setaccountusername(account.getusername()); connection.addrole(connectionrole.authenticated); clientpermissionsmessage cpm = new clientpermissionsmessage(true, true, true, true); connection.sendmessage(cpm); }