public byte[] GroupMemberData(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { try { //MainConsole.Instance.Debug("[CAPS]: UploadBakedTexture Request in region: " + // m_regionName); OSDMap rm = (OSDMap)OSDParser.DeserializeLLSDXml(HttpServerHandlerHelpers.ReadFully(request)); UUID groupID = rm["group_id"].AsUUID(); OSDMap defaults = new OSDMap(); ulong EveryonePowers = (ulong)(GroupPowers.AllowSetHome | GroupPowers.Accountable | GroupPowers.JoinChat | GroupPowers.AllowVoiceChat | GroupPowers.ReceiveNotices | GroupPowers.StartProposal | GroupPowers.VoteOnProposal); defaults["default_powers"] = EveryonePowers; List <string> titles = new List <string>(); OSDMap members = new OSDMap(); int count = 0; foreach (GroupMembersData gmd in m_groupService.GetGroupMembers(m_service.AgentID, groupID)) { OSDMap member = new OSDMap(); member["donated_square_meters"] = gmd.Contribution; member["owner"] = (gmd.IsOwner ? "Y" : "N"); member["last_login"] = gmd.OnlineStatus; if (titles.Contains(gmd.Title)) { member["title"] = titles.FindIndex((s) => s == gmd.Title); } else { titles.Add(gmd.Title); member["title"] = titles.Count - 1; } member["powers"] = gmd.AgentPowers; count++; members[gmd.AgentID.ToString()] = member; } OSDMap map = new OSDMap(); map["member_count"] = count; map["group_id"] = groupID; map["defaults"] = defaults; map["titles"] = titles.ToOSDArray(); map["members"] = members; return(OSDParser.SerializeLLSDXmlBytes(map)); } catch (Exception e) { MainConsole.Instance.Error("[CAPS]: " + e); } return(null); }
public void EnsureSessionIsStarted(UUID groupID) { if (m_doRemoteOnly) { DoRemoteCallPost(true, "InstantMessageServerURI", groupID); return; } if (!SessionExists(groupID)) { GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, groupID, null); CreateSession(new ChatSession { Members = new List <ChatSessionMember>(), SessionID = groupID, Name = groupInfo.GroupName }); foreach ( GroupMembersData gmd in m_groupData.GetGroupMembers(UUID.Zero, groupID) .Where( gmd => (gmd.AgentPowers & (ulong)GroupPowers.JoinChat) == (ulong)GroupPowers.JoinChat) ) { AddMemberToGroup(new ChatSessionMember { AvatarKey = gmd.AgentID, CanVoiceChat = false, IsModerator = GroupPermissionCheck(gmd.AgentID, groupID, GroupPowers.ModerateChat), MuteText = false, MuteVoice = false, HasBeenAdded = false }, groupID); } } }
public List <GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID) { return(GroupsConnector.GetGroupMembers(requestingAgentID, GroupID)); }