aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llgroupmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llgroupmgr.cpp46
1 files changed, 22 insertions, 24 deletions
diff --git a/linden/indra/newview/llgroupmgr.cpp b/linden/indra/newview/llgroupmgr.cpp
index af6a6aa..7ea28e0 100644
--- a/linden/indra/newview/llgroupmgr.cpp
+++ b/linden/indra/newview/llgroupmgr.cpp
@@ -53,8 +53,6 @@
53#include "llfloatergroupinfo.h" 53#include "llfloatergroupinfo.h"
54#include "lluictrlfactory.h" 54#include "lluictrlfactory.h"
55 55
56LLGroupMgr sGroupMgr; // use local instance so that it gets cleaned up on application exit
57LLGroupMgr* gGroupMgr = &sGroupMgr;
58 56
59const U32 MAX_CACHED_GROUPS = 10; 57const U32 MAX_CACHED_GROUPS = 10;
60 58
@@ -705,7 +703,7 @@ void LLGroupMgrGroupData::sendRoleChanges()
705 // If we create a new role, then we need to re-fetch all the role data. 703 // If we create a new role, then we need to re-fetch all the role data.
706 if (need_role_data) 704 if (need_role_data)
707 { 705 {
708 gGroupMgr->sendGroupRoleDataRequest(getID()); 706 LLGroupMgr::getInstance()->sendGroupRoleDataRequest(getID());
709 } 707 }
710 708
711 // Clean up change lists 709 // Clean up change lists
@@ -811,7 +809,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
811 LLUUID request_id; 809 LLUUID request_id;
812 msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id); 810 msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
813 811
814 LLGroupMgrGroupData* group_datap = gGroupMgr->createGroupData(group_id); 812 LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
815 if (group_datap->mMemberRequestID != request_id) 813 if (group_datap->mMemberRequestID != request_id)
816 { 814 {
817 llwarns << "processGroupMembersReply: Received incorrect (stale?) request id" << llendl; 815 llwarns << "processGroupMembersReply: Received incorrect (stale?) request id" << llendl;
@@ -867,7 +865,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
867 //if group members are loaded while titles are missing, load the titles. 865 //if group members are loaded while titles are missing, load the titles.
868 if(group_datap->mTitles.size() < 1) 866 if(group_datap->mTitles.size() < 1)
869 { 867 {
870 gGroupMgr->sendGroupTitlesRequest(group_id); 868 LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id);
871 } 869 }
872 } 870 }
873 871
@@ -879,12 +877,12 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
879 if (group_datap->mPendingRoleMemberRequest) 877 if (group_datap->mPendingRoleMemberRequest)
880 { 878 {
881 group_datap->mPendingRoleMemberRequest = FALSE; 879 group_datap->mPendingRoleMemberRequest = FALSE;
882 gGroupMgr->sendGroupRoleMembersRequest(group_datap->mID); 880 LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_datap->mID);
883 } 881 }
884 } 882 }
885 883
886 group_datap->mChanged = TRUE; 884 group_datap->mChanged = TRUE;
887 gGroupMgr->notifyObservers(GC_MEMBER_DATA); 885 LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA);
888} 886}
889 887
890//static 888//static
@@ -933,7 +931,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data)
933 msg->getBOOL("GroupData", "MaturePublish", mature); 931 msg->getBOOL("GroupData", "MaturePublish", mature);
934 msg->getUUID(_PREHASH_GroupData, "OwnerRole", owner_role); 932 msg->getUUID(_PREHASH_GroupData, "OwnerRole", owner_role);
935 933
936 LLGroupMgrGroupData* group_datap = gGroupMgr->createGroupData(group_id); 934 LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
937 935
938 group_datap->mName = name; 936 group_datap->mName = name;
939 group_datap->mCharter = charter; 937 group_datap->mCharter = charter;
@@ -951,7 +949,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data)
951 group_datap->mGroupPropertiesDataComplete = TRUE; 949 group_datap->mGroupPropertiesDataComplete = TRUE;
952 group_datap->mChanged = TRUE; 950 group_datap->mChanged = TRUE;
953 951
954 gGroupMgr->notifyObservers(GC_PROPERTIES); 952 LLGroupMgr::getInstance()->notifyObservers(GC_PROPERTIES);
955} 953}
956 954
957// static 955// static
@@ -972,7 +970,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
972 LLUUID request_id; 970 LLUUID request_id;
973 msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id); 971 msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
974 972
975 LLGroupMgrGroupData* group_data = gGroupMgr->createGroupData(group_id); 973 LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
976 if (group_data->mRoleDataRequestID != request_id) 974 if (group_data->mRoleDataRequestID != request_id)
977 { 975 {
978 llwarns << "processGroupRoleDataReply: Received incorrect (stale?) request id" << llendl; 976 llwarns << "processGroupRoleDataReply: Received incorrect (stale?) request id" << llendl;
@@ -1013,12 +1011,12 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
1013 if (group_data->mPendingRoleMemberRequest) 1011 if (group_data->mPendingRoleMemberRequest)
1014 { 1012 {
1015 group_data->mPendingRoleMemberRequest = FALSE; 1013 group_data->mPendingRoleMemberRequest = FALSE;
1016 gGroupMgr->sendGroupRoleMembersRequest(group_data->mID); 1014 LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_data->mID);
1017 } 1015 }
1018 } 1016 }
1019 1017
1020 group_data->mChanged = TRUE; 1018 group_data->mChanged = TRUE;
1021 gGroupMgr->notifyObservers(GC_ROLE_DATA); 1019 LLGroupMgr::getInstance()->notifyObservers(GC_ROLE_DATA);
1022} 1020}
1023 1021
1024// static 1022// static
@@ -1042,7 +1040,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
1042 U32 total_pairs; 1040 U32 total_pairs;
1043 msg->getU32(_PREHASH_AgentData, "TotalPairs", total_pairs); 1041 msg->getU32(_PREHASH_AgentData, "TotalPairs", total_pairs);
1044 1042
1045 LLGroupMgrGroupData* group_data = gGroupMgr->createGroupData(group_id); 1043 LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
1046 1044
1047 if (group_data->mRoleMembersRequestID != request_id) 1045 if (group_data->mRoleMembersRequestID != request_id)
1048 { 1046 {
@@ -1127,7 +1125,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
1127 } 1125 }
1128 1126
1129 group_data->mChanged = TRUE; 1127 group_data->mChanged = TRUE;
1130 gGroupMgr->notifyObservers(GC_ROLE_MEMBER_DATA); 1128 LLGroupMgr::getInstance()->notifyObservers(GC_ROLE_MEMBER_DATA);
1131} 1129}
1132 1130
1133// static 1131// static
@@ -1145,7 +1143,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
1145 LLUUID group_id; 1143 LLUUID group_id;
1146 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id ); 1144 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
1147 1145
1148 LLGroupMgrGroupData* group_data = gGroupMgr->createGroupData(group_id); 1146 LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
1149 1147
1150 LLUUID request_id; 1148 LLUUID request_id;
1151 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_RequestID, request_id); 1149 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_RequestID, request_id);
@@ -1177,7 +1175,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
1177 } 1175 }
1178 1176
1179 group_data->mChanged = TRUE; 1177 group_data->mChanged = TRUE;
1180 gGroupMgr->notifyObservers(GC_TITLES); 1178 LLGroupMgr::getInstance()->notifyObservers(GC_TITLES);
1181} 1179}
1182 1180
1183// static 1181// static
@@ -1210,7 +1208,7 @@ void LLGroupMgr::processJoinGroupReply(LLMessageSystem* msg, void ** data)
1210 // refresh all group information 1208 // refresh all group information
1211 gAgent.sendAgentDataUpdateRequest(); 1209 gAgent.sendAgentDataUpdateRequest();
1212 1210
1213 gGroupMgr->clearGroupData(group_id); 1211 LLGroupMgr::getInstance()->clearGroupData(group_id);
1214 // refresh the floater for this group, if any. 1212 // refresh the floater for this group, if any.
1215 LLFloaterGroupInfo::refreshGroup(group_id); 1213 LLFloaterGroupInfo::refreshGroup(group_id);
1216 // refresh the group panel of the search window, if necessary. 1214 // refresh the group panel of the search window, if necessary.
@@ -1232,7 +1230,7 @@ void LLGroupMgr::processLeaveGroupReply(LLMessageSystem* msg, void ** data)
1232 // refresh all group information 1230 // refresh all group information
1233 gAgent.sendAgentDataUpdateRequest(); 1231 gAgent.sendAgentDataUpdateRequest();
1234 1232
1235 gGroupMgr->clearGroupData(group_id); 1233 LLGroupMgr::getInstance()->clearGroupData(group_id);
1236 // close the floater for this group, if any. 1234 // close the floater for this group, if any.
1237 LLFloaterGroupInfo::closeGroup(group_id); 1235 LLFloaterGroupInfo::closeGroup(group_id);
1238 // refresh the group panel of the search window, if necessary. 1236 // refresh the group panel of the search window, if necessary.
@@ -1286,11 +1284,11 @@ LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id)
1286{ 1284{
1287 LLGroupMgrGroupData* group_datap; 1285 LLGroupMgrGroupData* group_datap;
1288 1286
1289 group_map_t::iterator existing_group = gGroupMgr->mGroups.find(id); 1287 group_map_t::iterator existing_group = LLGroupMgr::getInstance()->mGroups.find(id);
1290 if (existing_group == gGroupMgr->mGroups.end()) 1288 if (existing_group == LLGroupMgr::getInstance()->mGroups.end())
1291 { 1289 {
1292 group_datap = new LLGroupMgrGroupData(id); 1290 group_datap = new LLGroupMgrGroupData(id);
1293 gGroupMgr->addGroup(group_datap); 1291 LLGroupMgr::getInstance()->addGroup(group_datap);
1294 } 1292 }
1295 else 1293 else
1296 { 1294 {
@@ -1647,7 +1645,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
1647 bool start_message = true; 1645 bool start_message = true;
1648 LLMessageSystem* msg = gMessageSystem; 1646 LLMessageSystem* msg = gMessageSystem;
1649 1647
1650 LLGroupMgrGroupData* group_datap = gGroupMgr->getGroupData(group_id); 1648 LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
1651 if (!group_datap) return; 1649 if (!group_datap) return;
1652 1650
1653 for (std::vector<LLUUID>::iterator it = member_ids.begin(); 1651 for (std::vector<LLUUID>::iterator it = member_ids.begin();
@@ -1832,7 +1830,7 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename)
1832 role_action_data->mPowerBit = set_power_mask; 1830 role_action_data->mPowerBit = set_power_mask;
1833 role_action_set->mActionSetData = role_action_data; 1831 role_action_set->mActionSetData = role_action_data;
1834 1832
1835 gGroupMgr->mRoleActionSets.push_back(role_action_set); 1833 LLGroupMgr::getInstance()->mRoleActionSets.push_back(role_action_set);
1836 } 1834 }
1837 return true; 1835 return true;
1838} 1836}
@@ -1840,7 +1838,7 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename)
1840// static 1838// static
1841void LLGroupMgr::debugClearAllGroups(void*) 1839void LLGroupMgr::debugClearAllGroups(void*)
1842{ 1840{
1843 gGroupMgr->clearGroups(); 1841 LLGroupMgr::getInstance()->clearGroups();
1844 LLGroupMgr::parseRoleActions("role_actions.xml"); 1842 LLGroupMgr::parseRoleActions("role_actions.xml");
1845} 1843}
1846 1844