diff --git a/indra/llinventory/CMakeLists.txt b/indra/llinventory/CMakeLists.txt index 7758978c2905297f11826f1bbfda32d1cb92a047..a37b3ca65f39811ff1b507d1b5e8e41ed61af9b3 100644 --- a/indra/llinventory/CMakeLists.txt +++ b/indra/llinventory/CMakeLists.txt @@ -19,6 +19,7 @@ include_directories( set(llinventory_SOURCE_FILES llcategory.cpp + lleconomy.cpp llfoldertype.cpp llinventory.cpp llinventorydefines.cpp @@ -41,6 +42,7 @@ set(llinventory_HEADER_FILES CMakeLists.txt llcategory.h + lleconomy.h llfoldertype.h llinventory.h llinventorydefines.h diff --git a/indra/newview/llagentbenefits.cpp b/indra/newview/llagentbenefits.cpp index 2d219735a09cf22b7512b5c6e651239808e48254..e97136ef5c87f3b2fc2e9c3c0cdd4df5dd3b6733 100644 --- a/indra/newview/llagentbenefits.cpp +++ b/indra/newview/llagentbenefits.cpp @@ -26,6 +26,14 @@ #include "llviewerprecompiledheaders.h" #include "llagentbenefits.h" +#include "llagent.h" +#include "llagentpicksinfo.h" +#include "lleconomy.h" +#include "llstartup.h" +#include "llviewercontrol.h" +#include "llviewernetwork.h" +#include "llviewerregion.h" + LLAgentBenefits::LLAgentBenefits(): m_initalized(false), m_animated_object_limit(-1), @@ -34,7 +42,8 @@ LLAgentBenefits::LLAgentBenefits(): m_group_membership_limit(-1), m_picks_limit(-1), m_sound_upload_cost(-1), - m_texture_upload_cost(-1) + m_texture_upload_cost(-1), + m_create_group_cost(-1) { } @@ -102,42 +111,86 @@ bool LLAgentBenefits::init(const LLSD& benefits_sd) S32 LLAgentBenefits::getAnimatedObjectLimit() const { - return m_animated_object_limit; + if (LLGridManager::instance().isInSecondlife()) + { + return m_animated_object_limit; + } + else + { + S32 max_attach = 0; + if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits")) + { + max_attach = getAttachmentLimit(); + } + else + { + if (gAgent.getRegion()) + { + LLSD features; + gAgent.getRegion()->getSimulatorFeatures(features); + if (features.has("AnimatedObjects")) + { + max_attach = features["AnimatedObjects"]["MaxAgentAnimatedObjectAttachments"].asInteger(); + } + } + } + return max_attach; + } } S32 LLAgentBenefits::getAnimationUploadCost() const { - return m_animation_upload_cost; + return LLGridManager::instance().isInSecondlife() ? m_animation_upload_cost : LLGlobalEconomy::instance().getPriceUpload(); } S32 LLAgentBenefits::getAttachmentLimit() const { - return m_attachment_limit; + if (LLGridManager::instance().isInSecondlife()) + { + return m_attachment_limit; + } + else + { + const S32 MAX_AGENT_ATTACHMENTS = 38; + + S32 max_attach = MAX_AGENT_ATTACHMENTS; + + if (gAgent.getRegion()) + { + LLSD features; + gAgent.getRegion()->getSimulatorFeatures(features); + if (features.has("MaxAgentAttachments")) + { + max_attach = features["MaxAgentAttachments"].asInteger(); + } + } + return max_attach; + } } S32 LLAgentBenefits::getCreateGroupCost() const { - return m_create_group_cost; + return LLGridManager::instance().isInSecondlife() ? m_create_group_cost : 0; } S32 LLAgentBenefits::getGroupMembershipLimit() const { - return m_group_membership_limit; + return LLGridManager::instance().isInSecondlife() ? m_group_membership_limit : gMaxAgentGroups; } S32 LLAgentBenefits::getPicksLimit() const { - return m_picks_limit; + return LLGridManager::instance().isInSecondlife() ? m_picks_limit : LLAgentPicksInfo::instance().getMaxNumberOfPicks(); } S32 LLAgentBenefits::getSoundUploadCost() const { - return m_sound_upload_cost; + return LLGridManager::instance().isInSecondlife() ? m_sound_upload_cost : LLGlobalEconomy::instance().getPriceUpload(); } S32 LLAgentBenefits::getTextureUploadCost() const { - return m_texture_upload_cost; + return LLGridManager::instance().isInSecondlife() ? m_texture_upload_cost : LLGlobalEconomy::instance().getPriceUpload(); } bool LLAgentBenefits::findUploadCost(LLAssetType::EType& asset_type, S32& cost) const diff --git a/indra/newview/llagentpicksinfo.cpp b/indra/newview/llagentpicksinfo.cpp index d1adc1844472f8e1ad7ad77c266c5f79d4025717..15efbd0061a1b5c14930f348e0d7d1738014c932 100644 --- a/indra/newview/llagentpicksinfo.cpp +++ b/indra/newview/llagentpicksinfo.cpp @@ -28,6 +28,7 @@ #include "llagentpicksinfo.h" #include "llagent.h" +#include "llagentbenefits.h" #include "llavatarpropertiesprocessor.h" const S32 MAX_AVATAR_PICKS = 10; @@ -112,7 +113,7 @@ void LLAgentPicksInfo::requestNumberOfPicks() bool LLAgentPicksInfo::isPickLimitReached() { - return getNumberOfPicks() >= getMaxNumberOfPicks(); + return getNumberOfPicks() >= LLAgentBenefitsMgr::current().getPicksLimit(); } void LLAgentPicksInfo::onServerRespond(LLAvatarPicks* picks) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c856fad7d623df1761f383a7efc48a01cc8450ad..b55931858c527f1e1e73402e30b2492cc23e2bc9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2775,7 +2775,7 @@ bool LLAppViewer::initConfiguration() LLStartUp::setStartSLURL(start_slurl); if(start_slurl.getType() == LLSLURL::LOCATION) { - LLGridManager::getInstance()->setGridChoice(start_slurl.getGrid()); + LLGridManager::getInstance()->setGridChoice(start_slurl.getGrid(), false); } } diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index efd1e03d68b6eb523c6edfb72041d6389b8cf516..6f8acae5916b8ffdb2dd76164a59eef62a70b485 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -29,6 +29,7 @@ #include "llpanelprofilepicks.h" #include "llagent.h" +#include "llagentbenefits.h" #include "llagentpicksinfo.h" #include "llavataractions.h" #include "llavatarpropertiesprocessor.h" @@ -360,7 +361,7 @@ void LLPanelProfilePicks::updateData() bool LLPanelProfilePicks::canAddNewPick() { return (!LLAgentPicksInfo::getInstanceFast()->isPickLimitReached() && - mTabContainer->getTabCount() < LLAgentPicksInfo::getInstanceFast()->getMaxNumberOfPicks() && + mTabContainer->getTabCount() < LLAgentBenefitsMgr::current().getPicksLimit() && RlvActions::canShowLocation()); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index bebdfc87e828cf5fa43c67192a7448da21f0cc61..76e03ca55f59a4bd593848b3af205c4ba5dda7a8 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -219,6 +219,7 @@ // exported globals // bool gAgentMovementCompleted = false; +S32 gMaxAgentGroups; const std::string SCREEN_HOME_FILENAME = "screen_home%s.png"; const std::string SCREEN_LAST_FILENAME = "screen_last%s.png"; @@ -1635,6 +1636,11 @@ bool idle_startup() send_complete_agent_movement(regionp->getHost()); gAssetStorage->setUpstream(regionp->getHost()); gCacheName->setUpstream(regionp->getHost()); + if (!LLGridManager::instance().isInSecondlife()) + { + msg->newMessageFast(_PREHASH_EconomyDataRequest); + gAgent.sendReliableMessage(); + } } display_startup(); @@ -3331,7 +3337,14 @@ bool process_login_success_response() { LLSD response = LLLoginInstance::getInstance()->getResponse(); - mBenefitsSuccessfullyInit = init_benefits(response); + if (LLGridManager::instance().isInSecondlife()) + { + mBenefitsSuccessfullyInit = init_benefits(response); + } + else + { + mBenefitsSuccessfullyInit = true; + } std::string text(response["udp_blacklist"]); if(!text.empty()) @@ -3650,6 +3663,27 @@ bool process_login_success_response() LLViewerMedia::getInstance()->openIDSetup(openid_url, openid_token); } + if (!LLGridManager::instance().isInSecondlife()) + { + if (response.has("max-agent-groups") || response.has("max_groups")) + { + std::string max_agent_groups; + response.has("max_groups") ? + max_agent_groups = response["max_groups"].asString() + : max_agent_groups = response["max-agent-groups"].asString(); + + gMaxAgentGroups = atoi(max_agent_groups.c_str()); + LL_INFOS("LLStartup") << "gMaxAgentGroups read from login.cgi: " + << gMaxAgentGroups << LL_ENDL; + } + else + { + gMaxAgentGroups = 0; + LL_INFOS("LLStartup") << "did not receive max-agent-groups. unlimited groups activated" << LL_ENDL; + } + } + + bool success = false; // JC: gesture loading done below, when we have an asset system // in place. Don't delete/clear gUserCredentials until then. diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 3fb4eec4d83afb479e7ae4559d1eec083c318b64..f6825ad0e83d5839f5e3ef55518c6cc783a85e6d 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -78,6 +78,7 @@ typedef enum { // exported symbols extern bool gAgentMovementCompleted; +extern S32 gMaxAgentGroups; extern LLPointer<LLViewerTexture> gStartTexture; class LLStartUp diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d1ae3d7f618622129b3d3474743fd8fe261cebba..6effc71229e241539002d88f4b39fbd1825e44c3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -32,6 +32,7 @@ #include "llaudioengine.h" #include "llavataractions.h" #include "llavatarnamecache.h" // IDEVO HACK +#include "lleconomy.h" #include "lleventtimer.h" #include "llfloaterreg.h" #include "llfolderview.h" @@ -93,6 +94,7 @@ #include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" +#include "llviewernetwork.h" #include "llviewerinventory.h" #include "llviewerjoystick.h" #include "llviewerobjectlist.h" @@ -5832,7 +5834,21 @@ void process_frozen_message(LLMessageSystem *msgsystem, void **user_data) // do some extra stuff once we get our economy data void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) { - LL_DEBUGS("Benefits") << "Received economy data, not currently used" << LL_ENDL; + if (!LLGridManager::getInstance()->isInSecondlife()) + { + LLGlobalEconomy::processEconomyData(msg, LLGlobalEconomy::getInstance()); + + const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()); + const std::string sound_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getSoundUploadCost()); + const std::string animation_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getAnimationUploadCost()); + gMenuHolder->getChild<LLUICtrl>("Upload Image")->setLabelArg("[COST]", texture_upload_cost_str); + gMenuHolder->getChild<LLUICtrl>("Upload Sound")->setLabelArg("[COST]", sound_upload_cost_str); + gMenuHolder->getChild<LLUICtrl>("Upload Animation")->setLabelArg("[COST]", animation_upload_cost_str); + } + else + { + LL_DEBUGS("Benefits") << "Received economy data, not currently used" << LL_ENDL; + } } void notify_cautioned_script_question(const LLSD& notification, const LLSD& response, S32 orig_questions, BOOL granted)