当前位置: 首页>>代码示例>>C#>>正文


C# ISimulationDataService类代码示例

本文整理汇总了C#中ISimulationDataService的典型用法代码示例。如果您正苦于以下问题:C# ISimulationDataService类的具体用法?C# ISimulationDataService怎么用?C# ISimulationDataService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISimulationDataService类属于命名空间,在下文中一共展示了ISimulationDataService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestScene

 public TestScene(
     RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene,
     SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService,
     IConfigSource config, string simulatorVersion)
     : base(regInfo, authen, physicsScene, sceneGridService, simDataService, estateDataService,
            config, simulatorVersion)
 {
 }
开发者ID:ffoliveira,项目名称:opensimulator,代码行数:8,代码来源:TestScene.cs

示例2: TestScene

 public TestScene(
     RegionInfo regInfo, AgentCircuitManager authen, 
     ISimulationDataService simDataService, IEstateDataService estateDataService,
     IConfigSource config, string simulatorVersion)
     : base(regInfo, authen, simDataService, estateDataService,
            config, simulatorVersion)
 {
 }
开发者ID:CassieEllen,项目名称:opensim,代码行数:8,代码来源:TestScene.cs

示例3: TestScene

 public TestScene(
     RegionInfo regInfo, AgentCircuitManager authen,
     SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService,
     ModuleLoader moduleLoader, bool dumpAssetsToFile,
     IConfigSource config, string simulatorVersion)
     : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader,
            dumpAssetsToFile, config, simulatorVersion)
 {
 }
开发者ID:JAllard,项目名称:opensim,代码行数:9,代码来源:TestScene.cs

示例4: ProcessBackup

        /// <summary>
        /// Processes backup.
        /// </summary>
        /// <param name="datastore"></param>
        public virtual void ProcessBackup(ISimulationDataService datastore, bool forcedBackup)
        {
            if (!m_isBackedUp)
            {
//                m_log.DebugFormat(
//                    "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID);
                return;
            }

            if (IsDeleted || UUID == UUID.Zero)
            {
//                m_log.DebugFormat(
//                    "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
                return;
            }

            // Since this is the top of the section of call stack for backing up a particular scene object, don't let
            // any exception propogate upwards.
            try
            {
                if (!m_scene.ShuttingDown) // if shutting down then there will be nothing to handle the return so leave till next restart
                {
                    ILandObject parcel = m_scene.LandChannel.GetLandObject(
                            m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);

                    if (parcel != null && parcel.LandData != null &&
                            parcel.LandData.OtherCleanTime != 0)
                    {
                        if (parcel.LandData.OwnerID != OwnerID &&
                                (parcel.LandData.GroupID != GroupID ||
                                parcel.LandData.GroupID == UUID.Zero))
                        {
                            if ((DateTime.UtcNow - RootPart.Rezzed).TotalMinutes >
                                    parcel.LandData.OtherCleanTime)
                            {
                                DetachFromBackup();
                                m_log.DebugFormat(
                                    "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", 
                                     RootPart.UUID);
                                m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
                                m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
                                        DeRezAction.Return, UUID.Zero);

                                return;
                            }
                        }
                    }
                }

                if (m_scene.UseBackup && HasGroupChanged)
                {
                    // don't backup while it's selected or you're asking for changes mid stream.
                    if (isTimeToPersist() || forcedBackup)
                    {
//                        m_log.DebugFormat(
//                            "[SCENE]: Storing {0}, {1} in {2}",
//                            Name, UUID, m_scene.RegionInfo.RegionName);

                        SceneObjectGroup backup_group = Copy(false);
                        backup_group.RootPart.Velocity = RootPart.Velocity;
                        backup_group.RootPart.Acceleration = RootPart.Acceleration;
                        backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
                        backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
                        HasGroupChanged = false;
                        HasGroupChangedDueToDelink = false;

                        m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
                        datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);

                        backup_group.ForEachPart(delegate(SceneObjectPart part) 
                        { 
                            part.Inventory.ProcessInventoryBackup(datastore); 
                        });

                        backup_group = null;
                    }
//                    else
//                    {
//                        m_log.DebugFormat(
//                            "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
//                            Name, UUID, IsSelected);
//                    }
                }
            }
            catch (Exception e)
            {
                m_log.ErrorFormat(
                    "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}", 
                    Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace);
            }
        }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:95,代码来源:SceneObjectGroup.cs

示例5: ProcessInventoryBackup

        /// <summary>
        /// Process inventory backup
        /// </summary>
        /// <param name="datastore"></param>
        public void ProcessInventoryBackup(ISimulationDataService datastore)
        {
            if (HasInventoryChanged)
            {
                HasInventoryChanged = false;
                List<TaskInventoryItem> items = GetInventoryItems();
                datastore.StorePrimInventory(m_part.UUID, items);

            }
        }
开发者ID:openmetaversefoundation,项目名称:fortis-opensim,代码行数:14,代码来源:SceneObjectPartInventory.cs

示例6: CreateScene

        protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
            IEstateDataService estateDataService, AgentCircuitManager circuitManager)
        {
            SceneCommunicationService sceneGridService = new SceneCommunicationService();

            return new Scene(
                regionInfo, circuitManager, sceneGridService,
                simDataService, estateDataService, m_moduleLoader, false, m_configSettings.PhysicalPrim,
                m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
        }
开发者ID:NovaGrid,项目名称:opensim,代码行数:10,代码来源:OpenSimBase.cs

示例7: Scene

        public Scene(RegionInfo regInfo, AgentCircuitManager authen, 
                     ISimulationDataService simDataService, IEstateDataService estateDataService,
                     IConfigSource config, string simulatorVersion)
            : this(regInfo)
        {
            m_config = config;
            FrameTime = 0.0908f;
            FrameTimeWarnPercent = 60;
            FrameTimeCritPercent = 40;
            Normalized55FPS = true;
            MinMaintenanceTime = 1;
            SeeIntoRegion = true;

            Random random = new Random();

            m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4);
            m_authenticateHandler = authen;
            m_sceneGridService = new SceneCommunicationService();
            m_SimulationDataService = simDataService;
            m_EstateDataService = estateDataService;

            m_lastIncoming = 0;
            m_lastOutgoing = 0;

            m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
            m_asyncSceneObjectDeleter.Enabled = true;

            m_asyncInventorySender = new AsyncInventorySender(this);

            #region Region Settings

            // Load region settings
            // LoadRegionSettings creates new region settings in persistence if they don't already exist for this region.
            // However, in this case, the default textures are not set in memory properly, so we need to do it here and
            // resave.
            // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new
            // region is set up and avoid these gyrations.
            RegionSettings rs = simDataService.LoadRegionSettings(RegionInfo.RegionID);
            m_extraSettings = simDataService.GetExtra(RegionInfo.RegionID);

            bool updatedTerrainTextures = false;
            if (rs.TerrainTexture1 == UUID.Zero)
            {
                rs.TerrainTexture1 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_1;
                updatedTerrainTextures = true;
            }

            if (rs.TerrainTexture2 == UUID.Zero)
            {
                rs.TerrainTexture2 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_2;
                updatedTerrainTextures = true;
            }

            if (rs.TerrainTexture3 == UUID.Zero)
            {
                rs.TerrainTexture3 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_3;
                updatedTerrainTextures = true;
            }

            if (rs.TerrainTexture4 == UUID.Zero)
            {
                rs.TerrainTexture4 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_4;
                updatedTerrainTextures = true;
            }

            if (updatedTerrainTextures)
                rs.Save();

            RegionInfo.RegionSettings = rs;

            if (estateDataService != null)
                RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false);

            #endregion Region Settings

            //Bind Storage Manager functions to some land manager functions for this scene
            EventManager.OnLandObjectAdded +=
                new EventManager.LandObjectAdded(simDataService.StoreLandObject);
            EventManager.OnLandObjectRemoved +=
                new EventManager.LandObjectRemoved(simDataService.RemoveLandObject);

             RegisterDefaultSceneEvents();

            // XXX: Don't set the public property since we don't want to activate here.  This needs to be handled 
            // better in the future.
            m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts;

            PhysicsEnabled = !RegionInfo.RegionSettings.DisablePhysics;

            m_simulatorVersion = simulatorVersion + " (" + Util.GetRuntimeInformation() + ")";

            #region Region Config

            // Region config overrides global config
            //
            if (m_config.Configs["Startup"] != null)
            {
                IConfig startupConfig = m_config.Configs["Startup"];

                StartDisabled = startupConfig.GetBoolean("StartDisabled", false);
//.........这里部分代码省略.........
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:101,代码来源:Scene.cs

示例8: StartupSpecific

        /// <summary>
        /// Performs startup specific to the region server, including initialization of the scene 
        /// such as loading configuration from disk.
        /// </summary>
        protected virtual void StartupSpecific()
        {
            #region Console Setup

            if (m_console != null)
            {
                ILoggerRepository repository = LogManager.GetRepository();
                IAppender[] appenders = repository.GetAppenders();

                foreach (IAppender appender in appenders)
                {
                    if (appender.Name == "Console")
                    {
                        m_consoleAppender = (OpenSimAppender)appender;
                        break;
                    }
                }

                if (null == m_consoleAppender)
                {
                    Notice("No appender named Console found (see the log4net config file for this executable)!");
                }
                else
                {
                    m_consoleAppender.Console = m_console;

                    // If there is no threshold set then the threshold is effectively everything.
                    if (null == m_consoleAppender.Threshold)
                        m_consoleAppender.Threshold = Level.All;

                    Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
                }

                m_console.Commands.AddCommand("base", false, "quit",
                        "quit",
                        "Quit the application", HandleQuit);

                m_console.Commands.AddCommand("base", false, "shutdown",
                        "shutdown",
                        "Quit the application", HandleQuit);

                m_console.Commands.AddCommand("base", false, "set log level",
                        "set log level <level>",
                        "Set the console logging level", HandleLogLevel);

                m_console.Commands.AddCommand("base", false, "show info",
                        "show info",
                        "Show general information", HandleShow);

                m_console.Commands.AddCommand("base", false, "show stats",
                        "show stats",
                        "Show statistics", HandleShow);

                m_console.Commands.AddCommand("base", false, "show threads",
                        "show threads",
                        "Show thread status", HandleShow);

                m_console.Commands.AddCommand("base", false, "show uptime",
                        "show uptime",
                        "Show server uptime", HandleShow);

                m_console.Commands.AddCommand("base", false, "show version",
                        "show version",
                        "Show server version", HandleShow);
            }

            #endregion Console Setup

            IConfig startupConfig = m_config.Source.Configs["Startup"];
            if (startupConfig != null)
            {
                string pidFile = startupConfig.GetString("PIDFile", String.Empty);
                if (pidFile != String.Empty)
                    CreatePIDFile(pidFile);
                
                userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
            }

            // Load the simulation data service
            IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"];
            if (simDataConfig == null)
                throw new Exception("Configuration file is missing the [SimulationDataStore] section");
            string module = simDataConfig.GetString("LocalServiceModule", String.Empty);
            if (String.IsNullOrEmpty(module))
                throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section");
            m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source });

            // Load the estate data service
            IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"];
            if (estateDataConfig == null)
                throw new Exception("Configuration file is missing the [EstateDataStore] section");
            module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
            if (String.IsNullOrEmpty(module))
                throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section");
            m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { m_config.Source });

//.........这里部分代码省略.........
开发者ID:hanu4me,项目名称:fortis-opensim,代码行数:101,代码来源:OpenSimBase.cs

示例9: SceneHelpers

        public SceneHelpers(CoreAssetCache cache)
        {
            SceneManager = new SceneManager();

            m_assetService          = StartAssetService(cache);
            m_authenticationService = StartAuthenticationService();
            m_inventoryService      = StartInventoryService();
            m_gridService           = StartGridService();
            m_userAccountService    = StartUserAccountService();
            m_presenceService       = StartPresenceService();

            m_inventoryService.PostInitialise();
            m_assetService.PostInitialise();
            m_userAccountService.PostInitialise();
            m_presenceService.PostInitialise();

            m_cache = cache;

            m_physicsScene = StartPhysicsScene();

            SimDataService 
                = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:23,代码来源:SceneHelpers.cs

示例10: TriggerOnBackup

 public void TriggerOnBackup(ISimulationDataService dstore, bool forced)
 {
     OnBackupDelegate handlerOnAttach = OnBackup;
     if (handlerOnAttach != null)
     {
         foreach (OnBackupDelegate d in handlerOnAttach.GetInvocationList())
         {
             try
             {
                 d(dstore, forced);
             }
             catch (Exception e)
             {
                 m_log.ErrorFormat(
                     "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing.  {0} {1}", 
                     e.Message, e.StackTrace);
             }
         }
     }
 }
开发者ID:CCIR,项目名称:opensim,代码行数:20,代码来源:EventManager.cs

示例11: Scene

        public Scene(RegionInfo regInfo, AgentCircuitManager authen,
                     SceneCommunicationService sceneGridService,
                     ISimulationDataService simDataService, IEstateDataService estateDataService,
                     ModuleLoader moduleLoader, bool dumpAssetsToFile,
                     IConfigSource config, string simulatorVersion)
            : this(regInfo)
        {
            m_config = config;


            Random random = new Random();

            m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4);
            m_moduleLoader = moduleLoader;
            m_authenticateHandler = authen;
            m_sceneGridService = sceneGridService;
            m_SimulationDataService = simDataService;
            m_EstateDataService = estateDataService;
            m_regionHandle = m_regInfo.RegionHandle;
            m_regionName = m_regInfo.RegionName;

            m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
            m_asyncSceneObjectDeleter.Enabled = true;

            m_asyncInventorySender = new AsyncInventorySender(this);

            #region Region Settings

            // Load region settings
            // LoadRegionSettings creates new region settings in persistence if they don't already exist for this region.
            // However, in this case, the default textures are not set in memory properly, so we need to do it here and
            // resave.
            // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new
            // region is set up and avoid these gyrations.
            RegionSettings rs = simDataService.LoadRegionSettings(m_regInfo.RegionID);
            bool updatedTerrainTextures = false;
            if (rs.TerrainTexture1 == UUID.Zero)
            {
                rs.TerrainTexture1 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_1;
                updatedTerrainTextures = true;
            }

            if (rs.TerrainTexture2 == UUID.Zero)
            {
                rs.TerrainTexture2 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_2;
                updatedTerrainTextures = true;
            }

            if (rs.TerrainTexture3 == UUID.Zero)
            {
                rs.TerrainTexture3 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_3;
                updatedTerrainTextures = true;
            }

            if (rs.TerrainTexture4 == UUID.Zero)
            {
                rs.TerrainTexture4 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_4;
                updatedTerrainTextures = true;
            }

            if (updatedTerrainTextures)
                rs.Save();

            m_regInfo.RegionSettings = rs;

            if (estateDataService != null)
                m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false);

            #endregion Region Settings

            MainConsole.Instance.Commands.AddCommand("region", false, "reload estate",
                                          "reload estate",
                                          "Reload the estate data", HandleReloadEstate);

            MainConsole.Instance.Commands.AddCommand("region", false, "delete object owner",
                                          "delete object owner <UUID>",
                                          "Delete object by owner", HandleDeleteObject);
            MainConsole.Instance.Commands.AddCommand("region", false, "delete object creator",
                                          "delete object creator <UUID>",
                                          "Delete object by creator", HandleDeleteObject);
            MainConsole.Instance.Commands.AddCommand("region", false, "delete object uuid",
                                          "delete object uuid <UUID>",
                                          "Delete object by uuid", HandleDeleteObject);
            MainConsole.Instance.Commands.AddCommand("region", false, "delete object name",
                                          "delete object name <name>",
                                          "Delete object by name", HandleDeleteObject);

            MainConsole.Instance.Commands.AddCommand("region", false, "delete object outside",
                                          "delete object outside",
                                          "Delete all objects outside boundaries", HandleDeleteObject);

            //Bind Storage Manager functions to some land manager functions for this scene
            EventManager.OnLandObjectAdded +=
                new EventManager.LandObjectAdded(simDataService.StoreLandObject);
            EventManager.OnLandObjectRemoved +=
                new EventManager.LandObjectRemoved(simDataService.RemoveLandObject);

            m_sceneGraph = new SceneGraph(this);

            // If the scene graph has an Unrecoverable error, restart this sim.
//.........这里部分代码省略.........
开发者ID:JamesStallings,项目名称:Ubit-opensim,代码行数:101,代码来源:Scene.cs

示例12: Scene

        public Scene(RegionInfo regInfo, AgentCircuitManager authen,
                     SceneCommunicationService sceneGridService,
                     ISimulationDataService simDataService, IEstateDataService estateDataService,
                     ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
                     bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
        {
            m_config = config;

            Random random = new Random();
            
            BordersLocked = true;

            Border northBorder = new Border();
            northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize);  //<---
            northBorder.CrossDirection = Cardinals.N;
            NorthBorders.Add(northBorder);

            Border southBorder = new Border();
            southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0);    //--->
            southBorder.CrossDirection = Cardinals.S;
            SouthBorders.Add(southBorder);

            Border eastBorder = new Border();
            eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize);   //<---
            eastBorder.CrossDirection = Cardinals.E;
            EastBorders.Add(eastBorder);

            Border westBorder = new Border();
            westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0);     //--->
            westBorder.CrossDirection = Cardinals.W;
            WestBorders.Add(westBorder);

            BordersLocked = false;

            m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue/2))+(uint)(uint.MaxValue/4);
            m_moduleLoader = moduleLoader;
            m_authenticateHandler = authen;
            m_sceneGridService = sceneGridService;
            m_SimulationDataService = simDataService;
            m_EstateDataService = estateDataService;
            m_regInfo = regInfo;
            m_regionHandle = m_regInfo.RegionHandle;
            m_regionName = m_regInfo.RegionName;
            m_datastore = m_regInfo.DataStore;
            m_lastUpdate = Util.EnvironmentTickCount();

            m_physicalPrim = physicalPrim;
            m_seeIntoRegionFromNeighbor = SeeIntoRegionFromNeighbor;

            m_eventManager = new EventManager();
            m_permissions = new ScenePermissions(this);

            m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
            m_asyncSceneObjectDeleter.Enabled = true;

            #region Region Settings

            // Load region settings
            m_regInfo.RegionSettings = simDataService.LoadRegionSettings(m_regInfo.RegionID);
            if (estateDataService != null)
                m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false);

            #endregion Region Settings

            MainConsole.Instance.Commands.AddCommand("region", false, "reload estate",
                                          "reload estate",
                                          "Reload the estate data", HandleReloadEstate);

            //Bind Storage Manager functions to some land manager functions for this scene
            EventManager.OnLandObjectAdded +=
                new EventManager.LandObjectAdded(simDataService.StoreLandObject);
            EventManager.OnLandObjectRemoved +=
                new EventManager.LandObjectRemoved(simDataService.RemoveLandObject);

            m_sceneGraph = new SceneGraph(this, m_regInfo);

            // If the scene graph has an Unrecoverable error, restart this sim.
            // Currently the only thing that causes it to happen is two kinds of specific
            // Physics based crashes.
            //
            // Out of memory
            // Operating system has killed the plugin
            m_sceneGraph.UnRecoverableError += RestartNow;

            RegisterDefaultSceneEvents();

            DumpAssetsToFile = dumpAssetsToFile;

            m_scripts_enabled = !RegionInfo.RegionSettings.DisableScripts;

            m_physics_enabled = !RegionInfo.RegionSettings.DisablePhysics;

            StatsReporter = new SimStatsReporter(this);
            StatsReporter.OnSendStatsResult += SendSimStatsPackets;
            StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;

            // Old
            /*
            m_simulatorVersion = simulatorVersion
                + " (OS " + Util.GetOperatingSystemInformation() + ")"
//.........这里部分代码省略.........
开发者ID:N3X15,项目名称:VoxelSim,代码行数:101,代码来源:Scene.cs

示例13: Scene

        public Scene(RegionInfo regInfo, AgentCircuitManager authen,
                     SceneCommunicationService sceneGridService,
            IConfigSource config, string simulatorVersion, ISimulationDataService simDataService, IStatsCollector stats)
        {
            //THIS NEEDS RESET TO FIX RESTARTS
            shuttingdown = false;

            m_stats = stats;
            m_config = config;
            Random random = new Random();
            m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4);
            m_authenticateHandler = authen;
            m_sceneGridService = sceneGridService;
            m_regInfo = regInfo;
            m_lastUpdate = Util.EnvironmentTickCount();

            
            BordersLocked = true;

            Border northBorder = new Border();
            northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize);  //<---
            northBorder.CrossDirection = Cardinals.N;
            NorthBorders.Add(northBorder);

            Border southBorder = new Border();
            southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0);    //--->
            southBorder.CrossDirection = Cardinals.S;
            SouthBorders.Add(southBorder);

            Border eastBorder = new Border();
            eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize);   //<---
            eastBorder.CrossDirection = Cardinals.E;
            EastBorders.Add(eastBorder);

            Border westBorder = new Border();
            westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0);     //--->
            westBorder.CrossDirection = Cardinals.W;
            WestBorders.Add(westBorder);

            BordersLocked = false;

            AuroraEventManager = new AuroraEventManager();
            m_eventManager = new EventManager();
            m_permissions = new ScenePermissions(this);

            m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
            m_asyncSceneObjectDeleter.Enabled = true;

            m_SimulationDataService = simDataService;

            // Load region settings
            m_regInfo.RegionSettings = m_SimulationDataService.LoadRegionSettings(m_regInfo.RegionID);
            FindEstateInfo();

            //Bind Storage Manager functions to some land manager functions for this scene
            IParcelServiceConnector conn = DataManager.RequestPlugin<IParcelServiceConnector>();
            if(conn != null)
            {
                EventManager.OnLandObjectAdded +=
                    new EventManager.LandObjectAdded(conn.StoreLandObject);
                EventManager.OnLandObjectRemoved +=
                    new EventManager.LandObjectRemoved(conn.RemoveLandObject);
            }
            else
            {
                EventManager.OnLandObjectAdded +=
                    new EventManager.LandObjectAdded(SimulationDataService.StoreLandObject);
                EventManager.OnLandObjectRemoved +=
                    new EventManager.LandObjectRemoved(SimulationDataService.RemoveLandObject);
            }

            m_sceneGraph = new SceneGraph(this, m_regInfo);

            StatsReporter = new SimStatsReporter(this);
            StatsReporter.OnSendStatsResult += SendSimStatsPackets;
            StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;

            m_simulatorVersion = simulatorVersion + " (" + Util.GetRuntimeInformation() + ")";

            #region Region Config

            try
            {
                DirectionsToBlockChildAgents = new bool[3,3];
                DirectionsToBlockChildAgents.Initialize();
                IConfig aurorastartupConfig = m_config.Configs["AuroraStartup"];
                if (aurorastartupConfig != null)
                {
                    RunScriptsInAttachments = aurorastartupConfig.GetBoolean("AllowRunningOfScriptsInAttachments", false);
                    m_UseSelectionParticles = aurorastartupConfig.GetBoolean("UseSelectionParticles", true);
                    EnableFakeRaycasting = aurorastartupConfig.GetBoolean("EnableFakeRaycasting", false);
                    MaxLowValue = aurorastartupConfig.GetFloat("MaxLowValue", -1000);
                    Util.RegionViewSize = aurorastartupConfig.GetInt("RegionSightSize", 1);
                    Util.CloseLocalRegions = aurorastartupConfig.GetBoolean("CloseLocalAgents", true);
                    m_DefaultObjectName = aurorastartupConfig.GetString("DefaultObjectName", m_DefaultObjectName);
                    CheckForObjectCulling = aurorastartupConfig.GetBoolean("CheckForObjectCulling", CheckForObjectCulling);
                    SetObjectCapacity(aurorastartupConfig.GetInt("ObjectCapacity", ObjectCapacity));
                }

                IConfig regionConfig = m_config.Configs[this.RegionInfo.RegionName];
//.........这里部分代码省略.........
开发者ID:shangcheng,项目名称:Aurora,代码行数:101,代码来源:Scene.cs

示例14: CreateScene

        protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
            IEstateDataService estateDataService, AgentCircuitManager circuitManager)
        {
			if (m_log.IsDebugEnabled) {
				m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod ().Name);
			}

            SceneCommunicationService sceneGridService = new SceneCommunicationService();

            return new Scene(
                regionInfo, circuitManager, sceneGridService,
                simDataService, estateDataService,
                Config, m_version);
        }
开发者ID:AkiraSonoda,项目名称:akisim,代码行数:14,代码来源:OpenSimBase.cs

示例15: ProcessInventoryBackup

        /// <summary>
        /// Process inventory backup
        /// </summary>
        /// <param name="datastore"></param>
        public void ProcessInventoryBackup(ISimulationDataService datastore)
        {
            // Removed this because linking will cause an immediate delete of the new
            // child prim from the database and the subsequent storing of the prim sees
            // the inventory of it as unchanged and doesn't store it at all. The overhead
            // of storing prim inventory needlessly is much less than the aggravation
            // of prim inventory loss.
            //            if (HasInventoryChanged)
            //            {
                Items.LockItemsForRead(true);
                try
                {
                    datastore.StorePrimInventory(m_part.UUID, Items.Values);
                }
                catch {}

                HasInventoryChanged = false;

                Items.LockItemsForRead(false);

            //            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:26,代码来源:SceneObjectPartInventory.cs


注:本文中的ISimulationDataService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。