public UnturnedUserProvider(
            IEventBus eventBus,
            IUserDataSeeder dataSeeder,
            IUserDataStore userDataStore,
            IRuntime runtime)
        {
            m_EventBus      = eventBus;
            m_DataSeeder    = dataSeeder;
            m_UserDataStore = userDataStore;
            m_Runtime       = runtime;
            m_UnturnedUsers = new HashSet <UnturnedUser>();
            m_PendingUsers  = new HashSet <UnturnedPendingUser>();

            // sync users in case of openmod reloads
            foreach (var client in Provider.clients)
            {
                m_UnturnedUsers.Add(new UnturnedUser(userDataStore, client.player));
            }

            foreach (var pending in Provider.pending)
            {
                m_PendingUsers.Add(new UnturnedPendingUser(userDataStore, pending));
            }

            Provider.onCheckValidWithExplanation += OnPendingPlayerConnecting;
            Provider.onEnemyConnected            += OnPlayerConnected;
            Provider.onEnemyDisconnected         += OnPlayerDisconnected;
            Provider.onRejectingPlayer           += OnRejectingPlayer;
        }
        public HubManager(IUserDataStore userDataStore)
        {
            UserDataStore = userDataStore;

            //Connect();
            Task.Run(async() => await Connect());
        }
 public UserDataDatabase(IConfiguration configuration, IEconomyDispatcher dispatcher,
                         IStringLocalizer stringLocalizer, IUserDataStore userDataStore) : base(configuration)
 {
     m_Dispatcher      = dispatcher;
     m_StringLocalizer = stringLocalizer;
     m_UserDataStore   = userDataStore;
 }
Example #4
0
        private readonly UserData m_Data;//todo

        public OfflineUser(IUserDataStore userDataStore, UserData data) : base(userDataStore)
        {
            Id          = data.Id;
            Type        = data.Type;
            DisplayName = data.LastDisplayName;
            m_Data      = data;
        }
Example #5
0
 public EmployeeController(IEmployeeDataStore employeeData, IUserDataStore userData, IStoreDataStore storeData, IEmployeeWorkHourDataStore employeeWorkHourData)
 {
     employeeDataStore         = employeeData;
     userDataStore             = userData;
     storeDataStore            = storeData;
     employeeWorkHourDataStore = employeeWorkHourData;
 }
Example #6
0
 public UserDataDecorator(
     IUserDataStore <UserData> userDataStore,
     ITypedModuleProvider typedModuleProvider)
 {
     _userDataStore       = userDataStore;
     _typedModuleProvider = typedModuleProvider;
 }
        public SizeCheckingHandler(IWolfClient client,
                                   ILogger <SizeCheckingHandler> logger, IHostEnvironment environment, IHttpClientFactory httpClientFactory,
                                   IUserDataStore userDataStore, IGroupConfigStore groupConfigStore,
                                   IOptionsMonitor <SizeCheckingOptions> picSizeOptions, IOptionsMonitor <BotOptions> botOptions, IOptionsMonitor <CommandsOptions> commandsOptions)
        {
            // store all services
            this._client            = client;
            this._log               = logger;
            this._environment       = environment;
            this._httpClientFactory = httpClientFactory;
            this._userDataStore     = userDataStore;
            this._groupConfigStore  = groupConfigStore;
            this._picSizeOptions    = picSizeOptions;
            this._botOptions        = botOptions;
            this._commandsOptions   = commandsOptions;

            this._cts = new CancellationTokenSource();

            // add client listeners
            this._client.AddMessageListener <ChatMessage>(OnChatMessage);

            // read options
            this.OnPicSizeOptionsReload(picSizeOptions.CurrentValue);
            picSizeOptions.OnChange(this.OnPicSizeOptionsReload);
        }
        public RegisterStoreViewModel(IValidatableObjectFactory validatableObjectFactory, IUserDataStore userDataStore, IStoreDataStore storeDataStore,
                                      IStoreFactory storeFactory, IUserFactory userFactory,
                                      IRegisterCardViewModel cardViewModel, IStoreRegistrationEntry storeRegistrationEntry)
        {
            _validatableObjectFactory = validatableObjectFactory;
            _UserDataStore            = userDataStore;
            _StoreDataStore           = storeDataStore;
            _StoreFactory             = storeFactory;
            _UserFactory           = userFactory;
            CardViewModel          = cardViewModel;
            StoreRegistrationEntry = storeRegistrationEntry;

            StoreName      = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Store 1");
            CardNumber     = _validatableObjectFactory.CreateSimpleValidatebleObject <string>();
            Longitude      = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("1");
            Latitude       = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("2");
            StoreOwnerName = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Owner 1");
            Description    = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Description");
            Category       = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Category");

            StoreNameValidationCommand      = new Command(() => StoreName.Validate());
            LongitudeValidationCommand      = new Command(() => Longitude.Validate());
            LatitudeValidationCommand       = new Command(() => Latitude.Validate());
            StoreOwnerNameValidationCommand = new Command(() => StoreOwnerName.Validate());
            MoreInfoCommand      = new Command <CommandEventData>((commandData) => MoreInfoPopup(commandData));
            RegisterStoreCommand =
                new Command <CommandEventData>(async(data) => await NavigateToInventoryProductItem(data));
            DescriptionValidationCommand = new Command(() => Description.Validate());
            GetLogoPhotoCommand          = new Command(async() => ProductImageSource = await Utils.PickPhoto());
            TakeLogoPhotoCommand         = new Command(() => { });
            GetLocationCommand           = new Command(async() => await GetLocation());
            TypeOfCardChangedCommand     = new Command <CommandEventData>((data) => TypeOfCardSelectionChangedHandler(data));

            Init();
        }
 public CommandPermissionRemove(IServiceProvider serviceProvider,
                                IPermissionRoleStore permissionRoleStore,
                                IUserDataStore usersDataStore,
                                IPermissionChecker permissionChecker) : base(serviceProvider, permissionRoleStore, usersDataStore)
 {
     m_PermissionChecker = permissionChecker;
 }
Example #10
0
 public UserDataDatabase(IEconomyDispatcher dispatcher, IPluginAccessor <Economy> economyPlugin,
                         IUserDataStore userDataStore) : base(
         economyPlugin)
 {
     m_EconomyDispatcher = dispatcher;
     m_UserDataStore     = userDataStore;
 }
Example #11
0
 public CDeleteHome(IStringLocalizer stringLocalizer,
                    IUserDataStore userDataStore,
                    IServiceProvider serviceProvider) : base(serviceProvider)
 {
     m_StringLocalizer = stringLocalizer;
     m_UserDataStore   = userDataStore;
 }
 protected CommandPermissionAction(IServiceProvider serviceProvider,
                                   IPermissionGroupStore permissionGroupStore,
                                   IUserDataStore userDataStore) : base(serviceProvider)
 {
     m_PermissionGroupStore = permissionGroupStore;
     m_UserDataStore        = userDataStore;
 }
        public NotificationViewModel(INotificationDataStore notificationData, IUserDataStore dataStore)
        {
            NotificationDataStore = notificationData;

            userDataStore = dataStore;

            JobRequestPreseters = new ObservableCollection <JobRequestPresenter>();

            GetRequest();

            App.HubManager.GetHubConnection.On <string>("Notification", (item) =>
            {
                MainThread.BeginInvokeOnMainThread(() =>
                {
                    try
                    {
                        UpdateUI(item);
                    }
                    catch (Exception ex)
                    {
                        App.Current.MainPage.DisplayAlert("Notification Error", ex.Message, "OK");
                    }
                });
            });

            MessagingCenter.Subscribe <JobRequestPresenter, JobRequestPresenter>(this, "ToRemove", (sender, arg) =>
            {
                var result = JobRequestPreseters.Remove(arg);

                //var tempdata = JobRequestPreseters;

                //JobRequestPreseters = new ObservableCollection<JobRequestPresenter>(tempdata);
            });
        }
        public UnicornConfigurationUsersEventHandler(IConfiguration configuration)
        {
            Assert.ArgumentNotNull(configuration, nameof(configuration));

            _predicate = configuration.Resolve <IUserPredicate>();
            _dataStore = configuration.Resolve <IUserDataStore>();
        }
Example #15
0
 public PermissionExtensions(IServiceProvider serviceProvider, IPermissionRolesDataStore permissionRolesDataStore,
                             IUserDataStore userDataStore, ILogger <PermissionExtensions> logger, ILifetimeScope lifetimeScope) : base(serviceProvider)
 {
     m_PermissionRolesDataStore = permissionRolesDataStore;
     m_UserDataStore            = userDataStore;
     m_Logger        = logger;
     m_LifetimeScope = lifetimeScope;
 }
 public CommandPermissionAdd(
     IPermissionChecker permissionChecker,
     IServiceProvider serviceProvider,
     IPermissionGroupStore permissionGroupStore,
     IUserDataStore usersDataStore) : base(serviceProvider, permissionGroupStore, usersDataStore)
 {
     m_PermissionChecker = permissionChecker;
 }
Example #17
0
 public DefaultPermissionRoleStore(IPermissionRolesDataStore permissionRolesDataStore, IUserDataStore userDataStore,
                                   IRuntime runtime, IEventBus eventBus)
 {
     m_PermissionRolesDataStore = permissionRolesDataStore;
     m_UserDataStore            = userDataStore;
     m_Runtime  = runtime;
     m_EventBus = eventBus;
 }
Example #18
0
 public ModuleService(IModuleStore moduleStore, IFileStore fileStore, IPortalSettingsStore portalSettingsStore, IUserDataStore userDataStore, ISyrinxCamundaClientService camundaClient)
 {
     this.moduleStore         = moduleStore;
     this.fileStore           = fileStore;
     this.portalSettingsStore = portalSettingsStore;
     this.userDataStore       = userDataStore;
     this.camundaClient       = camundaClient;
 }
Example #19
0
 public SalaryService(IUserDataStore userDataStore, IUserManager userManager, IStringLocalizer stringLocalizer, IConfiguration configuration, Lazy <IEconomyProvider> economyProvider)
 {
     _configuration   = configuration;
     _userDataStore   = userDataStore;
     _stringLocalizer = stringLocalizer;
     _userManager     = userManager;
     _economyProvider = economyProvider;
 }
Example #20
0
 public UserNotesHandler(IUserDataStore userDataStore, IOptionsSnapshot <BotOptions> botOptions, IOptionsSnapshot <UserNotesOptions> notesOptions, ILogger <UserNotesHandler> logger)
 {
     // store all services
     this._log           = logger;
     this._botOptions    = botOptions.Value;
     this._notesOptions  = notesOptions.Value;
     this._userDataStore = userDataStore;
 }
 public UnturnedPendingUser(IUserProvider userProvider, IUserDataStore userDataStore, SteamPending steamPending) : base(userProvider, userDataStore)
 {
     SteamPending = steamPending;
     SteamId      = steamPending.playerID.steamID;
     DisplayName  = steamPending.playerID.characterName;
     Type         = KnownActorTypes.Player;
     Session      = new UnturnedPendingUserSession(this);
 }
Example #22
0
        public override async Task <bool> CheckAsync(ICommandContext context, IServiceProvider services, CancellationToken cancellationToken = default)
        {
            IUserDataStore userDataStore = services.GetRequiredService <IUserDataStore>();
            // check if user is bot admin
            UserData userData = await userDataStore.GetUserDataAsync(context.Message.SenderID.Value, cancellationToken).ConfigureAwait(false);

            return(userData.IsBotAdmin);
        }
Example #23
0
 public LicenseController(IStoreLicenseDataStore storeLicenseData, IUserDataStore userData, IStripeServiceDS stripeServiceDS, ICardDataStore cardDataStore, ISubcriptionDataStore subcriptionDataStore)
 {
     storeLicenseDataStore     = storeLicenseData;
     userDataStore             = userData;
     this.StripeServiceDS      = stripeServiceDS;
     this.cardDataStore        = cardDataStore;
     this.SubcriptionDataStore = subcriptionDataStore;
 }
Example #24
0
 public QueuesSystemHandler(IIdQueueStore idQueueStore, IUserDataStore userDataStore, IOptionsSnapshot <QueuesSystemOptions> queuesOptions, IOptionsSnapshot <BotOptions> botOptions, ILogger <QueuesSystemHandler> logger)
 {
     // store all services
     this._log           = logger;
     this._botOptions    = botOptions.Value;
     this._queuesOptions = queuesOptions.Value;
     this._idQueueStore  = idQueueStore;
     this._userDataStore = userDataStore;
 }
Example #25
0
 public DefaultPermissionStore(
     IUserDataStore userDataStore,
     IPermissionRolesDataStore permissionRolesDataStore,
     IPermissionRoleStore permissionRoleStore)
 {
     m_UserDataStore            = userDataStore;
     m_PermissionRolesDataStore = permissionRolesDataStore;
     m_PermissionRoleStore      = permissionRoleStore;
 }
 public DefaultPermissionStore(
     IUserDataStore userDataStore,
     IPermissionGroupsDataStore permissionGroupsDataStore,
     IPermissionGroupStore permissionGroupStore)
 {
     m_UserDataStore             = userDataStore;
     m_PermissionGroupsDataStore = permissionGroupsDataStore;
     m_PermissionGroupStore      = permissionGroupStore;
 }
Example #27
0
 public CommandPermissionAdd(IPermissionChecker permissionChecker,
                             ICommandPermissionBuilder commandPermissionBuilder,
                             IServiceProvider serviceProvider,
                             IPermissionRoleStore permissionRoleStore,
                             IUserDataStore usersDataStore,
                             IUserManager userManager,
                             IPermissionRegistry commandRegistry) : base(serviceProvider, permissionRoleStore, commandPermissionBuilder, permissionChecker, usersDataStore, userManager, commandRegistry)
 {
     m_PermissionChecker = permissionChecker;
 }
        public LoginController(IUserDataStore userData, IUserConnectedDataStore userConnectedData)
        {
            userDataStore          = userData;
            userConnectedDataStore = userConnectedData;
            //UsersConnected = usersConnected;
            //ComunicationService = comunication;
            //ComunicationService = new ComunicationService();

            LogUser.ComunicationService = new ComunicationService();
        }
Example #29
0
 protected CommandRoleAction(IPermissionChecker permissionChecker,
                             ICommandPermissionBuilder commandPermissionBuilder,
                             IServiceProvider serviceProvider,
                             IPermissionRoleStore permissionRoleStore,
                             IUserDataStore usersDataStore,
                             IUserManager userManager,
                             IPermissionRegistry commandRegistry) : base(serviceProvider, permissionRoleStore, commandPermissionBuilder, permissionChecker, usersDataStore, userManager, commandRegistry)
 {
     m_PermissionRoleStore = permissionRoleStore;
 }
Example #30
0
        public UserLoader(IUserPredicate userPredicate, IUserDataStore userDataStore, IUserLoaderLogger logger, IUserSyncConfiguration syncConfiguration)
        {
            Assert.ArgumentNotNull(userPredicate, nameof(userPredicate));
            Assert.ArgumentNotNull(userDataStore, nameof(userDataStore));
            Assert.ArgumentNotNull(logger, nameof(logger));

            _userPredicate     = userPredicate;
            _userDataStore     = userDataStore;
            _logger            = logger;
            _syncConfiguration = syncConfiguration;
        }
Example #31
0
        public UserLoader(IUserPredicate userPredicate, IUserDataStore userDataStore, IUserLoaderLogger logger, IUserSyncConfiguration syncConfiguration)
        {
            Assert.ArgumentNotNull(userPredicate, nameof(userPredicate));
            Assert.ArgumentNotNull(userDataStore, nameof(userDataStore));
            Assert.ArgumentNotNull(logger, nameof(logger));

            _userPredicate = userPredicate;
            _userDataStore = userDataStore;
            _logger = logger;
            _syncConfiguration = syncConfiguration;
        }