Commits

Baker Linden committed eeb1099

- Fixed an issue where service was called twice in a frame
- Changed level of output logs
- Cleaned up comments

  • Participants
  • Parent commits 8c2a345

Comments (0)

Files changed (5)

indra/newview/llgroupmgr.cpp

 #include <vector>
 #include <algorithm>
 
+#include "llappviewer.h"
 #include "llagent.h"
 #include "llui.h"
 #include "message.h"
 
 LLGroupMgr::LLGroupMgr()
 {
+	mLastGroupMembersRequestFrame = 0;
 }
 
 LLGroupMgr::~LLGroupMgr()
 }
 
 
-
-
-
 void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id)
 {
 	lldebugs << "LLGroupMgr::sendGroupRoleDataRequest" << llendl;
 
 //////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////// 
-// STUBBED IN FOR code completion
+// I DON'T KNOW WHERE TO PUT THIS
 class GroupMemberDataResponder : public LLHTTPClient::Responder
 {
 public:
 
 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();
 
 	 // 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)
 		if(member_info.has("donated_square_meters"))
 			contribution = member_info["donated_square_meters"];
 
+		// Owner Flag
 		if(member_info.has("owner"))
 			is_owner = true;
 
 		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)
 {

indra/newview/llgroupmgr.h

 									  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);
 
 	typedef std::set<LLParticularGroupObserver*> observer_set_t;
 	typedef std::map<LLUUID,observer_set_t> observer_map_t;
 	observer_map_t mParticularObservers;
+
+	S32 mLastGroupMembersRequestFrame;
 };
 
 

indra/newview/llpanelgroupgeneral.cpp

 		
 		if (!gdatap || !gdatap->isMemberDataComplete() )
 		{
-			//////////////////////////////////////////////////////////////////////////
-			// BAKER TODO:
-			//	Use cap here!
-			//////////////////////////////////////////////////////////////////////////
 			LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
 			//LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID);
 		}
 	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)
 		{
 	}
 	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
 	{

indra/newview/llpanelgroupinvite.cpp

 		{
 			LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID);
 			
-			//////////////////////////////////////////////////////////////////////////
-			// BAKER TODO:
-			//	Use cap here!
-			//////////////////////////////////////////////////////////////////////////
 			LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID);
 			//LLGroupMgr::getInstance()->sendGroupMembersRequest(mImplementation->mGroupID);
 

indra/newview/llpanelgrouproles.cpp

 		
 		if (!gdatap || !gdatap->isMemberDataComplete() )
 		{
-			//////////////////////////////////////////////////////////////////////////
-			// BAKER TODO:
-			//	Use cap here!
-			//////////////////////////////////////////////////////////////////////////
 			LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
 			//LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID);
 		}
 
 	if (!gdatap || !gdatap->isMemberDataComplete())
 	{
-		//////////////////////////////////////////////////////////////////////////
-		// BAKER TODO:
-		//	Use cap here!
-		//////////////////////////////////////////////////////////////////////////
 		LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
 		//LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID);
 	}
 	}
 	else
 	{
-		//////////////////////////////////////////////////////////////////////////
-		// BAKER TODO:
-		//	Use cap here!
-		//////////////////////////////////////////////////////////////////////////
 		LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
 		//LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID);
 	}