void LoginHandler::ProcessLoginData(const QMap<QString, QString> &data) { QString type = data["AvatarType"]; if (type == "OpenSim") { credentials_.SetType(ProtocolUtilities::AT_OpenSim); QString username = data["Username"]; QStringList firstAndLast = username.split(" "); if (firstAndLast.length() == 2) { credentials_.SetFirstName(firstAndLast.at(0)); credentials_.SetLastName(firstAndLast.at(1)); credentials_.SetPassword(data["Password"]); QString startLocation = data["StartLocation"]; if (!startLocation.isEmpty()) credentials_.SetStartLocation(startLocation); server_entry_point_url_ = ValidateServerUrl(data["WorldAddress"]); if (server_entry_point_url_.isValid()) { Logout(); StartWorldSession(); } } else { RexLogicModule::LogError("Username was not in form \"firstname lastname\", could not perform login"); } } else if (type == "RealXtend") { credentials_.SetType(ProtocolUtilities::AT_RealXtend); credentials_.SetIdentity(data["Username"]); credentials_.SetPassword(data["Password"]); credentials_.SetAuthenticationUrl(ValidateServerUrl(data["AuthenticationAddress"])); QString startLocation = data["StartLocation"]; if (!startLocation.isEmpty()) credentials_.SetStartLocation(startLocation); server_entry_point_url_ = ValidateServerUrl(data["WorldAddress"]); if (server_entry_point_url_.isValid()) { Logout(); StartWorldSession(); } } else { RexLogicModule::LogError("Could not find avatar type in login info map. Cannot proceed login."); } }
void OpenSimLoginHandler::ProcessOpenSimLogin(QMap<QString,QString> map) { SAFE_DELETE(credentials_); credentials_ = new ProtocolUtilities::OpenSimCredentials(); ProtocolUtilities::OpenSimCredentials *osCredentials = dynamic_cast<ProtocolUtilities::OpenSimCredentials *>(credentials_); if (osCredentials) { QString username = map["Username"]; QStringList firstAndLast = username.split(" "); if (firstAndLast.length() == 2) { osCredentials->SetFirstName(firstAndLast.at(0)); osCredentials->SetLastName(firstAndLast.at(1)); osCredentials->SetPassword(map["Password"]); server_entry_point_url_ = ValidateServerUrl(map["WorldAddress"]); if (server_entry_point_url_.isValid()) { Logout(); emit LoginStarted(); InstantiateWorldSession(); } } else { rex_logic_module_->LogInfo("Username was not in form firstname lastname, could not perform login"); } } }
void TaigaLoginHandler::ProcessCommandParameterLogin(QString &entry_point_url) { server_entry_point_url_ = ValidateServerUrl(entry_point_url); dynamic_cast<ProtocolUtilities::TaigaCredentials *>(credentials_)->SetIdentityUrl("NotNeeded"); if (server_entry_point_url_.isValid()) { emit LoginStarted(); InstantiateWorldSession(); } }
void OpenSimLoginHandler::ProcessRealXtendLogin(QMap<QString,QString> map) { SAFE_DELETE(credentials_); credentials_ = new ProtocolUtilities::RealXtendCredentials(); ProtocolUtilities::RealXtendCredentials *rexCredentials = dynamic_cast<ProtocolUtilities::RealXtendCredentials *>(credentials_); if (rexCredentials) { rexCredentials->SetIdentity(map["Username"]); rexCredentials->SetPassword(map["Password"]); rexCredentials->SetAuthenticationUrl(ValidateServerUrl(map["AuthenticationAddress"])); server_entry_point_url_ = ValidateServerUrl(map["WorldAddress"]); if (server_entry_point_url_.isValid()) { Logout(); emit LoginStarted(); InstantiateWorldSession(); } } }
void LoginHandler::ProcessLoginData(const QString &url) { server_entry_point_url_ = ValidateServerUrl(url); credentials_.SetIdentity(""); if (server_entry_point_url_.isValid()) { credentials_.SetType(ProtocolUtilities::AT_Taiga); StartWorldSession(); } }
void TaigaLoginHandler::ProcessWebLogin(QWebFrame *web_frame) { int pos1, pos2; QString entry_point_url, identityUrl; QString returnValue = web_frame->evaluateJavaScript("ReturnSuccessValue()").toString(); pos1 = returnValue.indexOf(QString("http://"), 0); pos2 = returnValue.indexOf(QString("?"), 0); entry_point_url = returnValue.mid(pos1, pos2-pos1); pos1 = returnValue.lastIndexOf(QString("&")); identityUrl = returnValue.mid(pos1+1, returnValue.length()-1); dynamic_cast<ProtocolUtilities::TaigaCredentials *>(credentials_)->SetIdentityUrl(identityUrl); server_entry_point_url_ = ValidateServerUrl(entry_point_url); if (server_entry_point_url_.isValid()) { Logout(); emit LoginStarted(); InstantiateWorldSession(); } }
void LoginHandler::ProcessLoginData(QWebFrame *frame) { int pos1, pos2; QString entry_point_url, identityUrl; QString returnValue = frame->evaluateJavaScript("ReturnSuccessValue()").toString(); pos1 = returnValue.indexOf("http://", 0); pos2 = returnValue.indexOf('?', 0); entry_point_url = returnValue.mid(pos1, pos2-pos1); pos1 = returnValue.lastIndexOf('&'); identityUrl = returnValue.mid(pos1+1, returnValue.length()-1); credentials_.SetIdentity(identityUrl); server_entry_point_url_ = ValidateServerUrl(entry_point_url); if (server_entry_point_url_.isValid()) { credentials_.SetType(ProtocolUtilities::AT_Taiga); Logout(); StartWorldSession(); } }