static Watchdog() { m_threads = new ThreadedClasses.RwLockedDictionary <int, ThreadWatchdogInfo>(); m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS); m_watchdogTimer.AutoReset = false; m_watchdogTimer.Elapsed += WatchdogTimerElapsed; }
public Dictionary <ulong, string> GetChildrenSeeds(UUID agentID) { ThreadedClasses.RwLockedDictionary <ulong, string> seeds = null; if (m_childrenSeeds.TryGetValue(agentID, out seeds)) { return(new Dictionary <ulong, string>(seeds)); } return(new Dictionary <ulong, string>()); }
// ----------------------------------------------------------------- /// <summary> /// </summary> // ----------------------------------------------------------------- public void AddRegion(Scene scene) { if (m_enabled) { m_scene = scene; m_scene.RegisterModuleInterface <IJsonStoreModule>(this); m_sharedStore = UUID.Zero; m_JsonValueStore = new ThreadedClasses.RwLockedDictionary <UUID, JsonStore>(); m_JsonValueStore.Add(m_sharedStore, new JsonStore("")); scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; } }
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) { ThreadedClasses.RwLockedDictionary <AssetType, InventoryFolderBase> ff = null; if (m_FolderTypes.TryGetValue(userID, out ff)) { InventoryFolderBase f = null; if (ff.TryGetValue(type, out f)) { return(f); } } return(null); }
public void Cache(UUID userID, AssetType type, InventoryFolderBase folder) { ThreadedClasses.RwLockedDictionary <AssetType, InventoryFolderBase> ff = null; ff = m_FolderTypes.GetOrAdd(userID, delegate() { return(new ThreadedClasses.RwLockedDictionary <AssetType, InventoryFolderBase>()); }, CACHE_EXPIRATION_SECONDS); try { ff.Add(type, folder); } catch { } }
// ----------------------------------------------------------------- /// <summary> /// </summary> // ----------------------------------------------------------------- public void AddRegion(Scene scene) { if (m_enabled) { m_scene = scene; m_scene.RegisterModuleInterface<IJsonStoreModule>(this); m_sharedStore = UUID.Zero; m_JsonValueStore = new ThreadedClasses.RwLockedDictionary<UUID, JsonStore>(); m_JsonValueStore.Add(m_sharedStore,new JsonStore("")); scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; } }
public BSActorCollection(BSScene physicsScene) { m_physicsScene = physicsScene; m_actors = new ThreadedClasses.RwLockedDictionary<string, BSActor>(); }
public void SetChildrenSeed(UUID agentID, Dictionary <ulong, string> seeds) { //m_log.DebugFormat(" !!! Setting child seeds in {0} to {1}", m_scene.RegionInfo.RegionName, seeds.Count); m_childrenSeeds[agentID] = new ThreadedClasses.RwLockedDictionary <ulong, string>(seeds); }
public BSActorCollection(BSScene physicsScene) { m_physicsScene = physicsScene; m_actors = new ThreadedClasses.RwLockedDictionary <string, BSActor>(); }
public override void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent) { mesher = meshmerizer; _taintOperations = new List<TaintCallbackEntry>(); _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); _postStepOperations = new List<TaintCallbackEntry>(); PhysObjects = new ThreadedClasses.RwLockedDictionary<uint, BSPhysObject>(); Shapes = new BSShapeCollection(this); m_simulatedTime = 0f; LastTimeStep = 0.1f; // Allocate pinned memory to pass parameters. UnmanagedParams = new ConfigurationParameters[1]; // Set default values for physics parameters plus any overrides from the ini file GetInitialParameterValues(config); // Force some parameters to values depending on other configurations // Only use heightmap terrain implementation if terrain larger than legacy size if ((uint)regionExtent.X > Constants.RegionSize || (uint)regionExtent.Y > Constants.RegionSize) { m_log.WarnFormat("{0} Forcing terrain implementation to heightmap for large region", LogHeader); BSParam.TerrainImplementation = (float)BSTerrainPhys.TerrainImplementation.Heightmap; } // Get the connection to the physics engine (could be native or one of many DLLs) PE = SelectUnderlyingBulletEngine(BulletEngineName); // Enable very detailed logging. // By creating an empty logger when not logging, the log message invocation code // can be left in and every call doesn't have to check for null. if (m_physicsLoggingEnabled) { PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes, m_physicsLoggingDoFlush); PhysicsLogging.ErrorLogger = m_log; // for DEBUG. Let's the logger output its own error messages. } else { PhysicsLogging = new Logging.LogWriter(); } // Allocate memory for returning of the updates and collisions from the physics engine m_collisionArray = new CollisionDesc[m_maxCollisionsPerFrame]; m_updateArray = new EntityProperties[m_maxUpdatesPerFrame]; // The bounding box for the simulated world. The origin is 0,0,0 unless we're // a child in a mega-region. // Bullet actually doesn't care about the extents of the simulated // area. It tracks active objects no matter where they are. Vector3 worldExtent = regionExtent; World = PE.Initialize(worldExtent, Params, m_maxCollisionsPerFrame, ref m_collisionArray, m_maxUpdatesPerFrame, ref m_updateArray); Constraints = new BSConstraintCollection(World); TerrainManager = new BSTerrainManager(this, worldExtent); TerrainManager.CreateInitialGroundPlaneAndTerrain(); // Put some informational messages into the log file. m_log.InfoFormat("{0} Linksets implemented with {1}", LogHeader, (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation); InTaintTime = false; m_initialized = true; // If the physics engine runs on its own thread, start same. if (BSParam.UseSeparatePhysicsThread) { // The physics simulation should happen independently of the heartbeat loop m_physicsThread = new Thread(BulletSPluginPhysicsThread); m_physicsThread.Name = BulletEngineName; m_physicsThread.Start(); } }
public void SetChildrenSeed(UUID agentID, Dictionary<ulong, string> seeds) { //m_log.DebugFormat(" !!! Setting child seeds in {0} to {1}", m_scene.RegionInfo.RegionName, seeds.Count); m_childrenSeeds[agentID] = new ThreadedClasses.RwLockedDictionary<ulong, string>(seeds); }
static Watchdog() { m_threads = new ThreadedClasses.RwLockedDictionary<int, ThreadWatchdogInfo>(); m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS); m_watchdogTimer.AutoReset = false; m_watchdogTimer.Elapsed += WatchdogTimerElapsed; }