diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterbuyland.cpp | 96 |
1 files changed, 56 insertions, 40 deletions
diff --git a/linden/indra/newview/llfloaterbuyland.cpp b/linden/indra/newview/llfloaterbuyland.cpp index ca5f677..1b72d4e 100644 --- a/linden/indra/newview/llfloaterbuyland.cpp +++ b/linden/indra/newview/llfloaterbuyland.cpp | |||
@@ -75,7 +75,7 @@ private: | |||
75 | virtual ~LLFloaterBuyLandUI(); | 75 | virtual ~LLFloaterBuyLandUI(); |
76 | 76 | ||
77 | LLViewerRegion* mRegion; | 77 | LLViewerRegion* mRegion; |
78 | LLParcel* mParcel; | 78 | LLParcelSelectionHandle mParcel; |
79 | bool mIsClaim; | 79 | bool mIsClaim; |
80 | bool mIsForGroup; | 80 | bool mIsForGroup; |
81 | 81 | ||
@@ -146,7 +146,7 @@ public: | |||
146 | static LLFloaterBuyLandUI* soleInstance(bool createIfNeeded); | 146 | static LLFloaterBuyLandUI* soleInstance(bool createIfNeeded); |
147 | 147 | ||
148 | void setForGroup(bool is_for_group); | 148 | void setForGroup(bool is_for_group); |
149 | void setParcel(LLViewerRegion* region, LLParcel* parcel); | 149 | void setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel); |
150 | 150 | ||
151 | void updateAgentInfo(); | 151 | void updateAgentInfo(); |
152 | void updateParcelInfo(); | 152 | void updateParcelInfo(); |
@@ -205,7 +205,7 @@ static void cacheNameUpdateRefreshesBuyLand(const LLUUID&, | |||
205 | 205 | ||
206 | // static | 206 | // static |
207 | void LLFloaterBuyLand::buyLand( | 207 | void LLFloaterBuyLand::buyLand( |
208 | LLViewerRegion* region, LLParcel* parcel, bool is_for_group) | 208 | LLViewerRegion* region, LLParcelSelectionHandle parcel, bool is_for_group) |
209 | { | 209 | { |
210 | if(is_for_group && !gAgent.hasPowerInActiveGroup(GP_LAND_DEED)) | 210 | if(is_for_group && !gAgent.hasPowerInActiveGroup(GP_LAND_DEED)) |
211 | { | 211 | { |
@@ -216,7 +216,7 @@ void LLFloaterBuyLand::buyLand( | |||
216 | LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(true); | 216 | LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(true); |
217 | ui->setForGroup(is_for_group); | 217 | ui->setForGroup(is_for_group); |
218 | ui->setParcel(region, parcel); | 218 | ui->setParcel(region, parcel); |
219 | ui->open(); | 219 | ui->open(); /*Flawfinder: ignore*/ |
220 | } | 220 | } |
221 | 221 | ||
222 | // static | 222 | // static |
@@ -350,7 +350,7 @@ void LLFloaterBuyLandUI::SelectionObserver::changed() | |||
350 | else { | 350 | else { |
351 | ui->setParcel( | 351 | ui->setParcel( |
352 | gParcelMgr->getSelectionRegion(), | 352 | gParcelMgr->getSelectionRegion(), |
353 | gParcelMgr->getSelectedParcel()); | 353 | gParcelMgr->getParcelSelection()); |
354 | } | 354 | } |
355 | } | 355 | } |
356 | } | 356 | } |
@@ -368,7 +368,8 @@ void LLFloaterBuyLandUI::updateAgentInfo() | |||
368 | 368 | ||
369 | void LLFloaterBuyLandUI::updateParcelInfo() | 369 | void LLFloaterBuyLandUI::updateParcelInfo() |
370 | { | 370 | { |
371 | mParcelValid = mParcel && mRegion; | 371 | LLParcel* parcel = mParcel->getParcel(); |
372 | mParcelValid = parcel && mRegion; | ||
372 | mParcelIsForSale = false; | 373 | mParcelIsForSale = false; |
373 | mParcelIsFirstLand = false; | 374 | mParcelIsFirstLand = false; |
374 | mParcelIsGroupLand = false; | 375 | mParcelIsGroupLand = false; |
@@ -391,50 +392,61 @@ void LLFloaterBuyLandUI::updateParcelInfo() | |||
391 | return; | 392 | return; |
392 | } | 393 | } |
393 | 394 | ||
394 | if (gParcelMgr->getMultipleOwners()) | 395 | if (mParcel->getMultipleOwners()) |
395 | { | 396 | { |
396 | mCannotBuyReason = childGetText("multiple_parcels_selected"); | 397 | mCannotBuyReason = childGetText("multiple_parcels_selected"); |
397 | return; | 398 | return; |
398 | } | 399 | } |
399 | 400 | ||
401 | const LLUUID& parcelOwner = parcel->getOwnerID(); | ||
400 | 402 | ||
401 | const LLUUID& parcelOwner = mParcel->getOwnerID(); | 403 | mIsClaim = parcel->isPublic(); |
402 | |||
403 | mIsClaim = mParcel->isPublic(); | ||
404 | if (!mIsClaim) | 404 | if (!mIsClaim) |
405 | { | 405 | { |
406 | mParcelActualArea = mParcel->getArea(); | 406 | mParcelActualArea = parcel->getArea(); |
407 | mParcelIsForSale = mParcel->getForSale(); | 407 | mParcelIsForSale = parcel->getForSale(); |
408 | mParcelIsFirstLand = mParcel->getReservedForNewbie(); | 408 | mParcelIsFirstLand = parcel->getReservedForNewbie(); |
409 | mParcelIsGroupLand = mParcel->getIsGroupOwned(); | 409 | mParcelIsGroupLand = parcel->getIsGroupOwned(); |
410 | mParcelPrice = mParcelIsForSale ? mParcel->getSalePrice() : 0; | 410 | mParcelPrice = mParcelIsForSale ? parcel->getSalePrice() : 0; |
411 | 411 | ||
412 | if (mParcelIsGroupLand) | 412 | if (mParcelIsGroupLand) |
413 | { | 413 | { |
414 | LLUUID group_id = mParcel->getGroupID(); | 414 | LLUUID group_id = parcel->getGroupID(); |
415 | mParcelGroupContribution = gAgent.getGroupContribution(group_id); | 415 | mParcelGroupContribution = gAgent.getGroupContribution(group_id); |
416 | } | 416 | } |
417 | } | 417 | } |
418 | else | 418 | else |
419 | { | 419 | { |
420 | mParcelActualArea = gParcelMgr->getClaimableArea(); | 420 | mParcelActualArea = mParcel->getClaimableArea(); |
421 | mParcelIsForSale = true; | 421 | mParcelIsForSale = true; |
422 | mParcelPrice = mParcelActualArea * mParcel->getClaimPricePerMeter(); | 422 | mParcelPrice = mParcelActualArea * parcel->getClaimPricePerMeter(); |
423 | } | 423 | } |
424 | 424 | ||
425 | mParcelBillableArea = | 425 | mParcelBillableArea = |
426 | llround(mRegion->getBillableFactor() * mParcelActualArea); | 426 | llround(mRegion->getBillableFactor() * mParcelActualArea); |
427 | 427 | ||
428 | mParcelSupportedObjects = mParcel->getMaxPrimCapacity(); | 428 | mParcelSupportedObjects = llround( |
429 | mParcelSoldWithObjects = mParcel->getSellWithObjects(); | 429 | parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); |
430 | // Can't have more than region max tasks, regardless of parcel | ||
431 | // object bonus factor. | ||
432 | LLViewerRegion* region = gParcelMgr->getSelectionRegion(); | ||
433 | if(region) | ||
434 | { | ||
435 | S32 max_tasks_per_region = (S32)region->getMaxTasks(); | ||
436 | mParcelSupportedObjects = llmin( | ||
437 | mParcelSupportedObjects, max_tasks_per_region); | ||
438 | } | ||
439 | |||
440 | mParcelSoldWithObjects = parcel->getSellWithObjects(); | ||
441 | |||
430 | 442 | ||
431 | LLVector3 center = mParcel->getCenterpoint(); | 443 | LLVector3 center = parcel->getCenterpoint(); |
432 | mParcelLocation = llformat("%s %d,%d", | 444 | mParcelLocation = llformat("%s %d,%d", |
433 | mRegion->getName().c_str(), | 445 | mRegion->getName().c_str(), |
434 | (int)center[VX], (int)center[VY] | 446 | (int)center[VX], (int)center[VY] |
435 | ); | 447 | ); |
436 | 448 | ||
437 | mParcelSnapshot = mParcel->getSnapshotID(); | 449 | mParcelSnapshot = parcel->getSnapshotID(); |
438 | 450 | ||
439 | updateNames(); | 451 | updateNames(); |
440 | 452 | ||
@@ -453,7 +465,7 @@ void LLFloaterBuyLandUI::updateParcelInfo() | |||
453 | 465 | ||
454 | if (!mIsClaim) | 466 | if (!mIsClaim) |
455 | { | 467 | { |
456 | const LLUUID& authorizedBuyer = mParcel->getAuthorizedBuyerID(); | 468 | const LLUUID& authorizedBuyer = parcel->getAuthorizedBuyerID(); |
457 | const LLUUID buyer = gAgent.getID(); | 469 | const LLUUID buyer = gAgent.getID(); |
458 | const LLUUID newOwner = mIsForGroup ? gAgent.getGroupID() : buyer; | 470 | const LLUUID newOwner = mIsForGroup ? gAgent.getGroupID() : buyer; |
459 | 471 | ||
@@ -492,7 +504,7 @@ void LLFloaterBuyLandUI::updateParcelInfo() | |||
492 | return; | 504 | return; |
493 | } | 505 | } |
494 | 506 | ||
495 | if (gParcelMgr->hasOthersSelected()) | 507 | if (mParcel->hasOthersSelected()) |
496 | { | 508 | { |
497 | // Policy: Must not have someone else's land selected | 509 | // Policy: Must not have someone else's land selected |
498 | mCannotBuyReason = childGetText("not_owned_by_you"); | 510 | mCannotBuyReason = childGetText("not_owned_by_you"); |
@@ -511,7 +523,7 @@ void LLFloaterBuyLandUI::updateParcelInfo() | |||
511 | } | 523 | } |
512 | */ | 524 | */ |
513 | 525 | ||
514 | if (mParcel->getReservedForNewbie()) | 526 | if (parcel->getReservedForNewbie()) |
515 | { | 527 | { |
516 | if (mIsForGroup) | 528 | if (mIsForGroup) |
517 | { | 529 | { |
@@ -684,9 +696,10 @@ void LLFloaterBuyLandUI::updateWebSiteInfo() | |||
684 | #endif | 696 | #endif |
685 | 697 | ||
686 | LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); | 698 | LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); |
687 | keywordArgs.appendString("agentId", gAgent.getID().getString()); | 699 | keywordArgs.appendString("agentId", gAgent.getID().asString()); |
688 | keywordArgs.appendString("secureSessionId", | 700 | keywordArgs.appendString( |
689 | gAgent.getSecureSessionID().getString()); | 701 | "secureSessionId", |
702 | gAgent.getSecureSessionID().asString()); | ||
690 | keywordArgs.appendInt("billableArea", mPreflightAskBillableArea); | 703 | keywordArgs.appendInt("billableArea", mPreflightAskBillableArea); |
691 | keywordArgs.appendInt("currencyBuy", mPreflightAskCurrencyBuy); | 704 | keywordArgs.appendInt("currencyBuy", mPreflightAskCurrencyBuy); |
692 | 705 | ||
@@ -771,9 +784,10 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password) | |||
771 | } | 784 | } |
772 | 785 | ||
773 | LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); | 786 | LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); |
774 | keywordArgs.appendString("agentId", gAgent.getID().getString()); | 787 | keywordArgs.appendString("agentId", gAgent.getID().asString()); |
775 | keywordArgs.appendString("secureSessionId", | 788 | keywordArgs.appendString( |
776 | gAgent.getSecureSessionID().getString()); | 789 | "secureSessionId", |
790 | gAgent.getSecureSessionID().asString()); | ||
777 | keywordArgs.appendString("levelId", newLevel); | 791 | keywordArgs.appendString("levelId", newLevel); |
778 | keywordArgs.appendInt("billableArea", | 792 | keywordArgs.appendInt("billableArea", |
779 | mIsForGroup ? 0 : mParcelBillableArea); | 793 | mIsForGroup ? 0 : mParcelBillableArea); |
@@ -820,7 +834,9 @@ void LLFloaterBuyLandUI::sendBuyLand() | |||
820 | 834 | ||
821 | void LLFloaterBuyLandUI::updateNames() | 835 | void LLFloaterBuyLandUI::updateNames() |
822 | { | 836 | { |
823 | if (!mParcelValid) | 837 | LLParcel* parcelp = mParcel->getParcel(); |
838 | |||
839 | if (!parcelp) | ||
824 | { | 840 | { |
825 | mParcelSellerName = ""; | 841 | mParcelSellerName = ""; |
826 | return; | 842 | return; |
@@ -830,19 +846,19 @@ void LLFloaterBuyLandUI::updateNames() | |||
830 | { | 846 | { |
831 | mParcelSellerName = "Linden Lab"; | 847 | mParcelSellerName = "Linden Lab"; |
832 | } | 848 | } |
833 | else if (mParcel->getIsGroupOwned()) | 849 | else if (parcelp->getIsGroupOwned()) |
834 | { | 850 | { |
835 | char groupName[DB_LAST_NAME_BUF_SIZE]; | 851 | char groupName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
836 | 852 | ||
837 | gCacheName->getGroupName(mParcel->getGroupID(), &groupName[0]); | 853 | gCacheName->getGroupName(parcelp->getGroupID(), &groupName[0]); |
838 | mParcelSellerName = groupName; | 854 | mParcelSellerName = groupName; |
839 | } | 855 | } |
840 | else | 856 | else |
841 | { | 857 | { |
842 | char firstName[DB_LAST_NAME_BUF_SIZE]; | 858 | char firstName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
843 | char lastName[DB_LAST_NAME_BUF_SIZE]; | 859 | char lastName[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
844 | 860 | ||
845 | gCacheName->getName(mParcel->getOwnerID(), firstName, lastName); | 861 | gCacheName->getName(parcelp->getOwnerID(), firstName, lastName); |
846 | mParcelSellerName = llformat("%s %s", firstName, lastName); | 862 | mParcelSellerName = llformat("%s %s", firstName, lastName); |
847 | } | 863 | } |
848 | } | 864 | } |
@@ -939,7 +955,7 @@ BOOL LLFloaterBuyLandUI::postBuild() | |||
939 | return TRUE; | 955 | return TRUE; |
940 | } | 956 | } |
941 | 957 | ||
942 | void LLFloaterBuyLandUI::setParcel(LLViewerRegion* region, LLParcel* parcel) | 958 | void LLFloaterBuyLandUI::setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel) |
943 | { | 959 | { |
944 | if (mTransaction && mTransactionType == TransactionBuy) | 960 | if (mTransaction && mTransactionType == TransactionBuy) |
945 | { | 961 | { |
@@ -996,7 +1012,7 @@ BOOL LLFloaterBuyLandUI::canClose() | |||
996 | void LLFloaterBuyLandUI::onClose(bool app_quitting) | 1012 | void LLFloaterBuyLandUI::onClose(bool app_quitting) |
997 | { | 1013 | { |
998 | LLFloater::onClose(app_quitting); | 1014 | LLFloater::onClose(app_quitting); |
999 | delete this; | 1015 | destroy(); |
1000 | } | 1016 | } |
1001 | 1017 | ||
1002 | 1018 | ||