From 3a56fbf867194ec8fbc7d8237f9781ac9d72c8a4 Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Tue, 3 Jul 2012 23:34:56 +0000 Subject: MAINT-1231 Investigate increasing MAX_CACHED_GROUPS in llgroupmgr.cpp * increased max groups to 20 * changed cache to LRU instead of 'delete half when overfull' reviewed with Baker --- indra/newview/llgroupmgr.cpp | 55 +++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 14 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index efffd0f98e..aceb7f0614 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -63,7 +63,7 @@ #pragma warning(pop) // Restore all warnings to the previous state #endif -const U32 MAX_CACHED_GROUPS = 10; +const U32 MAX_CACHED_GROUPS = 20; // // LLRoleActionSet @@ -234,10 +234,16 @@ LLGroupMgrGroupData::LLGroupMgrGroupData(const LLUUID& id) : mRoleDataComplete(FALSE), mRoleMemberDataComplete(FALSE), mGroupPropertiesDataComplete(FALSE), - mPendingRoleMemberRequest(FALSE) + mPendingRoleMemberRequest(FALSE), + mAccessTime(0.0f) { } +void LLGroupMgrGroupData::setAccessed() +{ + mAccessTime = (F32)LLFrameTimer::getTotalSeconds(); +} + BOOL LLGroupMgrGroupData::getRoleData(const LLUUID& role_id, LLRoleData& role_data) { role_data_map_t::const_iterator it; @@ -1360,7 +1366,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id) { - LLGroupMgrGroupData* group_datap; + LLGroupMgrGroupData* group_datap = NULL; group_map_t::iterator existing_group = LLGroupMgr::getInstance()->mGroups.find(id); if (existing_group == LLGroupMgr::getInstance()->mGroups.end()) @@ -1373,6 +1379,11 @@ LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id) group_datap = existing_group->second; } + if (group_datap) + { + group_datap->setAccessed(); + } + return group_datap; } @@ -1413,25 +1424,41 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc) void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap) { - if (mGroups.size() > MAX_CACHED_GROUPS) + while (mGroups.size() >= MAX_CACHED_GROUPS) { - // get rid of groups that aren't observed - for (group_map_t::iterator gi = mGroups.begin(); gi != mGroups.end() && mGroups.size() > MAX_CACHED_GROUPS / 2; ) + // LRU: Remove the oldest un-observed group from cache until group size is small enough + + F32 oldest_access = LLFrameTimer::getTotalSeconds(); + group_map_t::iterator oldest_gi = mGroups.end(); + + for (group_map_t::iterator gi = mGroups.begin(); gi != mGroups.end(); ++gi ) { observer_multimap_t::iterator oi = mObservers.find(gi->first); if (oi == mObservers.end()) { - // not observed - LLGroupMgrGroupData* unobserved_groupp = gi->second; - delete unobserved_groupp; - mGroups.erase(gi++); - } - else - { - ++gi; + if (gi->second + && (gi->second->getAccessTime() < oldest_access)) + { + oldest_access = gi->second->getAccessTime(); + oldest_gi = gi; + } } } + + if (oldest_gi != mGroups.end()) + { + delete oldest_gi->second; + mGroups.erase(oldest_gi); + } + else + { + // All groups must be currently open, none to remove. + // Just add the new group anyway, but get out of this loop as it + // will never drop below max_cached_groups. + break; + } } + mGroups[group_datap->getID()] = group_datap; } -- cgit v1.2.3 From de2ce3f51ff54e67017d765c95264c66211c89da Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Thu, 23 Aug 2012 19:40:10 -0700 Subject: Start of getting WSGI service on viewer --- indra/newview/llgroupmgr.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index aceb7f0614..3300034f7f 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1500,6 +1500,10 @@ void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id) } } + + + + void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id) { lldebugs << "LLGroupMgr::sendGroupRoleDataRequest" << llendl; @@ -1832,6 +1836,93 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, } } + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +// STUBBED IN FOR code completion +class GroupMemberDataResponder : public LLHTTPClient::Responder +{ +public: + GroupMemberDataResponder() {} + virtual ~GroupMemberDataResponder() {} + virtual void result(const LLSD& pContent); + virtual void error(U32 pStatus, const std::string& pReason) {} +private: + LLSD mMemberData; +}; + +void GroupMemberDataResponder::result(const LLSD& pContent) +{ + LL_INFOS("BAKER") << "BAKER TAG ////////////////////////////////////////////////////////////////" << LL_ENDL; + // Did we get anything in pContent? + if(pContent.size()) + { + LL_INFOS("BAKER") << "Lik dis if u cry evertim" << LL_ENDL; + + // BAKER TODO: + // Figure out what to do with all the dataz. + // Looks like processGroupMembersReply does the work + LLUUID agent_id = pContent["agent_id"]; + LLUUID group_id = pContent["group_id"]; + LLSD member_list = pContent["members"]; + LLSD titles = pContent["titles"]; + LLSD defaults = pContent["defaults"]; + + int i = 0; + ++i; + + + + } + else + { + LL_INFOS("BAKER") << "WE AIN'T FOUND SHIT!" << LL_ENDL; + + // BAKER TODO: + // Handle this case + + } + LL_INFOS("BAKER") << "//////////////////////////////////////////////////////////////////////////\n" << LL_ENDL; +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +// BAKER +// static +void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) +{ + //sendGroupMembersRequest(group_id); + //return; + +#if 1 + LLViewerRegion* currentRegion = gAgent.getRegion(); + + // Check to make sure we have our capabilities + if(!currentRegion->capabilitiesReceived()) + { + LL_INFOS("BAKER") << " Capabilities not received! -- OSHITSON --" << LL_ENDL; + // BAKER TODO: Handle this! + } + + // Get our capability + std::string cap_url = currentRegion->getCapability("GroupMemberData"); + + // Post to our service. Add a body containing the group_id. + LLSD body = LLSD::emptyMap(); + body["group_id"] = group_id; + + LLHTTPClient::ResponderPtr grp_data_responder = new GroupMemberDataResponder(); + // This could take a while to finish, timeout after 10 minutes. + LLHTTPClient::post(cap_url, body, grp_data_responder, LLSD(), 600); +#endif +} +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + + void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id) { lldebugs << "LLGroupMgr::sendGroupRoleChanges" << llendl; -- cgit v1.2.3 From 238ac6c0e869d1c8c380e3e7b70d4803c385f352 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Tue, 28 Aug 2012 17:32:01 -0700 Subject: Got viewer displaying new data format --- indra/newview/llgroupmgr.cpp | 142 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 112 insertions(+), 30 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 3300034f7f..2e1d1d5c77 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1851,38 +1851,13 @@ private: LLSD mMemberData; }; -void GroupMemberDataResponder::result(const LLSD& pContent) +void GroupMemberDataResponder::result(const LLSD& content) { LL_INFOS("BAKER") << "BAKER TAG ////////////////////////////////////////////////////////////////" << LL_ENDL; - // Did we get anything in pContent? - if(pContent.size()) - { - LL_INFOS("BAKER") << "Lik dis if u cry evertim" << LL_ENDL; - - // BAKER TODO: - // Figure out what to do with all the dataz. - // Looks like processGroupMembersReply does the work - LLUUID agent_id = pContent["agent_id"]; - LLUUID group_id = pContent["group_id"]; - LLSD member_list = pContent["members"]; - LLSD titles = pContent["titles"]; - LLSD defaults = pContent["defaults"]; - - int i = 0; - ++i; - - - - } - else - { - LL_INFOS("BAKER") << "WE AIN'T FOUND SHIT!" << LL_ENDL; - - // BAKER TODO: - // Handle this case - - } + LL_INFOS("BAKER") << "Got data from responder" << LL_ENDL; + LLGroupMgr::processCapGroupMembersRequest(content); LL_INFOS("BAKER") << "//////////////////////////////////////////////////////////////////////////\n" << LL_ENDL; + } ////////////////////////////////////////////////////////////////////////// @@ -1898,6 +1873,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) //return; #if 1 + LLViewerRegion* currentRegion = gAgent.getRegion(); // Check to make sure we have our capabilities @@ -1912,13 +1888,119 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) // Post to our service. Add a body containing the group_id. LLSD body = LLSD::emptyMap(); - body["group_id"] = group_id; + body["group_id"] = group_id; + // Session id? LLHTTPClient::ResponderPtr grp_data_responder = new GroupMemberDataResponder(); // This could take a while to finish, timeout after 10 minutes. LLHTTPClient::post(cap_url, body, grp_data_responder, LLSD(), 600); + #endif } + + +// 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 + } + + 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) + return; + + LLUUID group_id = content["group_id"].asUUID(); + + LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id); + if(!group_datap) + { + LL_WARNS("GrpMgr") << "Received incorrect, possibly stale, group or request id" << LL_ENDL; + return; + } + + group_datap->mMemberCount = num_members; + + LLSD member_list = content["members"]; + LLSD titles = content["titles"]; + LLSD defaults = content["defaults"]; + + std::string online_status; + std::string title; + S32 contribution; + U64 member_powers; + // If this is changed to a bool, make sure to change the LLGroupMemberData constructor + BOOL is_owner; + + // Compute this once, rather than every time. + U64 default_powers = llstrtou64(defaults["default_powers"].asString().c_str(), NULL, 16); + + LLSD::map_const_iterator member_iter_start = member_list.beginMap(); + LLSD::map_const_iterator member_iter_end = member_list.endMap(); + for( ; member_iter_start != member_iter_end; ++member_iter_start) + { + // Reset defaults + online_status = "unknown"; + title = titles[0]; + contribution = 0; + member_powers = default_powers; + is_owner = false; + + const LLUUID member_id(member_iter_start->first); + LLSD member_info = member_iter_start->second; + + // Online Status + if(member_info.has("last_login")) + { + online_status = member_info["last_login"]; + if(online_status == "Online") + online_status = LLTrans::getString("group_member_status_online"); + else + formatDateString(online_status); + } + + // Title + if(member_info.has("title")) + title = titles[member_info["title"].asInteger()]; + + // Powers + if(member_info.has("powers")) + member_powers = llstrtou64(member_info["powers"].asString().c_str(), NULL, 16); + + // Land Contribution + if(member_info.has("donated_square_meters")) + contribution = member_info["donated_square_meters"]; + + if(member_info.has("owner")) + is_owner = true; + + LLGroupMemberData* data = new LLGroupMemberData(member_id, + contribution, + member_powers, + title, + online_status, + is_owner); + + group_datap->mMembers[member_id] = data; + } + + group_datap->mMemberDataComplete = TRUE; + group_datap->mRoleMemberDataComplete = TRUE; + group_datap->mMemberRequestID.setNull(); + group_datap->mChanged = TRUE; + LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA); + + LL_INFOS("BAKER") << "//////////////////////////////////////////////////////////////////////////\n" << LL_ENDL; +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 7ecf3ce40f4ec27a43878a3a2192c97479d22fcf Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Fri, 31 Aug 2012 17:53:47 -0700 Subject: - Fixed an issue where service was called twice in a frame - Changed level of output logs - Cleaned up comments --- indra/newview/llgroupmgr.cpp | 54 +++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') 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 #include +#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) { -- cgit v1.2.3 From 5dfbc62c1bbab145b1f1b826833c0e485fc73250 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Tue, 4 Sep 2012 10:54:16 -0700 Subject: Cleaned up comments --- indra/newview/llgroupmgr.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index b9bcedda13..7a738bd9ea 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1836,9 +1836,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, } -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// I DON'T KNOW WHERE TO PUT THIS +// Responder class for capability group management class GroupMemberDataResponder : public LLHTTPClient::Responder { public: @@ -1854,8 +1852,6 @@ void GroupMemberDataResponder::result(const LLSD& content) { LLGroupMgr::processCapGroupMembersRequest(content); } -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// // static @@ -1870,8 +1866,8 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) // Check to make sure we have our capabilities if(!currentRegion->capabilitiesReceived()) { - LL_INFOS("BAKER") << " Capabilities not received! -- OSHITSON --" << LL_ENDL; - // BAKER TODO: Handle this! + LL_INFOS("BAKER") << " Capabilities not received!" << LL_ENDL; + return; } // Get our capability @@ -1880,10 +1876,10 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) // Post to our service. Add a body containing the group_id. LLSD body = LLSD::emptyMap(); body["group_id"] = group_id; - // Session id? LLHTTPClient::ResponderPtr grp_data_responder = new GroupMemberDataResponder(); - // This could take a while to finish, timeout after 10 minutes. + + // This could take a while to finish, timeout after 10 minutes. LLHTTPClient::post(cap_url, body, grp_data_responder, LLSD(), 600); mLastGroupMembersRequestFrame = gFrameCount; @@ -1896,8 +1892,8 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) // Did we get anything in content? if(!content.size()) { - // BAKER TODO: - // Maybe display a popup saying something went wrong? + LL_DEBUGS("GrpMgr") << "No group member data received." << LL_ENDL; + return; } // If we have no members, there's no reason to do anything else @@ -1943,8 +1939,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) const LLUUID member_id(member_iter_start->first); LLSD member_info = member_iter_start->second; - - // Online Status + if(member_info.has("last_login")) { online_status = member_info["last_login"]; @@ -1954,19 +1949,15 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) formatDateString(online_status); } - // Title if(member_info.has("title")) title = titles[member_info["title"].asInteger()]; - // Powers if(member_info.has("powers")) member_powers = llstrtou64(member_info["powers"].asString().c_str(), NULL, 16); - // Land Contribution if(member_info.has("donated_square_meters")) contribution = member_info["donated_square_meters"]; - // Owner Flag if(member_info.has("owner")) is_owner = true; -- cgit v1.2.3 From e459024c8283a26a1aefce0db65e0d7dd2c7e16d Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Wed, 5 Sep 2012 15:55:34 -0700 Subject: [MAINT-513] Large group management - Reduced the timeout to 5 minutes, down from 10 minutes. - Provided output for GroupMemberResponder error - Removed commented calls to sendGroupMembersRequest - Reordered calls to sendCapGroupMembersRequest so it's called last --- indra/newview/llgroupmgr.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 7a738bd9ea..3fed8bb9b0 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1843,11 +1843,16 @@ public: GroupMemberDataResponder() {} virtual ~GroupMemberDataResponder() {} virtual void result(const LLSD& pContent); - virtual void error(U32 pStatus, const std::string& pReason) {} + virtual void error(U32 pStatus, const std::string& pReason); private: LLSD mMemberData; }; +void GroupMemberDataResponder::error(U32 pStatus, const std::string& pReason) +{ + LL_WARNS("GrpMgr") << "Error receiving group member data." << LL_ENDL; +} + void GroupMemberDataResponder::result(const LLSD& content) { LLGroupMgr::processCapGroupMembersRequest(content); @@ -1866,7 +1871,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) // Check to make sure we have our capabilities if(!currentRegion->capabilitiesReceived()) { - LL_INFOS("BAKER") << " Capabilities not received!" << LL_ENDL; + LL_WARNS("GrpMgr") << " Capabilities not received!" << LL_ENDL; return; } @@ -1879,8 +1884,8 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) LLHTTPClient::ResponderPtr grp_data_responder = new GroupMemberDataResponder(); - // This could take a while to finish, timeout after 10 minutes. - LLHTTPClient::post(cap_url, body, grp_data_responder, LLSD(), 600); + // This could take a while to finish, timeout after 5 minutes. + LLHTTPClient::post(cap_url, body, grp_data_responder, LLSD(), 300); mLastGroupMembersRequestFrame = gFrameCount; } @@ -1975,6 +1980,9 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) // 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. + // + // TODO: + // Refactor to reduce multiple calls for data we already have. if(group_datap->mTitles.size() < 1) LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id); -- cgit v1.2.3 From c30ecf2ebd6ff6b6b4def9da25aea2b4c975328d Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Thu, 6 Sep 2012 15:19:05 -0700 Subject: Added explicit casting for Linux build, hopefully making it work. --- indra/newview/llgroupmgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 3fed8bb9b0..9841eda625 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1937,7 +1937,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) { // Reset defaults online_status = "unknown"; - title = titles[0]; + title = (std::string)titles[0]; contribution = 0; member_powers = default_powers; is_owner = false; @@ -1947,7 +1947,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) if(member_info.has("last_login")) { - online_status = member_info["last_login"]; + online_status = (std::string)member_info["last_login"]; if(online_status == "Online") online_status = LLTrans::getString("group_member_status_online"); else @@ -1955,7 +1955,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) } if(member_info.has("title")) - title = titles[member_info["title"].asInteger()]; + title = (std::string)titles[member_info["title"].asInteger()]; if(member_info.has("powers")) member_powers = llstrtou64(member_info["powers"].asString().c_str(), NULL, 16); -- cgit v1.2.3 From 5520bebaeb486462a3482173ccc8518d9158e0d5 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Thu, 6 Sep 2012 16:00:59 -0700 Subject: Do the proper fix this time... --- indra/newview/llgroupmgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 9841eda625..9c0a30e689 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1937,7 +1937,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) { // Reset defaults online_status = "unknown"; - title = (std::string)titles[0]; + title = titles[0].asString(); contribution = 0; member_powers = default_powers; is_owner = false; @@ -1947,7 +1947,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) if(member_info.has("last_login")) { - online_status = (std::string)member_info["last_login"]; + online_status = member_info["last_login"].asString(); if(online_status == "Online") online_status = LLTrans::getString("group_member_status_online"); else @@ -1955,7 +1955,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) } if(member_info.has("title")) - title = (std::string)titles[member_info["title"].asInteger()]; + title = titles[member_info["title"].asInteger()].asString(); if(member_info.has("powers")) member_powers = llstrtou64(member_info["powers"].asString().c_str(), NULL, 16); -- cgit v1.2.3 From a905f7c74ee35ac16237311eb1d0fbda6577aadb Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Wed, 3 Oct 2012 21:16:04 +0000 Subject: - Fixed an issue where group list wouldn't fall back to UDP if the region doesn't support the new GroupMemberData capabaility - Fixed a potential null pointer crash. Thanks to Ansariel from Firestorm for these! Reviewer: Myself --- indra/newview/llgroupmgr.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 9c0a30e689..6916cf813a 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1867,6 +1867,12 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) return; LLViewerRegion* currentRegion = gAgent.getRegion(); + // Thank you FS:Ansariel! + if(!currentRegion) + { + LL_WARNS("GrpMgr") << "Agent does not have a current region. Uh-oh!" << LL_ENDL; + return; + } // Check to make sure we have our capabilities if(!currentRegion->capabilitiesReceived()) @@ -1878,6 +1884,14 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) // Get our capability std::string cap_url = currentRegion->getCapability("GroupMemberData"); + // Thank you FS:Ansariel! + if(cap_url.empty()) + { + LL_INFOS("GrpMgr") << "Region has no GroupMemberData capability. Falling back to UDP fetch." << LL_ENDL; + sendGroupMembersRequest(group_id); + return; + } + // Post to our service. Add a body containing the group_id. LLSD body = LLSD::emptyMap(); body["group_id"] = group_id; -- cgit v1.2.3 From 5c22524f29e4ab1f287f0e443bbdbea2f516c0d2 Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Mon, 3 Dec 2012 16:37:05 -0800 Subject: MAINT-1979 Viewer crashes while attempting to join group in the moment of loading group members * Fix one race condition that could dereference a dangling pointer. reviewed with Simon and Baker. --- indra/newview/llgroupmgr.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 6916cf813a..81eb1d397e 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -238,6 +238,7 @@ LLGroupMgrGroupData::LLGroupMgrGroupData(const LLUUID& id) : mPendingRoleMemberRequest(FALSE), mAccessTime(0.0f) { + mMemberVersion.generate(); } void LLGroupMgrGroupData::setAccessed() @@ -318,14 +319,14 @@ void LLGroupMgrGroupData::setRoleData(const LLUUID& role_id, LLRoleData role_dat role_data.mChangeType = RC_UPDATE_DATA; } else - { + { role_data.mChangeType = RC_UPDATE_POWERS; } mRoleChanges[role_id] = role_data; } else - { + { llwarns << "Change being made to non-existant role " << role_id << llendl; } } @@ -424,6 +425,7 @@ void LLGroupMgrGroupData::removeMemberData() } mMembers.clear(); mMemberDataComplete = FALSE; + mMemberVersion.generate(); } void LLGroupMgrGroupData::removeRoleData() @@ -945,6 +947,8 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) } } + group_datap->mMemberVersion.generate(); + if (group_datap->mMembers.size() == (U32)group_datap->mMemberCount) { group_datap->mMemberDataComplete = TRUE; @@ -1771,8 +1775,6 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, bool start_message = true; LLMessageSystem* msg = gMessageSystem; - - LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id); if (!group_datap) return; @@ -1833,6 +1835,8 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, { gAgent.sendReliableMessage(); } + + group_datap->mMemberVersion.generate(); } @@ -1990,6 +1994,8 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) group_datap->mMembers[member_id] = data; } + group_datap->mMemberVersion.generate(); + // 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 -- cgit v1.2.3 From 54cdc322b8f2bd35b289cacf3493622e7cc51194 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 5 Mar 2013 22:05:22 -0800 Subject: Fixing issues with not detecting when LLSD XML parsing fails. Changing most http error handlers to understand LLSD error responses. Fleshing out most http error handler message spam. --- indra/newview/llgroupmgr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 81eb1d397e..cbd844cdac 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1847,14 +1847,15 @@ public: GroupMemberDataResponder() {} virtual ~GroupMemberDataResponder() {} virtual void result(const LLSD& pContent); - virtual void error(U32 pStatus, const std::string& pReason); + virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent); private: LLSD mMemberData; }; -void GroupMemberDataResponder::error(U32 pStatus, const std::string& pReason) +void GroupMemberDataResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent) { - LL_WARNS("GrpMgr") << "Error receiving group member data." << LL_ENDL; + LL_WARNS("GrpMgr") << "Error receiving group member data [status:" + << pStatus << "]: " << pContent << LL_ENDL; } void GroupMemberDataResponder::result(const LLSD& content) -- cgit v1.2.3 From bf6182daa8b4d7cea79310547f71d7a3155e17b0 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 29 Mar 2013 07:50:08 -0700 Subject: Update Mac and Windows breakpad builds to latest --- indra/newview/llgroupmgr.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/llgroupmgr.cpp (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp old mode 100644 new mode 100755 -- cgit v1.2.3