diff options
| author | Todd Stinson <stinson@lindenlab.com> | 2012-05-09 18:04:45 -0700 |
|---|---|---|
| committer | Todd Stinson <stinson@lindenlab.com> | 2012-05-09 18:04:45 -0700 |
| commit | d4e5e180f82a8d959b88cc3eb1f69a3fff238d6a (patch) | |
| tree | ea0b716a6c14c8144d963f7dbe2812e93f3a75f8 /indra/newview/llpathfindinglinkset.cpp | |
| parent | 92ce47a1b21b3cc06d3d962394f44617a780ffbd (diff) | |
Adding an owner field to the pathfinding linksets console. Making the scroll list just wide enough for the additional field, but not cleaning up the rest of the floater until Leo has a chance to review.
Diffstat (limited to 'indra/newview/llpathfindinglinkset.cpp')
| -rw-r--r-- | indra/newview/llpathfindinglinkset.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp index e7478870ca..e2ece8794f 100644 --- a/indra/newview/llpathfindinglinkset.cpp +++ b/indra/newview/llpathfindinglinkset.cpp @@ -26,13 +26,18 @@ */ #include "llviewerprecompiledheaders.h" + #include "llpathfindinglinkset.h" -#include "llsd.h" + #include "v3math.h" +#include "llavatarname.h" +#include "llavatarnamecache.h" +#include "llsd.h" #include "lluuid.h" #define LINKSET_NAME_FIELD "name" #define LINKSET_DESCRIPTION_FIELD "description" +#define LINKSET_OWNER_FIELD "owner" #define LINKSET_LAND_IMPACT_FIELD "landimpact" #define LINKSET_MODIFIABLE_FIELD "modifiable" #ifdef DEPRECATED_NAVMESH_PERMANENT_WALKABLE_FLAGS @@ -64,6 +69,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const LLSD& pTerrainLinksetItem) mIsTerrain(true), mName(), mDescription(), + mOwnerUUID(), + mOwnerName(), mLandImpact(0U), mLocation(LLVector3::zero), #ifdef MISSING_MODIFIABLE_FIELD_WAR @@ -85,6 +92,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& mIsTerrain(false), mName(), mDescription(), + mOwnerUUID(), + mOwnerName(), mLandImpact(0U), mLocation(LLVector3::zero), #ifdef MISSING_MODIFIABLE_FIELD_WAR @@ -106,6 +115,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther) : mUUID(pOther.mUUID), mName(pOther.mName), mDescription(pOther.mDescription), + mOwnerUUID(pOther.mOwnerUUID), + mOwnerName(pOther.mOwnerName), mLandImpact(pOther.mLandImpact), mLocation(pOther.mLocation), #ifdef MISSING_MODIFIABLE_FIELD_WAR @@ -132,6 +143,8 @@ LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkse mUUID = pOther.mUUID; mName = pOther.mName; mDescription = pOther.mDescription; + mOwnerUUID = pOther.mOwnerUUID; + mOwnerName = pOther.mOwnerName; mLandImpact = pOther.mLandImpact; mLocation = pOther.mLocation; #ifdef MISSING_MODIFIABLE_FIELD_WAR @@ -153,6 +166,18 @@ LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkse return *this; } +std::string LLPathfindingLinkset::getOwnerName() const +{ + std::string ownerName; + + if (hasOwnerName()) + { + ownerName = mOwnerName.getCompleteName(); + } + + return ownerName; +} + BOOL LLPathfindingLinkset::isPhantom() const { return isPhantom(getLinksetUse()); @@ -227,7 +252,21 @@ void LLPathfindingLinkset::parseObjectData(const LLSD &pLinksetItem) llassert(pLinksetItem.has(LINKSET_DESCRIPTION_FIELD)); llassert(pLinksetItem.get(LINKSET_DESCRIPTION_FIELD).isString()); mDescription = pLinksetItem.get(LINKSET_DESCRIPTION_FIELD).asString(); - + +#ifdef SERVER_SIDE_OWNER_ROLLOUT_COMPLETE + llassert(pLinksetItem.has(LINKSET_OWNER_FIELD)); + llassert(pLinksetItem.get(LINKSET_OWNER_FIELD).isUUID()); + mOwnerUUID = pLinksetItem.get(LINKSET_OWNER_FIELD).asUUID(); + LLAvatarNameCache::get(mOwnerUUID, &mOwnerName); +#else // SERVER_SIDE_OWNER_ROLLOUT_COMPLETE + if (pLinksetItem.has(LINKSET_OWNER_FIELD)) + { + llassert(pLinksetItem.get(LINKSET_OWNER_FIELD).isUUID()); + mOwnerUUID = pLinksetItem.get(LINKSET_OWNER_FIELD).asUUID(); + LLAvatarNameCache::get(mOwnerUUID, &mOwnerName); + } +#endif // SERVER_SIDE_OWNER_ROLLOUT_COMPLETE + llassert(pLinksetItem.has(LINKSET_LAND_IMPACT_FIELD)); llassert(pLinksetItem.get(LINKSET_LAND_IMPACT_FIELD).isInteger()); llassert(pLinksetItem.get(LINKSET_LAND_IMPACT_FIELD).asInteger() >= 0); |
