public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID)
        {
            object remoteValue = DoRemote(requestingAgentID, GroupID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<GroupRoleMembersData>)remoteValue;

            List<GroupRoleMembersData> RoleMembers = new List<GroupRoleMembersData>();

            QueryFilter filter = new QueryFilter();
            filter.andFilters["GroupID"] = GroupID;
            List<string> Roles = data.Query(new string[2]{
                "RoleID",
                "AgentID"
            }, "osgrouprolemembership", filter, null, null, null);

            GroupMembersData GMD = GetAgentGroupMemberData(requestingAgentID, GroupID, requestingAgentID);
            long canViewMemebersBit = 140737488355328L;
            long canDoBit;
            for (int i = 0; i < Roles.Count; i += 2)
            {
                GroupRoleMembersData RoleMember = new GroupRoleMembersData
                {
                    RoleID = UUID.Parse(Roles[i]),
                    MemberID = UUID.Parse(Roles[i + 1])
                };
                filter.andFilters.Remove("GroupID");
                filter.andFilters["RoleID"] = RoleMember.RoleID;
                List<string> roleInfo = data.Query(new string[1] { "Powers" }, "osrole", filter, null, null, null);
                canDoBit = long.Parse(roleInfo[0]);
                // if they are a member, they can see everyone, otherwise, only the roles that are supposed to be shown
                if (GMD != null || ((canDoBit & canViewMemebersBit) == canViewMemebersBit || RoleMember.MemberID == requestingAgentID))
                {
                    RoleMembers.Add(RoleMember);
                }
            }

            return RoleMembers;
        }
        public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID)
        {
            object remoteValue = DoRemote(requestingAgentID, GroupID);
            if (remoteValue != null || m_doRemoteOnly)
                return (List<GroupRoleMembersData>)remoteValue;

            List<GroupRoleMembersData> RoleMembers = new List<GroupRoleMembersData>();

            QueryTables tables = new QueryTables();
            tables.AddTable("osgrouprolemembership", "osgrm");
            tables.AddTable("osrole", "osr", JoinType.Inner, new[,] { { "osr.RoleID", "osgrm.RoleID" } });

            QueryFilter filter = new QueryFilter();
            filter.andFilters["osgrm.GroupID"] = GroupID;
            string[] fields = new[]
                                  {
                                      "osgrm.RoleID",
                                      "osgrm.AgentID",
                                      "osr.Powers"
                                  };
            List<string> Roles = data.Query(fields, tables, filter, null, null, null);

            GroupMembersData GMD = GetAgentGroupMemberData(requestingAgentID, GroupID, requestingAgentID);
            const long canViewMemebersBit = 140737488355328L;
            for (int i = 0; i < Roles.Count; i += fields.Length)
            {
                GroupRoleMembersData RoleMember = new GroupRoleMembersData
                {
                    RoleID = UUID.Parse(Roles[i]),
                    MemberID = UUID.Parse(Roles[i + 1])
                };

                // if they are a member, they can see everyone, otherwise, only the roles that are supposed to be shown
                if (GMD != null || ((long.Parse(Roles[i + 2]) & canViewMemebersBit) == canViewMemebersBit || RoleMember.MemberID == requestingAgentID))
                    RoleMembers.Add(RoleMember);
            }

            return RoleMembers;
        }
        public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID groupID)
        {
            if (m_debugEnabled)
                MainConsole.Instance.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]  {0} called", MethodBase.GetCurrentMethod().Name);

            List<GroupRoleMembersData> members = new List<GroupRoleMembersData>();

            Dictionary<string, OSDMap> GroupRoles;
            if (SimianGetGenericEntries(groupID, "GroupRole", out GroupRoles))
            {
                foreach (KeyValuePair<string, OSDMap> Role in GroupRoles)
                {
                    Dictionary<UUID, OSDMap> GroupRoleMembers;
                    if (SimianGetGenericEntries("GroupRole" + groupID.ToString(), Role.Key, out GroupRoleMembers))
                    {
            #if (!ISWIN)
                        foreach (KeyValuePair<UUID, OSDMap> GroupRoleMember in GroupRoleMembers)
                        {
                            GroupRoleMembersData data = new GroupRoleMembersData();

                            data.MemberID = GroupRoleMember.Key;
                            data.RoleID = UUID.Parse(Role.Key);

                            members.Add(data);
                        }
            #else
                        members.AddRange(GroupRoleMembers.Select(GroupRoleMember => new GroupRoleMembersData
                                                                                        {
                                                                                            MemberID =
                                                                                                GroupRoleMember.Key,
                                                                                            RoleID =
                                                                                                UUID.Parse(Role.Key)
                                                                                        }));
            #endif
                    }
                }
            }

            return members;
        }