diff options
Diffstat (limited to 'indra/newview/llestateinfomodel.cpp')
-rw-r--r-- | indra/newview/llestateinfomodel.cpp | 80 |
1 files changed, 18 insertions, 62 deletions
diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index 8f2eb41307..950ac712d1 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -58,12 +58,18 @@ boost::signals2::connection LLEstateInfoModel::setCommitCallback(const update_si void LLEstateInfoModel::sendEstateInfo() { - if (!commitEstateInfoCaps()) - { - // the caps method failed, try the old way - LLFloaterRegionInfo::nextInvoice(); - commitEstateInfoDataserver(); - } + std::string url = gAgent.getRegion()->getCapability("EstateChangeInfo"); + + if (url.empty()) + { + LL_WARNS("EstateInfo") << "Unable to get URL for cap: EstateChangeInfo!!!" << LL_ENDL; + // whoops, couldn't find the cap, so bail out + return; + } + + LLCoros::instance().launch("LLEstateInfoModel::commitEstateInfoCapsCoro", + boost::bind(&LLEstateInfoModel::commitEstateInfoCapsCoro, this, url)); + } bool LLEstateInfoModel::getUseFixedSun() const { return getFlag(REGION_FLAGS_SUN_FIXED); } @@ -71,14 +77,16 @@ bool LLEstateInfoModel::getIsExternallyVisible() const { return getFlag(REGION_F bool LLEstateInfoModel::getAllowDirectTeleport() const { return getFlag(REGION_FLAGS_ALLOW_DIRECT_TELEPORT); } bool LLEstateInfoModel::getDenyAnonymous() const { return getFlag(REGION_FLAGS_DENY_ANONYMOUS); } bool LLEstateInfoModel::getDenyAgeUnverified() const { return getFlag(REGION_FLAGS_DENY_AGEUNVERIFIED); } -bool LLEstateInfoModel::getAllowVoiceChat() const { return getFlag(REGION_FLAGS_ALLOW_VOICE); } +bool LLEstateInfoModel::getAllowVoiceChat() const { return getFlag(REGION_FLAGS_ALLOW_VOICE); } +bool LLEstateInfoModel::getAllowAccessOverride() const { return getFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE); } void LLEstateInfoModel::setUseFixedSun(bool val) { setFlag(REGION_FLAGS_SUN_FIXED, val); } void LLEstateInfoModel::setIsExternallyVisible(bool val) { setFlag(REGION_FLAGS_EXTERNALLY_VISIBLE, val); } void LLEstateInfoModel::setAllowDirectTeleport(bool val) { setFlag(REGION_FLAGS_ALLOW_DIRECT_TELEPORT, val); } void LLEstateInfoModel::setDenyAnonymous(bool val) { setFlag(REGION_FLAGS_DENY_ANONYMOUS, val); } void LLEstateInfoModel::setDenyAgeUnverified(bool val) { setFlag(REGION_FLAGS_DENY_AGEUNVERIFIED, val); } -void LLEstateInfoModel::setAllowVoiceChat(bool val) { setFlag(REGION_FLAGS_ALLOW_VOICE, val); } +void LLEstateInfoModel::setAllowVoiceChat(bool val) { setFlag(REGION_FLAGS_ALLOW_VOICE, val); } +void LLEstateInfoModel::setAllowAccessOverride(bool val) { setFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE, val); } void LLEstateInfoModel::update(const strings_t& strings) { @@ -111,23 +119,6 @@ void LLEstateInfoModel::notifyCommit() //== PRIVATE STUFF ============================================================ -// tries to send estate info using a cap; returns true if it succeeded -bool LLEstateInfoModel::commitEstateInfoCaps() -{ - std::string url = gAgent.getRegion()->getCapability("EstateChangeInfo"); - - if (url.empty()) - { - // whoops, couldn't find the cap, so bail out - return false; - } - - LLCoros::instance().launch("LLEstateInfoModel::commitEstateInfoCapsCoro", - boost::bind(&LLEstateInfoModel::commitEstateInfoCapsCoro, this, url)); - - return true; -} - void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -145,6 +136,7 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url) body["deny_anonymous"] = getDenyAnonymous(); body["deny_age_unverified"] = getDenyAgeUnverified(); body["allow_voice_chat"] = getAllowVoiceChat(); + body["override_public_access"] = getAllowAccessOverride(); body["invoice"] = LLFloaterRegionInfo::getLastInvoice(); @@ -169,43 +161,6 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url) } } -/* This is the old way of doing things, is deprecated, and should be - deleted when the dataserver model can be removed */ -// key = "estatechangeinfo" -// strings[0] = str(estate_id) (added by simulator before relay - not here) -// strings[1] = estate_name -// strings[2] = str(estate_flags) -// strings[3] = str((S32)(sun_hour * 1024.f)) -void LLEstateInfoModel::commitEstateInfoDataserver() -{ - LL_DEBUGS("Windlight Sync") << "Sending estate info: " - << "is_sun_fixed = " << getUseFixedSun() - << ", sun_hour = " << getSunHour() << LL_ENDL; - LL_DEBUGS() << getInfoDump() << LL_ENDL; - - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("EstateOwnerMessage"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used - - msg->nextBlock("MethodData"); - msg->addString("Method", "estatechangeinfo"); - msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); - - msg->nextBlock("ParamList"); - msg->addString("Parameter", getName()); - - msg->nextBlock("ParamList"); - msg->addString("Parameter", llformat("%u", getFlags())); - - msg->nextBlock("ParamList"); - msg->addString("Parameter", llformat("%d", (S32) (getSunHour() * 1024.0f))); - - gAgent.sendMessage(); -} - std::string LLEstateInfoModel::getInfoDump() { LLSD dump; @@ -218,6 +173,7 @@ std::string LLEstateInfoModel::getInfoDump() dump["deny_anonymous" ] = getDenyAnonymous(); dump["deny_age_unverified" ] = getDenyAgeUnverified(); dump["allow_voice_chat" ] = getAllowVoiceChat(); + dump["override_public_access"] = getAllowAccessOverride(); std::stringstream dump_str; dump_str << dump; |