diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-05-15 16:35:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 16:35:49 +0300 |
commit | e49dcb8d0c9f539997effb640e350d9d0689aae6 (patch) | |
tree | 1bf99eaccce6de17c62f13c6595f7f497548dc5c /indra/newview/llestateinfomodel.cpp | |
parent | 531cd34f670170ade57f8813fe48012b61a1d3c2 (diff) | |
parent | 5f8a7374b9f18e0112d6749a9c845bd077a81acb (diff) |
Merge pull request #1476 from secondlife/marchcat/x-b-merge
Maint X -> Maint B merge
Diffstat (limited to 'indra/newview/llestateinfomodel.cpp')
-rw-r--r-- | indra/newview/llestateinfomodel.cpp | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index 5be56660d6..a7d18d85ce 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llestateinfomodel.cpp * @brief Estate info model * * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2011, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -40,79 +40,79 @@ #include "llcorehttputil.h" LLEstateInfoModel::LLEstateInfoModel() -: mID(0) -, mFlags(0) -, mSunHour(0) +: mID(0) +, mFlags(0) +, mSunHour(0) { } boost::signals2::connection LLEstateInfoModel::setUpdateCallback(const update_signal_t::slot_type& cb) { - return mUpdateSignal.connect(cb); + return mUpdateSignal.connect(cb); } boost::signals2::connection LLEstateInfoModel::setCommitCallback(const update_signal_t::slot_type& cb) { - return mCommitSignal.connect(cb); + return mCommitSignal.connect(cb); } void LLEstateInfoModel::sendEstateInfo() { - if (!commitEstateInfoCaps()) - { - // the caps method failed, try the old way - LLFloaterRegionInfo::nextInvoice(); - commitEstateInfoDataserver(); - } + if (!commitEstateInfoCaps()) + { + // the caps method failed, try the old way + LLFloaterRegionInfo::nextInvoice(); + commitEstateInfoDataserver(); + } } -bool LLEstateInfoModel::getUseFixedSun() const { return getFlag(REGION_FLAGS_SUN_FIXED); } -bool LLEstateInfoModel::getIsExternallyVisible() const { return getFlag(REGION_FLAGS_EXTERNALLY_VISIBLE); } -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::getAllowAccessOverride() const { return getFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE); } +bool LLEstateInfoModel::getUseFixedSun() const { return getFlag(REGION_FLAGS_SUN_FIXED); } +bool LLEstateInfoModel::getIsExternallyVisible() const { return getFlag(REGION_FLAGS_EXTERNALLY_VISIBLE); } +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::getAllowAccessOverride() const { return getFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE); } bool LLEstateInfoModel::getAllowEnvironmentOverride() const { return getFlag(REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE); } bool LLEstateInfoModel::getDenyScriptedAgents() const { return getFlag(REGION_FLAGS_DENY_BOTS); } -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::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::setAllowAccessOverride(bool val) { setFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE, val); } void LLEstateInfoModel::setAllowEnvironmentOverride(bool val) { setFlag(REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE, val); } void LLEstateInfoModel::setDenyScriptedAgents(bool val) { setFlag(REGION_FLAGS_DENY_BOTS, val); } void LLEstateInfoModel::update(const strings_t& strings) { - // NOTE: LLDispatcher extracts strings with an extra \0 at the - // end. If we pass the std::string direct to the UI/renderer - // it draws with a weird character at the end of the string. - mName = strings[0].c_str(); - mOwnerID = LLUUID(strings[1].c_str()); - mID = strtoul(strings[2].c_str(), NULL, 10); - mFlags = strtoul(strings[3].c_str(), NULL, 10); - mSunHour = ((F32)(strtod(strings[4].c_str(), NULL)))/1024.0f; - - LL_DEBUGS("WindlightSync") << "Received estate info: " - << "is_sun_fixed = " << getUseFixedSun() - << ", sun_hour = " << getSunHour() << LL_ENDL; - LL_DEBUGS() << getInfoDump() << LL_ENDL; - - // Update region owner. - LLViewerRegion* regionp = gAgent.getRegion(); - regionp->setOwner(mOwnerID); - - // Let interested parties know that estate info has been updated. - mUpdateSignal(); + // NOTE: LLDispatcher extracts strings with an extra \0 at the + // end. If we pass the std::string direct to the UI/renderer + // it draws with a weird character at the end of the string. + mName = strings[0].c_str(); + mOwnerID = LLUUID(strings[1].c_str()); + mID = strtoul(strings[2].c_str(), NULL, 10); + mFlags = strtoul(strings[3].c_str(), NULL, 10); + mSunHour = ((F32)(strtod(strings[4].c_str(), NULL)))/1024.0f; + + LL_DEBUGS("WindlightSync") << "Received estate info: " + << "is_sun_fixed = " << getUseFixedSun() + << ", sun_hour = " << getSunHour() << LL_ENDL; + LL_DEBUGS() << getInfoDump() << LL_ENDL; + + // Update region owner. + LLViewerRegion* regionp = gAgent.getRegion(); + regionp->setOwner(mOwnerID); + + // Let interested parties know that estate info has been updated. + mUpdateSignal(); } void LLEstateInfoModel::notifyCommit() { - mCommitSignal(); + mCommitSignal(); } //== PRIVATE STUFF ============================================================ @@ -120,13 +120,13 @@ void LLEstateInfoModel::notifyCommit() // tries to send estate info using a cap; returns true if it succeeded bool LLEstateInfoModel::commitEstateInfoCaps() { - std::string url = gAgent.getRegionCapability("EstateChangeInfo"); + std::string url = gAgent.getRegionCapability("EstateChangeInfo"); - if (url.empty()) - { - // whoops, couldn't find the cap, so bail out - return false; - } + 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)); @@ -186,51 +186,51 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url) // strings[3] = str((S32)(sun_hour * 1024.f)) void LLEstateInfoModel::commitEstateInfoDataserver() { - LL_DEBUGS("WindlightSync") << "Sending estate info: " - << "is_sun_fixed = " << getUseFixedSun() - << ", sun_hour = " << getSunHour() << LL_ENDL; - LL_DEBUGS() << getInfoDump() << LL_ENDL; + LL_DEBUGS("WindlightSync") << "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 + 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("MethodData"); + msg->addString("Method", "estatechangeinfo"); + msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); - msg->nextBlock("ParamList"); - msg->addString("Parameter", getName()); + msg->nextBlock("ParamList"); + msg->addString("Parameter", getName()); - msg->nextBlock("ParamList"); - msg->addString("Parameter", llformat("%u", getFlags())); + msg->nextBlock("ParamList"); + msg->addString("Parameter", llformat("%u", getFlags())); - msg->nextBlock("ParamList"); - msg->addString("Parameter", llformat("%d", (S32) (getSunHour() * 1024.0f))); + msg->nextBlock("ParamList"); + msg->addString("Parameter", llformat("%d", (S32) (getSunHour() * 1024.0f))); - gAgent.sendMessage(); + gAgent.sendMessage(); } std::string LLEstateInfoModel::getInfoDump() { - LLSD dump; - dump["estate_name" ] = getName(); - dump["sun_hour" ] = getSunHour(); - - dump["is_sun_fixed" ] = getUseFixedSun(); - dump["is_externally_visible"] = getIsExternallyVisible(); - dump["allow_direct_teleport"] = getAllowDirectTeleport(); - dump["deny_anonymous" ] = getDenyAnonymous(); - dump["deny_age_unverified" ] = getDenyAgeUnverified(); + LLSD dump; + dump["estate_name" ] = getName(); + dump["sun_hour" ] = getSunHour(); + + dump["is_sun_fixed" ] = getUseFixedSun(); + dump["is_externally_visible"] = getIsExternallyVisible(); + dump["allow_direct_teleport"] = getAllowDirectTeleport(); + dump["deny_anonymous" ] = getDenyAnonymous(); + dump["deny_age_unverified" ] = getDenyAgeUnverified(); dump["block_bots" ] = getDenyScriptedAgents(); - dump["allow_voice_chat" ] = getAllowVoiceChat(); + dump["allow_voice_chat" ] = getAllowVoiceChat(); dump["override_public_access"] = getAllowAccessOverride(); dump["override_environment"] = getAllowEnvironmentOverride(); - std::stringstream dump_str; - dump_str << dump; - return dump_str.str(); + std::stringstream dump_str; + dump_str << dump; + return dump_str.str(); } |