Beispiel #1
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            if (_connectionCache.TryGetValue(Context.ConnectionId, out var player))
            {
                _connectionCache.Remove(Context.ConnectionId);
                await _httpClient.DeleteAsync($"enqueued-teams/{player.PlayerId}?api_key=secret");

                await Clients.All.SendAsync("PlayerLeft", player);
            }

            await base.OnDisconnectedAsync(exception);
        }
        public override void Install()
        {
            _services.Settings.SaveSetting(new ShopConnectorSettings());
            _services.Localization.ImportPluginResourcesFromXml(PluginDescriptor);

            InsertProfile(ShopConnectorProductXmlExportProvider.SystemName, true);
            InsertProfile(ShopConnectorCategoryXmlExportProvider.SystemName, true);

            base.Install();

            ConnectionCache.Remove();
        }
Beispiel #3
0
        public ActionResult Configure(ConfigurationModel model, FormCollection form)
        {
            if (!ModelState.IsValid)
            {
                return(Configure());
            }

            var settings = Services.Settings.LoadSetting <ShopConnectorSettings>();

            model.Copy(settings, false);

            Services.Settings.SaveSetting(settings);
            ConnectionCache.Remove();

            NotifySuccess(T("Admin.Common.DataSuccessfullySaved"));
            return(Configure());
        }
        public override void Uninstall()
        {
            ConnectionCache.Remove();

            _services.Settings.DeleteSetting <ShopConnectorSettings>();
            _services.Localization.DeleteLocaleStringResources(PluginDescriptor.ResourceRootKey);

            InsertProfile(ShopConnectorProductXmlExportProvider.SystemName, false);
            InsertProfile(ShopConnectorCategoryXmlExportProvider.SystemName, false);

            var migrator = new DbMigrator(new Configuration());

            migrator.Update(DbMigrator.InitialDatabase);

            FileSystemHelper.ClearDirectory(ShopConnectorFileSystem.GetDirectory(null), true);

            base.Uninstall();
        }