From 64d9705ae21c42f4c7869a414e250c5de251b143 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 17 Aug 2012 03:56:38 +0000 Subject: Expanding region flags to 64 bits. Adding region protocol flags --- indra/newview/llregioninfomodel.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llregioninfomodel.cpp') diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index 698c4f9bb9..cc777d9297 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -119,7 +119,7 @@ void LLRegionInfoModel::sendRegionTerrain(const LLUUID& invoice) const bool LLRegionInfoModel::getUseFixedSun() const { - return mRegionFlags & REGION_FLAGS_SUN_FIXED; + return ((mRegionFlags & REGION_FLAGS_SUN_FIXED) != 0); } void LLRegionInfoModel::setUseFixedSun(bool fixed) @@ -141,7 +141,6 @@ void LLRegionInfoModel::update(LLMessageSystem* msg) msg->getStringFast(_PREHASH_RegionInfo, _PREHASH_SimName, mSimName); msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, mEstateID); msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, mParentEstateID); - msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, mRegionFlags); msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_SimAccess, mSimAccess); msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_MaxAgents, mAgentLimit); msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, mObjectBonusFactor); @@ -159,6 +158,17 @@ void LLRegionInfoModel::update(LLMessageSystem* msg) msg->getF32(_PREHASH_RegionInfo, _PREHASH_SunHour, mSunHour); LL_DEBUGS("Windlight Sync") << "Got region sun hour: " << mSunHour << LL_ENDL; + if (msg->has(_PREHASH_RegionInfo3)) + { + msg->getU64Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, mRegionFlags); + } + else + { + U32 flags = 0; + msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, flags); + mRegionFlags = flags; + } + // the only reasonable way to decide if we actually have any data is to // check to see if any of these fields have nonzero sizes if (msg->getSize(_PREHASH_RegionInfo2, _PREHASH_ProductSKU) > 0 || -- cgit v1.3 From c188fa6ab7f008069ac5c8d7ae8abc793e7e96f9 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 17 Aug 2012 06:34:28 +0000 Subject: Fix for incorrectly reading extended region flags --- indra/newview/llfloatergodtools.cpp | 2 +- indra/newview/llfloaterregioninfo.cpp | 2 +- indra/newview/llregioninfomodel.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llregioninfomodel.cpp') diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index aac8f5bfc1..9c95899c77 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -239,7 +239,7 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) if (msg->has(_PREHASH_RegionInfo3)) { - msg->getU64Fast(_PREHASH_RegionInfo3, _PREHASH_RegionFlags, region_flags); + msg->getU64Fast(_PREHASH_RegionInfo3, _PREHASH_RegionFlagsExtended, region_flags); } else { diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 1d9f519d70..a179e4dff7 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -348,7 +348,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) if (msg->has(_PREHASH_RegionInfo3)) { - msg->getU64("RegionInfo", "RegionFlags", region_flags); + msg->getU64("RegionInfo", "RegionFlagsExtended", region_flags); } else { diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index cc777d9297..498564ecc9 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -160,7 +160,7 @@ void LLRegionInfoModel::update(LLMessageSystem* msg) if (msg->has(_PREHASH_RegionInfo3)) { - msg->getU64Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, mRegionFlags); + msg->getU64Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlagsExtended, mRegionFlags); } else { -- cgit v1.3 From ba07e95d682428f20e529fca4cc324817dc781a7 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 17 Aug 2012 08:22:50 +0000 Subject: Added extended flags to god tools region info response --- indra/newview/llfloatergodtools.cpp | 6 +++++- indra/newview/llfloaterregioninfo.cpp | 2 +- indra/newview/llregioninfomodel.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llregioninfomodel.cpp') diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 9c95899c77..ab56b8e3d6 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -351,6 +351,7 @@ void LLFloaterGodTools::sendGodUpdateRegionInfo() LLMessageSystem *msg = gMessageSystem; LLPanelRegionTools *rtool = god_tools->mPanelRegionTools; + U64 region_flags = computeRegionFlags(); msg->newMessage("GodUpdateRegionInfo"); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -359,11 +360,14 @@ void LLFloaterGodTools::sendGodUpdateRegionInfo() msg->addStringFast(_PREHASH_SimName, rtool->getSimName()); msg->addU32Fast(_PREHASH_EstateID, rtool->getEstateID()); msg->addU32Fast(_PREHASH_ParentEstateID, rtool->getParentEstateID()); - msg->addU32Fast(_PREHASH_RegionFlags, computeRegionFlags()); + // Legacy flags + msg->addU32Fast(_PREHASH_RegionFlags, U32(region_flags)); msg->addF32Fast(_PREHASH_BillableFactor, rtool->getBillableFactor()); msg->addS32Fast(_PREHASH_PricePerMeter, rtool->getPricePerMeter()); msg->addS32Fast(_PREHASH_RedirectGridX, rtool->getRedirectGridX()); msg->addS32Fast(_PREHASH_RedirectGridY, rtool->getRedirectGridY()); + msg->nextBlockFast(_PREHASH_RegionInfo2); + msg->addU64Fast(_PREHASH_RegionFlagsExtended, region_flags); gAgent.sendReliableMessage(); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index a179e4dff7..a36021f971 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -348,7 +348,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) if (msg->has(_PREHASH_RegionInfo3)) { - msg->getU64("RegionInfo", "RegionFlagsExtended", region_flags); + msg->getU64("RegionInfo3", "RegionFlagsExtended", region_flags); } else { diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index 498564ecc9..590e246482 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -160,7 +160,7 @@ void LLRegionInfoModel::update(LLMessageSystem* msg) if (msg->has(_PREHASH_RegionInfo3)) { - msg->getU64Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlagsExtended, mRegionFlags); + msg->getU64Fast(_PREHASH_RegionInfo3, _PREHASH_RegionFlagsExtended, mRegionFlags); } else { -- cgit v1.3