Пример #1
0
            public ViewerConnection(SceneList scenes, UUID agentID, UUID sceneID, UUID partID, UUID itemID)
            {
                m_Scenes  = scenes;
                AgentID   = agentID;
                m_SceneID = sceneID;
                m_PartID  = partID;
                m_ItemID  = itemID;

                ClientUDP = new UDPCircuitsManager(new System.Net.IPAddress(0), 0, null, null, null, new List <IPortControlServiceInterface>());
                ClientUDP.Start();
            }
Пример #2
0
        protected SceneImplementation(
            SceneImplementationFactory sceneParams,
            RegionInfo ri)
            : base(ri.Size.X, ri.Size.Y)
        {
            SceneCapabilities.Add("ProductInfoRequest", new ProductInfoRequestCapability(this));
            m_Scenes     = sceneParams.Scenes;
            m_HttpServer = sceneParams.HttpServer;
            if (sceneParams.AssetService == null)
            {
                throw new ArgumentNullException("persistentAssetService");
            }
            if (sceneParams.GridService == null)
            {
                throw new ArgumentNullException("gridService");
            }
            if (ri == null)
            {
                throw new ArgumentNullException(nameof(ri));
            }
            if (sceneParams.AvatarNameServices == null)
            {
                throw new ArgumentNullException("avatarNameServices");
            }
            if (sceneParams.SimulationDataStorage == null)
            {
                throw new ArgumentNullException("simulationDataStorage");
            }
            if (sceneParams.EstateService == null)
            {
                throw new ArgumentNullException("estateService");
            }
            if (sceneParams.m_CapabilitiesConfig == null)
            {
                throw new ArgumentNullException("capabilitiesConfig");
            }
            if (sceneParams.RegionStorage == null)
            {
                throw new ArgumentNullException("regionStorage");
            }

            #region Setup services
            m_ChatService           = sceneParams.ChatFactory.Instantiate(ri.ID);
            RegionStorage           = sceneParams.RegionStorage;
            GroupsNameService       = sceneParams.GroupsNameService;
            GroupsService           = sceneParams.GroupsService;
            m_NeighborService       = sceneParams.NeighborService;
            m_SimulationDataStorage = sceneParams.SimulationDataStorage;
            PersistentAssetService  = sceneParams.AssetService;
            TemporaryAssetService   = sceneParams.AssetCacheService;
            GridService             = sceneParams.GridService;
            ExperienceService       = sceneParams.ExperienceService;
            ExperienceNameService   = sceneParams.ExperienceNameService;
            EstateService           = sceneParams.EstateService;
            /* next line is there to break the circular dependencies */
            TryGetScene = m_Scenes.TryGetValue;

            UserAgentServicePlugins.AddRange(sceneParams.UserAgentServicePlugins);
            AssetServicePlugins.AddRange(sceneParams.AssetServicePlugins);
            InventoryServicePlugins.AddRange(sceneParams.InventoryServicePlugins);

            #endregion

            #region Setup Region Data
            ID                        = ri.ID;
            GatekeeperURI             = ri.GridURI;
            Access                    = ri.Access;
            ID                        = ri.ID;
            Name                      = ri.Name;
            Owner                     = ri.Owner;
            GridPosition              = ri.Location;
            ProductName               = ri.ProductName;
            RegionPort                = ri.ServerPort;
            m_ExternalHostNameService = sceneParams.ExternalHostNameService;
            #endregion

            /* load estate flags cache */
            uint       estateID;
            EstateInfo estate;
            if (EstateService.RegionMap.TryGetValue(ID, out estateID) &&
                EstateService.TryGetValue(estateID, out estate))
            {
                m_EstateData = estate;
            }
            else
            {
                throw new ArgumentException("Could not load estate data");
            }

            m_RestartObject    = new RestartObject(m_Scenes, this, sceneParams, sceneParams.RegionStorage);
            m_IMService        = sceneParams.IMService;
            m_UDPServer        = new UDPCircuitsManager(new IPAddress(0), (int)ri.ServerPort, sceneParams.IMService, m_ChatService, this, sceneParams.PortControlServices);
            CapabilitiesConfig = sceneParams.m_CapabilitiesConfig;
            foreach (AvatarNameServiceInterface avNameService in sceneParams.AvatarNameServices)
            {
                AvatarNameServices.Add(avNameService);
            }

            Terrain     = new TerrainController(this);
            Environment = new EnvironmentController(this, sceneParams.WindModelFactory);

            if (sceneParams.PathfindingServiceFactory != null)
            {
                PathfindingService = sceneParams.PathfindingServiceFactory.Instantiate(this);
            }

            m_IMRouter = sceneParams.IMRouter;
            m_IMRouter.SceneIM.Add(IMSend);
            OnRemove += RemoveScene;
            m_UDPServer.Start();

            ScriptThreadPool = sceneParams.ScriptWorkerThreadPoolFactory.InstantiateThreadPool(ID);
        }