示例#1
0
 public void Startup(ConfigurationLoader loader)
 {
     m_IMRouter          = loader.IMRouter;
     m_AvatarNameService = loader.GetService <AvatarNameServiceInterface>(m_AvatarNameServiceName);
     m_OfflineIMService  = loader.GetService <OfflineIMServiceInterface>(m_OfflineIMServiceName);
     m_IMRouter.OfflineIM.Add(Send);
 }
示例#2
0
        public void Startup(ConfigurationLoader loader)
        {
            HomeURI = loader.HomeURI;

            m_AgentInventoryService = loader.GetService <InventoryServiceInterface>(m_AgentInventoryServiceName);
            m_AgentAssetService     = loader.GetService <AssetServiceInterface>(m_AgentAssetServiceName);
            if (m_AgentProfileServiceName?.Length != 0)
            {
                m_AgentProfileService = loader.GetService <ProfileServiceInterface>(m_AgentProfileServiceName);
            }
            m_AgentFriendsService = loader.GetService <FriendsServiceInterface>(m_AgentFriendsServiceName);
            m_UserSessionService  = loader.GetService <UserSessionServiceInterface>(m_UserSessionServiceName);
            m_GridService         = loader.GetService <GridServiceInterface>(m_GridServiceName);
            if (m_OfflineIMServiceName?.Length != 0)
            {
                m_OfflineIMService = loader.GetService <OfflineIMServiceInterface>(m_OfflineIMServiceName);
            }
            if (m_AgentExperienceServiceName?.Length != 0)
            {
                loader.GetService(m_AgentExperienceServiceName, out m_AgentExperienceService);
            }
            if (m_AgentGroupsServiceName?.Length != 0)
            {
                loader.GetService(m_AgentGroupsServiceName, out m_AgentGroupsService);
            }
            m_UserAccountService    = loader.GetService <UserAccountServiceInterface>(m_UserAccountServiceName);
            m_AgentUserAgentService = new LocalUserAgentService(m_UserSessionService, m_UserAccountService, m_RequiresInventoryIDAsIMSessionID, HomeURI);

            m_Scenes               = loader.Scenes;
            m_Commands             = loader.CommandRegistry;
            m_CapsRedirector       = loader.CapsRedirector;
            m_PacketHandlerPlugins = loader.GetServicesByValue <IProtocolExtender>();
        }
示例#3
0
        public void HandlerThread()
        {
            Thread.CurrentThread.Name = "OfflineIM Retrieve Handler Thread";

            while (!m_ShutdownOfflineIM)
            {
                KeyValuePair <AgentCircuit, Message> req;
                try
                {
                    req = RequestQueue.Dequeue(1000);
                }
                catch
                {
                    continue;
                }

                Message m = req.Value;

                if (req.Key == null)
                {
                    continue;
                }

                var imreq = (RetrieveInstantMessages)m;
                if (imreq.SessionID != imreq.CircuitSessionID ||
                    imreq.AgentID != imreq.CircuitAgentID)
                {
                    continue;
                }

                ViewerAgent agent = req.Key.Agent;

                OfflineIMServiceInterface offlineIMService = agent.OfflineIMService;
                if (offlineIMService != null)
                {
                    try
                    {
                        foreach (GridInstantMessage gim in offlineIMService.GetOfflineIMs(agent.Owner.ID))
                        {
                            try
                            {
                                agent.IMSend(gim);
                            }
                            catch
                            {
                                /* do not pass exceptions to caller */
                            }
                        }
                    }
                    catch
                    {
                        /* do not pass exceptions to caller */
                    }
                }
            }
        }
 public void Startup(ConfigurationLoader loader)
 {
     m_UserSessionService = loader.GetService <UserSessionServiceInterface>(m_UserSessionServiceName);
     m_OfflineIMService   = loader.GetService <OfflineIMServiceInterface>(m_OfflineIMServiceName);
     m_UserAccountService = loader.GetService <UserAccountServiceInterface>(m_UserAccountServiceName);
     m_HttpServer         = loader.HttpServer;
     m_HttpServer.StartsWithUriHandlers.Add("/UserCAPS/ReadOfflineMsgs/", CapsHandler);
     if (loader.TryGetHttpsServer(out m_HttpsServer))
     {
         m_HttpsServer.StartsWithUriHandlers.Add("/UserCAPS/ReadOfflineMsgs/", CapsHandler);
     }
 }
        protected void ProcessReadOfflineMsgs(UUID ownerID, HttpRequest req, OfflineIMServiceInterface offlineIMService)
        {
            if (req.Method != "GET")
            {
                req.ErrorResponse(HttpStatusCode.MethodNotAllowed, "Method not allowed");
                return;
            }

            var resmap = new Map();
            var msgs   = new AnArray();

            resmap.Add("messages", msgs);
            if (offlineIMService != null)
            {
                try
                {
                    foreach (GridInstantMessage gim in offlineIMService.GetOfflineIMs(ownerID))
                    {
                        msgs.Add(new Map
                        {
                            { "binary_bucket", new BinaryData(gim.BinaryBucket) },
                            { "parent_estate_id", gim.ParentEstateID },
                            { "from_agent_id", gim.FromAgent.ID },
                            { "from_group", gim.IsFromGroup },
                            { "dialog", (int)gim.Dialog },
                            { "session_id", gim.IMSessionID },
                            { "timestamp", gim.Timestamp.AsInt },
                            { "from_agent_name", gim.FromAgent.FullName },
                            { "message", gim.Message },
                            { "region_id", gim.RegionID },
                            { "local_x", gim.Position.X },
                            { "local_y", gim.Position.Y },
                            { "local_z", gim.Position.Z },
                            { "asset_id", gim.FromGroup.ID } /* probably this gets changed in feature */
                        });
                    }
                }
                catch
                {
                    /* do not pass exceptions to caller */
                }
            }
            using (HttpResponse res = req.BeginResponse("application/llsd+xml"))
            {
                using (Stream s = res.GetOutputStream())
                {
                    LlsdXml.Serialize(resmap, s);
                }
            }
        }