コード例 #1
0
 public void OpenRegionInfo(IScenePresence presence)
 {
     OSD item = BuildOpenRegionInfo(presence);
     IEventQueueService eq = presence.Scene.RequestModuleInterface<IEventQueueService>();
     if (eq != null)
         eq.Enqueue(item, presence.UUID, presence.Scene.RegionInfo.RegionID);
 }
コード例 #2
0
        /// <summary>
        /// Send the user a display name update
        /// </summary>
        /// <param name="newDisplayName"></param>
        /// <param name="oldDisplayName"></param>
        /// <param name="InfoFromAv"></param>
        /// <param name="ToAgentID"></param>
        public void DisplayNameUpdate(string newDisplayName, string oldDisplayName, UserAccount InfoFromAv, UUID ToAgentID)
        {
            if (m_eventQueue != null)
            {
                //If the DisplayName is blank, the client refuses to do anything, so we send the name by default
                if (newDisplayName == "")
                {
                    newDisplayName = InfoFromAv.Name;
                }

                bool isDefaultName = isDefaultDisplayName(InfoFromAv.FirstName, InfoFromAv.LastName, InfoFromAv.Name, newDisplayName);

                OSD item = DisplayNameUpdate(newDisplayName, oldDisplayName, InfoFromAv.PrincipalID, isDefaultName, InfoFromAv.FirstName, InfoFromAv.LastName, InfoFromAv.FirstName + "." + InfoFromAv.LastName);
                m_eventQueue.Enqueue(item, ToAgentID, m_service.RegionHandle);
            }
        }
コード例 #3
0
        /// <summary>
        ///     Send a console message to the viewer
        /// </summary>
        /// <param name="AgentID"></param>
        /// <param name="text"></param>
        void SendConsoleEventEQM(UUID AgentID, string text)
        {
            OSDMap item = new OSDMap {
                { "body", text },
                { "message", OSD.FromString("SimConsoleResponse") }
            };

            msgQ.Enqueue(item, AgentID, m_Scene.RegionInfo.RegionID);
        }
コード例 #4
0
        private byte[] ProcessEnqueueEQMMessage(OSDMap request)
        {
            OSDMap response = new OSDMap();

            response["success"] = false;
            try
            {
                UUID     agentID      = request["AgentID"].AsUUID();
                ulong    regionHandle = m_ourRegionHandle == 0 ? request["RegionHandle"].AsULong() : m_ourRegionHandle;
                OSDArray events       = new OSDArray();
                if (request.ContainsKey("Events") && request["Events"].Type == OSDType.Array)
                {
                    events = (OSDArray)request["Events"];
                }

                List <OSD> OSDEvents = new List <OSD>();

                foreach (OSD ev in events)
                {
                    OSD Event = OSDParser.DeserializeLLSDXml(ev.AsString());
                    OSDEvents.Add(Event);
                }

                IClientCapsService clientCaps = m_capsService.GetClientCapsService(agentID);
                if (clientCaps != null)
                {
                    IRegionClientCapsService regionClient = clientCaps.GetCapsService(regionHandle);
                    if (regionClient != null)
                    {
                        bool enqueueResult = false;
                        foreach (OSD ev in OSDEvents)
                        {
                            enqueueResult = m_eventQueueService.Enqueue(ev, agentID, regionHandle);
                            if (!enqueueResult) //Break if one fails
                            {
                                break;
                            }
                        }
                        response["success"] = enqueueResult;
                    }
                }
            }
            catch (Exception ex)
            {
                m_log.Error("[EQMHandler]: ERROR IN THE HANDLER: " + ex.ToString());
                response            = new OSDMap();
                response["success"] = false;
            }
            string resp = OSDParser.SerializeJsonString(response);

            if (resp == "")
            {
                return(new byte[0]);
            }
            return(Util.UTF8.GetBytes(resp));
        }
コード例 #5
0
        public void SendProfileToClientEQ(IScenePresence presence, RegionLightShareData wl)
        {
            OSD item = BuildSendEQMessage(wl.ToOSD());
            IEventQueueService eq = presence.Scene.RequestModuleInterface <IEventQueueService>();

            if (eq != null)
            {
                eq.Enqueue(item, presence.UUID, presence.Scene.RegionInfo.RegionHandle);
            }
        }
コード例 #6
0
        /// <summary>
        ///     Send a console message to the viewer
        /// </summary>
        /// <param name="AgentID"></param>
        /// <param name="text"></param>
        private void SendConsoleEventEQM(UUID AgentID, string text)
        {
            OSDMap item = new OSDMap {
                { "body", text }, { "message", OSD.FromString("SimConsoleResponse") }
            };
            IEventQueueService eq = m_Scene.RequestModuleInterface <IEventQueueService>();

            if (eq != null)
            {
                eq.Enqueue(item, AgentID, m_Scene.RegionInfo.RegionID);
            }
        }
コード例 #7
0
 public void TriggerWindlightUpdate(int interpolate)
 {
     foreach (IScenePresence presence in m_scene.GetScenePresences())
     {
         OSD item = BuildEQM(interpolate);
         IEventQueueService eq = presence.Scene.RequestModuleInterface <IEventQueueService>();
         if (eq != null)
         {
             eq.Enqueue(item, presence.UUID, presence.Scene.RegionInfo.RegionID);
         }
     }
 }
コード例 #8
0
        /// <summary>
        /// Send a console message to the viewer
        /// </summary>
        /// <param name="AgentID"></param>
        /// <param name="text"></param>
        private void SendConsoleEventEQM(UUID AgentID, string text)
        {
            OSDMap item = new OSDMap();

            item.Add("body", text);
            item.Add("message", OSD.FromString("SimConsoleResponse"));
            IEventQueueService eq = m_scenes[0].RequestModuleInterface <IEventQueueService> ();

            if (eq != null)
            {
                eq.Enqueue(item, AgentID, findScene(AgentID).RegionInfo.RegionHandle);
            }
        }
コード例 #9
0
ファイル: DisplayNamesModule.cs プロジェクト: kow/Aurora-Sim
        /// <summary>
        /// Send the user a display name update
        /// </summary>
        /// <param name="newDisplayName"></param>
        /// <param name="oldDisplayName"></param>
        /// <param name="InfoFromAv"></param>
        /// <param name="ToAgentID"></param>
        public void DisplayNameUpdate(string newDisplayName, string oldDisplayName, IScenePresence InfoFromAv, UUID ToAgentID)
        {
            if (m_eventQueue != null)
            {
                //If the DisplayName is blank, the client refuses to do anything, so we send the name by default
                if (newDisplayName == "")
                {
                    newDisplayName = InfoFromAv.Name;
                }

                bool isDefaultName = false;
                if (newDisplayName == InfoFromAv.Name)
                {
                    isDefaultName = true;
                }
                else if (newDisplayName == InfoFromAv.Firstname + "." + InfoFromAv.Lastname)
                {
                    isDefaultName = true;
                }

                OSD item = DisplayNameUpdate(newDisplayName, oldDisplayName, InfoFromAv.UUID, isDefaultName, InfoFromAv.Firstname, InfoFromAv.Lastname, InfoFromAv.Firstname + "." + InfoFromAv.Lastname);
                m_eventQueue.Enqueue(item, ToAgentID, InfoFromAv.Scene.RegionInfo.RegionHandle);
            }
        }
コード例 #10
0
        protected OSDMap OnMessageReceived(OSDMap message)
        {
            //We need to check and see if this is an GroupSessionAgentUpdate
            if (message.ContainsKey("Method") && message ["Method"] == "GroupSessionAgentUpdate")
            {
                //COMES IN ON WhiteCore.SERVER SIDE
                //Send it on to whomever it concerns
                OSDMap innerMessage = (OSDMap)message ["Message"];
                if (innerMessage ["message"] == "ChatterBoxSessionAgentListUpdates")
                // ONLY forward on this type of message
                {
                    UUID agentID                 = message ["AgentID"];
                    IEventQueueService eqs       = m_registry.RequestModuleInterface <IEventQueueService> ();
                    IAgentInfoService  agentInfo = m_registry.RequestModuleInterface <IAgentInfoService> ();
                    if (agentInfo != null)
                    {
                        UserInfo user = agentInfo.GetUserInfo(agentID.ToString());
                        if (user != null && user.IsOnline)
                        {
                            eqs.Enqueue(innerMessage, agentID, user.CurrentRegionID);
                        }
                    }
                }
            }
            else if (message.ContainsKey("Method") && message ["Method"] == "FixGroupRoleTitles")
            {
                // This message comes in on WhiteCore.Server side from the region
                UUID groupID = message ["GroupID"].AsUUID();
                UUID agentID = message ["AgentID"].AsUUID();
                UUID roleID  = message ["RoleID"].AsUUID();
                byte type    = (byte)message ["Type"].AsInteger();
                IGroupsServiceConnector     con     = Framework.Utilities.DataManager.RequestPlugin <IGroupsServiceConnector> ();
                List <GroupRoleMembersData> members = con.GetGroupRoleMembers(agentID, groupID);
                List <GroupRolesData>       roles   = con.GetGroupRoles(agentID, groupID);
                GroupRolesData everyone             = null;

                foreach (GroupRolesData role in roles.Where(role => role.Name == "Everyone"))
                {
                    everyone = role;
                }

                List <UserInfo> regionsToBeUpdated = new List <UserInfo> ();
                foreach (GroupRoleMembersData data in members)
                {
                    if (data.RoleID == roleID)
                    {
                        // They were affected by the change
                        switch ((GroupRoleUpdate)type)
                        {
                        case GroupRoleUpdate.Create:
                        case GroupRoleUpdate.NoUpdate:     // No changes...
                            break;

                        case GroupRoleUpdate.UpdatePowers: // Possible we don't need to send this?
                        case GroupRoleUpdate.UpdateAll:
                        case GroupRoleUpdate.UpdateData:
                        case GroupRoleUpdate.Delete:
                            if (type == (byte)GroupRoleUpdate.Delete)
                            {
                                // Set them to the most limited role since their role is gone
                                con.SetAgentGroupSelectedRole(data.MemberID, groupID, everyone.RoleID);
                            }

                            // Need to update their title inworld
                            IAgentInfoService agentInfoService = m_registry.RequestModuleInterface <IAgentInfoService> ();
                            UserInfo          info;
                            if (agentInfoService != null &&
                                (info = agentInfoService.GetUserInfo(agentID.ToString())) != null && info.IsOnline)
                            {
                                // Forward the message
                                regionsToBeUpdated.Add(info);
                            }
                            break;
                        }
                    }
                }
                if (regionsToBeUpdated.Count != 0)
                {
                    ISyncMessagePosterService messagePost = m_registry.RequestModuleInterface <ISyncMessagePosterService> ();
                    if (messagePost != null)
                    {
                        foreach (UserInfo userInfo in regionsToBeUpdated)
                        {
                            OSDMap outgoingMessage = new OSDMap();
                            outgoingMessage ["Method"]   = "ForceUpdateGroupTitles";
                            outgoingMessage ["GroupID"]  = groupID;
                            outgoingMessage ["RoleID"]   = roleID;
                            outgoingMessage ["RegionID"] = userInfo.CurrentRegionID;
                            messagePost.Post(userInfo.CurrentRegionURI, outgoingMessage);
                        }
                    }
                }
            }
            else if (message.ContainsKey("Method") && message ["Method"] == "ForceUpdateGroupTitles")
            {
                // This message comes in on the region side from WhiteCore.Server
                UUID          groupID  = message ["GroupID"].AsUUID();
                UUID          roleID   = message ["RoleID"].AsUUID();
                UUID          regionID = message ["RegionID"].AsUUID();
                IGroupsModule gm       = m_registry.RequestModuleInterface <IGroupsModule> ();
                if (gm != null)
                {
                    gm.UpdateUsersForExternalRoleUpdate(groupID, roleID, regionID);
                }
            }
            return(null);
        }
コード例 #11
0
        protected OSDMap OnMessageReceived(OSDMap message)
        {
            //We need to check and see if this is an GroupSessionAgentUpdate
            if (message.ContainsKey("Method") && message["Method"] == "GroupSessionAgentUpdate")
            {
                //COMES IN ON AURORA.SERVER SIDE
                //Send it on to whomever it concerns
                OSDMap innerMessage = (OSDMap)message["Message"];
                if (innerMessage["message"] == "ChatterBoxSessionAgentListUpdates")
                //ONLY forward on this type of message
                {
                    UUID agentID            = message["AgentID"];
                    IEventQueueService eqs  = m_registry.RequestModuleInterface <IEventQueueService>();
                    ICapsService       caps = m_registry.RequestModuleInterface <ICapsService>();
                    if (caps != null)
                    {
                        IClientCapsService clientCaps = caps.GetClientCapsService(agentID);
                        if (clientCaps != null && clientCaps.GetRootCapsService() != null)
                        {
                            eqs.Enqueue(innerMessage, agentID, clientCaps.GetRootCapsService().RegionHandle);
                        }
                    }
                }
            }
            else if (message.ContainsKey("Method") && message["Method"] == "FixGroupRoleTitles")
            {
                //COMES IN ON AURORA.SERVER SIDE FROM REGION
                UUID groupID = message["GroupID"].AsUUID();
                UUID agentID = message["AgentID"].AsUUID();
                UUID roleID  = message["RoleID"].AsUUID();
                byte type    = (byte)message["Type"].AsInteger();
                IGroupsServiceConnector     con     = DataManager.RequestPlugin <IGroupsServiceConnector>();
                List <GroupRoleMembersData> members = con.GetGroupRoleMembers(agentID, groupID);
                List <GroupRolesData>       roles   = con.GetGroupRoles(agentID, groupID);
                GroupRolesData everyone             = null;
#if (!ISWIN)
                foreach (GroupRolesData role in roles)
                {
                    if (role.Name == "Everyone")
                    {
                        everyone = role;
                    }
                }
#else
                foreach (GroupRolesData role in roles.Where(role => role.Name == "Everyone"))
                {
                    everyone = role;
                }
#endif

                List <ulong> regionsToBeUpdated = new List <ulong>();
                foreach (GroupRoleMembersData data in members)
                {
                    if (data.RoleID == roleID)
                    {
                        //They were affected by the change
                        switch ((GroupRoleUpdate)type)
                        {
                        case GroupRoleUpdate.Create:
                        case GroupRoleUpdate.NoUpdate:
                            //No changes...
                            break;

                        case GroupRoleUpdate.UpdatePowers:     //Possible we don't need to send this?
                        case GroupRoleUpdate.UpdateAll:
                        case GroupRoleUpdate.UpdateData:
                        case GroupRoleUpdate.Delete:
                            if (type == (byte)GroupRoleUpdate.Delete)
                            {
                                //Set them to the most limited role since their role is gone
                                con.SetAgentGroupSelectedRole(data.MemberID, groupID, everyone.RoleID);
                            }
                            //Need to update their title inworld
                            ICapsService caps = m_registry.RequestModuleInterface <ICapsService>();
                            if (caps != null)
                            {
                                IClientCapsService clientCaps = caps.GetClientCapsService(agentID);
                                if (clientCaps != null && clientCaps.GetRootCapsService() != null)
                                {
                                    regionsToBeUpdated.Add(clientCaps.GetRootCapsService().RegionHandle);
                                }
                            }
                            break;
                        }
                    }
                }
                if (regionsToBeUpdated.Count != 0)
                {
                    IAsyncMessagePostService messagePost = m_registry.RequestModuleInterface <IAsyncMessagePostService>();
                    if (messagePost != null)
                    {
                        foreach (ulong regionhandle in regionsToBeUpdated)
                        {
                            OSDMap outgoingMessage = new OSDMap();
                            outgoingMessage["Method"]   = "ForceUpdateGroupTitles";
                            outgoingMessage["GroupID"]  = groupID;
                            outgoingMessage["RoleID"]   = roleID;
                            outgoingMessage["RegionID"] = regionhandle;
                            messagePost.Post(regionhandle, outgoingMessage);
                        }
                    }
                }
            }
            else if (message.ContainsKey("Method") && message["Method"] == "ForceUpdateGroupTitles")
            {
                //COMES IN ON REGION SIDE FROM AURORA.SERVER
                UUID          groupID  = message["GroupID"].AsUUID();
                UUID          roleID   = message["RoleID"].AsUUID();
                ulong         regionID = message["RegionID"].AsULong();
                IGroupsModule gm       = m_registry.RequestModuleInterface <IGroupsModule>();
                if (gm != null)
                {
                    gm.UpdateUsersForExternalRoleUpdate(groupID, roleID, regionID);
                }
            }
            else if (message.ContainsKey("Method") && message["Method"] == "SendGroupNoticeToUsers")
            {
                //COMES IN ON REGION SIDE FROM AURORA.SERVER
                GroupNoticeInfo notice = new GroupNoticeInfo();
                notice.FromOSD((OSDMap)message["Notice"]);
                IGroupsModule gm = m_registry.RequestModuleInterface <IGroupsModule>();
                if (gm != null)
                {
                    gm.SendGroupNoticeToUsers(null, notice, true);
                }
            }
            return(null);
        }