diff options
Diffstat (limited to 'linden/indra/newview/llgroupmgr.cpp')
-rw-r--r-- | linden/indra/newview/llgroupmgr.cpp | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/linden/indra/newview/llgroupmgr.cpp b/linden/indra/newview/llgroupmgr.cpp index 7ea28e0..30b7cbd 100644 --- a/linden/indra/newview/llgroupmgr.cpp +++ b/linden/indra/newview/llgroupmgr.cpp | |||
@@ -821,8 +821,8 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) | |||
821 | if (group_datap->mMemberCount > 0) | 821 | if (group_datap->mMemberCount > 0) |
822 | { | 822 | { |
823 | S32 contribution = 0; | 823 | S32 contribution = 0; |
824 | char online_status[DB_DATETIME_BUF_SIZE]; /* Flawfinder: ignore */ | 824 | std::string online_status; |
825 | char title[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */ | 825 | std::string title; |
826 | U64 agent_powers = 0; | 826 | U64 agent_powers = 0; |
827 | BOOL is_owner = FALSE; | 827 | BOOL is_owner = FALSE; |
828 | 828 | ||
@@ -834,8 +834,8 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) | |||
834 | msg->getUUIDFast(_PREHASH_MemberData, _PREHASH_AgentID, member_id, i ); | 834 | msg->getUUIDFast(_PREHASH_MemberData, _PREHASH_AgentID, member_id, i ); |
835 | msg->getS32(_PREHASH_MemberData, _PREHASH_Contribution, contribution, i); | 835 | msg->getS32(_PREHASH_MemberData, _PREHASH_Contribution, contribution, i); |
836 | msg->getU64(_PREHASH_MemberData, "AgentPowers", agent_powers, i); | 836 | msg->getU64(_PREHASH_MemberData, "AgentPowers", agent_powers, i); |
837 | msg->getStringFast(_PREHASH_MemberData, _PREHASH_OnlineStatus, DB_DATETIME_BUF_SIZE, online_status, i); | 837 | msg->getStringFast(_PREHASH_MemberData, _PREHASH_OnlineStatus, online_status, i); |
838 | msg->getString(_PREHASH_MemberData, "Title", DB_GROUP_TITLE_BUF_SIZE, title, i); | 838 | msg->getString(_PREHASH_MemberData, "Title", title, i); |
839 | msg->getBOOL(_PREHASH_MemberData,"IsOwner",is_owner,i); | 839 | msg->getBOOL(_PREHASH_MemberData,"IsOwner",is_owner,i); |
840 | 840 | ||
841 | if (member_id.notNull()) | 841 | if (member_id.notNull()) |
@@ -844,8 +844,8 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) | |||
844 | LLGroupMemberData* newdata = new LLGroupMemberData(member_id, | 844 | LLGroupMemberData* newdata = new LLGroupMemberData(member_id, |
845 | contribution, | 845 | contribution, |
846 | agent_powers, | 846 | agent_powers, |
847 | std::string(title), | 847 | title, |
848 | std::string(online_status), | 848 | online_status, |
849 | is_owner); | 849 | is_owner); |
850 | #if LL_DEBUG | 850 | #if LL_DEBUG |
851 | LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(member_id); | 851 | LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(member_id); |
@@ -898,13 +898,13 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) | |||
898 | } | 898 | } |
899 | 899 | ||
900 | LLUUID group_id; | 900 | LLUUID group_id; |
901 | char name[DB_GROUP_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 901 | std::string name; |
902 | char charter[DB_GROUP_CHARTER_BUF_SIZE]; /* Flawfinder: ignore */ | 902 | std::string charter; |
903 | BOOL show_in_list = FALSE; | 903 | BOOL show_in_list = FALSE; |
904 | LLUUID founder_id; | 904 | LLUUID founder_id; |
905 | U64 powers_mask = GP_NO_POWERS; | 905 | U64 powers_mask = GP_NO_POWERS; |
906 | S32 money = 0; | 906 | S32 money = 0; |
907 | char member_title[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */ | 907 | std::string member_title; |
908 | LLUUID insignia_id; | 908 | LLUUID insignia_id; |
909 | LLUUID owner_role; | 909 | LLUUID owner_role; |
910 | U32 membership_fee = 0; | 910 | U32 membership_fee = 0; |
@@ -915,18 +915,18 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) | |||
915 | BOOL mature = FALSE; | 915 | BOOL mature = FALSE; |
916 | 916 | ||
917 | msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id ); | 917 | msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id ); |
918 | msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_FounderID, founder_id); | 918 | msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_FounderID, founder_id); |
919 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_Name, DB_GROUP_NAME_BUF_SIZE, name ); | 919 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_Name, name ); |
920 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_Charter, DB_GROUP_CHARTER_BUF_SIZE, charter ); | 920 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_Charter, charter ); |
921 | msg->getBOOLFast(_PREHASH_GroupData, _PREHASH_ShowInList, show_in_list ); | 921 | msg->getBOOLFast(_PREHASH_GroupData, _PREHASH_ShowInList, show_in_list ); |
922 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_MemberTitle, DB_GROUP_TITLE_BUF_SIZE, member_title ); | 922 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_MemberTitle, member_title ); |
923 | msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_InsigniaID, insignia_id ); | 923 | msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_InsigniaID, insignia_id ); |
924 | msg->getU64Fast(_PREHASH_GroupData, _PREHASH_PowersMask, powers_mask ); | 924 | msg->getU64Fast(_PREHASH_GroupData, _PREHASH_PowersMask, powers_mask ); |
925 | msg->getU32Fast(_PREHASH_GroupData, _PREHASH_MembershipFee, membership_fee ); | 925 | msg->getU32Fast(_PREHASH_GroupData, _PREHASH_MembershipFee, membership_fee ); |
926 | msg->getBOOLFast(_PREHASH_GroupData, _PREHASH_OpenEnrollment, open_enrollment ); | 926 | msg->getBOOLFast(_PREHASH_GroupData, _PREHASH_OpenEnrollment, open_enrollment ); |
927 | msg->getS32Fast(_PREHASH_GroupData, _PREHASH_GroupMembershipCount, num_group_members); | 927 | msg->getS32Fast(_PREHASH_GroupData, _PREHASH_GroupMembershipCount, num_group_members); |
928 | msg->getS32(_PREHASH_GroupData, "GroupRolesCount", num_group_roles); | 928 | msg->getS32(_PREHASH_GroupData, "GroupRolesCount", num_group_roles); |
929 | msg->getS32Fast(_PREHASH_GroupData, _PREHASH_Money, money); | 929 | msg->getS32Fast(_PREHASH_GroupData, _PREHASH_Money, money); |
930 | msg->getBOOL("GroupData", "AllowPublish", allow_publish); | 930 | msg->getBOOL("GroupData", "AllowPublish", allow_publish); |
931 | msg->getBOOL("GroupData", "MaturePublish", mature); | 931 | msg->getBOOL("GroupData", "MaturePublish", mature); |
932 | msg->getUUID(_PREHASH_GroupData, "OwnerRole", owner_role); | 932 | msg->getUUID(_PREHASH_GroupData, "OwnerRole", owner_role); |
@@ -979,9 +979,9 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) | |||
979 | 979 | ||
980 | msg->getS32(_PREHASH_GroupData, "RoleCount", group_data->mRoleCount ); | 980 | msg->getS32(_PREHASH_GroupData, "RoleCount", group_data->mRoleCount ); |
981 | 981 | ||
982 | char name[DB_GROUP_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 982 | std::string name; |
983 | char title[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */ | 983 | std::string title; |
984 | char desc[DB_GROUP_CHARTER_BUF_SIZE]; /* Flawfinder: ignore */ | 984 | std::string desc; |
985 | U64 powers = 0; | 985 | U64 powers = 0; |
986 | U32 member_count = 0; | 986 | U32 member_count = 0; |
987 | LLUUID role_id; | 987 | LLUUID role_id; |
@@ -992,9 +992,9 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) | |||
992 | { | 992 | { |
993 | msg->getUUID("RoleData", "RoleID", role_id, i ); | 993 | msg->getUUID("RoleData", "RoleID", role_id, i ); |
994 | 994 | ||
995 | msg->getString("RoleData","Name",DB_GROUP_NAME_BUF_SIZE,name,i); | 995 | msg->getString("RoleData","Name",name,i); |
996 | msg->getString("RoleData","Title",DB_GROUP_TITLE_BUF_SIZE,title,i); | 996 | msg->getString("RoleData","Title",title,i); |
997 | msg->getString("RoleData","Description",DB_GROUP_CHARTER_BUF_SIZE,desc,i); | 997 | msg->getString("RoleData","Description",desc,i); |
998 | msg->getU64("RoleData","Powers",powers,i); | 998 | msg->getU64("RoleData","Powers",powers,i); |
999 | msg->getU32("RoleData","Members",member_count,i); | 999 | msg->getU32("RoleData","Members",member_count,i); |
1000 | 1000 | ||
@@ -1154,20 +1154,17 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data) | |||
1154 | return; | 1154 | return; |
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | char title_buf[DB_GROUP_TITLE_BUF_SIZE]; /* Flawfinder: ignore */ | ||
1158 | |||
1159 | LLGroupTitle title; | 1157 | LLGroupTitle title; |
1160 | 1158 | ||
1161 | S32 i = 0; | 1159 | S32 i = 0; |
1162 | S32 blocks = msg->getNumberOfBlocksFast(_PREHASH_GroupData); | 1160 | S32 blocks = msg->getNumberOfBlocksFast(_PREHASH_GroupData); |
1163 | for (i=0; i<blocks; ++i) | 1161 | for (i=0; i<blocks; ++i) |
1164 | { | 1162 | { |
1165 | msg->getString("GroupData","Title",DB_GROUP_TITLE_BUF_SIZE,title_buf,i); | 1163 | msg->getString("GroupData","Title",title.mTitle,i); |
1166 | title.mTitle = title_buf; | ||
1167 | msg->getUUID("GroupData","RoleID",title.mRoleID,i); | 1164 | msg->getUUID("GroupData","RoleID",title.mRoleID,i); |
1168 | msg->getBOOL("GroupData","Selected",title.mSelected,i); | 1165 | msg->getBOOL("GroupData","Selected",title.mSelected,i); |
1169 | 1166 | ||
1170 | if (title_buf[0] != '\0') | 1167 | if (!title.mTitle.empty()) |
1171 | { | 1168 | { |
1172 | lldebugs << "LLGroupMgr adding title: " << title.mTitle << ", " << title.mRoleID << ", " << (title.mSelected ? 'Y' : 'N') << llendl; | 1169 | lldebugs << "LLGroupMgr adding title: " << title.mTitle << ", " << title.mRoleID << ", " << (title.mSelected ? 'Y' : 'N') << llendl; |
1173 | group_data->mTitles.push_back(title); | 1170 | group_data->mTitles.push_back(title); |
@@ -1243,12 +1240,12 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) | |||
1243 | { | 1240 | { |
1244 | LLUUID group_id; | 1241 | LLUUID group_id; |
1245 | BOOL success; | 1242 | BOOL success; |
1246 | char message[MAX_STRING]; /* Flawfinder: ignore */ | 1243 | std::string message; |
1247 | 1244 | ||
1248 | msg->getUUIDFast(_PREHASH_ReplyData, _PREHASH_GroupID, group_id ); | 1245 | msg->getUUIDFast(_PREHASH_ReplyData, _PREHASH_GroupID, group_id ); |
1249 | 1246 | ||
1250 | msg->getBOOLFast(_PREHASH_ReplyData, _PREHASH_Success, success ); | 1247 | msg->getBOOLFast(_PREHASH_ReplyData, _PREHASH_Success, success ); |
1251 | msg->getStringFast(_PREHASH_ReplyData, _PREHASH_Message, MAX_STRING, message ); | 1248 | msg->getStringFast(_PREHASH_ReplyData, _PREHASH_Message, message ); |
1252 | 1249 | ||
1253 | if (success) | 1250 | if (success) |
1254 | { | 1251 | { |
@@ -1274,7 +1271,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) | |||
1274 | else | 1271 | else |
1275 | { | 1272 | { |
1276 | // *TODO:translate | 1273 | // *TODO:translate |
1277 | LLString::format_map_t args; | 1274 | LLStringUtil::format_map_t args; |
1278 | args["[MESSAGE]"] = message; | 1275 | args["[MESSAGE]"] = message; |
1279 | gViewerWindow->alertXml("UnableToCreateGroup", args); | 1276 | gViewerWindow->alertXml("UnableToCreateGroup", args); |
1280 | } | 1277 | } |
@@ -1723,7 +1720,7 @@ void LLGroupMgr::cancelGroupRoleChanges(const LLUUID& group_id) | |||
1723 | } | 1720 | } |
1724 | 1721 | ||
1725 | //static | 1722 | //static |
1726 | bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) | 1723 | bool LLGroupMgr::parseRoleActions(const std::string& xml_filename) |
1727 | { | 1724 | { |
1728 | LLXMLNodePtr root; | 1725 | LLXMLNodePtr root; |
1729 | 1726 | ||
@@ -1747,7 +1744,7 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) | |||
1747 | LLRoleAction* role_action_data = new LLRoleAction(); | 1744 | LLRoleAction* role_action_data = new LLRoleAction(); |
1748 | 1745 | ||
1749 | // name= | 1746 | // name= |
1750 | LLString action_set_name; | 1747 | std::string action_set_name; |
1751 | if (action_set->getAttributeString("name", action_set_name)) | 1748 | if (action_set->getAttributeString("name", action_set_name)) |
1752 | { | 1749 | { |
1753 | lldebugs << "Loading action set " << action_set_name << llendl; | 1750 | lldebugs << "Loading action set " << action_set_name << llendl; |
@@ -1761,13 +1758,13 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) | |||
1761 | continue; | 1758 | continue; |
1762 | } | 1759 | } |
1763 | // description= | 1760 | // description= |
1764 | LLString set_description; | 1761 | std::string set_description; |
1765 | if (action_set->getAttributeString("description", set_description)) | 1762 | if (action_set->getAttributeString("description", set_description)) |
1766 | { | 1763 | { |
1767 | role_action_data->mDescription = set_description; | 1764 | role_action_data->mDescription = set_description; |
1768 | } | 1765 | } |
1769 | // long description= | 1766 | // long description= |
1770 | LLString set_longdescription; | 1767 | std::string set_longdescription; |
1771 | if (action_set->getAttributeString("longdescription", set_longdescription)) | 1768 | if (action_set->getAttributeString("longdescription", set_longdescription)) |
1772 | { | 1769 | { |
1773 | role_action_data->mLongDescription = set_longdescription; | 1770 | role_action_data->mLongDescription = set_longdescription; |
@@ -1788,7 +1785,7 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) | |||
1788 | LLRoleAction* role_action = new LLRoleAction(); | 1785 | LLRoleAction* role_action = new LLRoleAction(); |
1789 | 1786 | ||
1790 | // name= | 1787 | // name= |
1791 | LLString action_name; | 1788 | std::string action_name; |
1792 | if (action->getAttributeString("name", action_name)) | 1789 | if (action->getAttributeString("name", action_name)) |
1793 | { | 1790 | { |
1794 | lldebugs << "Loading action " << action_name << llendl; | 1791 | lldebugs << "Loading action " << action_name << llendl; |
@@ -1801,13 +1798,13 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) | |||
1801 | continue; | 1798 | continue; |
1802 | } | 1799 | } |
1803 | // description= | 1800 | // description= |
1804 | LLString description; | 1801 | std::string description; |
1805 | if (action->getAttributeString("description", description)) | 1802 | if (action->getAttributeString("description", description)) |
1806 | { | 1803 | { |
1807 | role_action->mDescription = description; | 1804 | role_action->mDescription = description; |
1808 | } | 1805 | } |
1809 | // long description= | 1806 | // long description= |
1810 | LLString longdescription; | 1807 | std::string longdescription; |
1811 | if (action->getAttributeString("longdescription", longdescription)) | 1808 | if (action->getAttributeString("longdescription", longdescription)) |
1812 | { | 1809 | { |
1813 | role_action->mLongDescription = longdescription; | 1810 | role_action->mLongDescription = longdescription; |