diff options
author | Chris Baker <baker@lindenlab.com> | 2012-08-31 17:53:47 -0700 |
---|---|---|
committer | Chris Baker <baker@lindenlab.com> | 2012-08-31 17:53:47 -0700 |
commit | 7ecf3ce40f4ec27a43878a3a2192c97479d22fcf (patch) | |
tree | a3145a896e3fb1980bb08751d70780d166f6a056 | |
parent | 238ac6c0e869d1c8c380e3e7b70d4803c385f352 (diff) |
- Fixed an issue where service was called twice in a frame
- Changed level of output logs
- Cleaned up comments
-rw-r--r-- | indra/newview/llgroupmgr.cpp | 54 | ||||
-rw-r--r-- | indra/newview/llgroupmgr.h | 3 | ||||
-rw-r--r-- | indra/newview/llpanelgroupgeneral.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llpanelgroupinvite.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llpanelgrouproles.cpp | 12 |
5 files changed, 34 insertions, 55 deletions
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 2e1d1d5c77..b9bcedda13 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -36,6 +36,7 @@ #include <vector> #include <algorithm> +#include "llappviewer.h" #include "llagent.h" #include "llui.h" #include "message.h" @@ -745,6 +746,7 @@ void LLGroupMgrGroupData::cancelRoleChanges() LLGroupMgr::LLGroupMgr() { + mLastGroupMembersRequestFrame = 0; } LLGroupMgr::~LLGroupMgr() @@ -1501,9 +1503,6 @@ void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id) } - - - void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id) { lldebugs << "LLGroupMgr::sendGroupRoleDataRequest" << llendl; @@ -1839,7 +1838,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -// STUBBED IN FOR code completion +// I DON'T KNOW WHERE TO PUT THIS class GroupMemberDataResponder : public LLHTTPClient::Responder { public: @@ -1853,26 +1852,18 @@ private: void GroupMemberDataResponder::result(const LLSD& content) { - LL_INFOS("BAKER") << "BAKER TAG ////////////////////////////////////////////////////////////////" << LL_ENDL; - LL_INFOS("BAKER") << "Got data from responder" << LL_ENDL; LLGroupMgr::processCapGroupMembersRequest(content); - LL_INFOS("BAKER") << "//////////////////////////////////////////////////////////////////////////\n" << LL_ENDL; - } - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -// BAKER + + // static void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) { - //sendGroupMembersRequest(group_id); - //return; - -#if 1 + // Have we requested the information already this frame? + if(mLastGroupMembersRequestFrame == gFrameCount) + return; LLViewerRegion* currentRegion = gAgent.getRegion(); @@ -1895,24 +1886,20 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) // This could take a while to finish, timeout after 10 minutes. LLHTTPClient::post(cap_url, body, grp_data_responder, LLSD(), 600); -#endif + mLastGroupMembersRequestFrame = gFrameCount; } // static void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) { - LL_INFOS("BAKER") << "BAKER TAG ////////////////////////////////////////////////////////////////" << LL_ENDL; // Did we get anything in content? if(!content.size()) { - LL_INFOS("BAKER") << "WE AIN'T FOUND SHIT!" << LL_ENDL; // BAKER TODO: - // Handle this case + // Maybe display a popup saying something went wrong? } - LL_INFOS("BAKER") << "Lik dis if u cry evertim" << LL_ENDL; - // If we have no members, there's no reason to do anything else S32 num_members = content["member_count"]; if(num_members < 1) @@ -1979,6 +1966,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) if(member_info.has("donated_square_meters")) contribution = member_info["donated_square_meters"]; + // Owner Flag if(member_info.has("owner")) is_owner = true; @@ -1992,18 +1980,28 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) group_datap->mMembers[member_id] = data; } + // Technically, we have this data, but to prevent completely overhauling + // this entire system (it would be nice, but I don't have the time), + // I'm going to be dumb and just call services I most likely don't need + // with the thought being that the system might need it to be done. + if(group_datap->mTitles.size() < 1) + LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id); + + group_datap->mMemberDataComplete = TRUE; - group_datap->mRoleMemberDataComplete = TRUE; group_datap->mMemberRequestID.setNull(); + // Make the role-member data request + if (group_datap->mPendingRoleMemberRequest) + { + group_datap->mPendingRoleMemberRequest = FALSE; + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_id); + } + group_datap->mChanged = TRUE; LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA); - LL_INFOS("BAKER") << "//////////////////////////////////////////////////////////////////////////\n" << LL_ENDL; } -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id) { diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index b0c3cd025d..62b2978f21 100644 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -341,7 +341,6 @@ public: uuid_vec_t& member_ids); // BAKER - //static void sendCapGroupMembersRequest(const LLUUID& group_id); void sendCapGroupMembersRequest(const LLUUID& group_id); static void processCapGroupMembersRequest(const LLSD& content); @@ -380,6 +379,8 @@ private: typedef std::set<LLParticularGroupObserver*> observer_set_t; typedef std::map<LLUUID,observer_set_t> observer_map_t; observer_map_t mParticularObservers; + + S32 mLastGroupMembersRequestFrame; }; diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index fa5f5574dc..5b1c15ca45 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -317,10 +317,6 @@ void LLPanelGroupGeneral::activate() if (!gdatap || !gdatap->isMemberDataComplete() ) { - ////////////////////////////////////////////////////////////////////////// - // BAKER TODO: - // Use cap here! - ////////////////////////////////////////////////////////////////////////// LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); //LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } @@ -719,7 +715,7 @@ void LLPanelGroupGeneral::updateMembers() for( ; mMemberProgress != gdatap->mMembers.end() && i<UPDATE_MEMBERS_PER_FRAME; ++mMemberProgress, ++i) { - llinfos << "Adding " << mMemberProgress->first << ", " << mMemberProgress->second->getTitle() << llendl; + lldebugs << "Adding " << mMemberProgress->first << ", " << mMemberProgress->second->getTitle() << llendl; LLGroupMemberData* member = mMemberProgress->second; if (!member) { @@ -763,15 +759,15 @@ void LLPanelGroupGeneral::updateMembers() } sAllTime += all_timer.getElapsedTimeF32(); - llinfos << "Updated " << i << " of " << UPDATE_MEMBERS_PER_FRAME << "members in the list." << llendl; + lldebugs << "Updated " << i << " of " << UPDATE_MEMBERS_PER_FRAME << "members in the list." << llendl; if (mMemberProgress == gdatap->mMembers.end()) { - llinfos << " member list completed." << llendl; + lldebugs << " member list completed." << llendl; mListVisibleMembers->setEnabled(TRUE); - llinfos << "All Time: " << sAllTime << llendl; - llinfos << "SD Time: " << sSDTime << llendl; - llinfos << "Element Time: " << sElementTime << llendl; + lldebugs << "All Time: " << sAllTime << llendl; + lldebugs << "SD Time: " << sSDTime << llendl; + lldebugs << "Element Time: " << sElementTime << llendl; } else { diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index f05358bf59..f1ba84ec36 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -571,10 +571,6 @@ void LLPanelGroupInvite::updateLists() { LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID); - ////////////////////////////////////////////////////////////////////////// - // BAKER TODO: - // Use cap here! - ////////////////////////////////////////////////////////////////////////// LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID); //LLGroupMgr::getInstance()->sendGroupMembersRequest(mImplementation->mGroupID); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 9b0fb37693..0e40224346 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -356,10 +356,6 @@ void LLPanelGroupRoles::activate() if (!gdatap || !gdatap->isMemberDataComplete() ) { - ////////////////////////////////////////////////////////////////////////// - // BAKER TODO: - // Use cap here! - ////////////////////////////////////////////////////////////////////////// LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); //LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } @@ -1992,10 +1988,6 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) if (!gdatap || !gdatap->isMemberDataComplete()) { - ////////////////////////////////////////////////////////////////////////// - // BAKER TODO: - // Use cap here! - ////////////////////////////////////////////////////////////////////////// LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); //LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } @@ -2590,10 +2582,6 @@ void LLPanelGroupActionsSubTab::handleActionSelect() } else { - ////////////////////////////////////////////////////////////////////////// - // BAKER TODO: - // Use cap here! - ////////////////////////////////////////////////////////////////////////// LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); //LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } |