public OSDMap GetExternalCaps(UUID agentID, GridRegion region)
        {
            if (m_registry == null) return new OSDMap();
            OSDMap resp = new OSDMap();
            if (m_registry.RequestModuleInterface<IGridServerInfoService>() != null)
            {
                m_servers = m_registry.RequestModuleInterface<IGridServerInfoService>().GetGridURIs("SyncMessageServerURI");
                OSDMap req = new OSDMap();
                req["AgentID"] = agentID;
                req["Region"] = region.ToOSD();
                req["Method"] = "GetCaps";

                List<ManualResetEvent> events = new List<ManualResetEvent>();
                foreach (string uri in m_servers)
                {
                    ManualResetEvent even = new ManualResetEvent(false);
                    m_syncPoster.Get(uri, req, (r) =>
                    {
                        if (r == null)
                            return;
                        foreach (KeyValuePair<string, OSD> kvp in r)
                            resp.Add(kvp.Key, kvp.Value);
                        even.Set();
                    });
                    events.Add(even);
                }
                ManualResetEvent.WaitAll(events.ToArray());
            }
            foreach (var h in GetHandlers(agentID, region.RegionID))
            {
                if (m_allowedCapsModules.Contains(h.Name))
                    h.IncomingCapsRequest(agentID, region, m_registry.RequestModuleInterface<ISimulationBase>(), ref resp);
            }
            return resp;
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Method"]      = "CreateObjectRequest";
            map["Destination"] = Destination.ToOSD();
            map["Object"]      = Object.ToBinaryXml2();
            return(map);
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Method"]      = "CloseAgentRequest";
            map["AgentID"]     = AgentID;
            map["Destination"] = Destination.ToOSD();
            return(map);
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Method"]      = "UpdateAgentDataRequest";
            map["Destination"] = Destination.ToOSD();
            map["Update"]      = Update.ToOSD();
            return(map);
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Method"]         = "RetrieveAgentRequest";
            map["AgentID"]        = AgentID;
            map["Destination"]    = Destination.ToOSD();
            map["AgentIsLeaving"] = AgentIsLeaving;
            return(map);
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Method"]      = "MakeChildAgentRequest";
            map["AgentID"]     = AgentID;
            map["Destination"] = Destination.ToOSD();
            map["IsCrossing"]  = IsCrossing;
            return(map);
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Method"]        = "CreateAgentRequest";
            map["Destination"]   = Destination.ToOSD();
            map["TeleportFlags"] = TeleportFlags;
            map["CircuitData"]   = CircuitData.ToOSD();
            return(map);
        }
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Method"]         = "FailedToTeleportAgentRequest";
            map["AgentID"]        = AgentID;
            map["Destination"]    = Destination.ToOSD();
            map["IsCrossing"]     = IsCrossing;
            map["Reason"]         = Reason;
            map["FailedRegionID"] = FailedRegionID;
            return(map);
        }
        public OSDMap GetExternalCaps(UUID agentID, GridRegion region)
        {
            if (m_registry == null)
            {
                return(new OSDMap());
            }
            OSDMap resp = new OSDMap();

            if (m_registry.RequestModuleInterface <IGridServerInfoService>() != null)
            {
                m_servers = m_registry.RequestModuleInterface <IGridServerInfoService>().GetGridURIs("SyncMessageServerURI");
                OSDMap req = new OSDMap();
                req["AgentID"] = agentID;
                req["Region"]  = region.ToOSD();
                req["Method"]  = "GetCaps";

                List <ManualResetEvent> events = new List <ManualResetEvent>();
                foreach (string uri in m_servers.Where((u) => (!u.Contains(MainServer.Instance.Port.ToString()))))
                {
                    ManualResetEvent even = new ManualResetEvent(false);
                    m_syncPoster.Get(uri, req, (r) =>
                    {
                        if (r == null)
                        {
                            return;
                        }
                        foreach (KeyValuePair <string, OSD> kvp in r)
                        {
                            resp.Add(kvp.Key, kvp.Value);
                        }
                        even.Set();
                    });
                    events.Add(even);
                }
                if (events.Count > 0)
                {
                    ManualResetEvent.WaitAll(events.ToArray());
                }
            }
            foreach (var h in GetHandlers(agentID, region.RegionID))
            {
                if (m_allowedCapsModules.Contains(h.Name))
                {
                    h.IncomingCapsRequest(agentID, region, m_registry.RequestModuleInterface <ISimulationBase>(), ref resp);
                }
            }
            return(resp);
        }
Example #10
0
        public override OSDMap ToOSD()
        {
            OSDMap map = new OSDMap();

            map["Error"]       = Error;
            map["Neighbors"]   = new OSDArray(Neighbors.ConvertAll <OSD>((region) => region.ToOSD()));
            map["SessionID"]   = SessionID;
            map["RegionFlags"] = RegionFlags;
            if (Region != null)
            {
                map["Region"] = Region.ToOSD();
            }
            if (URIs != null)
            {
                map["URIs"] = URIs.ToOSDMap();
            }
            return(map);
        }
Example #11
0
        public bool Store(GridRegion region)
        {
            if (region.EstateOwner == UUID.Zero)
            {
                IEstateConnector EstateConnector = Framework.Utilities.DataManager.RequestPlugin <IEstateConnector>();
                EstateSettings   ES = null;
                if (EstateConnector != null)
                {
                    ES = EstateConnector.GetEstateSettings(region.RegionID);
                    if (ES != null)
                    {
                        region.EstateOwner = ES.EstateOwner;
                    }
                }
                if (region.EstateOwner == UUID.Zero && ES != null && ES.EstateID != 0)
                {
                    MainConsole.Instance.Error(
                        "[LocalGridConnector] Attempt to store region with owner of UUID.Zero detected:" +
                        (new System.Diagnostics.StackTrace()).GetFrame(1).ToString());
                }
            }

            Dictionary <string, object> row = new Dictionary <string, object>(14);

            row["ScopeID"]    = region.ScopeID;
            row["RegionUUID"] = region.RegionID;
            row["RegionName"] = region.RegionName;
            row["LocX"]       = region.RegionLocX;
            row["LocY"]       = region.RegionLocY;
            row["LocZ"]       = region.RegionLocZ;
            row["OwnerUUID"]  = region.EstateOwner;
            row["Access"]     = region.Access;
            row["SizeX"]      = region.RegionSizeX;
            row["SizeY"]      = region.RegionSizeY;
            row["SizeZ"]      = region.RegionSizeZ;
            row["Flags"]      = region.Flags;
            row["SessionID"]  = region.SessionID;
            row["Info"]       = OSDParser.SerializeJsonString(region.ToOSD());

            return(GD.Replace(m_realm, row));
        }
        public void RemoveExternalCaps(UUID agentID, GridRegion region)
        {
            OSDMap req = new OSDMap();

            req["AgentID"] = agentID;
            req["Region"]  = region.ToOSD();
            req["Method"]  = "RemoveCaps";

            foreach (string uri in m_servers)
            {
                m_syncPoster.Post(uri, req);
            }

            foreach (var h in GetHandlers(agentID, region.RegionID))
            {
                if (m_allowedCapsModules.Contains(h.Name))
                {
                    h.IncomingCapsDestruction();
                }
            }
        }
Example #13
0
        public void RemoveExternalCaps(UUID agentID, GridRegion region)
        {
            OSDMap req = new OSDMap();
            req["AgentID"] = agentID;
            req["Region"] = region.ToOSD();
            req["Method"] = "RemoveCaps";

            foreach (string uri in m_servers)
                m_syncPoster.Post(uri, req);

            foreach (var h in GetHandlers(agentID, region.RegionID))
            {
                if (m_allowedCapsModules.Contains(h.Name))
                    h.IncomingCapsDestruction();
            }
        }