public HGInstantMessageService(IConfigSource config, IInstantMessageSimConnector imConnector) { if (imConnector != null) { m_IMSimConnector = imConnector; } if (!m_Initialized) { m_Initialized = true; IConfig serverConfig = config.Configs["HGInstantMessageService"]; if (serverConfig == null) { throw new Exception(String.Format("No section HGInstantMessageService in config file")); } string gridService = serverConfig.GetString("GridService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string userAgentService = serverConfig.GetString("UserAgentService", String.Empty); m_InGatekeeper = serverConfig.GetBoolean("InGatekeeper", false); m_log.DebugFormat("[HG IM SERVICE]: Starting... InRobust? {0}", m_InGatekeeper); if (gridService == string.Empty || presenceService == string.Empty) { throw new Exception(String.Format("Incomplete specifications, InstantMessage Service cannot function.")); } Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args); m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args); m_UserAgentService = ServerUtils.LoadPlugin <IUserAgentService>(userAgentService, args); m_RegionCache = new ThreadedClasses.ExpiringCache <UUID, GridRegion>(30); IConfig cnf = config.Configs["Messaging"]; if (cnf == null) { return; } m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", false); if (m_InGatekeeper) { string offlineIMService = cnf.GetString("OfflineIMService", string.Empty); if (offlineIMService != string.Empty) { m_OfflineIMService = ServerUtils.LoadPlugin <IOfflineIMService>(offlineIMService, args); } } } }
public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; if (groupsConfig == null) { // Do not run this module by default. return; } else { // if groups aren't enabled, we're not needed. // if we're not specified as the connector to use, then we're not wanted if ((groupsConfig.GetBoolean("Enabled", false) == false) || (groupsConfig.GetString("ServicesConnectorModule", "XmlRpcGroupsServicesConnector") != Name)) { m_connectorEnabled = false; return; } m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); if (string.IsNullOrEmpty(m_groupsServerURI)) { m_log.ErrorFormat("Please specify a valid URL for GroupsServerURI in OpenSim.ini, [Groups]"); m_connectorEnabled = false; return; } m_disableKeepAlive = groupsConfig.GetBoolean("XmlRpcDisableKeepAlive", false); m_groupReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", string.Empty); m_groupWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty); m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30); if (m_cacheTimeout == 0) { m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Disabled."); } else { m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout); } m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false); // If we got all the config options we need, lets start'er'up m_memoryCache = new ThreadedClasses.ExpiringCache <string, XmlRpcResponse>(30); m_connectorEnabled = true; } }
public void Initialise(IConfigSource config) { IConfig texturesConfig = config.Configs["Textures"]; if (texturesConfig != null) { ReuseTextures = texturesConfig.GetBoolean("ReuseDynamicTextures", false); ReuseLowDataTextures = texturesConfig.GetBoolean("ReuseDynamicLowDataTextures", false); if (ReuseTextures) { m_reuseableDynamicTextures = new ThreadedClasses.ExpiringCache <string, UUID>(new TimeSpan(24, 0, 0)); } } }
public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; if (groupsConfig == null) { // Do not run this module by default. return; } // if groups aren't enabled, we're not needed. // if we're not specified as the connector to use, then we're not wanted if ((groupsConfig.GetBoolean("Enabled", false) == false) || (groupsConfig.GetString("MessagingModule", "") != Name)) { m_groupMessagingEnabled = false; return; } m_groupMessagingEnabled = groupsConfig.GetBoolean("MessagingEnabled", true); if (!m_groupMessagingEnabled) { return; } m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", true); if (m_messageOnlineAgentsOnly) { m_usersOnlineCache = new ThreadedClasses.ExpiringCache <UUID, PresenceInfo[]>(30); } else { m_log.Error("[Groups.Messaging]: GroupsMessagingModule V2 requires MessageOnlineUsersOnly = true"); m_groupMessagingEnabled = false; return; } m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); m_log.InfoFormat( "[Groups.Messaging]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}", m_messageOnlineAgentsOnly, m_debugEnabled); }
private UserAccountCache(IUserAccountService u) { m_UUIDCache = new ThreadedClasses.ExpiringCache<UUID, UserAccount>(30); m_UserAccountService = u; }
public UserAccountCache() { m_UUIDCache = new ThreadedClasses.ExpiringCache <UUID, UserAccount>(30); m_NameCache = new ThreadedClasses.ExpiringCache <string, UUID>(30); }
// Add this agent in this region as a banned person public void Add(ulong pRegionHandle, UUID pAgentID) { m_idCache = m_bannedRegions.GetOrAdd(pAgentID, delegate() { return new ThreadedClasses.ExpiringCache<ulong, DateTime>(30); }, TimeSpan.FromSeconds(45)); m_idCache.Add(pRegionHandle, DateTime.Now + TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15)); }
public HGInstantMessageService(IConfigSource config, IInstantMessageSimConnector imConnector) { if (imConnector != null) m_IMSimConnector = imConnector; if (!m_Initialized) { m_Initialized = true; IConfig serverConfig = config.Configs["HGInstantMessageService"]; if (serverConfig == null) throw new Exception(String.Format("No section HGInstantMessageService in config file")); string gridService = serverConfig.GetString("GridService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string userAgentService = serverConfig.GetString("UserAgentService", String.Empty); m_InGatekeeper = serverConfig.GetBoolean("InGatekeeper", false); m_log.DebugFormat("[HG IM SERVICE]: Starting... InRobust? {0}", m_InGatekeeper); if (gridService == string.Empty || presenceService == string.Empty) throw new Exception(String.Format("Incomplete specifications, InstantMessage Service cannot function.")); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(userAgentService, args); m_RegionCache = new ThreadedClasses.ExpiringCache<UUID, GridRegion>(30); IConfig cnf = config.Configs["Messaging"]; if (cnf == null) { return; } m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", false); if (m_InGatekeeper) { string offlineIMService = cnf.GetString("OfflineIMService", string.Empty); if (offlineIMService != string.Empty) m_OfflineIMService = ServerUtils.LoadPlugin<IOfflineIMService>(offlineIMService, args); } } }
public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; if (groupsConfig == null) { // Do not run this module by default. return; } else { // if groups aren't enabled, we're not needed. // if we're not specified as the connector to use, then we're not wanted if ((groupsConfig.GetBoolean("Enabled", false) == false) || (groupsConfig.GetString("ServicesConnectorModule", "XmlRpcGroupsServicesConnector") != Name)) { m_connectorEnabled = false; return; } m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); if (string.IsNullOrEmpty(m_groupsServerURI)) { m_log.ErrorFormat("Please specify a valid Simian Server for GroupsServerURI in OpenSim.ini, [Groups]"); m_connectorEnabled = false; return; } m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30); if (m_cacheTimeout == 0) { m_log.WarnFormat("[SIMIAN-GROUPS-CONNECTOR] Groups Cache Disabled."); } else { m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Groups Cache Timeout set to {0}.", m_cacheTimeout); } m_memoryCache = new ThreadedClasses.ExpiringCache<string, OSDMap>(30); // If we got all the config options we need, lets start'er'up m_connectorEnabled = true; m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); } }
public RegionInfoCache() { m_UUIDCache = new ThreadedClasses.ExpiringCache <ScopedRegionUUID, GridRegion>(30); m_NameCache = new ThreadedClasses.ExpiringCache <ScopedRegionName, ScopedRegionUUID>(30); m_PositionCache = new ThreadedClasses.ExpiringCache <ScopedRegionPosition, GridRegion>(30); }
private UserAccountCache(IUserAccountService u) { m_UUIDCache = new ThreadedClasses.ExpiringCache <UUID, UserAccount>(30); m_UserAccountService = u; }
public RegionInfoCache() { m_UUIDCache = new ThreadedClasses.ExpiringCache<ScopedRegionUUID, GridRegion>(30); m_NameCache = new ThreadedClasses.ExpiringCache<ScopedRegionName, ScopedRegionUUID>(30); m_PositionCache = new ThreadedClasses.ExpiringCache<ScopedRegionPosition, GridRegion>(30); }
public UserAccountCache() { m_UUIDCache = new ThreadedClasses.ExpiringCache<UUID, UserAccount>(30); m_NameCache = new ThreadedClasses.ExpiringCache<string, UUID>(30); }
/// <summary> /// This constructor is only here because of the Unit Tests... /// Don't use it. /// </summary> public DynamicTextureModule() { m_reuseableDynamicTextures = new ThreadedClasses.ExpiringCache <string, UUID>(new TimeSpan(24, 0, 0)); }
public void Initialise(IConfigSource config) { IConfig texturesConfig = config.Configs["Textures"]; if (texturesConfig != null) { ReuseTextures = texturesConfig.GetBoolean("ReuseDynamicTextures", false); ReuseLowDataTextures = texturesConfig.GetBoolean("ReuseDynamicLowDataTextures", false); if (ReuseTextures) { m_reuseableDynamicTextures = new ThreadedClasses.ExpiringCache<string, UUID>(new TimeSpan(24, 0, 0)); } } }
public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("AssetCaching", String.Empty); if (name == Name) { m_MemoryCache = new ThreadedClasses.ExpiringCache<string, AssetBase>(30); m_Enabled = true; m_log.InfoFormat("[FLOTSAM ASSET CACHE]: {0} enabled", this.Name); IConfig assetConfig = source.Configs["AssetCache"]; if (assetConfig == null) { m_log.Debug( "[FLOTSAM ASSET CACHE]: AssetCache section missing from config (not copied config-include/FlotsamCache.ini.example? Using defaults."); } else { m_FileCacheEnabled = assetConfig.GetBoolean("FileCacheEnabled", m_FileCacheEnabled); m_CacheDirectory = assetConfig.GetString("CacheDirectory", m_DefaultCacheDirectory); m_MemoryCacheEnabled = assetConfig.GetBoolean("MemoryCacheEnabled", m_MemoryCacheEnabled); m_MemoryExpiration = TimeSpan.FromHours(assetConfig.GetDouble("MemoryCacheTimeout", m_DefaultMemoryExpiration)); m_LogLevel = assetConfig.GetInt("LogLevel", m_LogLevel); m_HitRateDisplay = (ulong)assetConfig.GetLong("HitRateDisplay", (long)m_HitRateDisplay); m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration)); m_FileExpirationCleanupTimer = TimeSpan.FromHours( assetConfig.GetDouble("FileCleanupTimer", m_FileExpirationCleanupTimer.TotalHours)); m_CacheDirectoryTiers = assetConfig.GetInt("CacheDirectoryTiers", m_CacheDirectoryTiers); m_CacheDirectoryTierLen = assetConfig.GetInt("CacheDirectoryTierLength", m_CacheDirectoryTierLen); m_CacheWarnAt = assetConfig.GetInt("CacheWarnAt", m_CacheWarnAt); } m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory {0}", m_CacheDirectory); if (m_FileCacheEnabled && (m_FileExpiration > TimeSpan.Zero) && (m_FileExpirationCleanupTimer > TimeSpan.Zero)) { m_CacheCleanTimer = new System.Timers.Timer(m_FileExpirationCleanupTimer.TotalMilliseconds); m_CacheCleanTimer.AutoReset = true; m_CacheCleanTimer.Elapsed += CleanupExpiredFiles; m_CacheCleanTimer.Start(); } if (m_CacheDirectoryTiers < 1) { m_CacheDirectoryTiers = 1; } else if (m_CacheDirectoryTiers > 3) { m_CacheDirectoryTiers = 3; } if (m_CacheDirectoryTierLen < 1) { m_CacheDirectoryTierLen = 1; } else if (m_CacheDirectoryTierLen > 4) { m_CacheDirectoryTierLen = 4; } MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache status", "fcache status", "Display cache status", HandleConsoleCommand); MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache clear", "fcache clear [file] [memory]", "Remove all assets in the cache. If file or memory is specified then only this cache is cleared.", HandleConsoleCommand); MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache assets", "fcache assets", "Attempt a deep scan and cache of all assets in all scenes", HandleConsoleCommand); MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache expire", "fcache expire <datetime>", "Purge cached assets older then the specified date/time", HandleConsoleCommand); } } }
/// <summary> /// This constructor is only here because of the Unit Tests... /// Don't use it. /// </summary> public DynamicTextureModule() { m_reuseableDynamicTextures = new ThreadedClasses.ExpiringCache<string, UUID>(new TimeSpan(24, 0, 0)); }
public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("AssetCaching", String.Empty); if (name == Name) { m_MemoryCache = new ThreadedClasses.ExpiringCache <string, AssetBase>(30); m_Enabled = true; m_log.InfoFormat("[FLOTSAM ASSET CACHE]: {0} enabled", this.Name); IConfig assetConfig = source.Configs["AssetCache"]; if (assetConfig == null) { m_log.Debug( "[FLOTSAM ASSET CACHE]: AssetCache section missing from config (not copied config-include/FlotsamCache.ini.example? Using defaults."); } else { m_FileCacheEnabled = assetConfig.GetBoolean("FileCacheEnabled", m_FileCacheEnabled); m_CacheDirectory = assetConfig.GetString("CacheDirectory", m_DefaultCacheDirectory); m_MemoryCacheEnabled = assetConfig.GetBoolean("MemoryCacheEnabled", m_MemoryCacheEnabled); m_MemoryExpiration = TimeSpan.FromHours(assetConfig.GetDouble("MemoryCacheTimeout", m_DefaultMemoryExpiration)); m_LogLevel = assetConfig.GetInt("LogLevel", m_LogLevel); m_HitRateDisplay = (ulong)assetConfig.GetLong("HitRateDisplay", (long)m_HitRateDisplay); m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration)); m_FileExpirationCleanupTimer = TimeSpan.FromHours( assetConfig.GetDouble("FileCleanupTimer", m_FileExpirationCleanupTimer.TotalHours)); m_CacheDirectoryTiers = assetConfig.GetInt("CacheDirectoryTiers", m_CacheDirectoryTiers); m_CacheDirectoryTierLen = assetConfig.GetInt("CacheDirectoryTierLength", m_CacheDirectoryTierLen); m_CacheWarnAt = assetConfig.GetInt("CacheWarnAt", m_CacheWarnAt); } m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory {0}", m_CacheDirectory); if (m_FileCacheEnabled && (m_FileExpiration > TimeSpan.Zero) && (m_FileExpirationCleanupTimer > TimeSpan.Zero)) { m_CacheCleanTimer = new System.Timers.Timer(m_FileExpirationCleanupTimer.TotalMilliseconds); m_CacheCleanTimer.AutoReset = true; m_CacheCleanTimer.Elapsed += CleanupExpiredFiles; m_CacheCleanTimer.Start(); } if (m_CacheDirectoryTiers < 1) { m_CacheDirectoryTiers = 1; } else if (m_CacheDirectoryTiers > 3) { m_CacheDirectoryTiers = 3; } if (m_CacheDirectoryTierLen < 1) { m_CacheDirectoryTierLen = 1; } else if (m_CacheDirectoryTierLen > 4) { m_CacheDirectoryTierLen = 4; } MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache status", "fcache status", "Display cache status", HandleConsoleCommand); MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache clear", "fcache clear [file] [memory]", "Remove all assets in the cache. If file or memory is specified then only this cache is cleared.", HandleConsoleCommand); MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache assets", "fcache assets", "Attempt a deep scan and cache of all assets in all scenes", HandleConsoleCommand); MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache expire", "fcache expire <datetime>", "Purge cached assets older then the specified date/time", HandleConsoleCommand); } } }
public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; if (groupsConfig == null) { // Do not run this module by default. return; } else { // if groups aren't enabled, we're not needed. // if we're not specified as the connector to use, then we're not wanted if ((groupsConfig.GetBoolean("Enabled", false) == false) || (groupsConfig.GetString("MessagingModule", "") != Name)) { m_groupMessagingEnabled = false; return; } m_groupMessagingEnabled = groupsConfig.GetBoolean("MessagingEnabled", true); if (!m_groupMessagingEnabled) { return; } m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", true); if (m_messageOnlineAgentsOnly) m_usersOnlineCache = new ThreadedClasses.ExpiringCache<UUID, PresenceInfo[]>(30); m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); } m_log.InfoFormat( "[GROUPS-MESSAGING]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}", m_messageOnlineAgentsOnly, m_debugEnabled); }
public void AddRegion(Scene scene) { m_scene = scene; m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; landChannel = new LandChannel(scene, this); parcelInfoCache = new ThreadedClasses.ExpiringCache<string, ExtendedLandData>(new TimeSpan(0, 5, 0)); m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; m_scene.EventManager.OnLandBuy += EventManagerOnLandBuy; m_scene.EventManager.OnNewClient += EventManagerOnNewClient; m_scene.EventManager.OnMakeChildAgent += EventMakeChildAgent; m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; m_landListRwLock.AcquireWriterLock(-1); try { m_scene.LandChannel = (ILandChannel)landChannel; } finally { m_landListRwLock.ReleaseWriterLock(); } RegisterCommands(); }