private IMetaService CreateMeta(string rootAddress) { try { BasicHttpBinding binding = new BasicHttpBinding() { MaxReceivedMessageSize = 100000000, OpenTimeout = TimeSpan.FromMilliseconds(CONNECT_TIMEOUT), SendTimeout = TimeSpan.FromMilliseconds(READ_TIMEOUT), ReceiveTimeout = TimeSpan.FromMilliseconds(READ_TIMEOUT), CloseTimeout = TimeSpan.FromMilliseconds(CONNECT_TIMEOUT), }; ChannelFactory <IMetaService> factory = new ChannelFactory <IMetaService>( binding, new EndpointAddress(rootAddress + "MPExtended/MetaService") ); IMetaService channel = factory.CreateChannel(); if (!channel.TestConnection()) { return(null); } return(channel); } catch (Exception) { return(null); } }
/// <summary> /// base constructor /// </summary> /// <param name="translationLookup"></param> /// <param name="rconConnectionFactory"></param> public GameServerInstanceFactory(ITranslationLookup translationLookup, IRConConnectionFactory rconConnectionFactory, IGameLogReaderFactory gameLogReaderFactory, IMetaService metaService) { _translationLookup = translationLookup; _rconConnectionFactory = rconConnectionFactory; _gameLogReaderFactory = gameLogReaderFactory; _metaService = metaService; }
public ResetRankCommand(CommandConfiguration config, ITranslationLookup lookup, IMetaService metaService, IConfigurationHandlerFactory configurationHandlerFactory) : base(config, lookup) { _metaService = metaService; _configurationHandler = configurationHandlerFactory.GetConfigurationHandler <Configuration>("ClanTagRankCommands"); if (_configurationHandler.Configuration() == null) { _configurationHandler.Set((Configuration) new Configuration().Generate()); _configurationHandler.Save(); } Config = _configurationHandler.Configuration(); Name = "ResetRank"; Description = "set a user's clan tag Rank (does not give permissions)"; Alias = "rr"; Permission = EFClient.Permission.Administrator; RequiresTarget = true; Arguments = new[] { new CommandArgument() { //Name = "rank", //Required = false } }; }
protected IEnumerable <WebServiceSet> ComposeAll() { List <WebServiceSet> sets = new List <WebServiceSet>(); IPEndPoint tveAddress = hinter.GetConfiguredTVServerAddress(); string tveAddressInSet = tveAddress != null?tveAddress.ToString() : null; IMetaService tveMeta = tveAddress != null?ServiceClientFactory.CreateMeta(tveAddress) : null; // Start with the most simple case: full singleseat if (HasActiveMAS && HasActiveTAS && HasActiveWSS) { sets.Add(CreateServiceSet( OurAddress, HasActiveTAS ? OurAddress : null, HasActiveUI ? OurAddress : null )); } // Singleseat installation without using TV server if (HasActiveMAS && HasActiveWSS) { sets.Add(CreateServiceSet(OurAddress, null, HasActiveUI ? OurAddress : null)); } // Multiseat installation with UI + MAS + WSS on client and TAS + WSS on server (and we're the client) if (HasActiveMAS && HasActiveWSS && !HasActiveTAS && tveMeta != null) { if (!tveMeta.GetActiveServices().Contains(WebService.MediaAccessService) && !tveMeta.HasUI()) { sets.Add(CreateServiceSet(OurAddress, tveAddressInSet, HasActiveUI ? OurAddress : null)); } } // Same as previous, but now we're the server if (HasActiveTAS && HasActiveWSS && !HasActiveMAS) { sets.Add(CreateServiceSet(null, OurAddress, null)); } // Multiseat installation with MAS + TAS + WSS on server and only UI on the client (we're the client) if (HasActiveUI && !HasActiveMAS && !HasActiveTAS && !HasActiveWSS && tveMeta != null) { if (tveMeta.GetActiveServices().Contains(WebService.MediaAccessService)) { sets.Add(CreateServiceSet(tveAddressInSet, tveAddressInSet, OurAddress)); } } // Idem, but now we're the server if (HasActiveMAS && HasActiveTAS && HasActiveWSS) { sets.Add(CreateServiceSet(OurAddress, OurAddress, null)); } // TODO: external WSS return(sets); }
/// <summary> /// base constructor /// </summary> /// <param name="translationLookup"></param> /// <param name="rconConnectionFactory"></param> public GameServerInstanceFactory(ITranslationLookup translationLookup, IMetaService metaService, IServiceProvider serviceProvider) { _translationLookup = translationLookup; _metaService = metaService; _serviceProvider = serviceProvider; }
public ProdukteController(ApplicationDbContext context, ILoggerFactory loggerFactory, IMetaService metaService) { _context = context; factory = loggerFactory; logger = factory.CreateLogger <ProdukteController>(); cartHelper = new ShoppingCartHelper(_context, factory.CreateLogger <ShoppingCartHelper>()); this.metaService = metaService; }
public HomeController(ApplicationDbContext context, ILoggerFactory loggerFactory, IMetaService service) { _context = context; factory = loggerFactory; _logger = factory.CreateLogger <HomeController>(); metaService = service; cartHelper = new ShoppingCartHelper(_context, factory.CreateLogger <ShoppingCartHelper>()); }
public PropertyService(IFileService fileService, IMetaService metaService, IPropertyDataProvider propertyDataProvider, ICacheProvider cacheProvider) : base() { _fileService = fileService ?? throw new ArgumentNullException(nameof(fileService)); _metaService = metaService ?? throw new ArgumentNullException(nameof(metaService)); _propertyDataProvider = propertyDataProvider ?? throw new ArgumentNullException(nameof(propertyDataProvider)); _cacheProvider = cacheProvider ?? throw new ArgumentNullException(nameof(cacheProvider)); }
public ProductService(IFileService fileService, IMetaService metaService, IProductDataProvider productDataProvider, ICheckoutProvider checkoutProvider, ISecurityService securityService) { _fileService = fileService ?? throw new ArgumentNullException(nameof(fileService)); _metaService = metaService ?? throw new ArgumentNullException(nameof(metaService)); _productDataProvider = productDataProvider ?? throw new ArgumentNullException(nameof(productDataProvider)); _checkoutProvider = checkoutProvider ?? throw new ArgumentNullException(nameof(checkoutProvider)); _securityService = securityService ?? throw new ArgumentNullException(nameof(securityService)); }
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory, IDatabaseContextFactory databaseContextFactory, ITranslationLookup translationLookup, IMetaService metaService, IResourceQueryHelper <ChatSearchQuery, MessageResponse> chatQueryHelper) { Config = configurationHandlerFactory.GetConfigurationHandler <StatsConfiguration>("StatsPluginSettings"); _databaseContextFactory = databaseContextFactory; _translationLookup = translationLookup; _metaService = metaService; _chatQueryHelper = chatQueryHelper; }
public ListClientTags(CommandConfiguration config, ITranslationLookup layout, IMetaService metaService) : base(config, layout) { Name = "listclienttags"; Description = layout["COMMANDS_LIST_CLIENT_TAGS_DESC"]; Alias = "lct"; Permission = EFClient.Permission.Owner; RequiresTarget = false; _metaService = metaService; }
public void SetUp() { _timeModel = Substitute.For <ITimeModel>(); _timeModel.RealTimeSinceStartup.ReturnsForAnyArgs(0); _service = Substitute.For <IMetaService>(); _service.IsConnected.ReturnsForAnyArgs(true); _testModel = new MetaModel(_timeModel, _service, Substitute.For <IUpdateWatcher>()); }
public ClientContactViewModel(IDialogService dialogService, ISettings settings, IMetaService metaService) : base(dialogService, settings) { _metaService = metaService; Step = 2; Title = "Contacts"; MovePreviousLabel = "PREV"; MoveNextLabel = "NEXT"; Counties = RegionItem.Init("County"); SubCounties = RegionItem.Init("SubCounty"); Wards = RegionItem.Init("Ward"); }
public GscApiController(IManager manager, IMetaService metaService, IConfigurationHandlerFactory configurationHandlerFactory) : base(manager) { _metaService = metaService; _configurationHandler = configurationHandlerFactory.GetConfigurationHandler <Configuration>("ClanTagRankCommands"); if (_configurationHandler.Configuration() == null) { _configurationHandler.Set((Configuration) new Configuration().Generate()); _configurationHandler.Save(); } Config = _configurationHandler.Configuration(); }
public static async Task <IEnumerable <IClientMeta> > GetClientMeta(IMetaService metaService, MetaType?metaType, EFClient.Permission level, ClientPaginationRequest request) { IEnumerable <IClientMeta> meta = null; if (metaType == null) // all types { meta = await metaService.GetRuntimeMeta(request); } else { switch (metaType) { case MetaType.Information: meta = await metaService.GetRuntimeMeta <InformationResponse>(request, metaType.Value); break; case MetaType.AliasUpdate: meta = await metaService.GetRuntimeMeta <UpdatedAliasResponse>(request, metaType.Value); break; case MetaType.ChatMessage: meta = await metaService.GetRuntimeMeta <MessageResponse>(request, metaType.Value); break; case MetaType.Penalized: meta = await metaService.GetRuntimeMeta <AdministeredPenaltyResponse>(request, metaType.Value); break; case MetaType.ReceivedPenalty: meta = await metaService.GetRuntimeMeta <ReceivedPenaltyResponse>(request, metaType.Value); break; case MetaType.ConnectionHistory: meta = await metaService.GetRuntimeMeta <ConnectionHistoryResponse>(request, metaType.Value); break; } } if (level < EFClient.Permission.Trusted) { meta = meta.Where(_meta => !_meta.IsSensitive); } return(meta); }
public RestRequestProcessor( IOptions <RestOptions> options, ITelemetry telemetry, IContextService contextService, IMetaService metaService, IEntityFactory entityfactory, IEntityService entityService, IRestSerializerFactory serializerFactory) : base(telemetry, contextService, metaService, entityfactory, entityService) { _options = options.NotNull(nameof(options)); _serializerFactory = serializerFactory.NotNull(nameof(serializerFactory)); }
protected RequestProcessor( ITelemetry telemetry, IContextService contextService, IMetaService metaService, IEntityFactory entityfactory, IEntityService entityService) { Telemetry = telemetry.NotNull(nameof(telemetry)); ContextService = contextService.NotNull(nameof(contextService)); MetaService = metaService.NotNull(nameof(metaService)); EntityFactory = entityfactory.NotNull(nameof(entityfactory)); EntityService = entityService.NotNull(nameof(entityService)); }
/// <summary> /// Initializes a new <see cref="ZappProcess"/>. /// </summary> /// <param name="zappClient">Client used to communicate with the zapp-service.</param> /// <param name="metaService">Service used to receive meta info.</param> /// <param name="restService">Service used to host the process' rest-api.</param> /// <param name="portProvider">Provider to request bindable ports from.</param> /// <param name="libraryService">Service used to load libraries.</param> public ZappProcess( IZappClient zappClient, IRestService restService, IMetaService metaService, IPortProvider portProvider, ILibraryService libraryService) { this.zappClient = zappClient; this.restService = restService; this.metaService = metaService; this.portProvider = portProvider; this.libraryService = libraryService; }
public MetaRegistration(ILogger logger, IMetaService metaService, ITranslationLookup transLookup, IEntityService <EFClient> clientEntityService, IResourceQueryHelper <ClientPaginationRequest, ReceivedPenaltyResponse> receivedPenaltyHelper, IResourceQueryHelper <ClientPaginationRequest, AdministeredPenaltyResponse> administeredPenaltyHelper, IResourceQueryHelper <ClientPaginationRequest, UpdatedAliasResponse> updatedAliasHelper) { _logger = logger; _transLookup = transLookup; _metaService = metaService; _clientEntityService = clientEntityService; _receivedPenaltyHelper = receivedPenaltyHelper; _administeredPenaltyHelper = administeredPenaltyHelper; _updatedAliasHelper = updatedAliasHelper; }
/// <summary> /// Initializes a new instance of the <see cref="AnalyzerWebViewService"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="client"> /// The client. /// </param> /// <param name="mapper"> /// The mapper. /// </param> /// <param name="cache">The cache.</param> /// <param name="metaService">The Meta service.</param> public AnalyzerWebViewService( ILogger <AnalyzerWebViewService> logger, IAzureDevOpsFeedsRestApiClient client, IMapper mapper, IMemoryCache cache, IMetaService metaService) { this.logger = logger; this.client = client; this.mapper = mapper; this.cache = cache; this.metaService = metaService; }
/// <summary> /// Initializes a new <see cref="LibraryService"/>. /// </summary> /// <param name="kernel">Ninject kernel instance.</param> /// <param name="metaService">Service used for receiving meta info.</param> /// <param name="processController">Controller for process' lifetime.</param> /// <param name="nuGetPackageResolver">Resolver used to resolve NuGet packages.</param> /// <param name="postProcessors">Collection of library post-processors.</param> public LibraryService( IKernel kernel, IMetaService metaService, IProcessController processController, INuGetPackageResolver nuGetPackageResolver, IEnumerable <ILibraryPostProcessor> postProcessors) { this.kernel = kernel; this.metaService = metaService; this.processController = processController; this.nuGetPackageResolver = nuGetPackageResolver; this.postProcessors = postProcessors.ToArray(); }
public Plugin(ILogger <Plugin> logger, IConfigurationHandlerFactory configurationHandlerFactory, IDatabaseContextFactory databaseContextFactory, ITranslationLookup translationLookup, IMetaService metaService, IResourceQueryHelper <ChatSearchQuery, MessageResponse> chatQueryHelper, ILogger <StatManager> managerLogger, IEnumerable <IClientStatisticCalculator> statCalculators, IServerDistributionCalculator serverDistributionCalculator) { Config = configurationHandlerFactory.GetConfigurationHandler <StatsConfiguration>("StatsPluginSettings"); _databaseContextFactory = databaseContextFactory; _translationLookup = translationLookup; _metaService = metaService; _chatQueryHelper = chatQueryHelper; _managerLogger = managerLogger; _logger = logger; _statCalculators = statCalculators.ToList(); _serverDistributionCalculator = serverDistributionCalculator; }
public SetGravatarCommand(CommandConfiguration config, ITranslationLookup translationLookup, IMetaService metaService) : base(config, translationLookup) { Name = "setgravatar"; Description = _translationLookup["COMMANDS_GRAVATAR_DESC"]; Alias = "sg"; Permission = Permission.User; RequiresTarget = false; Arguments = new[] { new CommandArgument() { Name = _translationLookup["COMMANDS_ARGS_GRAVATAR"], Required = true } }; _metaService = metaService; }
public UnsetClientTagCommand(CommandConfiguration config, ITranslationLookup layout, IMetaService metaService) : base(config, layout) { Name = "unsetclienttag"; Description = layout["COMMANDS_UNSET_CLIENT_TAG_DESC"]; Alias = "uct"; Permission = EFClient.Permission.Owner; RequiresTarget = true; Arguments = new[] { new CommandArgument() { Name = _translationLookup["COMMANDS_ARGUMENT_TAG"], Required = true } }; _metaService = metaService; }
public ApplicationManager(ILogger <ApplicationManager> logger, IMiddlewareActionHandler actionHandler, IEnumerable <IManagerCommand> commands, ITranslationLookup translationLookup, IConfigurationHandler <CommandConfiguration> commandConfiguration, IConfigurationHandler <ApplicationConfiguration> appConfigHandler, IGameServerInstanceFactory serverInstanceFactory, IEnumerable <IPlugin> plugins, IParserRegexFactory parserRegexFactory, IEnumerable <IRegisterEvent> customParserEvents, IEventHandler eventHandler, IScriptCommandFactory scriptCommandFactory, IDatabaseContextFactory contextFactory, IMetaService metaService, IMetaRegistration metaRegistration, IScriptPluginServiceResolver scriptPluginServiceResolver, ClientService clientService, IServiceProvider serviceProvider, ChangeHistoryService changeHistoryService, ApplicationConfiguration appConfig, PenaltyService penaltyService) { MiddlewareActionHandler = actionHandler; _servers = new ConcurrentBag <Server>(); MessageTokens = new List <MessageToken>(); ClientSvc = clientService; PenaltySvc = penaltyService; ConfigHandler = appConfigHandler; StartTime = DateTime.UtcNow; PageList = new PageList(); AdditionalEventParsers = new List <IEventParser>() { new BaseEventParser(parserRegexFactory, logger, _appConfig) }; AdditionalRConParsers = new List <IRConParser>() { new BaseRConParser(serviceProvider.GetRequiredService <ILogger <BaseRConParser> >(), parserRegexFactory) }; TokenAuthenticator = new TokenAuthentication(); _logger = logger; _metaService = metaService; _tokenSource = new CancellationTokenSource(); _commands = commands.ToList(); _translationLookup = translationLookup; _commandConfiguration = commandConfiguration; _serverInstanceFactory = serverInstanceFactory; _parserRegexFactory = parserRegexFactory; _customParserEvents = customParserEvents; _eventHandler = eventHandler; _scriptCommandFactory = scriptCommandFactory; _metaRegistration = metaRegistration; _scriptPluginServiceResolver = scriptPluginServiceResolver; _serviceProvider = serviceProvider; _changeHistoryService = changeHistoryService; _appConfig = appConfig; Plugins = plugins; }
public MilestoneViewModel(INavigation navigation = null) : base(navigation) { trackerService = DependencyService.Get <ITrackerService>(); metaService = DependencyService.Get <IMetaService>(); authenticationService = DependencyService.Get <IAuthenticationService>(); userMilestoneService = DependencyService.Get <IUserMilestoneService>(); SetPageImageSize(); ShowBadgeAchievedImage = false; BadgeAchievedImage = string.Empty; StringFemale = StringFemaleDefault; StringMale = StringMaleDefault; ColorFemale = ColorMale = ColorGenderDefault; ActionType = ActionType.Check; BaseContent = null; CurrentWeightMinimumValue = 0; CurrentWeightMaximumValue = App.Configuration.AppConfig.MAXIMUM_WEIGHT_LOSE; CurrentWeightValue = CurrentWeightMinimumValue; UserTrackers = new List <UserTracker>(); UserMetas = new UserMeta(); WeightLossGoal = 0; PreviousWeight = 0; GoalAchieved = false; CurrentWeightEnabled = true; MilestoneAchieved = false; AchievedContent = null; CurrentTitle = TextResources.CurrentWeight; CurrentSubTitle = string.Empty; IsCurrentSubTitle = false; ImageFront = ImageDefault; ImageSide = ImageDefault; TShirtSize = string.Empty; AboutYourJourney = ErrorMessage; MilestoneExtended = new UserMilestoneExtended(); Milestones = new List <MilestonePercentage>(); UserMilestones = new List <UserMilestone>(); ViewComponents = new List <View>(); GetUserTracker(); }
internal static IConfigFile ReadConfigFile(this RemoteFileAccess remoteFileAccess, IMetaService m_metaService, string configFileName) { IConfigFile configFile = null; uint handle = 0U; string path = configFileName; remoteFileAccess.OpenFile(path, RemoteFileAccess.FileAccessMode.ReadAccess, ref handle); Siemens.Automation.OMSPlus.Managed.FileInfo info = new Siemens.Automation.OMSPlus.Managed.FileInfo(); remoteFileAccess.GetFileInfo(configFileName, ref info); uint bytes_to_read = (uint)info.size; byte[] buffer = new byte[(int)bytes_to_read]; uint read = 0U; remoteFileAccess.ReadFile(handle, ref buffer, bytes_to_read, RemoteFileAccess.CurrentPosition, ref read); byte[] bytes = new byte[(int)read]; for (uint index = 0U; index < read; ++index) { bytes[(int)index] = buffer[(int)index]; } string @string = new UTF8Encoding().GetString(bytes); remoteFileAccess.CloseFile(handle); XDocument innerDocument = m_metaService.ParseConfigFile(@string); if (innerDocument != null) { string fileName = Path.GetFileName(configFileName); ConfigFileParameters configFileParameters = GetConfigFileParameters(innerDocument, fileName); if (configFileParameters != null) { configFile = new ConfigFile(configFileParameters); } } return(configFile); }
public MetaController(IMetaService metaService) { _metaService = metaService; }
private void FoundAddress(string metaAddress) { // establish a meta connection and load all sets, if possible IEnumerable <WebServiceSet> sets; try { IMetaService meta = CreateMeta(metaAddress); if (meta == null) { return; } sets = meta.GetActiveServiceSets(); if (sets == null || sets.Count() == 0) { return; } } catch (Exception) { return; } // loop through sets and remove all subsets of this set (and dump this set if we already have a bigger one) lock (serviceSets) { foreach (WebServiceSet newSet in sets) { bool loopAgain = false; bool add = true; do { loopAgain = false; foreach (WebServiceSet acceptedSet in serviceSets) { if (acceptedSet.IsSubsetOf(newSet)) { serviceSets.Remove(acceptedSet); loopAgain = true; break; } else if (newSet.IsSubsetOf(acceptedSet) || newSet.IsSameAs(acceptedSet)) { add = false; break; } } } while (loopAgain && add); if (add) { // yeah, this seems to be a valid set. Add it and notify clients. serviceSets.Add(newSet); if (SetDiscovered != null) { SetDiscovered(this, new SetDiscoveredEventArgs(new ServiceAddressSet(newSet))); } } } } }
public ClientController(IManager manager, IMetaService metaService) : base(manager) { _metaService = metaService; }