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));
        }
Пример #2
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;

            service.AddStreamHandler("ExperiencePreferences",
                                     new GenericStreamHandler("POST", service.CreateCAPS("ExperiencePreferences", ""), ExperiencePreferences));

            service.AddStreamHandler("FindExperienceByName",
                                     new GenericStreamHandler("POST", service.CreateCAPS("FindExperienceByName", ""), FindExperienceByName));

            service.AddStreamHandler("GetExperiences",
                                     new GenericStreamHandler("POST", service.CreateCAPS("GetExperiences", ""), GetExperiences));

            service.AddStreamHandler("GetExperienceInfo",
                                     new GenericStreamHandler("POST", service.CreateCAPS("GetExperienceInfo", ""), GetExperienceInfo));

            service.AddStreamHandler("GetAdminExperiences",
                                     new GenericStreamHandler("POST", service.CreateCAPS("GetAdminExperiences", ""), GetAdminExperiences));

            service.AddStreamHandler("GetCreatorExperiences",
                                     new GenericStreamHandler("POST", service.CreateCAPS("GetCreatorExperiences", ""), GetCreatorExperiences));

            service.AddStreamHandler("UpdateExperience",
                                     new GenericStreamHandler("POST", service.CreateCAPS("UpdateExperience", ""), UpdateExperience));

            service.AddStreamHandler("IsExperienceAdmin",
                                     new GenericStreamHandler("POST", service.CreateCAPS("IsExperienceAdmin", ""), IsExperienceAdmin));

            service.AddStreamHandler("IsExperienceContributor",
                                     new GenericStreamHandler("POST", service.CreateCAPS("IsExperienceContributor", ""), IsExperienceContributor));
        }
Пример #3
0
        public static bool GetIsForeign(UUID AgentID, string server, IRegistryCore registry, out string serverURL)
        {
            serverURL = "";
            if (registry == null)
            {
                return(true);
            }
            ICapsService       caps       = registry.RequestModuleInterface <ICapsService>();
            IClientCapsService clientCaps = caps.GetClientCapsService(AgentID);

            if (clientCaps == null)
            {
                return(false);
            }
            IRegionClientCapsService regionClientCaps = clientCaps.GetRootCapsService();

            if (regionClientCaps == null)
            {
                return(false);
            }
            Dictionary <string, object> urls = regionClientCaps.CircuitData.ServiceURLs;

            if (urls != null && urls.Count > 0)
            {
                serverURL = urls[server].ToString();
                return(true);
            }
            return(false);
        }
Пример #4
0
 public BakedTextureUploader(string path, string method, IRegionClientCapsService caps)
 {
     newAssetID   = UUID.Random();
     uploaderPath = path;
     uploadMethod = method;
     clientCaps   = caps;
 }
Пример #5
0
 public void SendChildAgentUpdate(AgentPosition agentpos, IRegionClientCapsService regionCaps)
 {
     Util.FireAndForget(delegate(object o)
     {
         SendChildAgentUpdateAsync(agentpos, regionCaps);
     });
 }
Пример #6
0
 void OnMakeRootAgent(IScenePresence presence)
 {
     if ((presence.CallbackURI != null) && !presence.CallbackURI.Equals(""))
     {
         WebUtils.ServiceOSDRequest(presence.CallbackURI, null, "DELETE", 10000, false, false);
         presence.CallbackURI = null;
         ICapsService service = m_scene.RequestModuleInterface <ICapsService>();
         if (service != null)
         {
             IClientCapsService clientCaps = service.GetClientCapsService(presence.UUID);
             if (clientCaps != null)
             {
                 IRegionClientCapsService regionCaps = clientCaps.GetCapsService(m_scene.RegionInfo.RegionHandle);
                 if (regionCaps != null)
                 {
                     regionCaps.RootAgent = true;
                     foreach (IRegionClientCapsService regionClientCaps in clientCaps.GetCapsServices())
                     {
                         if (regionCaps.RegionHandle != regionClientCaps.RegionHandle)
                         {
                             regionClientCaps.RootAgent = false; //Reset any other agents that we might have
                         }
                     }
                 }
             }
         }
     }
 }
Пример #7
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service     = service;
            m_gridService = service.Registry.RequestModuleInterface <IGridService>();
            IConfig config =
                service.ClientCaps.Registry.RequestModuleInterface <ISimulationBase>().ConfigSource.Configs["MapCaps"];

            if (config != null)
            {
                m_allowCapsMessage = config.GetBoolean("AllowCapsMessage", m_allowCapsMessage);
            }

#if (!ISWIN)
            RestMethod method = delegate(string request, string path, string param,
                                         OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return(MapLayerRequest(request, path, param, httpRequest, httpResponse, m_service.AgentID));
            };
#else
            RestMethod method =
                (request, path, param, httpRequest, httpResponse) =>
                MapLayerRequest(request, path, param, httpRequest, httpResponse,
                                m_service.AgentID);
#endif
            m_service.AddStreamHandler("MapLayer",
                                       new RestStreamHandler("POST", m_service.CreateCAPS("MapLayer", m_mapLayerPath),
                                                             method));
            m_service.AddStreamHandler("MapLayerGod",
                                       new RestStreamHandler("POST", m_service.CreateCAPS("MapLayerGod", m_mapLayerPath),
                                                             method));
        }
        public void RegisterCaps (IRegionClientCapsService service)
        {
            m_service = service;
            
            service.AddStreamHandler ("ExperiencePreferences",
                                      new GenericStreamHandler ("POST", service.CreateCAPS ("ExperiencePreferences", ""), ExperiencePreferences));
            
            service.AddStreamHandler ("FindExperienceByName",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("FindExperienceByName", ""), FindExperienceByName));
            
            service.AddStreamHandler ("GetExperiences",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("GetExperiences", ""), GetExperiences));

            service.AddStreamHandler ("GetExperienceInfo",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("GetExperienceInfo", ""), GetExperienceInfo));
            
            service.AddStreamHandler ("GetAdminExperiences",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("GetAdminExperiences", ""), GetAdminExperiences));
            
            service.AddStreamHandler ("GetCreatorExperiences",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("GetCreatorExperiences", ""), GetCreatorExperiences));
            
            service.AddStreamHandler ("UpdateExperience",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("UpdateExperience", ""), UpdateExperience));
            
            service.AddStreamHandler ("IsExperienceAdmin",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("IsExperienceAdmin", ""), IsExperienceAdmin));

            service.AddStreamHandler ("IsExperienceContributor",
                                      new GenericStreamHandler ("POST", service.CreateCAPS("IsExperienceContributor", ""), IsExperienceContributor));
        }
Пример #9
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;

            string capsBase = "/CAPS/EQG/";

            m_capsPath = capsBase + UUID.Random() + "/";


            // Register this as a caps handler
            IRequestHandler rhandler = new RestHTTPHandler("POST", m_capsPath,
                                                           delegate(Hashtable m_dhttpMethod)
            {
                return(ProcessQueue(m_dhttpMethod, service.AgentID));
            });

            m_service.AddStreamHandler("EventQueueGet", rhandler);

            // This will persist this beyond the expiry of the caps handlers
            MainServer.Instance.AddPollServiceHTTPHandler(
                m_capsPath, EventQueuePoll, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, service.AgentID));

            Random rnd = new Random(Environment.TickCount);

            m_ids = rnd.Next(30000000);
        }
Пример #10
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;

            service.AddStreamHandler("AgentExperiences",
                                     new GenericStreamHandler("GET", service.CreateCAPS("AgentExperiences", ""), AgentExperiences));
        }
Пример #11
0
        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));
        }
Пример #12
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service     = service;
            m_gridService = service.Registry.RequestModuleInterface <IGridService>();
            IConfig config =
                service.ClientCaps.Registry.RequestModuleInterface <ISimulationBase>().ConfigSource.Configs["MapCaps"];

            if (config != null)
            {
                m_allowCapsMessage = config.GetBoolean("AllowCapsMessage", m_allowCapsMessage);
            }

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

            m_service.AddStreamHandler("MapLayer",
                                       new GenericStreamHandler("POST", m_service.CreateCAPS("MapLayer", ""),
                                                                method));
            m_service.AddStreamHandler("MapLayerGod",
                                       new GenericStreamHandler("POST", m_service.CreateCAPS("MapLayerGod", ""),
                                                                method));
        }
Пример #13
0
 public void RegisterCaps (IRegionClientCapsService service)
 {
     m_service = service;
     m_profileConnector = Framework.Utilities.DataManager.RequestPlugin<IProfileConnector> ();
     m_service.AddStreamHandler ("MeshUploadFlag",
         new GenericStreamHandler ("GET", m_service.CreateCAPS ("MeshUploadFlag", ""), MeshUploadFlagCAP));
 }
Пример #14
0
        public virtual bool Enqueue(string o, UUID agentID, UUID regionID)
        {
            if (m_doRemoteCalls && m_doRemoteOnly)
            {
                Util.FireAndForget((none) => {
                    EnqueueInternal(o, agentID, regionID);
                });
                return(true);
            }

            //Find the CapsService for the user and enqueue the event
            IRegionClientCapsService service = GetRegionClientCapsService(agentID, regionID);

            if (service == null)
            {
                return(false);
            }
            RegionClientEventQueueService eventQueueService = service.GetServiceConnectors()
                                                              .OfType <RegionClientEventQueueService> ()
                                                              .FirstOrDefault();

            if (eventQueueService == null)
            {
                return(false);
            }

            OSD ev = OSDParser.DeserializeLLSDXml(o);

            return(eventQueueService.Enqueue(ev));
        }
Пример #15
0
 public bool SendGridMessage(UUID toId, string message, bool goDeep, UUID transactionId)
 {
     try
     {
         if (m_doRemoteCalls)
         {
             return((bool)DoRemote(toId, message, goDeep, transactionId));
         }
         ICapsService       capsService = m_registry.RequestModuleInterface <ICapsService>();
         IClientCapsService client      = capsService.GetClientCapsService(toId);
         if (client != null)
         {
             IRegionClientCapsService regionClient = client.GetRootCapsService();
             if (regionClient != null)
             {
                 regionPostHandler.SendGridMessageRegionPostHandler(regionClient.Region, toId, message,
                                                                    transactionId);
             }
         }
     }
     catch (Exception e)
     {
         MainConsole.Instance.ErrorFormat("[CURRENCY CONNECTOR] UserCurrencyUpdate to m_ServerURI: {0}", e.ToString());
     }
     return(false);
 }
        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.");
        }
Пример #17
0
        /// <summary>
        ///     Create a Caps URL for the given user/region. Called normally by the EventQueueService or the LLLoginService on login
        /// </summary>
        /// <param name="agentID"></param>
        /// <param name="capsBase"></param>
        /// <param name="regionID"></param>
        /// <param name="isRootAgent">Will this child be a root agent</param>
        /// <param name="circuitData"></param>
        /// <param name="port">The port to use for the CAPS service</param>
        /// <returns></returns>
        public string CreateCAPS(UUID agentID, string capsBase, UUID regionID, bool isRootAgent,
                                 AgentCircuitData circuitData, uint port)
        {
            //Now make sure we didn't use an old one or something
            IClientCapsService service = GetOrCreateClientCapsService(agentID);

            if (service != null)
            {
                IRegionClientCapsService clientService = service.GetOrCreateCapsService(regionID, capsBase, circuitData,
                                                                                        port);

                if (clientService != null)
                {
                    //Fix the root agent status
                    clientService.RootAgent = isRootAgent;

                    MainConsole.Instance.Debug("[CapsService]: Adding Caps URL " + clientService.CapsUrl + " for agent " + agentID);
                    return(clientService.CapsUrl);
                }
            }

            MainConsole.Instance.ErrorFormat("[CapsService]: Unable to create caps for agent {0} on {1}",
                                             agentID, regionID);
            return(string.Empty);
        }
Пример #18
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service          = service;
            m_agentInfoService = service.Registry.RequestModuleInterface <IAgentInfoService>();

            GenericHTTPMethod method = delegate(Hashtable httpMethod)
            {
                return(ProcessUpdateAgentLanguage(httpMethod, m_service.AgentID));
            };

            service.AddStreamHandler("UpdateAgentLanguage", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentLanguage", ""),
                                                                                method));
            method = delegate(Hashtable httpMethod)
            {
                return(ProcessUpdateAgentInfo(httpMethod, m_service.AgentID));
            };
            service.AddStreamHandler("UpdateAgentInformation", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentInformation", ""),
                                                                                   method));

            method = delegate(Hashtable httpMethod)
            {
                return(HomeLocation(httpMethod, m_service.AgentID));
            };
            service.AddStreamHandler("HomeLocation", new RestHTTPHandler("POST", service.CreateCAPS("HomeLocation", ""),
                                                                         method));
        }
Пример #19
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            IConfig displayNamesConfig =
                service.ClientCaps.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource.Configs[
                    "DisplayNamesModule"];
            if (displayNamesConfig != null)
            {
                if (!displayNamesConfig.GetBoolean("Enabled", true))
                    return;
                string bannedNamesString = displayNamesConfig.GetString("BannedUserNames", "");
                if (bannedNamesString != "")
                    bannedNames = new List<string>(bannedNamesString.Split(','));
            }
            m_service = service;
            m_profileConnector = DataManager.RequestPlugin<IProfileConnector>();
            m_eventQueue = service.Registry.RequestModuleInterface<IEventQueueService>();
            m_userService = service.Registry.RequestModuleInterface<IUserAccountService>();

            string post = CapsUtil.CreateCAPS("SetDisplayName", "");
            service.AddCAPS("SetDisplayName", post);
            service.AddStreamHandler("SetDisplayName", new RestHTTPHandler("POST", post,
                                                                           ProcessSetDisplayName));

            post = CapsUtil.CreateCAPS("GetDisplayNames", "");
            service.AddCAPS("GetDisplayNames", post);
            service.AddStreamHandler("GetDisplayNames", new StreamHandler("GET", post,
                                                                          ProcessGetDisplayName));
        }
Пример #20
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_agentInfoService = service.Registry.RequestModuleInterface<IAgentInfoService>();
            
            GenericHTTPMethod method = delegate(Hashtable httpMethod)
            {
                return ProcessUpdateAgentLanguage(httpMethod, m_service.AgentID);
            };
            service.AddStreamHandler("UpdateAgentLanguage", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentLanguage", ""),
                                                      method));
            method = delegate(Hashtable httpMethod)
            {
                return ProcessUpdateAgentInfo(httpMethod, m_service.AgentID);
            };
            service.AddStreamHandler("UpdateAgentInformation", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentInformation", ""),
                                method));

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

            method = delegate(Hashtable httpMethod)
            {
                return HomeLocation(httpMethod, m_service.AgentID);
            };
            service.AddStreamHandler("HomeLocation", new RestHTTPHandler("POST", service.CreateCAPS("HomeLocation", ""),
                                                      method));
        }
        public virtual bool Enqueue(string o, UUID agentID, ulong regionHandle)
        {
            object remoteValue = DoRemote(o, agentID, regionHandle);

            if (remoteValue != null || m_doRemoteOnly)
            {
                return(remoteValue == null ? false : (bool)remoteValue);
            }

            //Find the CapsService for the user and enqueue the event
            IRegionClientCapsService service = GetRegionClientCapsService(agentID, regionHandle);

            if (service == null)
            {
                return(false);
            }
            RegionClientEventQueueService eventQueueService = service.GetServiceConnectors().
                                                              OfType <RegionClientEventQueueService>().FirstOrDefault();

            if (eventQueueService == null)
            {
                return(false);
            }

            OSD ev = OSDParser.DeserializeLLSDXml(o);

            return(eventQueueService.Enqueue(ev));
        }
Пример #22
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            IConfig displayNamesConfig =
                service.ClientCaps.Registry.RequestModuleInterface <ISimulationBase>().ConfigSource.Configs[
                    "DisplayNamesModule"];

            if (displayNamesConfig != null)
            {
                if (!displayNamesConfig.GetBoolean("Enabled", true))
                {
                    return;
                }
                string bannedNamesString = displayNamesConfig.GetString("BannedUserNames", "");
                if (bannedNamesString != "")
                {
                    bannedNames = new List <string>(bannedNamesString.Split(','));
                }
            }
            m_service          = service;
            m_profileConnector = Framework.Utilities.DataManager.RequestPlugin <IProfileConnector>();
            m_eventQueue       = service.Registry.RequestModuleInterface <IEventQueueService>();
            m_userService      = service.Registry.RequestModuleInterface <IUserAccountService>();

            string post = CapsUtil.CreateCAPS("SetDisplayName", "");

            service.AddStreamHandler("SetDisplayName", new GenericStreamHandler("POST", post,
                                                                                ProcessSetDisplayName));

            post = CapsUtil.CreateCAPS("GetDisplayNames", "");
            service.AddStreamHandler("GetDisplayNames", new GenericStreamHandler("GET", post,
                                                                                 ProcessGetDisplayName));
        }
Пример #23
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service          = service;
     m_profileConnector = Framework.Utilities.DataManager.RequestPlugin <IProfileConnector> ();
     m_service.AddStreamHandler("MeshUploadFlag",
                                new GenericStreamHandler("GET", m_service.CreateCAPS("MeshUploadFlag", ""), MeshUploadFlagCAP));
 }
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;

            string capsBase = "/CAPS/EQG/";

            m_capsPath = capsBase + UUID.Random() + "/";


            // Register this as a caps handler
            m_service.AddStreamHandler("EventQueueGet", new GenericStreamHandler("POST", m_capsPath,
                                                                                 delegate(string path, System.IO.Stream request,
                                                                                          OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return(ProcessQueue(httpResponse, service.AgentID));
            }));

            // This will persist this beyond the expiry of the caps handlers
            _isValid = true;
            MainServer.Instance.AddPollServiceHTTPHandler(
                m_capsPath, EventQueuePoll,
                new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, Valid, service.AgentID));

            Random rnd = new Random(Environment.TickCount);

            m_ids = rnd.Next(30000000);
        }
Пример #25
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.");
        }
Пример #26
0
        protected void SendGridMessage(string module, string[] cmd)
        {
            //Combine the params and figure out the message
            string user    = CombineParams(cmd, 3, 5);
            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.Split(' ')[0], user.Split(' ')[1]);

            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("GridWideMessage", message, regionClient.AgentID.ToString()));
                    m_log.Info("Message sent.");
                    return;
                }
            }
            m_log.Info("Could not find user to send message to.");
        }
Пример #27
0
 /// <summary>
 ///     Remove the client from this region
 /// </summary>
 /// <param name="service"></param>
 public void RemoveClientFromRegion(IRegionClientCapsService service)
 {
     if (m_clientsInThisRegion.ContainsKey(service.AgentID))
     {
         m_clientsInThisRegion.Remove(service.AgentID);
     }
 }
Пример #28
0
 /// <summary>
 /// Add this client to the region
 /// </summary>
 /// <param name="service"></param>
 public void AddClientToRegion(IRegionClientCapsService service)
 {
     if (!m_clientsInThisRegion.ContainsKey(service.AgentID))
         m_clientsInThisRegion.Add(service.AgentID, service);
     else //Update the client then... this shouldn't ever happen!
         m_clientsInThisRegion[service.AgentID] = service;
 }
Пример #29
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service = service;
     service.AddStreamHandler("ViewerStats",
                              new GenericStreamHandler("POST", service.CreateCAPS("ViewerStats", ""),
                                                       ViewerStatsReport));
 }
Пример #30
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_gridService = service.Registry.RequestModuleInterface<IGridService>();
            IConfig config =
                service.ClientCaps.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource.Configs["MapCaps"];
            if (config != null)
                m_allowCapsMessage = config.GetBoolean("AllowCapsMessage", m_allowCapsMessage);

#if (!ISWIN)
            RestMethod method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return MapLayerRequest(request, path, param, httpRequest, httpResponse, m_service.AgentID);
            };
#else
            RestMethod method =
                (request, path, param, httpRequest, httpResponse) =>
                MapLayerRequest(request, path, param, httpRequest, httpResponse,
                                m_service.AgentID);
#endif
            m_service.AddStreamHandler("MapLayer",
                                       new RestStreamHandler("POST", m_service.CreateCAPS("MapLayer", m_mapLayerPath),
                                                             method));
            m_service.AddStreamHandler("MapLayerGod",
                                       new RestStreamHandler("POST", m_service.CreateCAPS("MapLayerGod", m_mapLayerPath),
                                                             method));
        }
Пример #31
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service = service;
     service.AddStreamHandler("ViewerStats",
                              new GenericStreamHandler("POST", service.CreateCAPS("ViewerStats", ""),
                                                       ViewerStatsReport));
 }
 public void RegisterCaps (IRegionClientCapsService service)
 {
     m_service = service;
     
     service.AddStreamHandler ("GroupExperiences",
         new GenericStreamHandler ("GET", service.CreateCAPS ("GroupExperiences", ""), GroupExperiences));
 }
Пример #33
0
        public void RegisterCaps (IRegionClientCapsService service)
        {
            m_service = service;
            m_groupService = Framework.Utilities.DataManager.RequestPlugin<IGroupsServiceConnector> ();

            service.AddStreamHandler ("GroupMemberData",
                new GenericStreamHandler ("POST", service.CreateCAPS ("GroupMemberData", ""), GroupMemberData));
        }
Пример #34
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;

            m_service.AddStreamHandler("SimulatorFeatures",
                                       new GenericStreamHandler("GET", m_service.CreateCAPS("SimulatorFeatures", ""),
                                                                SimulatorFeaturesCAP));
        }
Пример #35
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;

            m_service.AddStreamHandler("SimulatorFeatures",
                                       new RestHTTPHandler("GET", m_service.CreateCAPS("SimulatorFeatures", ""),
                                                           SimulatorFeaturesCAP));
        }
Пример #36
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service      = service;
            m_groupService = Framework.Utilities.DataManager.RequestPlugin <IGroupsServiceConnector> ();

            service.AddStreamHandler("GroupMemberData",
                                     new GenericStreamHandler("POST", service.CreateCAPS("GroupMemberData", ""), GroupMemberData));
        }
Пример #37
0
        private void CloseNeighborAgents(GridRegion oldRegion, GridRegion destination, UUID AgentID)
        {
            Util.FireAndForget(delegate(object o)
            {
                //Sleep for 5 seconds to give the agents a chance to cross and get everything right
                Thread.Sleep(5000);
                //Now do a sanity check on the avatar
                IClientCapsService clientCaps = m_registry.RequestModuleInterface <ICapsService>().GetClientCapsService(AgentID);
                if (clientCaps == null)
                {
                    return;
                }
                IRegionClientCapsService rootRegionCaps = clientCaps.GetRootCapsService();
                if (rootRegionCaps == null)
                {
                    return;
                }
                IRegionClientCapsService ourRegionCaps = clientCaps.GetCapsService(destination.RegionHandle);
                if (ourRegionCaps == null)
                {
                    return;
                }
                //If they handles arn't the same, the agent moved, and we can't be sure that we should close these agents
                if (rootRegionCaps.RegionHandle != ourRegionCaps.RegionHandle)
                {
                    return;
                }

                INeighborService service = m_registry.RequestModuleInterface <INeighborService>();
                if (service != null)
                {
                    List <GridRegion> NeighborsOfOldRegion         = service.GetNeighbors(oldRegion);
                    List <GridRegion> NeighborsOfDestinationRegion = service.GetNeighbors(destination);

                    List <GridRegion> byebyeRegions = new List <GridRegion>(NeighborsOfOldRegion);
                    byebyeRegions.Add(oldRegion); //Add the old region, because it might need closed too

                    byebyeRegions.RemoveAll(delegate(GridRegion r)
                    {
                        if (r.RegionID == destination.RegionID)
                        {
                            return(true);
                        }
                        else if (NeighborsOfDestinationRegion.Contains(r))
                        {
                            return(true);
                        }
                        return(false);
                    });

                    if (byebyeRegions.Count > 0)
                    {
                        m_log.Info("[AgentProcessing]: Closing " + byebyeRegions.Count + " child agents around " + oldRegion.RegionName);
                        SendCloseChildAgent(AgentID, byebyeRegions);
                    }
                }
            });
        }
Пример #38
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service = service;
     m_userService = service.Registry.RequestModuleInterface<IUserAccountService>();
     m_profileConnector = DataManager.RequestPlugin<IProfileConnector>();
     m_service.AddStreamHandler("MeshUploadFlag",
                                new GenericStreamHandler("GET", m_service.CreateCAPS("MeshUploadFlag", ""),
                                                    MeshUploadFlagCAP));
 }
        public void RegisterCaps (IRegionClientCapsService service)
        {
            m_service = service;
            m_groupService = Framework.Utilities.DataManager.RequestPlugin<IGroupsServiceConnector> ();

            var apiUri = service.CreateCAPS ("GroupAPIv1", "");
            service.AddStreamHandler ("GroupAPIv1", new GenericStreamHandler ("GET", apiUri, ProcessGetGroupAPI));
            service.AddStreamHandler ("GroupAPIv1", new GenericStreamHandler ("POST", apiUri, ProcessPostGroupAPI));
        }
Пример #40
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service          = service;
     m_userService      = service.Registry.RequestModuleInterface <IUserAccountService>();
     m_profileConnector = DataManager.RequestPlugin <IProfileConnector>();
     m_service.AddStreamHandler("MeshUploadFlag",
                                new GenericStreamHandler("GET", m_service.CreateCAPS("MeshUploadFlag", ""),
                                                         MeshUploadFlagCAP));
 }
Пример #41
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service          = service;
            m_assetService     = service.Registry.RequestModuleInterface <IAssetService>();
            m_inventoryService = service.Registry.RequestModuleInterface <IInventoryService>();
            m_libraryService   = service.Registry.RequestModuleInterface <ILibraryService>();

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

            service.AddStreamHandler("WebFetchInventoryDescendents",
                                     new RestStreamHandler("POST", service.CreateCAPS("WebFetchInventoryDescendents", ""),
                                                           method));

            method = delegate(string request, string path, string param,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return(HandleFetchLibDescendents(request, m_service.AgentID));
            };
            service.AddStreamHandler("FetchLibDescendents",
                                     new RestStreamHandler("POST", service.CreateCAPS("FetchLibDescendents", ""),
                                                           method));

            method = delegate(string request, string path, string param,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return(HandleFetchInventory(request, m_service.AgentID));
            };
            service.AddStreamHandler("FetchInventory",
                                     new RestStreamHandler("POST", service.CreateCAPS("FetchInventory", ""),
                                                           method));

            method = delegate(string request, string path, string param,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return(HandleFetchLib(request, m_service.AgentID));
            };
            service.AddStreamHandler("FetchLib",
                                     new RestStreamHandler("POST", service.CreateCAPS("FetchLib", ""),
                                                           method));

            service.AddStreamHandler("NewFileAgentInventory",
                                     new RestStreamHandler("POST", service.CreateCAPS("NewFileAgentInventory", m_newInventory),
                                                           NewAgentInventoryRequest));

            method = delegate(string request, string path, string param,
                              OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return(HandleInventoryItemCreate(request, m_service.AgentID));
            };
            service.AddStreamHandler("InventoryItemCreate",
                                     new RestStreamHandler("POST", service.CreateCAPS("InventoryItemCreate", ""),
                                                           method));
        }
Пример #42
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));
        }
Пример #43
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));
        }
Пример #44
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_assetService = service.Registry.RequestModuleInterface<IAssetService>();
            m_inventoryService = service.Registry.RequestModuleInterface<IInventoryService>();
            m_libraryService = service.Registry.RequestModuleInterface<ILibraryService>();

            RestBytesMethod method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleWebFetchInventoryDescendents(request, m_service.AgentID);
            };
            service.AddStreamHandler("WebFetchInventoryDescendents",
                new RestBytesStreamHandler("POST", service.CreateCAPS("WebFetchInventoryDescendents", ""),
                                                      method));

            method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleFetchLibDescendents(request, m_service.AgentID);
            };
            service.AddStreamHandler("FetchLibDescendents",
                new RestBytesStreamHandler("POST", service.CreateCAPS("FetchLibDescendents", ""),
                                                      method));

            method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleFetchInventory(request, m_service.AgentID);
            };
            service.AddStreamHandler("FetchInventory",
                new RestBytesStreamHandler("POST", service.CreateCAPS("FetchInventory", ""),
                                                      method));

            method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleFetchLib(request, m_service.AgentID);
            };
            service.AddStreamHandler("FetchLib",
                new RestBytesStreamHandler("POST", service.CreateCAPS("FetchLib", ""),
                                                      method));

            service.AddStreamHandler("NewFileAgentInventory",
                new RestStreamHandler("POST", service.CreateCAPS("NewFileAgentInventory", m_newInventory),
                                                      NewAgentInventoryRequest));

            /*method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleInventoryItemCreate(request, m_service.AgentID);
            };
            service.AddStreamHandler("InventoryItemCreate",
                new RestBytesStreamHandler("POST", service.CreateCAPS("InventoryItemCreate", ""),
                                                      method));*/
        }
        public void RegisterCaps (IRegionClientCapsService service)
        {
            m_service = service;

            // retrieve our god's if needed
            InitGodNames ();

            m_service.AddStreamHandler ("SimulatorFeatures",
                new GenericStreamHandler ("GET", m_service.CreateCAPS ("SimulatorFeatures", ""), SimulatorFeaturesCAP));
        }
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service = service;
     m_imService = service.Registry.RequestModuleInterface<IInstantMessagingService>();
     if (m_imService != null)
     {
         service.AddStreamHandler("ChatSessionRequest",
                                  new GenericStreamHandler("POST", service.CreateCAPS("ChatSessionRequest", ""), ChatSessionRequest));
     }
 }
        public void RegisterCaps (IRegionClientCapsService service)
        {
            m_service = service;

            m_service.AddStreamHandler ("SimulatorFeatures", new RestHTTPHandler ("GET", m_service.CreateCAPS ("SimulatorFeatures", ""),
                                                      delegate (Hashtable m_dhttpMethod)
                                                      {
                                                          return SimulatorFeaturesCAP (m_dhttpMethod);
                                                      }));
        }
Пример #48
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service = service;
     m_userService = service.Registry.RequestModuleInterface<IUserAccountService>();
     m_profileConnector = DataManager.RequestPlugin<IProfileConnector>();
     m_service.AddStreamHandler("MeshUploadFlag", new RestHTTPHandler("GET", m_service.CreateCAPS("MeshUploadFlag", ""),
                                               delegate(Hashtable m_dhttpMethod)
                                               {
                                                   return MeshUploadFlagCAP(m_dhttpMethod);
                                               }));
 }
Пример #49
0
        public void RegisterCaps(UUID agentID, IRegionClientCapsService caps)
        {
            UUID capuuid = UUID.Random();

            caps.AddStreamHandler("ViewerStartAuction",
                                new RestHTTPHandler("POST", "/CAPS/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ViewerStartAuction(m_dhttpMethod, capuuid);
                                                      }));
        }
Пример #50
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service = service;
     m_assetService = service.Registry.RequestModuleInterface<IAssetService>();
     
     service.AddStreamHandler("GetTexture", 
         new StreamHandler("GET", service.CreateCAPS("GetTexture", ""),
                                                 ProcessGetTexture));
     service.AddStreamHandler("UploadBakedTexture", 
         new RestStreamHandler("POST", service.CreateCAPS("UploadBakedTexture", m_uploadBakedTexturePath),
                                                 UploadBakedTexture));
 }
Пример #51
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_gridService = service.Registry.RequestModuleInterface<IGridService>();

            RestMethod method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return MapLayerRequest(request, path, param, httpRequest, httpResponse, m_service.AgentID);
            };
            m_service.AddStreamHandler("MapLayer", new RestStreamHandler("POST", m_service.CreateCAPS("MapLayer", m_mapLayerPath),
                                                      method));
        }
        public void RegisterCaps (IRegionClientCapsService service)
        {
            m_service = service;
            
            HttpServerHandle method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) {
                return ProcessUpdateAgentPreferences (request, m_service.AgentID);
            };

            service.AddStreamHandler ("AgentPreferences",
                new GenericStreamHandler ("POST", service.CreateCAPS ("AgentPreferences", ""), method));
			
            service.AddStreamHandler ("UpdateAgentLanguage",
                new GenericStreamHandler ("POST", service.CreateCAPS ("UpdateAgentLanguage", ""), method));
			
            service.AddStreamHandler ("UpdateAgentInformation",
                new GenericStreamHandler ("POST", service.CreateCAPS ("UpdateAgentInformation", ""), method));
        }
Пример #53
0
        public void RegisterCaps(UUID agentID, IRegionClientCapsService caps)
        {
            UUID capuuid = UUID.Random();
            
            caps.AddStreamHandler("ObjectAdd",
                                 new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/",
                                                       delegate(Hashtable m_dhttpMethod)
                                                       {
                                                           return ProcessAdd(m_dhttpMethod, agentID, caps);
                                                       }));

            caps.AddStreamHandler("ServerReleaseNotes",
                                new RestHTTPHandler("POST", "/CAPS/ServerReleaseNotes/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessServerReleaseNotes(m_dhttpMethod, agentID, capuuid);
                                                      }));
        }
Пример #54
0
 public void RegisterCaps(IRegionClientCapsService service)
 {
     m_service = service;
     m_assetService = service.Registry.RequestModuleInterface<IAssetService>();
     
     service.AddStreamHandler("GetTexture", 
         new StreamHandler("GET", service.CreateCAPS("GetTexture", ""),
                                                 ProcessGetTexture));
     service.AddStreamHandler ("UploadBakedTexture",
         new RestStreamHandler ("POST", service.CreateCAPS ("UploadBakedTexture", m_uploadBakedTexturePath),
                                                 UploadBakedTexture));
     service.AddStreamHandler ("GetMesh",
         new RestHTTPHandler("GET", service.CreateCAPS ("GetMesh", ""),
                                                delegate(Hashtable m_dhttpMethod)
                                                {
                                                    return ProcessGetMesh(m_dhttpMethod);
                                                }));
 }
Пример #55
0
        /// <summary>
        /// Set up the CAPS for display names
        /// </summary>
        /// <param name="agentID"></param>
        /// <param name="caps"></param>
        public void RegisterCaps(UUID agentID, IRegionClientCapsService caps)
        {
            UUID capuuid = UUID.Random();

            caps.AddStreamHandler("SetDisplayName",
                                new RestHTTPHandler("POST", "/CAPS" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessSetDisplayName(m_dhttpMethod, agentID);
                                                      }));

            capuuid = UUID.Random();

            caps.AddStreamHandler("GetDisplayNames",
                                new RestHTTPHandler("POST", "/CAPS" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessGetDisplayName(m_dhttpMethod, agentID);
                                                      }));
        }
Пример #56
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_gridService = service.Registry.RequestModuleInterface<IGridService>();
            IConfig config =
                service.ClientCaps.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource.Configs["MapCaps"];
            if (config != null)
                m_allowCapsMessage = config.GetBoolean("AllowCapsMessage", m_allowCapsMessage);

            HttpServerHandle method = delegate(string path, Stream request, OSHttpRequest httpRequest,
                                                            OSHttpResponse httpResponse)
            {
                return MapLayerRequest(request.ReadUntilEnd(), httpRequest, httpResponse, m_service.AgentID);
            };
            m_service.AddStreamHandler("MapLayer",
                                       new GenericStreamHandler("POST", m_service.CreateCAPS("MapLayer", ""),
                                                             method));
            m_service.AddStreamHandler("MapLayerGod",
                                       new GenericStreamHandler("POST", m_service.CreateCAPS("MapLayerGod", ""),
                                                             method));
        }
Пример #57
0
        public virtual void EnableChildAgentsForPosition(IRegionClientCapsService caps, Vector3 position)
        {
            Util.FireAndForget((o) =>
                                   {
                                       int count = 0;
                                       IGridService gridService = m_registry.RequestModuleInterface<IGridService>();
                                       int xMin = (caps.Region.RegionLocX) + (int)(position.X) - ((gridService != null ? gridService.GetRegionViewSize() : 1) * caps.Region.RegionSizeX);
                                       int xMax = (caps.Region.RegionLocX) + (int) (position.X) + 256;
                                       int yMin = (caps.Region.RegionLocY) + (int)(position.Y) - ((gridService != null ? gridService.GetRegionViewSize() : 1) * caps.Region.RegionSizeY);
                                       int yMax = (caps.Region.RegionLocY) + (int) (position.Y) + 256;

                                       //Ask the grid service about the range
                                       List<GridRegion> neighbors =
                                           m_registry.RequestModuleInterface<IGridService>().GetRegionRange(caps.ClientCaps.AccountInfo.AllScopeIDs,
                                                                                                            xMin, xMax,
                                                                                                            yMin, yMax);

                                       ICapsService capsService = m_registry.RequestModuleInterface<ICapsService>();
                                       IClientCapsService clientCaps = capsService.GetClientCapsService(caps.AgentID);
                                       foreach (GridRegion neighbor in neighbors)
                                       {
                                           if (neighbor.RegionHandle != caps.RegionHandle &&
                                               clientCaps.GetCapsService(neighbor.RegionHandle) == null)
                                           {
                                               string reason;
                                               AgentCircuitData regionCircuitData = caps.CircuitData.Copy();
                                               GridRegion nCopy = neighbor;
                                               regionCircuitData.child = true; //Fix child agent status
                                               regionCircuitData.roothandle = caps.RegionHandle;
                                               regionCircuitData.reallyischild = true;
                                               bool useCallbacks = false;
                                               InformClientOfNeighbor(caps.AgentID, caps.RegionHandle, regionCircuitData,
                                                                      ref nCopy,
                                                                      (uint) TeleportFlags.Default, null, out reason,
                                                                      out useCallbacks);
                                           }
                                           count++;
                                       }
                                   });
        }
Пример #58
0
        public virtual void LogoutAgent(IRegionClientCapsService regionCaps, bool kickRootAgent)
        {
            //Close all neighbor agents as well, the root is closing itself, so don't call them
            ISimulationService SimulationService = m_registry.RequestModuleInterface<ISimulationService>();
            if (SimulationService != null)
            {
                IGridService GridService = m_registry.RequestModuleInterface<IGridService>();
                if (GridService != null)
                {
#if (!ISWIN)
                    foreach (IRegionClientCapsService regionClient in regionCaps.ClientCaps.GetCapsServices())
                    {
                        if (regionClient.RegionHandle != regionCaps.RegionHandle && regionClient.Region != null)
                        {
                            SimulationService.CloseAgent(regionClient.Region, regionCaps.AgentID);
                        }
                    }
#else
                    foreach (IRegionClientCapsService regionClient in regionCaps.ClientCaps.GetCapsServices().Where(regionClient => regionClient.RegionHandle != regionCaps.RegionHandle && regionClient.Region != null))
                    {
                        SimulationService.CloseAgent(regionClient.Region, regionCaps.AgentID);
                    }
#endif
                }
            }
            if (kickRootAgent && regionCaps.Region != null) //Kick the root agent then
                SimulationService.CloseAgent(regionCaps.Region, regionCaps.AgentID);
            //Close all caps
            regionCaps.ClientCaps.Close();

            IAgentInfoService agentInfoService = m_registry.RequestModuleInterface<IAgentInfoService>();
            if (agentInfoService != null)
                agentInfoService.SetLoggedIn(regionCaps.AgentID.ToString(), false, true, UUID.Zero);

            ICapsService capsService = m_registry.RequestModuleInterface<ICapsService>();
            if (capsService != null)
                capsService.RemoveCAPS(regionCaps.AgentID);
        }
Пример #59
0
        private bool CreateAgent(GridRegion region, IRegionClientCapsService regionCaps, ref AgentCircuitData aCircuit,
            ISimulationService SimulationService, ref int requestedUDPPort, out string reason)
        {
            CachedUserInfo info = new CachedUserInfo();
            IAgentConnector con = Aurora.DataManager.DataManager.RequestPlugin<IAgentConnector>();
            if (con != null)
                info.AgentInfo = con.GetAgent(aCircuit.AgentID);
            info.UserAccount = regionCaps.ClientCaps.AccountInfo;

            IGroupsServiceConnector groupsConn = Aurora.DataManager.DataManager.RequestPlugin<IGroupsServiceConnector>();
            if (groupsConn != null)
            {
                info.ActiveGroup = groupsConn.GetGroupMembershipData(aCircuit.AgentID, UUID.Zero, aCircuit.AgentID);
                info.GroupMemberships = groupsConn.GetAgentGroupMemberships(aCircuit.AgentID, aCircuit.AgentID);
            }
            aCircuit.OtherInformation["CachedUserInfo"] = info.ToOSD();
            return SimulationService.CreateAgent(region, aCircuit, aCircuit.teleportFlags, null,
                                                    out requestedUDPPort, out reason);
        }
Пример #60
0
        public virtual void SendChildAgentUpdateAsync(AgentPosition agentpos, IRegionClientCapsService regionCaps)
        {
            //We need to send this update out to all the child agents this region has
            IGridService service = m_registry.RequestModuleInterface<IGridService>();
            if (service != null)
            {
                ISimulationService SimulationService = m_registry.RequestModuleInterface<ISimulationService>();
                if (SimulationService != null)
                {
                    //Set the last location in the database
                    IAgentInfoService agentInfoService = m_registry.RequestModuleInterface<IAgentInfoService>();
                    if (agentInfoService != null)
                    {
                        //Find the lookAt vector
                        Vector3 lookAt = new Vector3(agentpos.AtAxis.X, agentpos.AtAxis.Y, 0);

                        if (lookAt != Vector3.Zero)
                            lookAt = Util.GetNormalizedVector(lookAt);
                        //Update the database
                        agentInfoService.SetLastPosition(regionCaps.AgentID.ToString(), regionCaps.Region.RegionID,
                                                         agentpos.Position, lookAt);
                    }

                    //Also update the service itself
                    regionCaps.LastPosition = agentpos.Position;
                    if (agentpos.UserGoingOffline)
                        return; //It just needed a last pos update

                    //Tell all neighbor regions about the new position as well
                    List<GridRegion> ourNeighbors = GetRegions(regionCaps.ClientCaps);
                    foreach (GridRegion region in ourNeighbors.Where(region => region != null && !SimulationService.UpdateAgent(region, agentpos)))
                    {
                        MainConsole.Instance.Info("[AgentProcessing]: Failed to inform " + region.RegionName +
                                   " about updating agent. ");
                    }

                    EnableChildAgentsForPosition(regionCaps, agentpos.Position);
                }
            }
        }