Inheritance: Universe.Framework.Modules.IDataTransferable
コード例 #1
0
        public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID groupID, UUID agentID)
        {
            GroupProfileData GPD = new GroupProfileData ();

            if (m_doRemoteOnly) {
                object remoteValue = DoRemote (requestingAgentID, groupID, agentID);
                return remoteValue != null ? (GroupProfileData)remoteValue : GPD;
            }

            if (!CheckGroupPermissions(requestingAgentID, groupID, (ulong) GroupPowers.MemberVisible))
                return GPD;


            GroupRecord record = GetGroupRecord(requestingAgentID, groupID, null);

            QueryFilter filter1 = new QueryFilter();
            filter1.andFilters["GroupID"] = agentID; // yes these look the wrong way around
            filter1.andFilters["AgentID"] = groupID; // but they were like that when I got here! ~ SignpostMarv

            QueryFilter filter2 = new QueryFilter();
            filter2.andFilters["GroupID"] = groupID;

            List<string> Membership = GD.Query(new[]
                                                     {
                                                         "Contribution",
                                                         "ListInProfile",
                                                         "SelectedRoleID"
            }, _MEMBERSHIPREALM, filter1, null, null, null);

            int GroupMemCount =
                int.Parse(GD.Query(new[] {"COUNT(AgentID)"}, _MEMBERSHIPREALM, filter2, null, null, null)[0]);

            int GroupRoleCount = int.Parse(GD.Query(new[] {"COUNT(RoleID)"}, _ROLEREALM, filter2, null, null, null)[0]);

            QueryFilter filter3 = new QueryFilter();
            filter3.andFilters["RoleID"] = Membership[2];
            List<string> GroupRole = GD.Query(new[]
                                                    {
                                                        "Name",
                                                        "Powers"
            }, _ROLEREALM, filter3, null, null, null);

            GPD.AllowPublish = record.AllowPublish;
            GPD.Charter = record.Charter;
            GPD.FounderID = record.FounderID;
            GPD.GroupID = record.GroupID;
            GPD.GroupMembershipCount = GroupMemCount;
            GPD.GroupRolesCount = GroupRoleCount;
            GPD.InsigniaID = record.GroupPicture;
            GPD.MaturePublish = record.MaturePublish;
            GPD.MembershipFee = record.MembershipFee;
            GPD.MemberTitle = GroupRole[0];
            GPD.Money = 0;

            GPD.Name = record.GroupName;
            GPD.OpenEnrollment = record.OpenEnrollment;
            GPD.OwnerRole = record.OwnerRoleID;
            GPD.PowersMask = ulong.Parse(GroupRole[1]);
            GPD.ShowInList = int.Parse(Membership[2]) == 1;

            return GPD;
        }
コード例 #2
0
        public GroupProfileData GetGroupProfile(UUID requestingAgentID, UUID groupID)
        {
            if (m_doRemoteOnly) {
                object remoteValue = DoRemote (requestingAgentID, groupID);
                return remoteValue != null ? (GroupProfileData)remoteValue : new GroupProfileData ();
            }

            GroupProfileData profile = new GroupProfileData();

            GroupRecord groupInfo = GetGroupRecord(requestingAgentID, groupID, null);
            if (groupInfo != null)
            {
                profile.AllowPublish = groupInfo.AllowPublish;
                profile.Charter = groupInfo.Charter;
                profile.FounderID = groupInfo.FounderID;
                profile.GroupID = groupID;
                profile.GroupMembershipCount =
                    GetGroupMembers(requestingAgentID, groupID).Count;
                profile.GroupRolesCount = GetGroupRoles(requestingAgentID, groupID).Count;
                profile.InsigniaID = groupInfo.GroupPicture;
                profile.MaturePublish = groupInfo.MaturePublish;
                profile.MembershipFee = groupInfo.MembershipFee;
                profile.Money = 0; // TODO: Get this from the currency server?
                profile.Name = groupInfo.GroupName;
                profile.OpenEnrollment = groupInfo.OpenEnrollment;
                profile.OwnerRole = groupInfo.OwnerRoleID;
                profile.ShowInList = groupInfo.ShowInList;
            }

            GroupMembershipData memberInfo = GetGroupMembershipData(requestingAgentID,
                                                                    groupID,
                                                                    requestingAgentID);
            if (memberInfo != null)
            {
                profile.MemberTitle = memberInfo.GroupTitle;
                profile.PowersMask = memberInfo.GroupPowers;
            }

            return profile;
        }
        public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID)
        {
            object remoteValue = DoRemote(requestingAgentID, GroupID, AgentID);
            if (remoteValue != null || m_doRemoteOnly)
                return (GroupProfileData) remoteValue;

            if (!CheckGroupPermissions(requestingAgentID, GroupID, (ulong) GroupPowers.MemberVisible))
                return new GroupProfileData();

            GroupProfileData GPD = new GroupProfileData();
            GroupRecord record = GetGroupRecord(requestingAgentID, GroupID, null);

            QueryFilter filter1 = new QueryFilter();
            // We need to check to see if these two are in the correct order, AgentID; and GroupID;
            filter1.andFilters["GroupID"] = AgentID;
            filter1.andFilters["AgentID"] = GroupID;

            QueryFilter filter2 = new QueryFilter();
            filter2.andFilters["GroupID"] = GroupID;

            List<string> Membership = data.Query(new[]
                                                     {
                                                         "Contribution",
                                                         "ListInProfile",
                                                         "SelectedRoleID"
                                                     }, "group_membership", filter1, null, null, null);

            int GroupMemCount =
                int.Parse(data.Query(new[] {"COUNT(AgentID)"}, "group_membership", filter2, null, null, null)[0]);

            int GroupRoleCount = int.Parse(data.Query(new[] {"COUNT(RoleID)"}, "group_roles", filter2, null, null, null)[0]);

            QueryFilter filter3 = new QueryFilter();
            filter3.andFilters["RoleID"] = Membership[2];
            List<string> GroupRole = data.Query(new[]
                                                    {
                                                        "Name",
                                                        "Powers"
                                                    }, "group_roles", filter3, null, null, null);

            GPD.AllowPublish = record.AllowPublish;
            GPD.Charter = record.Charter;
            GPD.FounderID = record.FounderID;
            GPD.GroupID = record.GroupID;
            GPD.GroupMembershipCount = GroupMemCount;
            GPD.GroupRolesCount = GroupRoleCount;
            GPD.InsigniaID = record.GroupPicture;
            GPD.MaturePublish = record.MaturePublish;
            GPD.MembershipFee = record.MembershipFee;
            GPD.MemberTitle = GroupRole[0];
            GPD.Money = 0;

            GPD.Name = record.GroupName;
            GPD.OpenEnrollment = record.OpenEnrollment;
            GPD.OwnerRole = record.OwnerRoleID;
            GPD.PowersMask = ulong.Parse(GroupRole[1]);
            GPD.ShowInList = int.Parse(Membership[2]) == 1;

            return GPD;
        }