Ejemplo n.º 1
0
        public FolderItemViewModel(IAssetService repository, FolderItem folderItem)
			: base(repository)
        {
            CurrentFolderItem = folderItem;

            // OpenItemCommand = new DelegateCommand(() => DoOpenAsset());
        }
        public UploadBakedTextureServerConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            if (configName != String.Empty)
                m_ConfigName = configName;

            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));

            string assetService = serverConfig.GetString("AssetService", String.Empty);

            if (assetService == String.Empty)
                throw new Exception("No AssetService in config file");

            Object[] args = new Object[] { config };
            m_AssetService =
                    ServerUtils.LoadPlugin<IAssetService>(assetService, args);

            if (m_AssetService == null)
                throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));

            // NEED TO FIX THIS
            OpenSim.Framework.Capabilities.Caps caps = new OpenSim.Framework.Capabilities.Caps(server, "", server.Port, "", UUID.Zero, "");
            server.AddStreamHandler(new RestStreamHandler(
                        "POST",
                        "/CAPS/UploadBakedTexture/",
                        new UploadBakedTextureHandler(caps, m_AssetService, true).UploadBakedTexture,
                        "UploadBakedTexture",
                        "Upload Baked Texture Capability"));

         }
Ejemplo n.º 3
0
 public Abuse(IAssetService assetService)
 {
     InitializeComponent();
     m_assetService = assetService;
     AbuseReportsConnector = Aurora.DataManager.DataManager.RequestPlugin<IAbuseReportsConnector>();
     Password = Util.Md5Hash(Microsoft.VisualBasic.Interaction.InputBox("Password for abuse reports database.", "Password Input Required", "", 0, 0));
 }
Ejemplo n.º 4
0
        // Constructor for standalone mode
        public HGInventoryService(InventoryServiceBase invService, IAssetService assetService, UserManagerBase userService, IHttpServer httpserver, string thisurl)
        {
            m_userService = userService;
            m_assetProvider = assetService;

            Init(invService, thisurl, httpserver);
        }
Ejemplo n.º 5
0
 public AssetServerGetHandler(IAssetService service, string url, string SessionID, IRegistryCore registry) :
     base("GET", url)
 {
     m_AssetService = service;
     m_SessionID = SessionID;
     m_registry = registry;
 }
Ejemplo n.º 6
0
 public Abuse(IAssetService assetService)
 {
     InitializeComponent();
     m_assetService = assetService;
     //AbuseReportsConnector = Aurora.DataManager.DataManager.RequestPlugin<IAbuseReportsConnector>();
     //Abuse.InputBox("Password Input Required", "Password for abuse reports database", ref Password);
 }
Ejemplo n.º 7
0
 public void RegionLoaded(Scene scene)
 {
     InventoryService = m_scene.InventoryService;
     AssetService = m_scene.AssetService;
     UserAccountService = m_scene.UserAccountService;
     AvatarService = m_scene.AvatarService;
 }
        public AssetServiceConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            if (configName != String.Empty)
                m_ConfigName = configName;

            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));

            string assetService = serverConfig.GetString("LocalServiceModule",
                    String.Empty);

            if (assetService == String.Empty)
                throw new Exception("No AssetService in config file");

            Object[] args = new Object[] { config };
            m_AssetService =
                    ServerUtils.LoadPlugin<IAssetService>(assetService, args);

            bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false);

            server.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
            server.AddStreamHandler(new AssetServerPostHandler(m_AssetService));
            server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowDelete));
        }
Ejemplo n.º 9
0
 public AssetController(IAssetService assetService, IAssetViewService assetViewService)
 {
     Auxilium.Validation.Validate.NotNull(assetService);
     Auxilium.Validation.Validate.NotNull(assetViewService);
     _assetService = assetService;
     _assetViewService = assetViewService;
 }
Ejemplo n.º 10
0
 public virtual void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = Aurora.DataManager.DataManager.RequestPlugin<IInventoryData> ();
     m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>();
     m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
     m_AssetService = registry.RequestModuleInterface<IAssetService>();
 }
Ejemplo n.º 11
0
        public AssetServerConnector(IConfigSource config, IHttpServer server) :
            base(config, server, "AssetService")
        {
            IConfig serverConfig = config.Configs["AssetService"];
            if (serverConfig == null)
                throw new Exception("No AssetService section in config file");

            string assetService = serverConfig.GetString("LocalServiceModule", String.Empty);

            if (String.IsNullOrEmpty(assetService))
                throw new Exception("No LocalServiceModule in AssetService section in config file");

            Object[] args = new Object[] { config };
            m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args);

            if (m_AssetService == null)
                throw new Exception("Failed to load IAssetService \"" + assetService + "\"");

            // Asset service endpoints
            server.AddStreamHandler(new TrustedStreamHandler("GET", "/assets", new CBAssetServerGetHandler(m_AssetService)));
            server.AddStreamHandler(new TrustedStreamHandler("POST", "/assets", new CBAssetServerPostHandler(m_AssetService)));
            server.AddStreamHandler(new TrustedStreamHandler("DELETE", "/assets", new CBAssetServerDeleteHandler(m_AssetService)));

            // Register this server connector as a Cable Beach service
            CableBeachServerState.RegisterService(new Uri(CableBeachServices.ASSETS), CreateCapabilitiesHandler);

            CableBeachServerState.Log.Info("[CABLE BEACH ASSETS]: AssetServerConnector is running");
        }
 public void Init()
 {
     // FIXME: We don't need a full scene here - it would be enough to set up the asset service.
     Scene scene = SceneSetupHelpers.SetupScene();
     m_assetService = scene.AssetService;
     m_uuidGatherer = new UuidGatherer(m_assetService);
 }
		public PickAssetViewModel(IAssetService assetRepository,
			IViewModelsFactory<IInputNameDialogViewModel> inputNameVmFactory)
		{
			_assetRepository = assetRepository;
			_inputNameVmFactory = inputNameVmFactory;

			AddressBarItems = new ObservableCollection<AssetEntitySearchViewModelBase>();
			SelectedFolderItems = new ObservableCollection<AssetEntitySearchViewModelBase>();

			CommonNotifyRequest = new InteractionRequest<Notification>();

			OpenItemCommand = new DelegateCommand<object>(RaiseOpenItemRequest);
			RefreshCommand = new DelegateCommand(LoadItems);
			UploadCommand = new DelegateCommand(RaiseUploadRequest, () => ParentItem.Type == AssetType.Container || ParentItem.Type == AssetType.Folder);
			CreateFolderCommand = new DelegateCommand(RaiseCreateFolderRequest);
			RenameCommand = new DelegateCommand(RaiseRenameRequest);
			DeleteCommand = new DelegateCommand(RaiseDeleteRequest);
			ParentItem = new RootSearchViewModel(null);
			CommonConfirmRequest = new InteractionRequest<Confirmation>();

			InputNameDialogRequest = new InteractionRequest<ConditionalConfirmation>();

			AssetPickMode = true;
			RootItemId = null;
		}
Ejemplo n.º 14
0
 public AssetServerPostHandler(IAssetService service, string url, ulong regionHandle, IRegistryCore registry) :
     base("POST", url)
 {
     m_AssetService = service;
     m_regionHandle = regionHandle;
     m_registry = registry;
 }
Ejemplo n.º 15
0
		public ImportService(IImportRepository importRepository, IAssetService blobProvider, ICatalogRepository catalogRepository, IOrderRepository orderRepository, IAppConfigRepository appConfigRepository, IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory)
		{
			_orderRepository = orderRepository;
			_catalogRepository = catalogRepository;
			_importJobRepository = importRepository;
			_appConfigRepository = appConfigRepository;
			_appConfigRepositoryFactory = appConfigRepositoryFactory;
			_assetProvider = blobProvider;

			_entityImporters = new List<IEntityImporter>
				{
					new ItemImporter() { Name = "Product"},
					new ItemImporter() { Name = "Sku"},
					new ItemImporter() { Name = "Bundle"},
					new ItemImporter() { Name = "DynamicKit"},
					new ItemImporter() { Name = "Package"},
					new PriceImporter(_catalogRepository),
					new AssociationImporter(_catalogRepository),
					new RelationImporter(_catalogRepository),
					new CategoryImporter(),
					new LocalizationImporter(),
					new TaxValueImporter(),
					new ItemAssetImporter(),
					new TaxCategoryImporter(),
					new JurisdictionImporter(),
					new JurisdictionGroupImporter(),
					new SeoImporter()
				};

			_importResults = new Dictionary<string, ImportResult>();
		}
Ejemplo n.º 16
0
        public GetMeshServerConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            if (configName != String.Empty)
                m_ConfigName = configName;

            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));

            string assetService = serverConfig.GetString("AssetService", String.Empty);

            if (assetService == String.Empty)
                throw new Exception("No AssetService in config file");

            Object[] args = new Object[] { config };
            m_AssetService =
                    ServerUtils.LoadPlugin<IAssetService>(assetService, args);

            if (m_AssetService == null)
                throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));

            string rurl = serverConfig.GetString("GetMeshRedirectURL");

            GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
            IRequestHandler reqHandler
                = new RestHTTPHandler(
                    "GET",
                    "/CAPS/" + UUID.Random(),
                    httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
                    "GetMesh",
                    null);
            server.AddStreamHandler(reqHandler); ;
        }
        public GetTextureServerConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            if (configName != String.Empty)
                m_ConfigName = configName;

            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));

            string assetService = serverConfig.GetString("AssetService", String.Empty);

            if (assetService == String.Empty)
                throw new Exception("No AssetService in config file");

            Object[] args = new Object[] { config };
            m_AssetService =
                    ServerUtils.LoadPlugin<IAssetService>(assetService, args);

            if (m_AssetService == null)
                throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));

            string rurl = serverConfig.GetString("GetTextureRedirectURL");
            ;
            server.AddStreamHandler(
                new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null, rurl));
        }
Ejemplo n.º 18
0
 public AssetServerDeleteHandler(IAssetService service, bool allowDelete, string url, ulong regionHandle, IRegistryCore registry) :
     base("DELETE", url)
 {
     m_AssetService = service;
     m_allowDelete = allowDelete;
     m_regionHandle = regionHandle;
     m_registry = registry;
 }
 public AssetServerGetHandler(IAssetService service, IServiceAuth auth, string redirectURL) :
     base("GET", "/assets", auth)
 {
     m_AssetService = service;
     m_RedirectURL = redirectURL;
     if (!m_RedirectURL.EndsWith("/"))
         m_RedirectURL = m_RedirectURL.TrimEnd('/');
 }
 public AssetServerDeleteHandler(IAssetService service, bool allowDelete, string url, string SessionID, IRegistryCore registry) :
     base("DELETE", url)
 {
     m_AssetService = service;
     m_allowDelete = allowDelete;
     m_SessionID = SessionID;
     m_registry = registry;
 }
Ejemplo n.º 21
0
 public GetTextureRobustHandler(string path, IAssetService assService, string name, string description, string redirectURL)
     : base("GET", path, name, description)
 {
     m_assetService = assService;
     m_RedirectURL = redirectURL;
     if (m_RedirectURL != null && !m_RedirectURL.EndsWith("/"))
         m_RedirectURL += "/";
 }
Ejemplo n.º 22
0
		public FolderViewModel(IAssetService repository, Folder folder)
			: base(repository)
		{
			CurrentFolder = folder;
			EmbeddedHierarchyEntry = this;

			OpenItemCommand = new DelegateCommand(DoOpenFolder);
		}
Ejemplo n.º 23
0
        public virtual void Start(IConfigSource config, IRegistryCore registry)
        {
            m_Database = DataManager.RequestPlugin<IInventoryData>();
            m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>();
            m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
            m_AssetService = registry.RequestModuleInterface<IAssetService>();

            registry.RequestModuleInterface<ISimulationBase>().EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
        }
		public CaseCommunicationControlViewModel(IAssetService assetService, IViewModelsFactory<IKnowledgeBaseDialogViewModel> knowledgeBaseGroupVmFactory, IAuthenticationContext authContext, string authorId, string authorName, CustomersDetailViewModel parentViewModel)
			: base(assetService, knowledgeBaseGroupVmFactory, authorId, authorName)
		{
			_parentViewModel = parentViewModel;
			_authContext = authContext;
			CommonConfirmRequest = new InteractionRequest<Confirmation>();
			IsReadOnly = !_authContext.CheckPermission(PredefinedPermissions.CustomersAddCaseComments);
			DefToolBarCommands();
		}
 public InventoryArchiveReadRequest(
     CachedUserInfo userInfo, string invPath, string loadPath, CommunicationsManager commsManager, IAssetService assetService)
     : this(
         userInfo,
         invPath,
         new GZipStream(new FileStream(loadPath, FileMode.Open), CompressionMode.Decompress),
         commsManager, assetService)
 {
 }
 public InventoryArchiveReadRequest(
     CachedUserInfo userInfo, string invPath, Stream loadStream, CommunicationsManager commsManager, IAssetService assetService)
 {
     m_userInfo = userInfo;
     m_invPath = invPath;
     m_loadStream = loadStream;
     m_commsManager = commsManager;
     m_assetService = assetService;
 }
Ejemplo n.º 27
0
        public RegionClient(GriderProxy p, string regionurl, string auth)
        {
            proxy = p;
            RegionURL = regionurl;
            AuthToken = auth;
            //assDownloader = new AssetDownloader(RegionURL, this);

            m_RegionAssetService = new AssetServicesConnector(RegionURL);
        }
Ejemplo n.º 28
0
        public void IncomingCapsRequest (UUID agentID, Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs)
        {
            m_agentID = agentID;
            m_moneyModule = simbase.ApplicationRegistry.RequestModuleInterface<IMoneyModule> ();
            m_assetService = simbase.ApplicationRegistry.RequestModuleInterface<IAssetService> ();
            m_inventoryService = simbase.ApplicationRegistry.RequestModuleInterface<IInventoryService> ();
            m_libraryService = simbase.ApplicationRegistry.RequestModuleInterface<ILibraryService> ();
            m_inventoryData = Framework.Utilities.DataManager.RequestPlugin<IInventoryData> ();

            HttpServerHandle method;
            string uri;

            method = (path, request, httpRequest, httpResponse) => HandleFetchInventoryDescendents (request, m_agentID);
            uri = "/CAPS/FetchInventoryDescendents/" + UUID.Random () + "/";
            capURLs ["WebFetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri;
            capURLs ["FetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri;
            capURLs ["FetchInventoryDescendents2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add (uri);
            MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method));

            method = (path, request, httpRequest, httpResponse) => HandleFetchLibDescendents (request, m_agentID);
            uri = "/CAPS/FetchLibDescendents/" + UUID.Random () + "/";
            capURLs ["FetchLibDescendents"] = MainServer.Instance.ServerURI + uri;
            capURLs ["FetchLibDescendents2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add (uri);
            MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method));

            method = (path, request, httpRequest, httpResponse) => HandleFetchInventory (request, m_agentID);
            uri = "/CAPS/FetchInventory/" + UUID.Random () + "/";
            capURLs ["FetchInventory"] = MainServer.Instance.ServerURI + uri;
            capURLs ["FetchInventory2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add (uri);
            MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method));

            method = (path, request, httpRequest, httpResponse) => HandleFetchLib (request, m_agentID);
            uri = "/CAPS/FetchLib/" + UUID.Random () + "/";
            capURLs ["FetchLib"] = MainServer.Instance.ServerURI + uri;
            capURLs ["FetchLib2"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add (uri);
            MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method));


            uri = "/CAPS/NewFileAgentInventory/" + UUID.Random () + "/";
            capURLs ["NewFileAgentInventory"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add (uri);
            MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, NewAgentInventoryRequest));

            uri = "/CAPS/NewFileAgentInventoryVariablePrice/" + UUID.Random () + "/";
            capURLs ["NewFileAgentInventoryVariablePrice"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add (uri);
            MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, NewAgentInventoryRequestVariablePrice));

            uri = "/CAPS/CreateInventoryCategory/" + UUID.Random () + "/";
            capURLs ["CreateInventoryCategory"] = MainServer.Instance.ServerURI + uri;
            m_uris.Add (uri);
            MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, CreateInventoryCategory));
        }
Ejemplo n.º 29
0
 public Abuse(IAssetService assetService, IJ2KDecoder j2k)
 {
     InitializeComponent();
     m_decoder = j2k;
     m_assetService = assetService;
     AbuseReportsConnector = DataManager.DataManager.RequestPlugin<IAbuseReportsConnector>();
     Password = "";
     Utilities.InputBox("Password Input Required", "Password for abuse reports database", ref Password);
 }
Ejemplo n.º 30
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service = service;
            m_assetService = service.Registry.RequestModuleInterface<IAssetService>();
            m_inventoryService = service.Registry.RequestModuleInterface<IInventoryService>();
            m_libraryService = service.Registry.RequestModuleInterface<ILibraryService>();

            RestBytesMethod method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleWebFetchInventoryDescendents(request, m_service.AgentID);
            };
            service.AddStreamHandler("WebFetchInventoryDescendents",
                new RestBytesStreamHandler("POST", service.CreateCAPS("WebFetchInventoryDescendents", ""),
                                                      method));

            method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleFetchLibDescendents(request, m_service.AgentID);
            };
            service.AddStreamHandler("FetchLibDescendents",
                new RestBytesStreamHandler("POST", service.CreateCAPS("FetchLibDescendents", ""),
                                                      method));

            method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleFetchInventory(request, m_service.AgentID);
            };
            service.AddStreamHandler("FetchInventory",
                new RestBytesStreamHandler("POST", service.CreateCAPS("FetchInventory", ""),
                                                      method));

            method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleFetchLib(request, m_service.AgentID);
            };
            service.AddStreamHandler("FetchLib",
                new RestBytesStreamHandler("POST", service.CreateCAPS("FetchLib", ""),
                                                      method));

            service.AddStreamHandler("NewFileAgentInventory",
                new RestStreamHandler("POST", service.CreateCAPS("NewFileAgentInventory", m_newInventory),
                                                      NewAgentInventoryRequest));

            /*method = delegate(string request, string path, string param,
                                                                OSHttpRequest httpRequest, OSHttpResponse httpResponse)
            {
                return HandleInventoryItemCreate(request, m_service.AgentID);
            };
            service.AddStreamHandler("InventoryItemCreate",
                new RestBytesStreamHandler("POST", service.CreateCAPS("InventoryItemCreate", ""),
                                                      method));*/
        }
Ejemplo n.º 31
0
 public AssetApiController(IUnitOfWork unitOfWork,
                           IAssetService assetService,
                           IAssetRepository assetRepository,
                           IBondRepository bondRepository,
                           IPortfolioRepository portfolioRepository,
                           ISessionService sessionService,
                           ILogger logger)
     : base(logger, unitOfWork, sessionService)
 {
     _assetService        = assetService;
     _assetRepository     = assetRepository;
     _bondRepository      = bondRepository;
     _portfolioRepository = portfolioRepository;
 }
Ejemplo n.º 32
0
 public ProjectsController(
     IPermissionService permissionService,
     IProjectsService projectsService,
     IAssetService assetService,
     IGraphService graphService,
     IApplicationIdentityService applicationIdentityService
     )
 {
     _permissionService          = permissionService ?? throw new ArgumentNullException(nameof(permissionService));
     _projectsService            = projectsService ?? throw new ArgumentNullException(nameof(projectsService));
     _graphService               = graphService ?? throw new ArgumentNullException(nameof(graphService));
     _assetService               = assetService ?? throw new ArgumentNullException(nameof(assetService));
     _applicationIdentityService = applicationIdentityService ?? throw new ArgumentNullException(nameof(applicationIdentityService));
 }
Ejemplo n.º 33
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public LLClientView(EndPoint remoteEP, IScene scene, LLUDPServer udpServer, LLUDPClient udpClient,
                            AgentCircuitData sessionInfo,
                            UUID agentId, UUID sessionId, uint circuitCode)
        {
            startMem = GC.GetTotalMemory(false);

            InitDefaultAnimations();

            m_scene = scene;

            IConfig advancedConfig = m_scene.Config.Configs ["ClientStack.LindenUDP"];

            if (advancedConfig != null)
            {
                m_allowUDPInv = advancedConfig.GetBoolean("AllowUDPInventory", m_allowUDPInv);
            }

            //m_killRecord = new HashSet<uint>();
            //            m_attachmentsSent = new HashSet<uint>();

            m_assetService = m_scene.RequestModuleInterface <IAssetService> ();
            m_GroupsModule = scene.RequestModuleInterface <IGroupsModule> ();
            m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface <IJ2KDecoder> ());
            ISimulationBase simulationBase = m_scene.RequestModuleInterface <ISimulationBase> ();

            if (simulationBase != null)
            {
                m_channelVersion = Util.StringToBytes256(simulationBase.Version);
            }
            m_agentId         = agentId;
            m_sessionId       = sessionId;
            m_secureSessionId = sessionInfo.SecureSessionID;
            m_circuitCode     = circuitCode;
            m_userEndPoint    = remoteEP;
            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.AllScopeIDs, m_agentId);

            if (account != null)
            {
                m_Name = account.Name;
            }

            StartPos = sessionInfo.StartingPosition;

            m_udpServer = udpServer;
            m_udpClient = udpClient;
            m_udpClient.OnQueueEmpty  += HandleQueueEmpty;
            m_udpClient.OnPacketStats += PopulateStats;

            RegisterLocalPacketHandlers();
        }
Ejemplo n.º 34
0
        public LLImageManager(LLClientView client, IAssetService pAssetCache, IJ2KDecoder pJ2kDecodeModule)
        {
            m_client = client;
            m_assetCache = pAssetCache;

            if (pAssetCache != null && m_missingImage == null)
                m_missingImage = pAssetCache.Get("5748decc-f629-461c-9a36-a35a221fe21f");

            if (m_missingImage == null)
                MainConsole.Instance.Error(
                    "[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client");

            m_j2kDecodeModule = pJ2kDecodeModule;
        }
Ejemplo n.º 35
0
        // Load the OARfile specified in Globals.params.InputOAR.
        // Parameters are in 'ConvOAR.Globals.params'.
        // For the moment, the OAR file must be specified with a string because of how OpenSimulator
        //     processes the input files. Note that the filename can be an 'http:' type URL.
        public async Task <BScene> LoadOAR(IAssetService assetService, AssetManager assetManager)
        {
            BScene ret = null;

            try {
                OarConverter converter = new OarConverter(Globals.log, Globals.parms);
                ret = await converter.ConvertOarToScene(assetService, assetManager);
            }
            catch (Exception e) {
                ConvOAR.Globals.log.ErrorFormat("{0} LoadOAR exception: {1}", _logHeader, e);
                throw (e);
            }
            return(ret);
        }
Ejemplo n.º 36
0
 public WalletBalanceService(IWalletBalanceRepository balanceRepository,
                             IObservableWalletRepository observableWalletRepository,
                             IBlockChainProvider blockChainProvider,
                             IAssetService assetService,
                             Network network,
                             ILogFactory logFactory)
 {
     _balanceRepository          = balanceRepository;
     _observableWalletRepository = observableWalletRepository;
     _blockChainProvider         = blockChainProvider;
     _assetService = assetService;
     _network      = network;
     _log          = logFactory.CreateLog(this);
 }
Ejemplo n.º 37
0
        public HGRemoteAssetService(IConfigSource config, string configName)
        {
            m_log.Debug("[HGRemoteAsset Service]: Starting");
            IConfig assetConfig = config.Configs[configName];

            if (assetConfig == null)
            {
                throw new Exception("No HGAssetService configuration");
            }

            Object[] args = new Object[] { config };

            string assetConnectorDll = assetConfig.GetString("AssetConnector", String.Empty);

            if (assetConnectorDll == String.Empty)
            {
                throw new Exception("Please specify AssetConnector in HGAssetService configuration");
            }

            m_assetConnector = ServerUtils.LoadPlugin <IAssetService>(assetConnectorDll, args);
            if (m_assetConnector == null)
            {
                throw new Exception(String.Format("Unable to create AssetConnector from {0}", assetConnectorDll));
            }

            string userAccountsDll = assetConfig.GetString("UserAccountsService", string.Empty);

            if (userAccountsDll == string.Empty)
            {
                throw new Exception("Please specify UserAccountsService in HGAssetService configuration");
            }

            m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(userAccountsDll, args);
            if (m_UserAccountService == null)
            {
                throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
            }

            m_HomeURL = Util.GetConfigVarFromSections <string>(config, "HomeURI",
                                                               new string[] { "Startup", "Hypergrid", configName }, string.Empty);
            if (m_HomeURL == string.Empty)
            {
                throw new Exception("[HGAssetService] No HomeURI specified");
            }

            m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);

            // Permissions
            m_AssetPerms = new AssetPermissions(assetConfig);
        }
Ejemplo n.º 38
0
        protected internal AssetsRequest(
            AssetsArchiver assetsArchiver, IDictionary <UUID, AssetType> uuids,
            IAssetService assetService, AssetsRequestCallback assetsRequestCallback)
        {
            m_assetsArchiver        = assetsArchiver;
            m_uuids                 = uuids;
            m_assetsRequestCallback = assetsRequestCallback;
            m_assetService          = assetService;
            m_repliesRequired       = uuids.Count;

            m_requestCallbackTimer           = new System.Timers.Timer(TIMEOUT);
            m_requestCallbackTimer.AutoReset = false;
            m_requestCallbackTimer.Elapsed  += new ElapsedEventHandler(OnRequestCallbackTimeout);
        }
Ejemplo n.º 39
0
        protected override async void Start()
        {
            base.Start();
            _assetService = new LocalAssetService(_modelsData);

            var models = await _assetService.GetAssetModels();

            foreach (var model in models.Data)
            {
                var element = ModelGridElement.Create(_gridLayout.transform, model);
                element.OnInfoBtnClicked += ElementOnInfoBtnClicked;
            }
            SceneManager.sceneLoaded += SceneManagerOnSceneLoaded;
        }
Ejemplo n.º 40
0
        public AssetServerProxy(IConfigSource config) : base(config)
        {
            IConfig assetConfig = config.Configs["AssetService"];

            if (assetConfig == null)
            {
                throw new Exception("No AssetService configuration");
            }

            m_assetServiceURL  = assetConfig.GetString("AssetServerURI", String.Empty);
            m_backupServiceURL = assetConfig.GetString("BackupAssetServerURI", String.Empty);

            String[] extraServers = assetConfig.GetString("ExtraAssetServer", String.Empty).Split(new string[] { "|" }, StringSplitOptions.None);

            m_log.Info("[AssetServerProxy]: Start with AssetServerURI: " + m_assetServiceURL);

            if (m_backupServiceURL != String.Empty)
            {
                m_log.Info("[AssetServerProxy]: Add backup asset server: " + m_backupServiceURL.Trim());

                IniConfigSource fakeConfig = new IniConfigSource();
                fakeConfig.AddConfig("AssetService");
                fakeConfig.Configs["AssetService"].Set("AssetServerURI", m_backupServiceURL.Trim());

                AssetServerProxy newService = new AssetServerProxy(fakeConfig);
                m_extraAssetServers.Add(newService);
                m_backupService = newService;
            }

            if (extraServers.Length != 0)
            {
                foreach (String thisURI in extraServers)
                {
                    if (thisURI.Trim() != String.Empty)
                    {
                        m_log.Info("[AssetServerProxy]: Add extra asset server: " + thisURI.Trim());

                        IniConfigSource fakeConfig = new IniConfigSource();
                        fakeConfig.AddConfig("AssetService");
                        fakeConfig.Configs["AssetService"].Set("AssetServerURI", thisURI.Trim());

                        AssetServerProxy newService = new AssetServerProxy(fakeConfig);
                        newService.EnableErrorCounter = true;
                        m_extraAssetServers.Add(newService);
                    }
                }
            }

            m_assetService = new AssetServicesConnector(m_assetServiceURL);
        }
Ejemplo n.º 41
0
 public AdminController(
     IPermissionService permissionService,
     IProjectsService projectsService,
     IApplicationIdentityService applicationIdentityService,
     IAssetService assetService,
     IConfiguration configuration
     )
 {
     _permissionService          = permissionService ?? throw new ArgumentNullException(nameof(permissionService));
     _projectsService            = projectsService ?? throw new ArgumentNullException(nameof(projectsService));
     _assetService               = assetService ?? throw new ArgumentNullException(nameof(assetService));
     _applicationIdentityService = applicationIdentityService ?? throw new ArgumentNullException(nameof(applicationIdentityService));
     _configuration              = configuration ?? throw new ArgumentNullException(nameof(configuration));
 }
 public InventoryArchiveReadRequest(
     UUID id, InventoryArchiverModule module, IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, string loadPath, bool merge)
     : this(
         id,
         module,
         inv,
         assets,
         uacc,
         userInfo,
         invPath,
         new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress),
         merge)
 {
 }
Ejemplo n.º 43
0
 public PostRepository(
     IUserService userService,
     IUnitOfWork unitOfWork,
     IMapper mapper,
     IPostOptionsRepository postOptionsRepository,
     IAssetService assetService)
 {
     _userService           = userService;
     _unitOfWork            = unitOfWork;
     _mapper                = mapper;
     _postOptionsRepository = postOptionsRepository;
     _currentUserId         = _userService.GetCurrentUserGuid();
     _assetService          = assetService;
 }
Ejemplo n.º 44
0
        public UndoRedoService(IWorldTreeService worldTreeService, IAssetService assetService, ISerializationNecessities serializationNecessities, ITrwDiffBuilder diffBuilder)
        {
            this.worldTreeService = worldTreeService;
            this.diffBuilder      = diffBuilder;
            var handlers      = serializationNecessities.GetTrwHandlerContainer(SaveLoadConstants.WorldSerializationType);
            var typeRedirects = serializationNecessities.GetTrwHandlerTypeRedirects(SaveLoadConstants.WorldSerializationType);

            diffApplier = new TrwSerializationDiffApplier(handlers, typeRedirects,
                                                          x => x.Add(SaveLoadConstants.AssetDictBagKey, new Dictionary <string, IAsset>()),
                                                          x => x.Add(SaveLoadConstants.AssetDictBagKey, assetService.Assets));
            diffIdentityComparer = new UndoRedoDiffIdentityComparer();
            undoStack            = new Stack <IUndoable>();
            redoStack            = new Stack <IUndoable>();
            guiObserver          = null;
        }
        public ArchiveReadRequest(Scene scene, Stream loadStream, Guid requestId, Dictionary <string, object> options)
        {
            m_rootScene  = scene;
            m_loadPath   = null;
            m_loadStream = loadStream;
            m_skipAssets = options.ContainsKey("skipAssets");
            m_merge      = options.ContainsKey("merge");
            m_requestId  = requestId;

            // Zero can never be a valid user id
            m_validUserUuids[UUID.Zero] = false;

            m_groupsModule = m_rootScene.RequestModuleInterface <IGroupsModule>();
            m_assetService = m_rootScene.AssetService;
        }
Ejemplo n.º 46
0
        public string Store(AssetBase asset)
        {
            string url     = string.Empty;
            string assetID = string.Empty;

            if (StringToUrlAndAssetID(asset.ID, out url, out assetID))
            {
                IAssetService connector = GetConnector(url);
                // Restore the assetID to a simple UUID
                asset.ID = assetID;
                return(connector.Store(asset));
            }

            return(String.Empty);
        }
Ejemplo n.º 47
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            m_service      = service;
            m_assetService = service.Registry.RequestModuleInterface <IAssetService>();

            service.AddStreamHandler("GetTexture",
                                     new GenericStreamHandler("GET", service.CreateCAPS("GetTexture", ""),
                                                              ProcessGetTexture));
            service.AddStreamHandler("UploadBakedTexture",
                                     new GenericStreamHandler("POST", service.CreateCAPS("UploadBakedTexture", m_uploadBakedTexturePath),
                                                              UploadBakedTexture));
            service.AddStreamHandler("GetMesh",
                                     new GenericStreamHandler("GET", service.CreateCAPS("GetMesh", ""),
                                                              ProcessGetMesh));
        }
Ejemplo n.º 48
0
    // Start is called before the first frame update
    void Start()
    {
        _assetService = new LocalAssetService(_modelDatas);

        var model = Resources.Load <GameObject>(_assetService.GetAssetModels().Result.Data[0].ModelPath);

        if (null != model)
        {
            _placer.placedPrefab = model;
        }
        else
        {
            Debug.LogWarning("Null asset model");
        }
    }
Ejemplo n.º 49
0
        public MainViewModel(IAssetService assetService, IPartService partService,
                             IMessageDialogService messageDialogService, IEventAggregator eventAggregator, Func <IPartDetailViewModel> partDetailViewModel)
        {
            //_eventAggregator.GetEvent<AfterPartSavedEvent>().Subscribe(AfterPartSaved);
            //_eventAggregator.GetEvent<OpenPartDetailEvent>().Subscribe(OnOpenDetailPart);
            _messageDialogService = messageDialogService;

            Parts                = new ObservableCollection <Part>();
            _assetService        = assetService;
            _partService         = partService;
            _partDetailViewModel = partDetailViewModel();

            _eventAggregator = eventAggregator;
            PartDetailModel  = partDetailViewModel();
        }
Ejemplo n.º 50
0
 public TripController(
     ITripDetectorFactory tripFactory,
     IAssetService assetService,
     ITrackingPointService pointService,
     ILoggerFactory loggerFactory,
     IPipeline pipeline,
     IMapper dtoMapper)
     : base(loggerFactory)
 {
     this.pipeline     = pipeline;
     this.tripFactory  = tripFactory;
     this.assetService = assetService;
     this.pointService = pointService;
     this.dtoMapper    = dtoMapper;
 }
Ejemplo n.º 51
0
        public string GetUrlForRegisteringClient(string SessionID, ulong RegionHandle)
        {
            IHttpServer server = m_registry.RequestModuleInterface <ISimulationBase>().GetHttpServer(m_port);

            m_port = server.Port;
            string url = "/assets" + UUID.Random();

            IAssetService m_AssetService = m_registry.RequestModuleInterface <IAssetService>();

            server.AddStreamHandler(new AssetServerGetHandler(m_AssetService, url, RegionHandle, m_registry));
            server.AddStreamHandler(new AssetServerPostHandler(m_AssetService, url, RegionHandle, m_registry));
            server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, m_allowDelete, url, RegionHandle, m_registry));

            return(url);
        }
Ejemplo n.º 52
0
 public AssetController(
     IQueryAll queryAll,
     IAssetService assetService,
     ICommand command,
     IMapper mapper)
 {
     if (queryAll == null)
     {
         throw new ArgumentNullException(nameof(queryAll));
     }
     _queryAll     = queryAll;
     _assetService = assetService;
     _command      = command;
     _mapper       = mapper;
 }
Ejemplo n.º 53
0
        public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId)
        {
            m_rootScene  = scene;
            m_loadPath   = null;
            m_loadStream = loadStream;
            m_merge      = merge;
            m_skipAssets = skipAssets;
            m_requestId  = requestId;

            // Zero can never be a valid user id
            m_validUserUuids[UUID.Zero] = false;

            m_groupsModule = m_rootScene.RequestModuleInterface <IGroupsModule>();
            m_assetService = m_rootScene.AssetService;
        }
 public TripController(
     ITripDetectorFactory tripFactory,
     IAssetService assetService,
     ITripService tripService,
     ITrackingPointService pointService,
     ILoggerFactory loggerFactory,
     IPipeline pipeline)
     : base(loggerFactory)
 {
     this.pipeline     = pipeline.ThrowIfNull(nameof(pipeline));
     this.tripFactory  = tripFactory.ThrowIfNull(nameof(tripFactory));
     this.assetService = assetService.ThrowIfNull(nameof(assetService));
     this.pointService = pointService.ThrowIfNull(nameof(pointService));
     this.tripService  = tripService.ThrowIfNull(nameof(tripService));
 }
Ejemplo n.º 55
0
        public XILRT(IAssetService assets)
        {
            m_Assets    = assets;
            m_AppDomain = new ILAppDomain();
            m_Core      = XCore.GetMainInstance();
            m_XServices = m_Core.Services;

#if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE)
            m_AppDomain.UnityMainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
#endif
            LoadSymbol = XCore.GetMainInstance().DevelopMode;
#if UNITY_EDITOR
            LoadSymbol = true;
#endif
        }
Ejemplo n.º 56
0
 public ExcelController(IAreaService areaService, IAssetAttributeService attributeService,
                        IAssetAttributeValueService attributeValueService, ILocationService locationService,
                        IAssetTypeService assetTypeService, IAssetService assetService, ICampusService campusService,
                        IAssetAttributeService assetAttributeService, ApplicationUserManager _userManager)
 {
     this.areaService           = areaService;
     this.attributeService      = attributeService;
     this.attributeValueService = attributeValueService;
     this.locationService       = locationService;
     this.assetTypeService      = assetTypeService;
     this.assetService          = assetService;
     this.campusService         = campusService;
     this.assetAttributeService = assetAttributeService;
     this._userManager          = _userManager;
 }
Ejemplo n.º 57
0
        public void RegionLoaded(Scene s)
        {
            if (!m_Enabled)
            {
                return;
            }

            lock (m_loadLock)
            {
                if (m_assetService == null && m_NumberScenes == 0)
                {
                    m_assetService = s.RequestModuleInterface <IAssetService>();
                    // We'll reuse the same handler for all requests.
                    m_getAssetHandler = new GetAssetsHandler(m_assetService);
                }

                if (m_assetService == null)
                {
                    m_Enabled = false;
                    return;
                }

                if (m_UserManagement == null)
                {
                    m_UserManagement = s.RequestModuleInterface <IUserManagement>();
                }

                s.EventManager.OnRegisterCaps   += RegisterCaps;
                s.EventManager.OnDeregisterCaps += DeregisterCaps;

                m_NumberScenes++;

                if (m_workerThreads == null)
                {
                    m_workerThreads = new Thread[3];
                    for (uint i = 0; i < 3; i++)
                    {
                        m_workerThreads[i] = WorkManager.StartThread(DoAssetRequests,
                                                                     String.Format("GetCapsAssetWorker{0}", i),
                                                                     ThreadPriority.Normal,
                                                                     true,
                                                                     false,
                                                                     null,
                                                                     int.MaxValue);
                    }
                }
            }
        }
Ejemplo n.º 58
0
        public virtual bool[] AssetsExist(string[] ids)
        {
            // This method is a bit complicated because it works even if the assets belong to different
            // servers; that requires sending separate requests to each server.

            // Group the assets by the server they belong to

            var url2assets = new Dictionary <string, List <AssetAndIndex> >();

            for (int i = 0; i < ids.Length; i++)
            {
                string url     = string.Empty;
                string assetID = string.Empty;

                if (Util.ParseForeignAssetID(ids[i], out url, out assetID))
                {
                    if (!url2assets.ContainsKey(url))
                    {
                        url2assets.Add(url, new List <AssetAndIndex>());
                    }
                    url2assets[url].Add(new AssetAndIndex(UUID.Parse(assetID), i));
                }
            }

            // Query each of the servers in turn

            bool[] exist = new bool[ids.Length];

            foreach (string url in url2assets.Keys)
            {
                IAssetService connector = GetConnector(url);
                lock (EndPointLock(connector))
                {
                    List <AssetAndIndex> curAssets = url2assets[url];
                    string[]             assetIDs  = curAssets.ConvertAll(a => a.assetID.ToString()).ToArray();
                    bool[] curExist = connector.AssetsExist(assetIDs);

                    int i = 0;
                    foreach (AssetAndIndex ai in curAssets)
                    {
                        exist[ai.index] = curExist[i];
                        ++i;
                    }
                }
            }

            return(exist);
        }
Ejemplo n.º 59
0
        protected internal AssetsRequest(
            AssetsArchiver assetsArchiver, IDictionary <UUID, AssetType> uuids,
            IAssetService assetService, AssetsRequestCallback assetsRequestCallback)
        {
            m_assetsArchiver        = assetsArchiver;
            m_uuids                 = uuids;
            m_assetsRequestCallback = assetsRequestCallback;
            m_assetService          = assetService;
            m_repliesRequired       = uuids.Count;

            m_requestCallbackTimer = new Timer(TIMEOUT)
            {
                AutoReset = false
            };
            m_requestCallbackTimer.Elapsed += OnRequestCallbackTimeout;
        }
        public InventoryArchiveReadRequest(
            IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, Stream loadStream, bool merge)
        {
            m_InventoryService   = inv;
            m_AssetService       = assets;
            m_UserAccountService = uacc;
            m_merge      = merge;
            m_userInfo   = userInfo;
            m_invPath    = invPath;
            m_loadStream = loadStream;

            // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things
            // (I thought they weren't).  We will need to bump the version number and perform this check on all
            // subsequent IAR versions only
            ControlFileLoaded = true;
        }