public CommunicationsLocal( ConfigSettings configSettings, NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder) : base(serversInfo, httpServer, assetCache, libraryRootFolder) { PluginLoader<IInventoryStoragePlugin> loader = new PluginLoader<IInventoryStoragePlugin>(); loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin)); loader.Load(); loader.Plugin.Initialize(configSettings); LocalUserServices lus = new LocalUserServices( serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); //lus.AddPlugin(new TemporaryUserProfilePlugin()); lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource); m_userService = lus; m_userAdminService = lus; m_avatarService = lus; m_messageService = lus; m_gridService = new LocalBackEndServices(); }
public CommunicationsOGS1( NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder, ConfigSettings configSettings) : base(serversInfo, httpServer, assetCache, libraryRootFolder) { OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); m_gridService = gridInterComms; // This plugin arrangement could eventually be configurable rather than hardcoded here. OGS1UserServices userServices = new OGS1UserServices(this); //userServices.AddPlugin(new TemporaryUserProfilePlugin()); userServices.AddPlugin(new OGS1UserDataPlugin(this, configSettings)); m_userService = userServices; m_messageService = userServices; m_avatarService = (IAvatarService)m_userService; PluginLoader <IInventoryStoragePlugin> loader = new PluginLoader <IInventoryStoragePlugin>(); loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin)); loader.Load(); loader.Plugin.Initialize(configSettings); }
public HGGridServicesGridMode(NetworkServersInfo servers_info, BaseHttpServer httpServe, IAssetCache asscache, SceneManager sman, UserProfileCacheService userv) : base(servers_info, httpServe, asscache, sman) { m_remoteBackend = new OGS1GridServices(servers_info, httpServe); m_userProfileCache = userv; }
public void CommitChanges(IAssetCache assetCache) { if (!connector.IsConnected) { Logger.Error("Not connected to VersionOne."); } try { var validationResult = new Dictionary <Asset, List <RequiredFieldsDto> >(); var internalCache = assetCache.ToInternalCache(); var workitems = assetCache.GetWorkitems(true); foreach (var item in workitems) { if (!ValidateWorkitemAndCommitOnSuccess(item, internalCache.Efforts, validationResult)) { continue; } foreach (var child in item.Children) { ValidateWorkitemAndCommitOnSuccess(child, internalCache.Efforts, validationResult); } } if (validationResult.Count > 0) { throw new ValidatorException(requiredFieldsValidator.CreateErrorMessage(validationResult)); } } catch (APIException ex) { Logger.Error("Failed to commit changes.", ex); } }
public void RegionLoaded(Scene scene) { if (!m_Enabled) { return; } if (m_Cache == null) { m_Cache = scene.RequestModuleInterface <IAssetCache>(); // Since we are a shared module and scene data is not // available for every method, the cache must be shared, too // if (!(m_Cache is ISharedRegionModule)) { m_Cache = null; } else { SetCache(m_Cache); } } m_log.InfoFormat("[ASSET CONNECTOR]: Enabled remote assets for region {0}", scene.RegionInfo.RegionName); if (m_Cache != null) { m_log.InfoFormat("[ASSET CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName); } }
/// <summary> /// Create a server that can set up sessions for virtual world client <-> server communications /// </summary> /// <param name="_listenIP"></param> /// <param name="port"></param> /// <param name="proxyPortOffset"></param> /// <param name="allow_alternate_port"></param> /// <param name="assetCache"></param> /// <param name="authenticateClass"></param> /// <returns></returns> public IClientNetworkServer CreateServer( IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IAssetCache assetCache) { return(CreateServer( _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, assetCache)); }
public static void UpdateAllAssetCaches() { bool assetCacheFound = false; IEnumerable <IAssetCache> assetCaches = GetAllAssetCaches(); int numCaches = assetCaches.Count(); for (int i = 0; i < numCaches; i++) { IAssetCache assetCache = assetCaches.ElementAt(i); EditorUtility.DisplayProgressBar($"Updating {numCaches} Asset Caches...", $"Updating the {assetCache.GetType().Name}'s Asset Caches.", i / (float)numCaches); assetCache.UpdateAssetCache(); assetCache.SaveAssets(); assetCacheFound = true; } EditorUtility.ClearProgressBar(); if (!assetCacheFound) { Debug.LogWarning("No asset caches were found in the project. Unable to update asset caches."); return; } AssetDatabase.SaveAssets(); Debug.Log("Asset caches updated."); }
//Faux destructor public void Close() { m_shuttingdown = true; m_j2kDecodeModule = null; m_assetCache = null; m_client = null; }
public CommunicationsLocal( ConfigSettings configSettings, NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder) : base(serversInfo, httpServer, assetCache, libraryRootFolder) { PluginLoader <IInventoryStoragePlugin> loader = new PluginLoader <IInventoryStoragePlugin>(); loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin)); loader.Load(); loader.Plugin.Initialize(configSettings); LocalUserServices lus = new LocalUserServices( serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this); //lus.AddPlugin(new TemporaryUserProfilePlugin()); lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource); m_userService = lus; m_userAdminService = lus; m_avatarService = lus; m_messageService = lus; m_gridService = new LocalBackEndServices(); }
/// <summary> /// Initializes the Mixed Reality Extension SDK API. /// </summary> /// <param name="defaultMaterial">The material template used for all SDK-spawned meshes.</param> /// <param name="behaviorFactory">The behavior factory to use within the runtime.</param> /// <param name="textFactory">The text factory to use within the runtime.</param> /// <param name="primitiveFactory">The primitive factory to use within the runtime.</param> /// <param name="libraryFactory">The library resource factory to use within the runtime.</param> /// <param name="assetCache">The place for this MRE to cache its meshes, etc.</param> /// <param name="gltfImporterFactory">The glTF loader factory. Uses default GLTFSceneImporter if omitted.</param> /// <param name="materialPatcher">Overrides default material property map (color and mainTexture only).</param> /// <param name="userInfoProvider">Provides appId/sessionId scoped IUserInfo instances.</param> /// <param name="engineConstants">Engine constants supplied by the host app.</param> /// <param name="logger">The logger to be used by the MRE SDK.</param> public static void InitializeAPI( UnityEngine.Material defaultMaterial, IBehaviorFactory behaviorFactory = null, ITextFactory textFactory = null, IPrimitiveFactory primitiveFactory = null, ILibraryResourceFactory libraryFactory = null, IAssetCache assetCache = null, IGLTFImporterFactory gltfImporterFactory = null, IMaterialPatcher materialPatcher = null, IUserInfoProvider userInfoProvider = null, IEngineConstants engineConstants = null, IMRELogger logger = null) { AppsAPI.DefaultMaterial = defaultMaterial; AppsAPI.BehaviorFactory = behaviorFactory; AppsAPI.TextFactory = textFactory ?? throw new ArgumentException($"{nameof(textFactory)} cannot be null"); AppsAPI.PrimitiveFactory = primitiveFactory ?? new MWPrimitiveFactory(); AppsAPI.LibraryResourceFactory = libraryFactory; AppsAPI.AssetCache = assetCache ?? new AssetCache(); AppsAPI.GLTFImporterFactory = gltfImporterFactory ?? new GLTFImporterFactory(); AppsAPI.MaterialPatcher = materialPatcher ?? new DefaultMaterialPatcher(); AppsAPI.UserInfoProvider = userInfoProvider ?? new NullUserInfoProvider(); AppsAPI.EngineConstants = engineConstants; #if ANDROID_DEBUG Logger = logger ?? new UnityLogger(); #else Logger = logger ?? new ConsoleLogger(); #endif }
public static OSD ToOSD(WearableCacheItem[] pcacheItems, IAssetCache dataCache) { OSDArray arr = new OSDArray(); foreach (WearableCacheItem item in pcacheItems) { OSDMap itemmap = new OSDMap(); itemmap.Add("textureindex", OSD.FromUInteger(item.TextureIndex)); itemmap.Add("cacheid", OSD.FromUUID(item.CacheId)); itemmap.Add("textureid", OSD.FromUUID(item.TextureID)); if (dataCache != null) { if (dataCache.Check(item.TextureID.ToString())) { AssetBase assetItem; dataCache.Get(item.TextureID.ToString(), out assetItem); if (assetItem != null) { itemmap.Add("assetdata", OSD.FromBinary(assetItem.Data)); itemmap.Add("assetcreator", OSD.FromString(assetItem.CreatorID)); itemmap.Add("assetname", OSD.FromString(assetItem.Name)); } } } arr.Add(itemmap); } return(arr); }
/// <summary> /// Add a new client circuit. We assume that is has already passed an authorization check /// </summary> /// <param name="epSender"></param> /// <param name="useCircuit"></param> /// <param name="assetCache"></param> /// <param name="sessionInfo"></param> /// <param name="proxyEP"></param> /// <returns> /// true if a new circuit was created, false if a circuit with the given circuit code already existed /// </returns> public virtual bool AddNewClient( EndPoint epSender, UseCircuitCodePacket useCircuit, IAssetCache assetCache, AuthenticateResponse sessionInfo, EndPoint proxyEP) { IClientAPI newuser; uint circuitCode = useCircuit.CircuitCode.Code; if (m_scene.ClientManager.TryGetClient(circuitCode, out newuser)) { // The circuit is already known to the scene. This not actually a problem since this will currently // occur if a client is crossing borders (hence upgrading its circuit). However, we shouldn't // really by trying to add a new client if this is the case. return(false); } UUID agentId = useCircuit.CircuitCode.ID; UUID sessionId = useCircuit.CircuitCode.SessionID; newuser = CreateNewCircuit( epSender, m_scene, assetCache, this, sessionInfo, agentId, sessionId, circuitCode, proxyEP); m_scene.ClientManager.Add(circuitCode, newuser); newuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler; newuser.OnLogout += LogoutHandler; newuser.OnConnectionClosed += CloseClient; newuser.Start(); return(true); }
public void RegionLoaded(Scene scene) { if (!m_Enabled) { return; } if (m_Cache == null) { m_Cache = scene.RequestModuleInterface <IAssetCache>(); if (!(m_Cache is ISharedRegionModule)) { m_Cache = null; } } m_log.DebugFormat( "[LOCAL ASSET SERVICES CONNECTOR]: Enabled connector for region {0}", scene.RegionInfo.RegionName); if (m_Cache != null) { m_log.DebugFormat( "[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName); } else { // Short-circuit directly to storage layer. This ends up storing temporary and local assets. // scene.UnregisterModuleInterface <IAssetService>(this); scene.RegisterModuleInterface <IAssetService>(m_AssetService); } }
public void RemoveRegion(Scene scene) { m_Scene.EventManager.OnRegisterCaps -= RegisterCaps; m_Scene.EventManager.OnDeregisterCaps -= DeregisterCaps; m_Scene = null; m_AssetCache = null; }
public void RegionLoaded(Scene scene) { if (!m_Enabled) { return; } if (m_Cache == null) { m_Cache = scene.RequestModuleInterface <IAssetCache>(); if (!(m_Cache is ISharedRegionModule)) { m_Cache = null; } } if (m_Cache == null) { m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset connector with caching for region {0}", scene.RegionInfo.RegionName); } else { m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset connector without caching for region {0}", scene.RegionInfo.RegionName); } }
public BakedTextureUploader(Caps caps, string path, IAssetCache assetCache, IJ2KDecoder layerDecoder) { m_uploaderPath = path; m_Caps = caps; m_assetCache = assetCache; m_layerDecoder = layerDecoder; }
/// <summary> /// Attempt to instantiate an IAssetCache implementation, using the /// provided IAssetServer reference. /// An asset cache implementation must provide a constructor that /// accepts two parameters; /// [1] A ConfigSettings reference. /// [2] An IAssetServer reference. /// The AssetCache value is obtained from the /// [StartUp]/AssetCache value in the configuration file. /// </summary> protected virtual IAssetCache ResolveAssetCache(IAssetServer assetServer) { IAssetCache assetCache = null; if (m_configSettings.AssetCache != null && m_configSettings.AssetCache != String.Empty) { m_log.DebugFormat("[OpenSim Base]: Attempting to load asset cache id = {0}", m_configSettings.AssetCache); try { PluginInitialiserBase init = new AssetCachePluginInitialiser(m_configSettings, assetServer); PluginLoader<IAssetCache> loader = new PluginLoader<IAssetCache>(init); loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache)); loader.Load(PLUGIN_ASSET_CACHE); if (loader.Plugins.Count > 0) { assetCache = (IAssetCache)loader.Plugins[0]; } } catch (Exception e) { m_log.Error("[OpenSim Base]: ResolveAssetCache failed"); m_log.Error(e); } } // If everything else fails, we force load the built-in asset cache return (IAssetCache) ((assetCache != null) ? assetCache : new AssetCache(assetServer)); }
public GetMeshHandler(Scene scene, UUID agentID, Caps caps) { m_Scene = scene; m_AgentID = agentID; m_Caps = caps; m_AssetCache = m_Scene.CommsManager.AssetCache; }
public CommunicationsOGS1( NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder) : base(serversInfo, httpServer, assetCache, false, libraryRootFolder) { OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); m_gridService = gridInterComms; if (serversInfo.secureInventoryServer) { OGS1SecureInventoryService invService = new OGS1SecureInventoryService(serversInfo.InventoryURL); AddSecureInventoryService(invService); m_defaultInventoryHost = invService.Host; } else { OGS1InventoryService invService = new OGS1InventoryService(serversInfo.InventoryURL); AddInventoryService(invService); m_defaultInventoryHost = invService.Host; } // This plugin arrangement could eventually be configurable rather than hardcoded here. OGS1UserServices userServices = new OGS1UserServices(this); userServices.AddPlugin(new TemporaryUserProfilePlugin()); userServices.AddPlugin(new OGS1UserDataPlugin(this)); m_userService = userServices; m_messageService = userServices; m_avatarService = (IAvatarService)m_userService; }
/// <summary> /// Create a server that can set up sessions for virtual world client <-> server communications /// </summary> /// <param name="_listenIP"></param> /// <param name="port"></param> /// <param name="proxyPortOffset"></param> /// <param name="allow_alternate_port"></param> /// <param name="assetCache"></param> /// <param name="authenticateClass"></param> /// <returns></returns> public IClientNetworkServer CreateServer( IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IAssetCache assetCache, AgentCircuitManager authenticateClass) { return(CreateServer( _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, assetCache, authenticateClass)); }
/// <summary> /// Initialize the server /// </summary> /// <param name="_listenIP"></param> /// <param name="port"></param> /// <param name="proxyPortOffsetParm"></param> /// <param name="allow_alternate_port"></param> /// <param name="configSource"></param> /// <param name="assetCache"></param> /// <param name="circuitManager"></param> public void Initialise( IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, IAssetCache assetCache, AgentCircuitManager circuitManager) { ClientStackUserSettings userSettings = new ClientStackUserSettings(); IConfig config = configSource.Configs["ClientStack.LindenUDP"]; if (config != null) { if (config.Contains("client_throttle_multiplier")) { userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier"); } } m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler); proxyPortOffset = proxyPortOffsetParm; listenPort = (uint)(port + proxyPortOffsetParm); listenIP = _listenIP; Allow_Alternate_Port = allow_alternate_port; m_assetCache = assetCache; m_circuitManager = circuitManager; CreatePacketServer(userSettings); // Return new port // This because in Grid mode it is not really important what port the region listens to as long as it is correctly registered. // So the option allow_alternate_ports="true" was added to default.xml port = (uint)(listenPort - proxyPortOffsetParm); }
public ScriptLoader(IAssetCache assetCache, ExecutionScheduler exeScheduler, WorkArrivedDelegate workArrived, EngineInterface engineInterface) { _assetCache = assetCache; _exeScheduler = exeScheduler; _workArrived = workArrived; _engineInterface = engineInterface; this.CreateDirectoryStructure(); }
public HGGridServicesStandalone(NetworkServersInfo servers_info, BaseHttpServer httpServe, IAssetCache asscache, SceneManager sman) : base(servers_info, sman) { //Respond to Grid Services requests MainServer.Instance.AddXmlRPCHandler("logoff_user", LogOffUser); MainServer.Instance.AddXmlRPCHandler("check", PingCheckReply); MainServer.Instance.AddXmlRPCHandler("land_data", LandData); }
public void RemoveRegion(Scene s) { s.EventManager.OnRegisterCaps -= RegisterCaps; --m_nscenes; if (m_nscenes <= 0) { m_assetCache = null; } }
/// <summary> /// Create a new client circuit /// </summary> /// <param name="remoteEP"></param> /// <param name="scene"></param> /// <param name="assetCache"></param> /// <param name="packServer"></param> /// <param name="sessionInfo"></param> /// <param name="agentId"></param> /// <param name="sessionId"></param> /// <param name="circuitCode"></param> /// <param name="proxyEP"></param> /// <returns></returns> protected virtual IClientAPI CreateNewCircuit( EndPoint remoteEP, IScene scene, IAssetCache assetCache, LLPacketServer packServer, AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) { return (new LLClientView( remoteEP, scene, assetCache, packServer, sessionInfo, agentId, sessionId, circuitCode, proxyEP, m_userSettings)); }
/// <summary> /// Constructor /// </summary> /// <param name="serversInfo"></param> /// <param name="httpServer"></param> /// <param name="assetCache"></param> public CommunicationsManager(NetworkServersInfo serversInfo, IHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder) { m_networkServersInfo = serversInfo; m_assetCache = assetCache; m_httpServer = httpServer; LibraryRoot = libraryRootFolder; Preload(); }
protected internal AssetsRequest( AssetsArchiver assetsArchiver, ICollection <UUID> uuids, IAssetCache assetCache, AssetsRequestCallback assetsRequestCallback) { m_assetsArchiver = assetsArchiver; m_uuids = uuids; m_assetsRequestCallback = assetsRequestCallback; m_assetCache = assetCache; m_repliesRequired = uuids.Count; }
protected internal AssetsRequest( AssetsArchiver assetsArchiver, ICollection<UUID> uuids, IAssetCache assetCache, AssetsRequestCallback assetsRequestCallback) { m_assetsArchiver = assetsArchiver; m_uuids = uuids; m_assetsRequestCallback = assetsRequestCallback; m_assetCache = assetCache; m_repliesRequired = uuids.Count; }
/// <summary> /// Start a script which is in this prim's inventory. /// </summary> /// <param name="item"></param> /// <returns></returns> public void CreateScriptInstance(TaskInventoryItem item, int startParam, bool postOnRez, string engine, int stateSource) { // m_log.InfoFormat( // "[PRIM INVENTORY]: " + // "Starting script {0}, {1} in prim {2}, {3}", // item.Name, item.ItemID, Name, UUID); if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) { return; } m_part.AddFlag(PrimFlags.Scripted); if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) { if (stateSource == 1 && // Prim crossing m_part.ParentGroup.Scene.m_trustBinaries) { m_items[item.ItemID].PermsMask = 0; m_items[item.ItemID].PermsGranter = UUID.Zero; m_part.ParentGroup.Scene.EventManager.TriggerRezScript( m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource); m_part.ParentGroup.AddActiveScriptCount(1); m_part.ScheduleFullUpdate(); return; } IAssetCache cache = m_part.ParentGroup.Scene.CommsManager.AssetCache; cache.GetAsset(item.AssetID, delegate(UUID assetID, AssetBase asset) { if (null == asset) { m_log.ErrorFormat( "[PRIM INVENTORY]: " + "Couldn't start script {0}, {1} since asset ID {2} could not be found", item.Name, item.ItemID, item.AssetID); } else { if (m_part.ParentGroup.m_savedScriptState != null) { RestoreSavedScriptState(item.OldItemID, item.ItemID); } m_items[item.ItemID].PermsMask = 0; m_items[item.ItemID].PermsGranter = UUID.Zero; string script = Utils.BytesToString(asset.Data); m_part.ParentGroup.Scene.EventManager.TriggerRezScript( m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); m_part.ParentGroup.AddActiveScriptCount(1); m_part.ScheduleFullUpdate(); } }, false); } }
public ThemeController( IThemeRegistry themeRegistry, IThemeVariablesService themeVarService, IThemeContext themeContext, IAssetCache assetCache) { _themeVarService = themeVarService; _themeRegistry = themeRegistry; _themeContext = themeContext; _assetCache = assetCache; }
public void RegionLoaded(Scene scene) { if (m_cache == null) { IAssetCache cache = scene.RequestModuleInterface <IAssetCache>(); if (cache is ISharedRegionModule) { m_cache = cache; } } }
public UuidGatherer(IAssetCache assetCache) { m_assetCache = assetCache; ISerializationEngine engine; if (ProviderRegistry.Instance.TryGet <ISerializationEngine>(out engine)) { m_inventorySerializer = engine.InventoryObjectSerializer; } }
public void Register(IWorkitemTreeView view) { if (view == null) { throw new ArgumentNullException("view"); } this.view = view; view.Controller = this; assetCache = DataLayer.CreateAssetCache(); }
public void SetUp() { dataLayerMock = mockRepository.StrictMock<IDataLayer>(); assetCacheMock = mockRepository.StrictMock<IAssetCache>(); settingsMock = mockRepository.StrictMock<ISettings>(); viewMock = mockRepository.StrictMock<IWorkitemTreeView>(); waitCursorStub = mockRepository.Stub<IWaitCursor>(); eventDispatcherMock = mockRepository.Stub<IEventDispatcher>(); loggerFactoryMock = mockRepository.DynamicMock<ILoggerFactory>(); effortTrackingMock = mockRepository.StrictMock<IEffortTracking>(); loggerFactoryMock.Stub(x => x.GetLogger(null)).IgnoreArguments().Return(mockRepository.Stub<ILogger>()); configuration = new Configuration(); Container.Rebind<IDataLayer>().ToConstant(dataLayerMock); controller = new WorkitemTreeController(loggerFactoryMock, dataLayerMock, configuration, settingsMock, eventDispatcherMock); }
public CommunicationsOGS1( NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, LibraryRootFolder libraryRootFolder, ConfigSettings configSettings) : base(serversInfo, httpServer, assetCache, libraryRootFolder) { OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); m_gridService = gridInterComms; // This plugin arrangement could eventually be configurable rather than hardcoded here. OGS1UserServices userServices = new OGS1UserServices(this); //userServices.AddPlugin(new TemporaryUserProfilePlugin()); userServices.AddPlugin(new OGS1UserDataPlugin(this, configSettings)); m_userService = userServices; m_messageService = userServices; m_avatarService = (IAvatarService)m_userService; PluginLoader<IInventoryStoragePlugin> loader = new PluginLoader<IInventoryStoragePlugin>(); loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin)); loader.Load(); loader.Plugin.Initialize(configSettings); }
/// <summary> /// Create a new client circuit /// </summary> /// <param name="remoteEP"></param> /// <param name="scene"></param> /// <param name="assetCache"></param> /// <param name="packServer"></param> /// <param name="sessionInfo"></param> /// <param name="agentId"></param> /// <param name="sessionId"></param> /// <param name="circuitCode"></param> /// <param name="proxyEP"></param> /// <returns></returns> protected virtual IClientAPI CreateNewCircuit( EndPoint remoteEP, IScene scene, IAssetCache assetCache, LLPacketServer packServer, AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) { return new LLClientView( remoteEP, scene, assetCache, packServer, sessionInfo, agentId, sessionId, circuitCode, proxyEP, m_userSettings); }
public void GetWorkitems(IAssetCache assetCache) { if(!connector.IsConnected) { Logger.Error("Not connected to VersionOne."); } if(CurrentProjectId == null) { throw new DataLayerException("Current project is not selected"); } if(assetCache.IsSet) { return; } try { var parentDef = workitemType.GetAttributeDefinition("Parent"); var query = new Query(workitemType, parentDef); AddSelection(query, Entity.TaskType); AddSelection(query, Entity.StoryType); AddSelection(query, Entity.DefectType); AddSelection(query, Entity.TestType); query.Filter = GetScopeFilter(workitemType); query.OrderBy.MajorSort(primaryWorkitemType.DefaultOrderBy, OrderBy.Order.Ascending); query.OrderBy.MinorSort(workitemType.DefaultOrderBy, OrderBy.Order.Ascending); var assetList = connector.Services.Retrieve(query); assetCache.ToInternalCache().Set(assetList.Assets); } catch(MetaException ex) { Logger.Error("Unable to get workitems.", ex); } catch(WebException ex) { connector.IsConnected = false; Logger.Error("Unable to get workitems.", ex); } catch(Exception ex) { Logger.Error("Unable to get workitems.", ex); } }
public void CommitChanges(IAssetCache assetCache) { if(!connector.IsConnected) { Logger.Error("Not connected to VersionOne."); } try { var validationResult = new Dictionary<Asset, List<RequiredFieldsDto>>(); var internalCache = assetCache.ToInternalCache(); var workitems = assetCache.GetWorkitems(true); foreach(var item in workitems) { if(!ValidateWorkitemAndCommitOnSuccess(item, internalCache.Efforts, validationResult)) { continue; } foreach(var child in item.Children) { ValidateWorkitemAndCommitOnSuccess(child, internalCache.Efforts, validationResult); } } if(validationResult.Count > 0) { throw new ValidatorException(requiredFieldsValidator.CreateErrorMessage(validationResult)); } } catch(APIException ex) { Logger.Error("Failed to commit changes.", ex); } }
public void AddRegion(Scene pScene) { m_Scene = pScene; m_AssetCache = m_Scene.CommsManager.AssetCache; }
public AssetsDearchiver(IAssetCache cache) { m_cache = cache; }
public CachedGetAssetStreamHandler(IAssetCache assetProvider) : base("GET", "/assets") { m_assetProvider = assetProvider; }
/// <summary> /// Create a server that can set up sessions for virtual world client <-> server communications /// </summary> /// <param name="_listenIP"></param> /// <param name="port"></param> /// <param name="proxyPortOffset"></param> /// <param name="allow_alternate_port"></param> /// <param name="configSource"> /// Can be null, in which case default values are used /// </param> /// <param name="assetCache"></param> /// <param name="authenticateClass"></param> /// <returns></returns> public IClientNetworkServer CreateServer( IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource, IAssetCache assetCache) { if (plugin != null) { IClientNetworkServer server = (IClientNetworkServer)Activator.CreateInstance(pluginAssembly.GetType(plugin.ToString())); server.Initialize( _listenIP, ref port, proxyPortOffset, allow_alternate_port, configSource); return server; } m_log.Error("[CLIENTSTACK]: Couldn't initialize a new server"); return null; }
public Meshmerizer() { _assetCache = ProviderRegistry.Instance.Get<IAssetCache>(); }
public void Register(IWorkitemTreeView view) { if(view == null) { throw new ArgumentNullException("view"); } this.view = view; view.Controller = this; assetCache = DataLayer.CreateAssetCache(); }
public InventoryCapsHandler(Scene scene, UUID agentID, Caps caps) { m_agentID = agentID; m_Caps = caps; m_Scene = scene; m_httpServer = m_Caps.HttpListener; m_regionName = m_Scene.RegionInfo.RegionName; m_assetCache = m_Scene.CommsManager.AssetCache; m_inventoryProviderSelector = ProviderRegistry.Instance.Get<IInventoryProviderSelector>(); m_checkedStorageProvider = m_inventoryProviderSelector.GetCheckedProvider(m_Caps.AgentID); m_libraryFolder = m_Scene.CommsManager.LibraryRoot; m_inventoryPool.Name = "Inventory Caps " + agentID; }
public UuidGatherer(IAssetCache assetCache) { m_assetCache = assetCache; }
/// <summary> /// Create a server that can set up sessions for virtual world client <-> server communications /// </summary> /// <param name="_listenIP"></param> /// <param name="port"></param> /// <param name="proxyPortOffset"></param> /// <param name="allow_alternate_port"></param> /// <param name="assetCache"></param> /// <param name="authenticateClass"></param> /// <returns></returns> public IClientNetworkServer CreateServer( IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IAssetCache assetCache) { return CreateServer( _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, assetCache); }
/// <summary> /// Add a new client circuit. We assume that is has already passed an authorization check /// </summary> /// <param name="epSender"></param> /// <param name="useCircuit"></param> /// <param name="assetCache"></param> /// <param name="sessionInfo"></param> /// <param name="proxyEP"></param> /// <returns> /// true if a new circuit was created, false if a circuit with the given circuit code already existed /// </returns> public virtual bool AddNewClient( EndPoint epSender, UseCircuitCodePacket useCircuit, IAssetCache assetCache, AuthenticateResponse sessionInfo, EndPoint proxyEP) { IClientAPI newuser; uint circuitCode = useCircuit.CircuitCode.Code; if (m_scene.ClientManager.TryGetClient(circuitCode, out newuser)) { // The circuit is already known to the scene. This not actually a problem since this will currently // occur if a client is crossing borders (hence upgrading its circuit). However, we shouldn't // really by trying to add a new client if this is the case. return false; } UUID agentId = useCircuit.CircuitCode.ID; UUID sessionId = useCircuit.CircuitCode.SessionID; newuser = CreateNewCircuit( epSender, m_scene, assetCache, this, sessionInfo, agentId, sessionId, circuitCode, proxyEP); m_scene.ClientManager.Add(circuitCode, newuser); newuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler; newuser.OnLogout += LogoutHandler; newuser.OnConnectionClosed += CloseClient; newuser.Start(); return true; }