本文整理汇总了C++中LLXMLRPCValue类的典型用法代码示例。如果您正苦于以下问题:C++ LLXMLRPCValue类的具体用法?C++ LLXMLRPCValue怎么用?C++ LLXMLRPCValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLXMLRPCValue类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clearEstimate
void LLCurrencyUIManager::Impl::updateCurrencyInfo()
{
clearEstimate();
mBought = false;
mCurrencyChanged = false;
if (mUserCurrencyBuy == 0)
{
mLocalCurrencyEstimated = true;
return;
}
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendString("language", LLUI::getLanguage());
keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy);
keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName"));
keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::getMajor());
keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::getMinor());
keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::getPatch());
keywordArgs.appendInt("viewerBuildVersion", LLVersionInfo::getBuild());
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionCurrency, "getCurrencyQuote", params);
}
示例2: startTransaction
void LLFloaterBuyLandUI::startTransaction(TransactionType type, const LLXMLRPCValue& params)
{
mTransactionType = type;
// Select a URI and method appropriate for the transaction type.
static std::string transaction_uri;
if (transaction_uri.empty())
{
transaction_uri = LLViewerLogin::getInstance()->getHelperURI() + "landtool.php";
}
const char* method;
switch (mTransactionType)
{
case TransactionPreflight:
method = "preflightBuyLandPrep";
break;
case TransactionBuy:
method = "buyLandPrep";
break;
default:
llwarns << "LLFloaterBuyLandUI: Unknown transaction type!" << llendl;
return;
}
mResponder = new XMLRPCResponder;
LLHTTPClient::postXMLRPC(transaction_uri, method, params.getValue(), mResponder);
}
示例3: tellUserError
void LLFloaterBuyLandUI::finishWebSiteInfo()
{
LLXMLRPCValue result = mTransaction->responseValue();
mSiteValid = result["success"].asBool();
if (!mSiteValid)
{
tellUserError(
result["errorMessage"].asString(),
result["errorURI"].asString()
);
return;
}
LLXMLRPCValue membership = result["membership"];
mSiteMembershipUpgrade = membership["upgrade"].asBool();
mSiteMembershipAction = membership["action"].asString();
mSiteMembershipPlanIDs.clear();
mSiteMembershipPlanNames.clear();
LLXMLRPCValue levels = membership["levels"];
for (LLXMLRPCValue level = levels.rewind();
level.isValid();
level = levels.next())
{
mSiteMembershipPlanIDs.push_back(level["id"].asString());
mSiteMembershipPlanNames.push_back(level["description"].asString());
}
mUserPlanChoice = 0;
LLXMLRPCValue landUse = result["landUse"];
mSiteLandUseUpgrade = landUse["upgrade"].asBool();
mSiteLandUseAction = landUse["action"].asString();
LLXMLRPCValue currency = result["currency"];
if (currency["estimatedCost"].isValid())
{
mCurrency.setUSDEstimate(currency["estimatedCost"].asInt());
}
if (currency["estimatedLocalCost"].isValid())
{
mCurrency.setLocalEstimate(currency["estimatedLocalCost"].asString());
}
mSiteConfirm = result["confirm"].asString();
}
示例4:
void LLCurrencyUIManager::Impl::updateCurrencyInfo()
{
mSiteCurrencyEstimated = false;
mSiteCurrencyEstimatedCost = 0;
mBought = false;
mCurrencyChanged = false;
if (mUserCurrencyBuy == 0)
{
mSiteCurrencyEstimated = true;
return;
}
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy);
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionCurrency, "getCurrencyQuote", params);
}
示例5: mCurlEasyRequestStateMachinePtr
LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
const std::string& method, LLXMLRPCValue params, bool useGzip)
: mCurlEasyRequestStateMachinePtr(NULL),
mStatus(LLXMLRPCTransaction::StatusNotStarted),
mURI(uri),
mResponse(0)
{
XMLRPC_REQUEST request = XMLRPC_RequestNew();
XMLRPC_RequestSetMethodName(request, method.c_str());
XMLRPC_RequestSetRequestType(request, xmlrpc_request_call);
XMLRPC_RequestSetData(request, params.getValue());
init(request, useGzip);
}
示例6:
void LLCurrencyUIManager::Impl::startTransaction(TransactionType type,
const char* method, LLXMLRPCValue params)
{
static std::string transactionURI;
if (transactionURI.empty())
{
transactionURI = LLViewerLogin::getInstance()->getHelperURI() + "currency.php";
}
mTransactionType = type;
mResponder = new XMLRPCResponder;
LLHTTPClient::postXMLRPC(transactionURI, method, params.getValue(), mResponder);
clearError();
}
示例7: updateWebSiteInfo
void LLFloaterBuyLandUI::updateWebSiteInfo()
{
S32 askBillableArea = mIsForGroup ? 0 : mParcelBillableArea;
S32 askCurrencyBuy = mCurrency.getAmount();
if (mTransaction && mTransactionType == TransactionPreflight
&& mPreflightAskBillableArea == askBillableArea
&& mPreflightAskCurrencyBuy == askCurrencyBuy)
{
return;
}
mPreflightAskBillableArea = askBillableArea;
mPreflightAskCurrencyBuy = askCurrencyBuy;
#if 0
// enable this code if you want the details to blank while we're talking
// to the web site... it's kind of jarring
mSiteValid = false;
mSiteMembershipUpgrade = false;
mSiteMembershipAction = "(waiting)";
mSiteMembershipPlanIDs.clear();
mSiteMembershipPlanNames.clear();
mSiteLandUseUpgrade = false;
mSiteLandUseAction = "(waiting)";
mSiteCurrencyEstimated = false;
mSiteCurrencyEstimatedCost = 0;
#endif
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendString("language", LLUI::getLanguage());
keywordArgs.appendInt("billableArea", mPreflightAskBillableArea);
keywordArgs.appendInt("currencyBuy", mPreflightAskCurrencyBuy);
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionPreflight, params);
}
示例8: mCurlRequest
LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
const std::string& method, LLXMLRPCValue params, bool useGzip)
: mCurlRequest(0),
mStatus(LLXMLRPCTransaction::StatusNotStarted),
mURI(uri),
mRequestText(0),
mResponse(0)
{
XMLRPC_REQUEST request = XMLRPC_RequestNew();
XMLRPC_RequestSetMethodName(request, method.c_str());
XMLRPC_RequestSetRequestType(request, xmlrpc_request_call);
XMLRPC_RequestSetData(request, params.getValue());
init(request, useGzip);
// DEV-28398: without this XMLRPC_RequestFree() call, it looks as though
// the 'request' object is simply leaked. It's less clear to me whether we
// should also ask to free request value data (second param 1), since the
// data come from 'params'.
XMLRPC_RequestFree(request, 1);
}
示例9: sendBuyLand
void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
{
if (!mCanBuy)
{
return;
}
BOOL remove_contribution = getChild<LLUICtrl>("remove_contribution")->getValue().asBoolean();
mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(),
gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution);
if (mParcelBuyInfo
&& !mSiteMembershipUpgrade
&& !mSiteLandUseUpgrade
&& mCurrency.getAmount() == 0
&& mSiteConfirm != "password")
{
sendBuyLand();
return;
}
std::string newLevel = "noChange";
if (mSiteMembershipUpgrade)
{
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
mUserPlanChoice = levels->getCurrentIndex();
newLevel = mSiteMembershipPlanIDs[mUserPlanChoice];
}
}
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendString("language", LLUI::getLanguage());
keywordArgs.appendString("levelId", newLevel);
keywordArgs.appendInt("billableArea",
mIsForGroup ? 0 : mParcelBillableArea);
keywordArgs.appendInt("currencyBuy", mCurrency.getAmount());
keywordArgs.appendInt("estimatedCost", mCurrency.getUSDEstimate());
keywordArgs.appendString("estimatedLocalCost", mCurrency.getLocalEstimate());
keywordArgs.appendString("confirm", mSiteConfirm);
if (!password.empty())
{
keywordArgs.appendString("password", password);
}
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionBuy, params);
}
示例10:
void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password)
{
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy);
if (mUSDCurrencyEstimated)
{
keywordArgs.appendInt("estimatedCost", mUSDCurrencyEstimatedCost);
}
if (mLocalCurrencyEstimated)
{
keywordArgs.appendString("estimatedLocalCost", mLocalCurrencyEstimatedCost);
}
keywordArgs.appendString("confirm", mSiteConfirm);
if (!password.empty())
{
keywordArgs.appendString("password", password);
}
keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName"));
keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::getMajor());
keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::getMinor());
keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::getPatch());
keywordArgs.appendInt("viewerBuildVersion", LLVersionInfo::getBuild());
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionBuy, "buyCurrency", params);
clearEstimate();
mCurrencyChanged = false;
}