public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service          = service;
            m_agentInfoService = service.Registry.RequestModuleInterface <IAgentInfoService> ();
            m_agentProcessing  = service.Registry.RequestModuleInterface <IAgentProcessing> ();

            HttpServerHandle method;

            service.AddStreamHandler("AvatarPickerSearch",
                                     new GenericStreamHandler("GET", service.CreateCAPS("AvatarPickerSearch", ""),
                                                              ProcessAvatarPickerSearch));

            method = delegate(string path, Stream request,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse) {
                return(HomeLocation(request, m_service.AgentID));
            };
            service.AddStreamHandler("HomeLocation",
                                     new GenericStreamHandler("POST", service.CreateCAPS("HomeLocation", ""),
                                                              method));

            method = delegate(string path, Stream request,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse) {
                return(TeleportLocation(request, m_service.AgentID));
            };

            service.AddStreamHandler("TeleportLocation",
                                     new GenericStreamHandler("POST", service.CreateCAPS("TeleportLocation", ""),
                                                              method));
        }
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_agentInfoService = service.Registry.RequestModuleInterface<IAgentInfoService>();
            m_agentProcessing = service.Registry.RequestModuleInterface<IAgentProcessing>();

            HttpServerHandle method;

            service.AddStreamHandler("AvatarPickerSearch",
                                     new GenericStreamHandler("GET", service.CreateCAPS("AvatarPickerSearch", ""),
                                                              ProcessAvatarPickerSearch));

            method = delegate(string path, Stream request,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse)
                         { return HomeLocation(request, m_service.AgentID); };
            service.AddStreamHandler("HomeLocation",
                                     new GenericStreamHandler("POST", service.CreateCAPS("HomeLocation", ""),
                                                              method));

            method = delegate(string path, Stream request,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse)
                         { return TeleportLocation(request, m_service.AgentID); };

            service.AddStreamHandler("TeleportLocation",
                                     new GenericStreamHandler("POST", service.CreateCAPS("TeleportLocation", ""),
                                                              method));
        }
        public void KickUser(UUID avatarID, string message)
        {
            //Get required interfaces
            IClientCapsService client = m_capsService.GetClientCapsService(avatarID);

            if (client != null)
            {
                IRegionClientCapsService regionClient = client.GetRootCapsService();
                if (regionClient != null)
                {
                    //Send the message to the client
                    m_messagePost.Get(regionClient.Region.ServerURI,
                                      BuildRequest("KickUserMessage", message, regionClient.AgentID.ToString()),
                                      (resp) =>
                    {
                        IAgentProcessing agentProcessor =
                            m_registry.RequestModuleInterface <IAgentProcessing>();
                        if (agentProcessor != null)
                        {
                            agentProcessor.LogoutAgent(regionClient, true);
                        }
                        MainConsole.Instance.Info("User has been kicked.");
                    });

                    return;
                }
            }
            MainConsole.Instance.Info("Could not find user to send message to.");
        }
示例#4
0
        public void KickUser(UUID avatarID, string message)
        {
            //Get required interfaces
            IAsyncMessagePostService messagePost = m_registry.RequestModuleInterface <IAsyncMessagePostService>();
            ICapsService             capsService = m_registry.RequestModuleInterface <ICapsService>();
            IClientCapsService       client      = capsService.GetClientCapsService(avatarID);

            if (client != null)
            {
                IRegionClientCapsService regionClient = client.GetRootCapsService();
                if (regionClient != null)
                {
                    //Send the message to the client
                    messagePost.Post(regionClient.RegionHandle,
                                     BuildRequest("KickUserMessage", message, regionClient.AgentID.ToString()));
                    IAgentProcessing agentProcessor = m_registry.RequestModuleInterface <IAgentProcessing>();
                    if (agentProcessor != null)
                    {
                        agentProcessor.LogoutAgent(regionClient, true);
                    }
                    MainConsole.Instance.Info("User will be kicked in less than 30 seconds.");
                    return;
                }
            }
            MainConsole.Instance.Info("Could not find user to send message to.");
        }
示例#5
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service          = service;
            m_agentInfoService = service.Registry.RequestModuleInterface <IAgentInfoService>();
            m_agentProcessing  = service.Registry.RequestModuleInterface <IAgentProcessing>();

#if (!ISWIN)
            GenericHTTPMethod method = delegate(Hashtable httpMethod)
            {
                return(ProcessUpdateAgentLanguage(httpMethod, m_service.AgentID));
            };
#else
            GenericHTTPMethod method = httpMethod => ProcessUpdateAgentLanguage(httpMethod, m_service.AgentID);
#endif
            service.AddStreamHandler("UpdateAgentLanguage", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentLanguage", ""),
                                                                                method));


#if (!ISWIN)
            method = delegate(Hashtable httpMethod)
            {
                return(ProcessUpdateAgentInfo(httpMethod, m_service.AgentID));
            };
#else
            method = httpMethod => ProcessUpdateAgentInfo(httpMethod, m_service.AgentID);
#endif
            service.AddStreamHandler("UpdateAgentInformation", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentInformation", ""),
                                                                                   method));

            service.AddStreamHandler("AvatarPickerSearch", new StreamHandler("GET", service.CreateCAPS("AvatarPickerSearch", ""),
                                                                             ProcessAvatarPickerSearch));

#if (!ISWIN)
            method = delegate(Hashtable httpMethod)
            {
                return(HomeLocation(httpMethod, m_service.AgentID));
            };
#else
            method = httpMethod => HomeLocation(httpMethod, m_service.AgentID);
#endif

            service.AddStreamHandler("HomeLocation", new RestHTTPHandler("POST", service.CreateCAPS("HomeLocation", ""),
                                                                         method));

#if (!ISWIN)
            method = delegate(Hashtable httpMethod)
            {
                return(TeleportLocation(httpMethod, m_service.AgentID));
            };
#else
            method = httpMethod => TeleportLocation(httpMethod, m_service.AgentID);
#endif

            service.AddStreamHandler("TeleportLocation", new RestHTTPHandler("POST", service.CreateCAPS("TeleportLocation", ""),
                                                                             method));
        }
示例#6
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_agentInfoService = service.Registry.RequestModuleInterface<IAgentInfoService>();
            m_agentProcessing = service.Registry.RequestModuleInterface<IAgentProcessing>();

#if (!ISWIN)
            GenericHTTPMethod method = delegate(Hashtable httpMethod)
            {
                return ProcessUpdateAgentLanguage(httpMethod, m_service.AgentID);
            };
#else
            GenericHTTPMethod method = httpMethod => ProcessUpdateAgentLanguage(httpMethod, m_service.AgentID);
#endif  
            service.AddStreamHandler("UpdateAgentLanguage", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentLanguage", ""),
                                                      method));


#if (!ISWIN)
            method = delegate(Hashtable httpMethod)
            {
                return ProcessUpdateAgentInfo(httpMethod, m_service.AgentID);
            };
#else
            method = httpMethod => ProcessUpdateAgentInfo(httpMethod, m_service.AgentID);
#endif
            service.AddStreamHandler("UpdateAgentInformation", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentInformation", ""),
                                method));

            service.AddStreamHandler ("AvatarPickerSearch", new StreamHandler ("GET", service.CreateCAPS("AvatarPickerSearch", ""),
                                                      ProcessAvatarPickerSearch));

#if (!ISWIN)
            method = delegate(Hashtable httpMethod)
            {
                return HomeLocation(httpMethod, m_service.AgentID);
            };
#else
            method = httpMethod => HomeLocation(httpMethod, m_service.AgentID);
#endif

            service.AddStreamHandler("HomeLocation", new RestHTTPHandler("POST", service.CreateCAPS("HomeLocation", ""),
                                                      method));

#if (!ISWIN)
            method = delegate(Hashtable httpMethod)
            {
                return TeleportLocation(httpMethod, m_service.AgentID);
            };
#else
            method = httpMethod => TeleportLocation(httpMethod, m_service.AgentID);
#endif

            service.AddStreamHandler("TeleportLocation", new RestHTTPHandler("POST", service.CreateCAPS("TeleportLocation", ""),
                                                      method));
        }
示例#7
0
        protected void KickUserMessage(string module, string[] cmd)
        {
            //Combine the params and figure out the message
            string user = CombineParams(cmd, 2, 4);

            if (user.EndsWith(" "))
            {
                user = user.Remove(user.Length - 1);
            }
            string message = CombineParams(cmd, 5);

            //Get required interfaces
            IAsyncMessagePostService messagePost = m_registry.RequestModuleInterface <IAsyncMessagePostService>();
            ICapsService             capsService = m_registry.RequestModuleInterface <ICapsService>();
            IUserAccountService      userService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount account = userService.GetUserAccount(UUID.Zero, user);

            if (account == null)
            {
                m_log.Info("User does not exist.");
                return;
            }
            IClientCapsService client = capsService.GetClientCapsService(account.PrincipalID);

            if (client != null)
            {
                IRegionClientCapsService regionClient = client.GetRootCapsService();
                if (regionClient != null)
                {
                    //Send the message to the client
                    messagePost.Post(regionClient.RegionHandle, BuildRequest("KickUserMessage", message, regionClient.AgentID.ToString()));
                    IAgentProcessing agentProcessor = m_registry.RequestModuleInterface <IAgentProcessing>();
                    if (agentProcessor != null)
                    {
                        agentProcessor.LogoutAgent(regionClient);
                    }
                    m_log.Info("User Kicked sent.");
                    return;
                }
            }
            m_log.Info("Could not find user to send message to.");
        }