Example #1
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(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);
        }
        /// <summary>
        ///     Tells the region to tell the given agent that the other agent is online
        /// </summary>
        /// <param name="AgentIDs">Agents that are 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, UUID.Zero));
        }
        /// <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);
        }
Example #4
0
        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 #5
0
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["AgentInfo"]   = AgentInfo.ToOSD();
            map["UserAccount"] = UserAccount.ToOSD();
            if (ActiveGroup != null)
            {
                map["ActiveGroup"] = ActiveGroup.ToOSD();
            }
            map["GroupMemberships"] = GroupMemberships.ToOSDArray();
            return(map);
        }
Example #6
0
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["ShowInMenu"]         = ShowInMenu;
            map["MenuPosition"]       = MenuPosition;
            map["MenuID"]             = MenuID;
            map["MenuTitle"]          = MenuTitle;
            map["MenuToolTip"]        = MenuToolTip;
            map["Location"]           = Location;
            map["LoggedInRequired"]   = LoggedInRequired;
            map["LoggedOutRequired"]  = LoggedOutRequired;
            map["AdminRequired"]      = AdminRequired;
            map["AdminLevelRequired"] = AdminLevelRequired;
            map["Children"]           = Children.ToOSDArray();
            return(map);
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["AgentInfo"]   = AgentInfo.ToOSD();
            map["UserAccount"] = UserAccount.ToOSD();
            if (ActiveGroup != null)
            {
                map["ActiveGroup"] = ActiveGroup.ToOSD();
            }
            map["GroupMemberships"] = GroupMemberships.ToOSDArray();
            map["OfflineMessages"]  = OfflineMessages.ToOSDArray();
            map["MuteList"]         = MuteList.ToOSDArray();
            if (Appearance != null)
            {
                map["Appearance"] = Appearance.ToOSD();
            }
            return(map);
        }
 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 #9
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;
        }