// don't send session-id on good bye, neither required nor desired
sendToken(aConnector, aConnector, lGoodBye);
}
private void login(WebSocketConnector aConnector, Token aToken) {
Token lResponse = createResponse(aToken);
String lUsername = aToken.getString("username");
// TODO: Add authentication and password check
String lPassword = aToken.getString("password");
String lGroup = aToken.getString("group");
if (log.isDebugEnabled()) {
log.debug("Processing 'login' (username='" + lUsername + "', group='" + lGroup + "') from '" + aConnector + "'...");
}
if (lUsername != null) {
lResponse.put("username", lUsername);
// lResponse.put("usid", getSessionId(aConnector));
lResponse.put("sourceId", aConnector.getId());
// set shared variables
setUsername(aConnector, lUsername);
setGroup(aConnector, lGroup);
} else {
lResponse.put("code", -1);
lResponse.put("msg", "missing arguments for 'login' command");
}
// send response to client
sendToken(aConnector, aConnector, lResponse);