/// <summary>
        ///   Tells the region to tell the given agent that the other agent is online
        /// </summary>
        /// <param name = "AgentID">Agent that is either logging in or logging out</param>
        /// <param name = "FriendToInformID">Friend that will be told of the incoming/outgoing user</param>
        /// <param name = "newStatus">Whether they are logged in or out</param>
        /// <returns></returns>
        public static OSDMap AgentStatusChanges(List<UUID> AgentIDs, UUID FriendToInformID, bool newStatus)
        {
            OSDMap llsdBody = new OSDMap
                                  {
                                      {"AgentIDs", AgentIDs.ToOSDArray()},
                                      {"FriendToInformID", FriendToInformID},
                                      {"NewStatus", newStatus}
                                  };

            return buildEvent("AgentStatusChanges", llsdBody, FriendToInformID, 0);
        }
 private void SendInstantMessages(string uri, List<GridInstantMessage> ims)
 {
     ISyncMessagePosterService syncMessagePoster = m_registry.RequestModuleInterface<ISyncMessagePosterService>();
     if (syncMessagePoster != null)
     {
         OSDMap map = new OSDMap();
         map["Method"] = "SendInstantMessages";
         map["Messages"] = ims.ToOSDArray();
         syncMessagePoster.Post(uri, map);
     }
 }
Example #3
0
        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(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;
        }