本文整理汇总了C++中LLPointer::identifierType方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPointer::identifierType方法的具体用法?C++ LLPointer::identifierType怎么用?C++ LLPointer::identifierType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPointer
的用法示例。
在下文中一共展示了LLPointer::identifierType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClickConnect
// static
void LLPanelLogin::onClickConnect(void *)
{
if (sInstance && sInstance->mCallback)
{
// tell the responder we're not here anymore
if ( gResponsePtr )
gResponsePtr->setParent( 0 );
// JC - Make sure the fields all get committed.
sInstance->setFocus(FALSE);
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
LLSD combo_val = combo->getSelectedValue();
if (combo_val.isUndefined())
{
combo_val = combo->getValue();
}
if(combo_val.isUndefined())
{
LLNotificationsUtil::add("StartRegionEmpty");
return;
}
try
{
LLGridManager::getInstance()->setGridChoice(combo_val.asString());
}
catch (LLInvalidGridName ex)
{
LLSD args;
args["GRID"] = combo_val.asString();
LLNotificationsUtil::add("InvalidGrid", args);
return;
}
updateStartSLURL();
std::string username = sInstance->getChild<LLUICtrl>("username_edit")->getValue().asString();
if(username.empty())
{
// user must type in something into the username field
LLNotificationsUtil::add("MustHaveAccountToLogIn");
}
else
{
LLPointer<LLCredential> cred;
BOOL remember;
getFields(cred, remember);
std::string identifier_type;
cred->identifierType(identifier_type);
LLSD allowed_credential_types;
LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
// check the typed in credential type against the credential types expected by the server.
for(LLSD::array_iterator i = allowed_credential_types.beginArray();
i != allowed_credential_types.endArray();
i++)
{
if(i->asString() == identifier_type)
{
// yay correct credential type
sInstance->mCallback(0, sInstance->mCallbackData);
return;
}
}
// Right now, maingrid is the only thing that is picky about
// credential format, as it doesn't yet allow account (single username)
// format creds. - Rox. James, we wanna fix the message when we change
// this.
LLNotificationsUtil::add("InvalidCredentialFormat");
}
}
}
示例2: onClickConnect
// static
void FSPanelLogin::onClickConnect(void *)
{
if (sInstance && sInstance->mCallback)
{
// JC - Make sure the fields all get committed.
sInstance->setFocus(FALSE);
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
LLSD combo_val = combo->getSelectedValue();
// the grid definitions may come from a user-supplied grids.xml, so they may not be good
LL_DEBUGS("AppInit")<<"grid "<<combo_val.asString()<<LL_ENDL;
try
{
LLGridManager::getInstance()->setGridChoice(combo_val.asString());
}
catch (LLInvalidGridName ex)
{
LLSD args;
args["GRID"] = ex.name();
LLNotificationsUtil::add("InvalidGrid", args);
return;
}
// The start location SLURL has already been sent to LLStartUp::setStartSLURL
std::string username = sInstance->getChild<LLUICtrl>("username_combo")->getValue().asString();
gSavedSettings.setString("UserLoginInfo", credentialName()); // <FS:CR>
LLSD blocked = FSData::instance().allowedLogin();
if (!blocked.isMap()) //hack for testing for an empty LLSD
{
if(username.empty())
{
// user must type in something into the username field
LLSD args;
args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel();
LLNotificationsUtil::add("MustHaveAccountToLogIn", args);
}
else
{
LLPointer<LLCredential> cred;
BOOL remember;
getFields(cred, remember);
std::string identifier_type;
cred->identifierType(identifier_type);
LLSD allowed_credential_types;
LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
// check the typed in credential type against the credential types expected by the server.
for(LLSD::array_iterator i = allowed_credential_types.beginArray();
i != allowed_credential_types.endArray();
i++)
{
if(i->asString() == identifier_type)
{
// yay correct credential type
sInstance->mCallback(0, sInstance->mCallbackData);
return;
}
}
// Right now, maingrid is the only thing that is picky about
// credential format, as it doesn't yet allow account (single username)
// format creds. - Rox. James, we wanna fix the message when we change
// this.
LLNotificationsUtil::add("InvalidCredentialFormat");
}
}
else
{
LLNotificationsUtil::add("BlockLoginInfo", blocked);
}
}
}
示例3: onClickConnect
// static
void LLPanelLogin::onClickConnect(void *)
{
if (sInstance && sInstance->mCallback)
{
// JC - Make sure the fields all get committed.
sInstance->setFocus(FALSE);
LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
LLSD combo_val = combo->getSelectedValue();
if (combo_val.isUndefined())
{
combo_val = combo->getValue();
}
if(combo_val.isUndefined())
{
LLNotificationsUtil::add("StartRegionEmpty");
return;
}
std::string new_combo_value = combo_val.asString();
if (!new_combo_value.empty())
{
std::string match = "://";
size_t found = new_combo_value.find(match);
if (found != std::string::npos)
new_combo_value.erase( 0,found+match.length());
}
try
{
LLGridManager::getInstance()->setGridChoice(new_combo_value);
}
catch (LLInvalidGridName ex)
{
LLSD args;
args["GRID"] = ex.name();
LLNotificationsUtil::add("InvalidGrid", args);
return;
}
updateStartSLURL();
std::string username = sInstance->getChild<LLUICtrl>("username_combo")->getValue().asString();
gSavedSettings.setString("UserLoginInfo", credential_name());
LLSD blocked = FSData::getInstance()->allowed_login();
if (!blocked.isMap()) //hack for testing for an empty LLSD
{
if(username.empty())
{
LLSD args;
args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel();
// user must type in something into the username field
LLNotificationsUtil::add("MustHaveAccountToLogIn", args);
}
else
{
LLPointer<LLCredential> cred;
BOOL remember;
getFields(cred, remember);
std::string identifier_type;
cred->identifierType(identifier_type);
LLSD allowed_credential_types;
LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
// check the typed in credential type against the credential types expected by the server.
for(LLSD::array_iterator i = allowed_credential_types.beginArray();
i != allowed_credential_types.endArray();
i++)
{
if(i->asString() == identifier_type)
{
// yay correct credential type
sInstance->mCallback(0, sInstance->mCallbackData);
return;
}
}
// Right now, maingrid is the only thing that is picky about
// credential format, as it doesn't yet allow account (single username)
// format creds. - Rox. James, we wanna fix the message when we change
// this.
LLNotificationsUtil::add("InvalidCredentialFormat");
}
}
}
}